/* ============================================================
   Call Center — main.css  v2
   Design: Precision dark SaaS — elevated, minimal, luxurious
   ============================================================ */

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

:root {
  --bg-base:      #08090c;
  --bg-surface:   #0f1117;
  --bg-elevated:  #161a24;
  --bg-overlay:   #1c2030;
  --bg-hover:     #222840;

  --border:        rgba(255,255,255,0.06);
  --border-light:  rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.13);

  --text-primary:   #eef0f6;
  --text-secondary: #7c8799;
  --text-muted:     #454f62;

  --accent:        #3b82f6;
  --accent-dim:    #2563eb;
  --accent-glow:   rgba(59,130,246,0.12);
  --accent-border: rgba(59,130,246,0.3);

  --green:        #22c55e;
  --green-dim:    rgba(34,197,94,0.12);
  --amber:        #f59e0b;
  --amber-dim:    rgba(245,158,11,0.12);
  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,0.12);
  --purple:       #8b5cf6;
  --purple-dim:   rgba(139,92,246,0.12);
  --cyan:         #06b6d4;
  --cyan-dim:     rgba(6,182,212,0.12);

  --sidebar-w:  248px;
  --topbar-h:   56px;

  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  18px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.6);
  --shadow-md: 0 4px 20px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.7);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --ease: cubic-bezier(.16,1,.3,1);
  --t:    160ms;
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ======================================================
   LAYOUT
   ====================================================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t) var(--ease);
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ======================================================
   SIDEBAR BRAND
   ====================================================== */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(59,130,246,.4), 0 4px 12px rgba(59,130,246,.25);
}
.brand-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ======================================================
   SIDEBAR NAV
   ====================================================== */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 14px 9px 5px;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  transition: background var(--t), color var(--t);
  margin-bottom: 1px;
  letter-spacing: -0.005em;
}
.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
  box-shadow: inset 1px 0 0 var(--accent);
}
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; }

/* ======================================================
   SIDEBAR FOOTER
   ====================================================== */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
  font-size: 12.5px; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px;
  border-radius: var(--r-sm);
  display: flex;
  transition: color var(--t), background var(--t);
}
.logout-btn:hover { color: var(--red); background: var(--red-dim); }

/* ======================================================
   TOPBAR
   ====================================================== */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: rgba(8,9,12,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
}
.sidebar-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer; padding: 4px;
  border-radius: var(--r-sm);
}
.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  letter-spacing: -0.01em;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.notif-badge {
  position: relative; cursor: pointer;
  color: var(--text-secondary); padding: 5px;
  border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
}
.notif-badge:hover { background: var(--bg-elevated); color: var(--text-primary); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px;
  background: var(--red); border-radius: 50%;
  border: 2px solid var(--bg-base);
}
.notif-dot.hidden { display: none; }

/* ======================================================
   PAGE CONTENT
   ====================================================== */
.page-content { flex: 1; padding: 26px 28px; }

/* ======================================================
   STAT CARDS — refined
   ====================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* Top accent strip */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}

.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.stat-sub { font-size: 11.5px; color: var(--text-muted); }

.stat-card.green  { border-color: rgba(34,197,94,.15); }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.blue   { border-color: rgba(59,130,246,.15); }
.stat-card.blue   .stat-value { color: var(--accent); }
.stat-card.amber  { border-color: rgba(245,158,11,.15); }
.stat-card.amber  .stat-value { color: var(--amber); }
.stat-card.purple { border-color: rgba(139,92,246,.15); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.cyan   { border-color: rgba(6,182,212,.15); }
.stat-card.cyan   .stat-value { color: var(--cyan); }
.stat-card.red    { border-color: rgba(239,68,68,.15); }
.stat-card.red    .stat-value { color: var(--red); }

/* ======================================================
   CARDS
   ====================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
}
.card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.mb-4 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 26px; }

/* ======================================================
   CHARTS
   ====================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.chart-card canvas { max-height: 210px; }

/* ======================================================
   TABLES
   ====================================================== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: transparent;
  padding: 9px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td {
  background: rgba(255,255,255,.025);
  color: var(--text-primary);
}
.td-phone {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* ======================================================
   BADGES
   ====================================================== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-blue   { background: var(--accent-glow);   color: #60a5fa; border-color: var(--accent-border); }
.badge-green  { background: var(--green-dim);     color: #4ade80; border-color: rgba(34,197,94,.25); }
.badge-amber  { background: var(--amber-dim);     color: #fbbf24; border-color: rgba(245,158,11,.25); }
.badge-red    { background: var(--red-dim);       color: #f87171; border-color: rgba(239,68,68,.25); }
.badge-purple { background: var(--purple-dim);    color: #a78bfa; border-color: rgba(139,92,246,.25); }
.badge-cyan   { background: var(--cyan-dim);      color: #22d3ee; border-color: rgba(6,182,212,.25); }

/* ======================================================
   BUTTONS
   ====================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.005em;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-overlay); border-color: var(--border-strong); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }

.btn-sm    { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon  { padding: 6px; width: 30px; height: 30px; justify-content: center; }

/* ======================================================
   FORMS
   ====================================================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 88px; line-height: 1.5; }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23545e72' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-hint  { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--red); margin-top: 4px; }

/* ======================================================
   MODAL
   ====================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  transform: translateY(10px) scale(0.985);
  transition: transform 220ms var(--ease);
}
.modal-overlay.open .modal { transform: none; }
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  padding: 4px; border-radius: var(--r-sm);
  display: flex;
  transition: color var(--t), background var(--t);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-elevated); }
.modal-body    { padding: 22px; }
.modal-footer  {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* ======================================================
   SEARCH BAR
   ====================================================== */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-input-wrap .form-control { padding-left: 34px; }

/* ======================================================
   PAGINATION
   ====================================================== */
.pagination {
  display: flex; align-items: center; gap: 4px;
  margin-top: 16px; justify-content: center;
}
.page-btn {
  min-width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 12.5px; cursor: pointer;
  transition: all var(--t); text-decoration: none;
  padding: 0 8px;
}
.page-btn:hover { background: var(--bg-overlay); color: var(--text-primary); border-color: var(--border-light); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ======================================================
   TOAST
   ====================================================== */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 11px 16px;
  display: flex; align-items: center; gap: 10px;
  min-width: 270px;
  box-shadow: var(--shadow-md);
  animation: toastIn 250ms var(--ease);
  font-size: 13px;
  transition: opacity 300ms;
}
.toast.success { border-left: 2px solid var(--green); }
.toast.error   { border-left: 2px solid var(--red); }
.toast.info    { border-left: 2px solid var(--accent); }
.toast-msg { flex: 1; color: var(--text-primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ======================================================
   STATUS BADGE
   ====================================================== */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px; font-weight: 500;
  border: 1px solid;
}

/* ======================================================
   SECTION HEADER
   ====================================================== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.section-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary); letter-spacing: -0.01em;
}

/* ======================================================
   TIMELINE
   ====================================================== */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: flex; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.timeline-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ======================================================
   EMPTY STATE
   ====================================================== */
.empty-state {
  text-align: center; padding: 52px 24px;
  color: var(--text-muted);
}
.empty-state-icon { margin-bottom: 14px; opacity: 0.2; }
.empty-state h3 { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.empty-state p  { font-size: 13px; }

/* ======================================================
   FILTERS ROW
   ====================================================== */
.filters-row {
  display: flex; gap: 10px;
  flex-wrap: wrap; margin-bottom: 18px; align-items: flex-end;
}
.filters-row .form-group { margin-bottom: 0; }
.filter-select { min-width: 130px; }

/* ======================================================
   SPINNER
   ====================================================== */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .55s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================
   PHONE DISPLAY
   ====================================================== */
.phone-display {
  font-family: var(--mono);
  font-size: 20px; font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.06em;
}

/* ======================================================
   NOTES
   ====================================================== */
.notes-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.note-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
}
.note-author { font-size: 11.5px; font-weight: 500; color: var(--accent); margin-bottom: 4px; }
.note-time   { font-size: 11px; color: var(--text-muted); float: right; }
.note-text   { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ======================================================
   TABS
   ====================================================== */
.tabs {
  display: flex; gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 16px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t), border-color var(--t);
  letter-spacing: -0.005em;
}
.tab-btn.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text-secondary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ======================================================
   DID BADGE — for submit page selector
   ====================================================== */
.did-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.did-option { display: none; }
.did-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
  min-height: 64px;
  gap: 4px;
}
.did-label:hover {
  background: var(--bg-overlay);
  border-color: var(--border-strong);
}
.did-option:checked + .did-label {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}
.did-label-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
}
.did-option:checked + .did-label .did-label-name { color: var(--accent); }
.did-label-num {
  font-size: 10.5px; font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ======================================================
   DID REPORT — per-DID cards
   ====================================================== */
.did-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.did-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--t);
}
.did-stat-card:hover { border-color: var(--border-light); background: var(--bg-elevated); }
.did-stat-card.selected { border-color: var(--accent); background: var(--accent-glow); }
.did-stat-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.did-stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); letter-spacing: -.03em; }
.did-stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.did-stat-card.selected .did-stat-value { color: var(--accent); }

/* ======================================================
   LOGIN PAGE
   ====================================================== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(59,130,246,.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(139,92,246,.04) 0%, transparent 70%);
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 390px;
  box-shadow: var(--shadow-xl);
}
.login-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 32px; }
.login-logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(59,130,246,.4), 0 4px 12px rgba(59,130,246,.25);
}
.login-logo-name { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -.02em; }
.login-heading  { font-size: 21px; font-weight: 700; color: var(--text-primary); letter-spacing: -.025em; margin-bottom: 5px; }
.login-sub      { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.login-submit   { width: 100%; justify-content: center; padding: 10px 16px; font-size: 13.5px; }
.login-error {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }
.remember-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.remember-row input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }
.remember-row label { font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-xl); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 18px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .did-grid   { grid-template-columns: repeat(3, 1fr); }
}

/* ======================================================
   UTILITIES
   ====================================================== */
.flex        { display: flex; }
.items-center{ align-items: center; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.mt-1        { margin-top: 4px; }
.mt-2        { margin-top: 8px; }
.mt-3        { margin-top: 12px; }
.mb-3        { margin-bottom: 12px; }
.text-sm     { font-size: 12.5px; }
.text-xs     { font-size: 11.5px; }
.text-muted  { color: var(--text-muted); }
.text-mono   { font-family: var(--mono); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-accent { color: var(--accent); }
.font-500    { font-weight: 500; }
.font-600    { font-weight: 600; }
.w-full      { width: 100%; }
.divider     { height: 1px; background: var(--border); margin: 20px 0; }

/* Subtle inner glow on surfaces */
.card, .chart-card, .stat-card {
  position: relative;
}
