/* ======================================
   CRM-IA | DongCheng Argentina
   ====================================== */

:root {
  --primary: #FF6B00;
  --primary-light: #ff8533;
  --secondary: #1a1a2e;
  --accent: #16213e;
  --success: #00b894;
  --warn: #fdcb6e;
  --error: #e17055;
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;

  --wa-green: #25D366;
  --ig-pink: #E1306C;
  --fb-blue: #1877F2;
  --msg-blue: #0084FF;
}

.dark-mode {
  --bg: #0f0f23;
  --bg-card: #1a1a2e;
  --bg-sidebar: #12122a;
  --bg-header: #12122a;
  --text: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #606080;
  --border: #2a2a4a;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ===== LOGIN ===== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
}

.login-card {
  background: var(--bg-card);
  padding: 48px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-group input,
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border var(--transition);
}

.form-group input:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

textarea.form-input {
  resize: vertical;
}

select.form-input {
  cursor: pointer;
}

.login-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  min-height: 18px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon { font-size: 24px; }

.brand-text {
  font-size: 16px;
  font-weight: 600;
}

.brand-sep {
  color: var(--text-muted);
  font-weight: 300;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--error); }

.theme-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== APP BODY ===== */
.app-body {
  display: flex;
  height: calc(100vh - 56px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.nav-list {
  list-style: none;
  padding: 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-icon { font-size: 16px; }

.nav-badge {
  position: absolute;
  right: 8px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.section { display: none; }
.section.active { display: block; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== METRICS GRID ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-card.accent { border-left: 4px solid var(--primary); }
.metric-card.success { border-left: 4px solid var(--success); }
.metric-card.warn { border-left: 4px solid var(--warn); }
.metric-card.error { border-left: 4px solid var(--error); }

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.5s ease;
}

.metric-value.updated {
  color: var(--primary);
  transform: scale(1.1);
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== CHARTS ===== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 160px;
  padding-top: 10px;
}

.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 60px;
  border-radius: 6px 6px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.chart-bar-label {
  font-size: 11px;
  margin-top: 6px;
  color: var(--text-secondary);
  text-align: center;
}

.chart-bar-value {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Line chart */
.chart-line {
  height: 160px;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.chart-line-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.7;
  transition: height 0.5s ease, opacity var(--transition);
  position: relative;
}

.chart-line-bar:hover {
  opacity: 1;
}

.chart-line-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.chart-line-bar:hover::after {
  opacity: 1;
}

/* ===== RECENT LIST ===== */
.recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.recent-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.recent-list { display: flex; flex-direction: column; gap: 4px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.recent-item:hover {
  background: var(--bg);
}

.recent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.recent-info {
  flex: 1;
  min-width: 0;
}

.recent-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recent-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-meta {
  text-align: right;
  flex-shrink: 0;
}

.recent-time {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.status-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
}

.status-badge.active { background: var(--success); color: #fff; }
.status-badge.idle { background: var(--warn); color: #333; }
.status-badge.closed { background: var(--text-muted); color: #fff; }

.channel-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 500;
}

.channel-badge.whatsapp { background: rgba(37,211,102,0.15); color: var(--wa-green); }
.channel-badge.instagram { background: rgba(225,48,108,0.15); color: var(--ig-pink); }
.channel-badge.facebook { background: rgba(24,119,242,0.15); color: var(--fb-blue); }
.channel-badge.messenger { background: rgba(0,132,255,0.15); color: var(--msg-blue); }

/* ===== INBOX LAYOUT ===== */
.inbox-layout {
  display: flex;
  height: calc(100vh - 56px - 48px);
  margin: -24px;
  border-top: none;
}

.inbox-list {
  width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  flex-shrink: 0;
}

.inbox-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.inbox-filters {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.conv-item:hover { background: var(--bg); }
.conv-item.selected { background: rgba(255,107,0,0.08); border-left: 3px solid var(--primary); }

.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.conv-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-meta {
  text-align: right;
  flex-shrink: 0;
}

.conv-time {
  font-size: 10px;
  color: var(--text-muted);
}

.conv-unread {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 4px;
  display: inline-block;
}

/* ===== CHAT VIEW ===== */
.inbox-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.chat-empty-icon { font-size: 48px; margin-bottom: 8px; }

.chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-name {
  font-size: 15px;
  font-weight: 600;
}

.chat-phone {
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
}

.msg-bubble.user {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-bubble.assistant {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  display: block;
}

.msg-badge-auto {
  font-size: 9px;
  background: rgba(255,255,255,0.3);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
}

.chat-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-send {
  padding: 10px 20px;
}

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg);
}

/* ===== CONTACTS FILTERS ===== */
.contacts-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

/* ===== QUEUE STATS ===== */
.queue-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.queue-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.queue-stat.warn { border-top: 3px solid var(--warn); }
.queue-stat.accent { border-top: 3px solid var(--primary); }
.queue-stat.success { border-top: 3px solid var(--success); }
.queue-stat.error { border-top: 3px solid var(--error); }

.queue-stat-value {
  font-size: 28px;
  font-weight: 700;
}

.queue-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== FOLLOWUPS ===== */
.followup-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.followups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.followup-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.followup-info { flex: 1; }

.followup-client {
  font-weight: 600;
  font-size: 13px;
}

.followup-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.followup-meta {
  text-align: right;
  flex-shrink: 0;
}

.followup-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

.followup-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.settings-card h4 {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--text);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.settings-row:last-of-type {
  border-bottom: none;
}

.mono {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== BADGES ===== */
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.badge-success { background: rgba(0,184,148,0.15); color: var(--success); }
.badge-warn { background: rgba(253,203,110,0.25); color: #d68910; }
.badge-error { background: rgba(225,112,85,0.15); color: var(--error); }
.badge-info { background: rgba(0,132,255,0.15); color: var(--msg-blue); }

.product-badge {
  display: inline-block;
  background: rgba(255,107,0,0.12);
  color: var(--primary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 2px;
  font-weight: 500;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-lg { max-width: 900px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0 4px;
}

.modal-body {
  padding: 20px;
}

.contact-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-meta {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.contact-meta p {
  margin-bottom: 4px;
}

.contact-products {
  margin-top: 12px;
}

.modal-chat {
  max-height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }

  .contact-detail-grid {
    grid-template-columns: 1fr;
  }

  .inbox-list {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: block; }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .inbox-layout {
    flex-direction: column;
  }

  .inbox-list {
    width: 100%;
    max-height: 40vh;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .queue-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .header-brand .brand-text { font-size: 13px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section.active {
  animation: fadeIn 0.2s ease;
}

/* ===== MSG SENDER BADGE ===== */
.msg-badge-sender {
  font-size: 9px;
  background: rgba(255,255,255,0.3);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
}

.msg-bubble.user .msg-badge-sender {
  background: rgba(0,0,0,0.08);
}

/* ===== USERS SECTION ===== */
#section-users .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#users-table td {
  white-space: nowrap;
}

#users-table .btn-ghost {
  margin-right: 4px;
}
