/* ============================================================
   TRUREPO — GLASSMORPHISM PURPLE THEME
   Style: Glassmorphism + Deep Purple (Hello Anton inspired)
   ============================================================ */

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

/* ── GLOBAL BACKGROUND: animated deep purple mesh ── */
body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0d0618;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* Animated purple mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(139,0,255,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 75%, rgba(88,0,214,0.28) 0%, transparent 55%),
    radial-gradient(ellipse 50% 70% at 50% 50%, rgba(60,0,160,0.15) 0%, transparent 65%),
    linear-gradient(135deg, #0d0618 0%, #120a24 40%, #0d0618 100%);
  pointer-events: none;
}

body > * { position: relative; z-index: 1; }

/* ── CSS VARIABLES ── */
:root {
  --primary:        #a855f7;
  --primary-hover:  #9333ea;
  --primary-glow:   rgba(168,85,247,0.35);
  --accent:         #e879f9;
  --accent-glow:    rgba(232,121,249,0.25);
  --danger:         #f43f5e;
  --success:        #34d399;
  --warning:        #fbbf24;
  --radius:         10px;
  --radius-lg:      16px;
  --transition:     0.18s cubic-bezier(0.4,0,0.2,1);

  /* Glass token */
  --glass-bg:       rgba(255,255,255,0.06);
  --glass-border:   rgba(255,255,255,0.12);
  --glass-blur:     blur(20px);
  --glass-shadow:   0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Dark theme (default) */
[data-theme="dark"], :root {
  --bg:           transparent;
  --surface:      rgba(255,255,255,0.06);
  --surface2:     rgba(255,255,255,0.09);
  --surface3:     rgba(255,255,255,0.13);
  --border:       rgba(255,255,255,0.1);
  --border-light: rgba(255,255,255,0.16);
  --text:         #f0e8ff;
  --text-muted:   #b89fd4;
  --text-dim:     #7a5f9a;
  --shadow:       0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  --input-bg:     rgba(255,255,255,0.07);
  --topbar-blur:  rgba(13,6,24,0.75);
}

/* Light theme */
[data-theme="light"] body {
  background: #f3e8ff;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(168,85,247,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 75%, rgba(139,0,255,0.10) 0%, transparent 55%),
    linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}
[data-theme="light"] {
  --bg:           transparent;
  --surface:      rgba(255,255,255,0.55);
  --surface2:     rgba(255,255,255,0.70);
  --surface3:     rgba(255,255,255,0.85);
  --border:       rgba(168,85,247,0.2);
  --border-light: rgba(168,85,247,0.3);
  --text:         #1e0a3c;
  --text-muted:   #6b3fa0;
  --text-dim:     #a78cbf;
  --shadow:       0 8px 32px rgba(100,0,200,0.12);
  --shadow-sm:    0 2px 8px rgba(100,0,200,0.08);
  --input-bg:     rgba(255,255,255,0.6);
  --topbar-blur:  rgba(243,232,255,0.8);
  --glass-bg:     rgba(255,255,255,0.5);
  --glass-border: rgba(168,85,247,0.25);
}



/* ── LAYOUT WRAPPER ── */
.app-shell {
  display: flex; height: 100vh; overflow: hidden;
  background: transparent;
}

/* ── SIDEBAR: frosted glass ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-right: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 4px 0 24px rgba(0,0,0,0.3), inset -1px 0 0 rgba(255,255,255,0.05) !important;
  display: flex; flex-direction: column;
  transition: width var(--transition);
  z-index: 20;
}

.sidebar-logo {
  padding: 22px 20px 16px;
  font-size: 1.1rem; font-weight: 800;
  letter-spacing: -.02em; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 0 16px rgba(168,85,247,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
}

.nav-section {
  font-size: .6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-dim);
  padding: 16px 20px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; margin: 2px 10px;
  border-radius: 10px; cursor: pointer;
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative; text-decoration: none;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.2);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(124,58,237,0.2));
  border-color: rgba(168,85,247,0.35);
  color: #e9d5ff;
  box-shadow: 0 0 16px rgba(168,85,247,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: linear-gradient(180deg, #a855f7, #7c3aed);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(168,85,247,0.8);
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--text-dim);
}

/* ── TOPBAR ── */
.topbar {
  height: 60px; flex-shrink: 0;
  background: rgba(13,6,24,0.7) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}

.topbar-greeting {
  flex: 1;
  font-size: 1rem; font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.topbar-greeting span {
  background: linear-gradient(90deg, #a855f7, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-right {
  display: flex; align-items: center; gap: 12px;
}

.topbar-icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.topbar-icon-btn:hover {
  background: rgba(168,85,247,0.15);
  border-color: rgba(168,85,247,0.3);
  color: var(--text);
}

/* Theme toggle */
.theme-toggle-wrap {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.theme-toggle {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover {
  background: rgba(168,85,247,0.15);
  border-color: rgba(168,85,247,0.3);
  color: #a855f7;
}
.theme-toggle-label { font-size: .75rem; color: var(--text-dim); }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1; overflow-y: auto;
  padding: 0;
  background: transparent;
}
.page-content {
  padding: 28px 28px 60px;
  max-width: 1400px;
}
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-size: 1.4rem; font-weight: 800;
  letter-spacing: -.03em; color: var(--text);
}
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: 4px; }

/* ── GLASS CARDS ── */
.card {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: var(--radius-lg) !important;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(168,85,247,0.3) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(168,85,247,0.15), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}
.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: .875rem; font-weight: 700; color: var(--text); }
.card-body { padding: 16px 20px; }

/* ── BUTTONS ── */
.btn {
  padding: 9px 18px; border-radius: 9px;
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  box-shadow: 0 0 20px rgba(168,85,247,0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #9333ea, #6d28d9);
  box-shadow: 0 0 28px rgba(168,85,247,0.6);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(168,85,247,0.15);
  border-color: rgba(168,85,247,0.3);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.btn-danger {
  background: rgba(244,63,94,0.15);
  border: 1px solid rgba(244,63,94,0.3);
  color: #f43f5e;
}
.btn-danger:hover {
  background: rgba(244,63,94,0.25);
  box-shadow: 0 0 16px rgba(244,63,94,0.3);
}
.btn-sm { padding: 6px 12px; font-size: .8rem; }

/* ── INPUTS ── */
.form-control {
  width: 100%;
  background: var(--input-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 9px !important;
  padding: 9px 13px !important;
  color: var(--text) !important;
  font-size: .875rem !important;
  transition: border-color var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(10px);
}
.form-control:focus {
  outline: none !important;
  border-color: rgba(168,85,247,0.5) !important;
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15), 0 0 16px rgba(168,85,247,0.1) !important;
}
.form-control::placeholder { color: var(--text-dim) !important; }
.form-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; display: block; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 6px;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}
.badge-new        { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.3); color: #d8b4fe; }
.badge-located    { background: rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.3); color: #7dd3fc; }
.badge-in_progress{ background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.3); color: #fde68a; }
.badge-recovered  { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.3); color: #6ee7b7; }
.badge-closed     { background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.2); color: #94a3b8; }
.badge-lost       { background: rgba(244,63,94,0.15); border-color: rgba(244,63,94,0.3); color: #fda4af; }

/* ── TABLES ── */
.table-wrap {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
  padding: 11px 16px; text-align: left;
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim);
  background: rgba(168,85,247,0.06);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px; font-size: .875rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(168,85,247,0.06); color: var(--text); }

/* ── MODALS ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.modal {
  background: rgba(20,8,40,0.85) !important;
  backdrop-filter: blur(32px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(180%) !important;
  border: 1px solid rgba(168,85,247,0.25) !important;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(168,85,247,0.1), inset 0 1px 0 rgba(255,255,255,0.08) !important;
  border-radius: 18px !important;
  width: 100%; max-width: 540px;
  animation: modalIn .22s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(244,63,94,0.15); border-color: rgba(244,63,94,0.3); color: #f43f5e; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── DASHBOARD GREETING CARD ── */
.greeting-card {
  background: linear-gradient(135deg, rgba(168,85,247,0.2) 0%, rgba(124,58,237,0.15) 50%, rgba(232,121,249,0.1) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 18px;
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
  box-shadow: 0 0 48px rgba(168,85,247,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
}
.greeting-card::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,121,249,0.15) 0%, transparent 65%);
}
.greeting-name {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -.04em;
  background: linear-gradient(90deg, #f0e8ff, #a855f7, #e879f9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.greeting-sub { font-size: .9rem; color: var(--text-muted); margin-top: 4px; }

/* ── PIPELINE BAR ── */
.pipeline-bar { display: flex; border-radius: 8px; overflow: hidden; height: 10px; gap: 2px; margin: 10px 0; }
.pipeline-seg { height: 100%; transition: flex var(--transition); border-radius: 4px; }

/* ── SKIP TRACE TAGS ── */
.skip-tag {
  font-size: .65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}
.st-check-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-method-check { display: none; }
.st-method-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 7px;
  font-size: .75rem; cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  transition: all var(--transition);
}
.st-method-check:checked + .st-method-label {
  background: rgba(168,85,247,0.2);
  border-color: rgba(168,85,247,0.4);
  color: #d8b4fe;
  box-shadow: 0 0 8px rgba(168,85,247,0.2);
}

/* ── AUTH PAGE ── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: transparent;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 22px;
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(168,85,247,0.08), inset 0 1px 0 rgba(255,255,255,0.1);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 0 32px rgba(168,85,247,0.6);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900; color: #fff;
  margin-bottom: 12px;
}
.auth-title {
  font-size: 1.5rem; font-weight: 900; letter-spacing: -.04em;
  text-align: center; color: var(--text); margin-bottom: 6px;
}
.auth-sub { text-align: center; color: var(--text-muted); font-size: .875rem; margin-bottom: 28px; }
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px; padding: 4px;
}
.auth-tab {
  flex: 1; padding: 8px; border-radius: 7px;
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none; background: transparent;
  color: var(--text-muted); transition: all var(--transition);
}
.auth-tab.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(124,58,237,0.2));
  border: 1px solid rgba(168,85,247,0.4);
  color: #e9d5ff;
  box-shadow: 0 0 12px rgba(168,85,247,0.2);
}

/* ── ALERTS ── */
.alert {
  padding: 10px 14px; border-radius: 9px;
  font-size: .84rem; margin-bottom: 14px;
  backdrop-filter: blur(10px);
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 8px;
}
.alert-error   { background: rgba(244,63,94,0.12); border-color: rgba(244,63,94,0.3); color: #fda4af; }
.alert-success { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.3); color: #6ee7b7; }
.alert-info    { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.3); color: #d8b4fe; }

/* ── SPINNER / LOADER ── */
.loading-center {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(168,85,247,0.15);
  border-top-color: #a855f7;
  animation: spin .7s linear infinite;
  box-shadow: 0 0 16px rgba(168,85,247,0.3);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--text-dim);
}
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.empty-state-body  { font-size: .875rem; line-height: 1.6; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.page-btn:hover  { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.3); color: var(--text); }
.page-btn.active { background: linear-gradient(135deg,#a855f7,#7c3aed); border-color: transparent; color: #fff; box-shadow: 0 0 12px rgba(168,85,247,0.4); }

/* ── SELECT ── */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' fill='none' stroke='%23a855f7' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 10px !important;
  padding-right: 32px !important;
}

/* ── ASSIGNMENTS TABLE STATUS SELECT ── */
.status-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .75rem; padding: 3px 8px;
  cursor: pointer;
}

/* ── LIGHT THEME OVERRIDES ── */
[data-theme="light"] .sidebar {
  background: rgba(255,255,255,0.6) !important;
  border-right-color: rgba(168,85,247,0.15) !important;
  box-shadow: 4px 0 24px rgba(100,0,200,0.08) !important;
}
[data-theme="light"] .topbar {
  background: rgba(243,232,255,0.8) !important;
  border-bottom-color: rgba(168,85,247,0.15) !important;
}
[data-theme="light"] .modal {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(168,85,247,0.25) !important;
}
[data-theme="light"] .nav-item { color: #6b3fa0; }
[data-theme="light"] .nav-item:hover { background: rgba(168,85,247,0.08); color: #1e0a3c; }
[data-theme="light"] .nav-item.active { background: linear-gradient(135deg,rgba(168,85,247,0.2),rgba(124,58,237,0.15)); color: #581c87; }
[data-theme="light"] th { background: rgba(168,85,247,0.05); }
[data-theme="light"] tr:hover td { background: rgba(168,85,247,0.05); }
[data-theme="light"] .greeting-card { background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(232,121,249,0.08)); }
[data-theme="light"] .auth-card { background: rgba(255,255,255,0.75); }

/* ── ANIMATIONS ── */
@keyframes fadeIn    { from{opacity:0} to{opacity:1} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes modalIn   { from{opacity:0;transform:scale(.94) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }
@keyframes slideIn   { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
@keyframes shimmer   { from{background-position:-200% 0} to{background-position:200% 0} }
@keyframes glowPulse { 0%,100%{box-shadow:0 0 16px rgba(168,85,247,0.3)} 50%{box-shadow:0 0 32px rgba(168,85,247,0.6)} }

.page-content > * { animation: slideIn .3s cubic-bezier(.34,1.1,.64,1) both; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168,85,247,0.55); }

/* ── MISC UTILITY ── */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-sm    { font-size: .8rem; }
.mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:14px} .mt-4{margin-top:20px}
.mb-1{margin-bottom:4px} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:14px} .mb-4{margin-bottom:20px}
.flex{display:flex} .items-center{align-items:center} .justify-between{justify-content:space-between}
.gap-1{gap:4px} .gap-2{gap:8px} .gap-3{gap:14px} .w-full{width:100%}


/* ── PRESERVED COMPONENT RULES ──*/

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



/* ===== DARK THEME (default) ===== */
:root, 

/* ===== LIGHT THEME ===== */


/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] 

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: var(--border);
  box-shadow: 2px 0 12px rgba(0,0,0,.05);
}

[data-theme="light"] .topbar {
  background: var(--topbar-blur);
  border-bottom-color: var(--border);
  backdrop-filter: blur(12px);
}

[data-theme="light"] .nav-item { color: #475569; }
[data-theme="light"] .nav-item:hover { background: #f1f5f9; color: #0f172a; }
[data-theme="light"] .nav-item.active { background: var(--primary); color: #fff; }
[data-theme="light"] .nav-section { color: #94a3b8; }
[data-theme="light"] .sidebar-footer { color: #94a3b8; }
[data-theme="light"] .logo-version { background: #f1f5f9; color: #64748b; border-color: var(--border); }

[data-theme="light"] .card { background: #fff; border-color: var(--border); }
[data-theme="light"] .card:hover { border-color: var(--border-light); box-shadow: 0 4px 20px rgba(0,0,0,.07); }

[data-theme="light"] .form-control {
  background: var(--input-bg);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="light"] .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
[data-theme="light"] select.form-control option { background: #fff; color: #0f172a; }

[data-theme="light"] .modal {
  background: #fff;
  border-color: var(--border-light);
  box-shadow: 0 24px 64px rgba(0,0,0,.15);
}
[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer { border-color: var(--border); }
[data-theme="light"] .modal-overlay { background: rgba(15,23,42,.5); }

[data-theme="light"] .btn-secondary {
  background: #f1f5f9;
  border-color: var(--border);
  color: #475569;
}
[data-theme="light"] .btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
[data-theme="light"] .btn-ghost { color: #475569; }
[data-theme="light"] .btn-ghost:hover { background: #f1f5f9; color: #0f172a; border-color: var(--border); }

[data-theme="light"] table th { color: #64748b; border-bottom-color: var(--border); }
[data-theme="light"] table td { border-bottom-color: var(--border); }
[data-theme="light"] tr:hover td { background: #f8fafc; }

[data-theme="light"] .user-pill {
  background: #f1f5f9;
  border-color: var(--border);
  color: #475569;
}
[data-theme="light"] .user-pill:hover { background: #e2e8f0; color: #0f172a; }

[data-theme="light"] .page-btn { background: #f1f5f9; border-color: var(--border); color: #475569; }
[data-theme="light"] .page-btn:hover { background: #e2e8f0; }
[data-theme="light"] .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

[data-theme="light"] .filter-bar .form-control { background: #fff; }

[data-theme="light"] .detail-section { background: #f8fafc; border-color: var(--border); }
[data-theme="light"] .detail-row { border-bottom-color: var(--border); }

[data-theme="light"] .activity-item { border-bottom-color: var(--border); }
[data-theme="light"] .activity-dot { box-shadow: none; }

/* Bento light overrides */
[data-theme="light"] .bento-cell {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
[data-theme="light"] .bento-cell:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
  border-color: var(--border-light);
}
[data-theme="light"] .bento-cell--total {
  background: linear-gradient(145deg, #e8f0fe 0%, #f0f6ff 100%);
  border-color: #c7d9fa;
}
[data-theme="light"] .bento-cell--total::before {
  background: radial-gradient(circle, rgba(26,86,219,.1) 0%, transparent 70%);
}
[data-theme="light"] .bento-cell--rate {
  background: linear-gradient(145deg, #e6faf8 0%, #f0fdfb 100%);
  border-color: #a7f3e8;
}
[data-theme="light"] .bento-cell--active {
  background: linear-gradient(145deg, #e8faf0 0%, #f0fdf6 100%);
  border-color: #a7f3c0;
}
[data-theme="light"] .bento-cell--located {
  background: linear-gradient(145deg, #fefce8 0%, #fffbeb 100%);
  border-color: #fde68a;
}
[data-theme="light"] .bento-cell--total .bento-big-num { color: #0f172a; }
[data-theme="light"] .bento-med-num { color: #0f172a; }
[data-theme="light"] .bento-ring-pct { color: #0d9488; }
[data-theme="light"] .bento-ring-track { stroke: #e2e8f0; }
[data-theme="light"] .bento-mini-pipeline,
[data-theme="light"] .bento-pipeline-bar-lg { background: #e2e8f0; }
[data-theme="light"] .bento-mini-bar { background: #e2e8f0; }
[data-theme="light"] .bento-act-dot { background: #fff; border-color: var(--primary); }
[data-theme="light"] .bento-act-line { background: var(--border); }
[data-theme="light"] .bento-case-row:hover { background: #f8fafc; }
[data-theme="light"] .bento-activity-row { border-bottom-color: var(--border); }

/* Skip trace light */
[data-theme="light"] .st-panel { background: #fff; border-color: var(--border); }
[data-theme="light"] .st-panel-header { background: #f8fafc; border-bottom-color: var(--border); }
[data-theme="light"] .st-lead-card:hover { background: #f8fafc; }
[data-theme="light"] .st-notes { background: #f1f5f9; border-left-color: var(--border-light); }
[data-theme="light"] .st-type-pill {
  background: rgba(217,119,6,.08);
  border-color: rgba(217,119,6,.2);
  color: #b45309;
}

/* Auth light */
[data-theme="light"] .auth-page { background: #f0f4f9; }
[data-theme="light"] .auth-page::before { background: radial-gradient(ellipse, rgba(26,86,219,.08) 0%, transparent 70%); }
[data-theme="light"] .auth-card { background: #fff; border-color: var(--border-light); box-shadow: 0 20px 60px rgba(0,0,0,.1); }
[data-theme="light"] .auth-tab { color: #475569; }
[data-theme="light"] .auth-tab.active { background: var(--primary); color: #fff; }
[data-theme="light"] .auth-tabs { background: #f1f5f9; border-color: var(--border); }

/* Theme toggle button */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--surface3);
  border-color: var(--border-light);
  color: var(--text);
  transform: rotate(20deg);
}
[data-theme="light"] .theme-toggle { background: #f1f5f9; border-color: var(--border); }
[data-theme="light"] .theme-toggle:hover { background: #e2e8f0; }

/* Smooth theme transition */
body, .sidebar, .topbar, .card, .bento-cell, .modal, .form-control, .btn {
  transition: background-color .25s ease, border-color .25s ease, color .15s ease, box-shadow .25s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

/* ===== LAYOUT ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.main-content {
  margin-left: 232px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.page-body { padding: 24px; flex: 1; }

/* ===== SIDEBAR ===== */
.sidebar-logo {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--primary-glow);
}

.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.logo-version { font-size: .6rem; background: var(--surface3); color: var(--text-muted); padding: 2px 6px; border-radius: 3px; font-weight: 600; letter-spacing: .04em; border: 1px solid var(--border-light); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section {
  padding: 12px 16px 5px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 8px;
  transition: all var(--transition);
  font-size: .875rem;
  font-weight: 500;
  position: relative;
  letter-spacing: -.01em;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

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

/* ===== TOPBAR ===== */
.topbar-title { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  transition: all var(--transition);
  color: var(--text-muted);
}
.user-pill:hover { border-color: var(--border-light); color: var(--text); background: var(--surface3); }

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem;
  color: #fff;
  box-shadow: 0 0 8px var(--primary-glow);
}

.chevron-down {
  width: 12px; height: 12px;
  opacity: .5;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }

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

.card-title { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: default;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.stat-card:hover::before { transform: scaleX(1); }
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.stat-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.04em;
  transition: color var(--transition);
}
.stat-card:hover .stat-number { color: var(--primary); }

.stat-label {
  font-size: .72rem;
  color: var(--text-dim);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

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

table { width: 100%; border-collapse: collapse; font-size: .855rem; }

th {
  padding: 9px 12px;
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  transition: background var(--transition);
}

tr { cursor: pointer; }
tr:hover td { background: var(--surface2); }
tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.badge-new        { background: rgba(26,86,219,.15);  color: #60a5fa; border: 1px solid rgba(26,86,219,.2); }
.badge-in_progress{ background: rgba(22,163,74,.12);  color: #4ade80; border: 1px solid rgba(22,163,74,.2); }
.badge-located    { background: rgba(217,119,6,.15);  color: #fbbf24; border: 1px solid rgba(217,119,6,.2); }
.badge-recovered  { background: rgba(20,184,166,.12); color: #2dd4bf; border: 1px solid rgba(20,184,166,.2); }
.badge-stored     { background: rgba(124,58,237,.15); color: #a78bfa; border: 1px solid rgba(124,58,237,.2); }
.badge-released   { background: rgba(14,165,233,.12); color: #38bdf8; border: 1px solid rgba(14,165,233,.2); }
.badge-closed     { background: rgba(71,85,105,.15);  color: #94a3b8; border: 1px solid rgba(71,85,105,.2); }
.badge-cancelled  { background: rgba(220,38,38,.12);  color: #f87171; border: 1px solid rgba(220,38,38,.2); }
.badge-urgent     { background: rgba(220,38,38,.15);  color: #fca5a5; border: 1px solid rgba(220,38,38,.25); }
.badge-high       { background: rgba(234,88,12,.15);  color: #fb923c; border: 1px solid rgba(234,88,12,.2); }
.badge-normal     { background: rgba(71,85,105,.12);  color: #94a3b8; border: 1px solid rgba(71,85,105,.2); }
.badge-low        { background: rgba(51,65,85,.1);    color: #64748b; border: 1px solid rgba(51,65,85,.15); }
.badge-owner      { background: rgba(217,119,6,.15);  color: #fbbf24; border: 1px solid rgba(217,119,6,.2); }
.badge-admin      { background: rgba(26,86,219,.15);  color: #60a5fa; border: 1px solid rgba(26,86,219,.2); }
.badge-agent      { background: rgba(22,163,74,.12);  color: #4ade80; border: 1px solid rgba(22,163,74,.2); }
.badge-viewer     { background: rgba(71,85,105,.12);  color: #94a3b8; border: 1px solid rgba(71,85,105,.2); }
.badge-free       { background: rgba(71,85,105,.12);  color: #94a3b8; border: 1px solid rgba(71,85,105,.2); }
.badge-pro        { background: rgba(26,86,219,.15);  color: #60a5fa; border: 1px solid rgba(26,86,219,.2); }
.badge-enterprise { background: rgba(217,119,6,.15);  color: #fbbf24; border: 1px solid rgba(217,119,6,.2); }
.badge-active     { background: rgba(22,163,74,.12);  color: #4ade80; border: 1px solid rgba(22,163,74,.2); }
.badge-inactive   { background: rgba(71,85,105,.12);  color: #94a3b8; border: 1px solid rgba(71,85,105,.2); }
.badge-locked     { background: rgba(220,38,38,.12);  color: #f87171; border: 1px solid rgba(220,38,38,.2); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: .845rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 0 var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface3);
  border-color: var(--border-light);
  color: var(--text);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 16px rgba(220,38,38,.3); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

.btn-sm { padding: 5px 11px; font-size: .79rem; }
.btn-xs { padding: 3px 8px; font-size: .72rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: .79rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: .01em;
}

.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 11px;
  color: var(--text);
  font-size: .855rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-dim); }
select.form-control option { background: var(--surface2); }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 13px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
  animation: slideUp .2s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.auth-page::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(26,86,219,.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(217,119,6,.06) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  animation: slideUp .3s cubic-bezier(0.34,1.2,0.64,1);
  position: relative;
  z-index: 1;
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-mark {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900; color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.auth-logo h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.auth-logo p { color: var(--text-muted); margin-top: 5px; font-size: .875rem; }

.auth-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .845rem;
  border-radius: 6px;
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ===== ALERTS ===== */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: .845rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: fadeIn .2s ease;
}
.alert-error { background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.25); color: #fca5a5; }
.alert-success { background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.25); color: #86efac; }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-control { max-width: 220px; }
.filter-bar .form-control:focus { max-width: 260px; transition: max-width .3s ease, border-color var(--transition), box-shadow var(--transition); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon {
  width: 52px; height: 52px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: .875rem; color: var(--text-muted); }

/* ===== LOADING ===== */
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 48px; }

/* ===== SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 2px; border-radius: 4px; }

/* ===== DETAIL VIEW ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.detail-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.detail-section h3 {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: .845rem;
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); flex-shrink: 0; }
.detail-value { font-weight: 500; text-align: right; color: var(--text); word-break: break-word; }

/* ===== ACTIVITY FEED ===== */
.activity-item {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--primary-glow);
}

.activity-time { font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
.activity-text { font-size: .845rem; color: var(--text-muted); }
.activity-text strong { color: var(--text); font-weight: 600; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 14px; }
.page-btn {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .79rem;
  font-weight: 600;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--surface3); border-color: var(--border-light); color: var(--text); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-glow); }

/* ===== STATUS LINE (top accent per status) ===== */
.status-line { height: 3px; border-radius: 2px; margin-bottom: 16px; }
.status-line-new        { background: linear-gradient(90deg, #1a56db, #3b82f6); }
.status-line-in_progress{ background: linear-gradient(90deg, #16a34a, #22c55e); }
.status-line-located    { background: linear-gradient(90deg, #d97706, #fbbf24); }
.status-line-recovered  { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.status-line-urgent     { background: linear-gradient(90deg, #dc2626, #f87171); }

/* ===== PROGRESS BAR ===== */
.progress-bar { background: var(--border); border-radius: 3px; height: 5px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--primary); transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-label { text-align: center; position: relative; margin: 20px 0; }
.divider-label span { background: var(--surface); padding: 0 12px; font-size: .75rem; color: var(--text-dim); position: relative; z-index: 1; }
.divider-label::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }

/* ===== TOOLTIPS ===== */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface3);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 5px 9px;
  border-radius: 5px;
  font-size: .75rem;
  white-space: nowrap;
  z-index: 300;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  animation: fadeIn .1s ease;
}

/* ===== INLINE STATUS SELECTOR ===== */
.status-select {
  background: var(--surface3);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text);
  padding: 4px 8px;
  font-size: .79rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}
.status-select:hover { border-color: var(--primary); }

/* ===== PAGE TRANSITION ===== */
.page-enter {
  animation: pageIn .2s cubic-bezier(0.4,0,0.2,1);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .main-content { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  #menu-toggle { display: flex !important; }
}


/* ===== SKIP TRACE PANEL ===== */
.st-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 16px;
}

.st-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.st-count-badge {
  background: var(--primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.st-lead-list { padding: 4px 0; }

.st-empty {
  text-align: center;
  padding: 36px 24px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  line-height: 1.6;
}

.st-lead-card {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.st-lead-card:last-child { border-bottom: none; }
.st-lead-card:hover { background: var(--surface2); }

.st-lead-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.st-type-pill {
  background: rgba(217,119,6,.15);
  border: 1px solid rgba(217,119,6,.25);
  color: #fbbf24;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.st-source-tag {
  font-size: .72rem;
  color: var(--text-dim);
  font-weight: 500;
}

.st-meta {
  font-size: .72rem;
  color: var(--text-dim);
}

.st-lead-body { font-size: .845rem; }

.st-detail-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  padding: 3px 0;
}
.st-detail-line svg { flex-shrink: 0; color: var(--text-dim); }

.st-notes {
  color: var(--text-muted);
  font-size: .82rem;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface3);
  border-radius: 5px;
  border-left: 2px solid var(--border-light);
  line-height: 1.5;
  white-space: pre-wrap;
}

.st-attempt-badge {
  display: inline-block;
  background: rgba(20,184,166,.12);
  border: 1px solid rgba(20,184,166,.2);
  color: #2dd4bf;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.st-map-link {
  color: var(--primary);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 600;
}
.st-map-link:hover { text-decoration: underline; }

.st-section { animation: fadeIn .2s ease; }

/* ===== DASHBOARD SUMMARY ROW ===== */
.dash-summary-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 20px;
  gap: 0;
}

.dash-kpi {
  text-align: center;
  min-width: 80px;
  padding: 0 20px;
}

.dash-kpi-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dash-kpi-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-top: 5px;
}

.dash-kpi-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ===== PIPELINE BAR ===== */
.pipeline-bar {
  height: 7px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  display: flex;
}

.pipeline-seg {
  height: 100%;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.pipeline-seg:first-child { border-radius: 4px 0 0 4px; }
.pipeline-seg:last-child  { border-radius: 0 4px 4px 0; }
.pipeline-seg:only-child  { border-radius: 4px; }

@media (max-width: 768px) {
  .dash-summary-row { flex-wrap: wrap; gap: 16px; }
  .dash-kpi { min-width: calc(50% - 16px); border: none; }
  .dash-kpi-divider { display: none; }
  .dash-summary-row > div:last-child { width: 100%; margin-left: 0 !important; }
}

/* ============================================================
   BENTO GRID — TruRepo Dashboard
   ============================================================ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: auto;
  gap: 12px;
  margin-bottom: 20px;
}

/* Cell base */
.bento-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.4,0,.2,1),
              border-color .2s ease,
              box-shadow .2s ease;
}
.bento-cell:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

/* Cascade entrance animation */
.bento-cascade {
  animation: bentoCascade .45s cubic-bezier(.34,1.2,.64,1) both;
  animation-delay: calc(var(--i) * 70ms);
}
@keyframes bentoCascade {
  from { opacity:0; transform: translateY(18px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1);   }
}

/* ---- CELL LAYOUT ASSIGNMENTS ---- */

/* A: Total — col 1-2, row 1-2 (tall left hero) */
.bento-cell--total {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  background: linear-gradient(145deg, #0d1a35 0%, #0a0f1e 100%);
  border-color: #1e3a5f;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bento-cell--total::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(26,86,219,.2) 0%, transparent 70%);
  pointer-events: none;
}

/* B: Recovery Rate — col 3, row 1 */
.bento-cell--rate {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
  background: linear-gradient(145deg, #0d1f1e 0%, #0a0f1e 100%);
  border-color: rgba(13,148,136,.25);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bento-cell--rate::before {
  content: '';
  position: absolute;
  bottom: -20px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 60px;
  background: radial-gradient(ellipse, rgba(13,148,136,.15) 0%, transparent 70%);
  pointer-events: none;
}

/* C: Active — col 4, row 1 */
.bento-cell--active {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
  background: linear-gradient(145deg, #0a1f12 0%, #0a0f1e 100%);
  border-color: rgba(22,163,74,.2);
}

/* D: Pipeline — col 3-6, row 2 */
.bento-cell--pipeline {
  grid-column: 3 / 7;
  grid-row: 2 / 3;
  background: var(--surface);
}

/* E: Located — col 5-6, row 1 */
.bento-cell--located {
  grid-column: 5 / 7;
  grid-row: 1 / 2;
  background: linear-gradient(145deg, #1a1205 0%, #0a0f1e 100%);
  border-color: rgba(217,119,6,.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* F: Urgent queue — col 1-4, row 3 */
.bento-cell--urgent {
  grid-column: 1 / 4;
  grid-row: 3 / 4;
}

/* G: Activity feed — col 4-6, row 3 */
.bento-cell--activity {
  grid-column: 4 / 7;
  grid-row: 3 / 4;
  background: var(--surface);
}

/* ---- TYPOGRAPHY ---- */
.bento-cell-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.bento-cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bento-cell-header .bento-cell-label { margin-bottom: 0; }

.bento-big-num {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bento-med-num {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bento-sub-line {
  font-size: .82rem;
  margin-top: 8px;
  font-weight: 500;
}

.bento-cell-footer { margin-top: auto; padding-top: 16px; }

/* ---- MINI PIPELINE (inside total cell) ---- */
.bento-mini-pipeline {
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  display: flex;
  overflow: hidden;
}

/* ---- FULL PIPELINE BAR ---- */
.bento-pipeline-bar-lg {
  height: 10px;
  border-radius: 6px;
  background: var(--surface3);
  display: flex;
  overflow: hidden;
  margin: 12px 0;
}

/* ---- LEGEND ---- */
.bento-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 4px;
}
.bento-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bento-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bento-legend-label {
  font-size: .75rem;
  color: var(--text-muted);
}
.bento-legend-val {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
}

/* ---- RING / ARC ---- */
.bento-ring-wrap {
  position: relative;
  width: 100px; height: 100px;
  margin: 4px auto 0;
}
.bento-ring {
  width: 100%; height: 100%;
  transform: rotate(-135deg);
}
.bento-ring-track {
  fill: none;
  stroke: var(--surface3);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 239;
  stroke-dashoffset: 60; /* leave gap at bottom */
}
.bento-ring-fill {
  fill: none;
  stroke: #0d9488;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 239;
  stroke-dashoffset: 239;
  filter: drop-shadow(0 0 6px rgba(13,148,136,.6));
}
.bento-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bento-ring-pct {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: #2dd4bf;
}
.bento-ring-unit {
  font-size: .65rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ---- PROGRESS ROW ---- */
.bento-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.bento-mini-bar {
  flex: 1;
  height: 5px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
}
.bento-mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.bento-pct-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

/* ---- GLOW BAR (Located cell accent) ---- */
.bento-glow-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: 14px;
}

/* ---- CASE LIST (Urgent cell) ---- */
.bento-case-list { display: flex; flex-direction: column; gap: 2px; }

.bento-case-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
}
.bento-case-row:hover { background: var(--surface2); }

.bento-case-num {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  min-width: 96px;
}
.bento-case-info { flex: 1; min-width: 0; }
.bento-case-name {
  font-size: .855rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bento-case-vehicle {
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.bento-empty-row {
  padding: 20px 10px;
  font-size: .845rem;
  color: var(--text-dim);
  text-align: center;
}

/* ---- ACTIVITY FEED ---- */
.bento-activity-feed { display: flex; flex-direction: column; }

.bento-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  animation: fadeIn .3s ease both;
}
.bento-activity-row:last-child { border-bottom: none; }

.bento-act-line {
  position: absolute;
  left: 6px; top: 18px;
  width: 1px;
  height: calc(100% + 8px);
  background: var(--border);
}
.bento-activity-row:last-child .bento-act-line { display: none; }

.bento-act-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--surface3);
  border: 2px solid var(--primary);
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 0 6px var(--primary-glow);
  z-index: 1;
}

.bento-act-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bento-act-who {
  font-size: .79rem;
  font-weight: 700;
  color: var(--text);
}
.bento-act-what {
  font-size: .79rem;
  color: var(--text-muted);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bento-act-time {
  font-size: .68rem;
  color: var(--text-dim);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .bento-cell--total    { grid-column: 1 / 3; grid-row: 1 / 2; }
  .bento-cell--rate     { grid-column: 3 / 4; grid-row: 1 / 2; }
  .bento-cell--active   { grid-column: 4 / 5; grid-row: 1 / 2; }
  .bento-cell--located  { grid-column: 1 / 2; grid-row: 2 / 3; }
  .bento-cell--pipeline { grid-column: 2 / 5; grid-row: 2 / 3; }
  .bento-cell--urgent   { grid-column: 1 / 3; grid-row: 3 / 4; }
  .bento-cell--activity { grid-column: 3 / 5; grid-row: 3 / 4; }
}

@media (max-width: 680px) {
  .bento-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bento-cell--total    { grid-column: 1 / 3; grid-row: auto; }
  .bento-cell--rate     { grid-column: 1 / 2; grid-row: auto; }
  .bento-cell--active   { grid-column: 2 / 3; grid-row: auto; }
  .bento-cell--located  { grid-column: 1 / 2; grid-row: auto; }
  .bento-cell--pipeline { grid-column: 1 / 3; grid-row: auto; }
  .bento-cell--urgent   { grid-column: 1 / 3; grid-row: auto; }
  .bento-cell--activity { grid-column: 1 / 3; grid-row: auto; }
  .bento-big-num { font-size: 3rem; }
}

/* ===== THEME TOGGLE WRAPPER ===== */
.theme-toggle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.theme-toggle-label {
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  line-height: 1;
  user-select: none;
  transition: color var(--transition);
}
.theme-toggle-wrap:hover .theme-toggle-label { color: var(--text-muted); }
.theme-toggle-wrap:hover .theme-toggle { transform: rotate(20deg); }

/* ===== SKIP TRACE v2 ===== */

.st-modal-wide { max-width: 820px !important; }
.st-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
@media (max-width: 680px) { .st-modal-body { grid-template-columns: 1fr; } }

.st-modal-col { display: flex; flex-direction: column; }

.st-section-head {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.st-dyn-sec { animation: fadeIn .2s ease; }

/* Lead card */
.st-lead-card {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: stCardIn .3s cubic-bezier(.34,1.2,.64,1) both;
  animation-delay: calc(var(--si,0) * 50ms);
}
@keyframes stCardIn {
  from { opacity:0; transform: translateX(-8px); }
  to   { opacity:1; transform: translateX(0); }
}
.st-lead-card:last-child { border-bottom: none; }
.st-lead-card:hover { background: var(--surface2); }

.st-lead-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}

.st-method-pill {
  font-size: .68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid transparent;
}

.st-sub-tag {
  font-size: .72rem; color: var(--text-dim);
  font-weight: 500;
}

/* Confidence bar */
.st-conf-wrap { width: 48px; }
.st-conf-bar {
  height: 4px; background: var(--surface3);
  border-radius: 2px; overflow: hidden;
}
.st-conf-fill {
  height: 100%; border-radius: 2px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.st-conf-low       { background: #475569; }
.st-conf-medium    { background: #d97706; box-shadow: 0 0 4px rgba(217,119,6,.4); }
.st-conf-high      { background: #16a34a; box-shadow: 0 0 4px rgba(22,163,74,.4); }
.st-conf-confirmed { background: #0d9488; box-shadow: 0 0 6px rgba(13,148,136,.5); }

.st-lead-body { font-size: .845rem; }

.st-detail-line {
  display: flex; align-items: flex-start; gap: 7px;
  color: var(--text-muted); padding: 3px 0;
}
.st-detail-line svg { flex-shrink:0; color:var(--text-dim); margin-top:1px; }

.st-notes {
  color: var(--text-muted); font-size: .82rem;
  margin-top: 7px; padding: 8px 11px;
  background: var(--surface3); border-radius: 5px;
  border-left: 2px solid var(--border-light);
  line-height: 1.55; white-space: pre-wrap;
}

.st-lead-footer {
  font-size: .68rem; color: var(--text-dim);
  margin-top: 8px; padding-top: 6px;
  border-top: 1px solid var(--border);
}

.st-followup-tag {
  display: inline-block; margin-top: 6px;
  background: rgba(26,86,219,.1); border: 1px solid rgba(26,86,219,.2);
  color: #60a5fa; font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .05em;
}

/* Summary dots */
.st-summary-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; cursor: default;
}

/* Check grid (effort modal) */
.st-check-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-top: 4px;
}
.st-check-item {
  display: flex; align-items: center; gap: 7px;
  font-size: .82rem; color: var(--text-muted);
  cursor: pointer; padding: 4px;
  border-radius: 5px;
  transition: background var(--transition);
}
.st-check-item:hover { background: var(--surface2); }
.st-method-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

.st-map-link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: .75rem; }
.st-map-link:hover { text-decoration: underline; }

/* Light theme overrides */
[data-theme="light"] .st-notes { background: #f1f5f9; border-left-color: #c8d2e0; }
[data-theme="light"] .st-check-item:hover { background: #f8fafc; }
[data-theme="light"] .st-lead-card:hover { background: #f8fafc; }


/* ══════════════════════════════════════════════
   BENTO GRID — GLASSMORPHISM PURPLE
   ══════════════════════════════════════════════ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto;
  gap: 16px;
  padding-bottom: 32px;
}

/* Cell base — frosted glass */
.bento-cell {
  background: rgba(255,255,255,0.05) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 18px !important;
  padding: 22px !important;
  position: relative;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.34,1.1,.64,1), border-color .2s, box-shadow .2s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.07) !important;
}
.bento-cell::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(168,85,247,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.bento-cell:hover {
  transform: translateY(-3px);
  border-color: rgba(168,85,247,0.28) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(168,85,247,0.15), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}

/* Cascade entry animation */
.bento-cascade {
  opacity: 0;
  animation: bentoIn .45s cubic-bezier(.34,1.1,.64,1) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes bentoIn {
  from { opacity:0; transform: translateY(22px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1);   }
}

/* Grid layout */
.bento-cell--total    { grid-column: span 4; grid-row: span 2; }
.bento-cell--rate     { grid-column: span 3; }
.bento-cell--active   { grid-column: span 2; }
.bento-cell--located  { grid-column: span 3; }
.bento-cell--pipeline { grid-column: span 8; }
.bento-cell--urgent   { grid-column: span 7; grid-row: span 2; }
.bento-cell--activity { grid-column: span 5; grid-row: span 2; }

/* Labels */
.bento-cell-label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.bento-cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.bento-cell-header .bento-cell-label { margin-bottom: 0; }

/* Big number (Total) */
.bento-big-num {
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
  background: linear-gradient(135deg, #f0e8ff 0%, #a855f7 60%, #e879f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(168,85,247,.5));
  margin-bottom: 10px;
}

/* Medium number */
.bento-med-num {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
  color: #a855f7;
  text-shadow: 0 0 24px rgba(168,85,247,.5);
  margin-bottom: 10px;
}

.bento-sub-line {
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bento-cell-footer { margin-top: auto; }

/* Mini pipeline bar (inside total cell) */
.bento-mini-pipeline {
  display: flex;
  gap: 3px;
  height: 5px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.bento-mini-pipeline .pipeline-seg {
  height: 100%;
  border-radius: 3px;
  transition: flex .4s ease;
}

/* Large pipeline bar */
.bento-pipeline-bar-lg {
  display: flex;
  gap: 4px;
  height: 12px;
  border-radius: 8px;
  overflow: hidden;
  margin: 6px 0 16px;
}
.bento-pipeline-bar-lg .pipeline-seg { height: 100%; border-radius: 6px; }

/* Pipeline legend */
.bento-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.bento-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--text-muted);
}
.bento-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bento-legend-val {
  font-weight: 700;
  color: var(--text);
  margin-left: 2px;
}

/* Progress bar (active cell) */
.bento-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bento-mini-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.bento-mini-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}
.bento-pct-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Glow bar (located cell) */
.bento-glow-bar {
  height: 4px;
  border-radius: 4px;
  margin-top: 14px;
}

/* Recovery ring */
.bento-ring-wrap {
  position: relative;
  width: 110px; height: 110px;
  margin: 4px auto 0;
}
.bento-ring { width: 100%; height: 100%; transform: rotate(-135deg); }
.bento-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 8;
  stroke-linecap: round;
}
.bento-ring-fill {
  fill: none;
  stroke: url(#purpleGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 239;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 0 6px rgba(168,85,247,.7));
}
.bento-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bento-ring-pct {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, #f0e8ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.bento-ring-unit {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 1px;
}

/* Urgent queue list */
.bento-case-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bento-case-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .15s;
  border: 1px solid transparent;
}
.bento-case-row:hover {
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.2);
  transform: translateX(3px);
}
.bento-case-num {
  font-size: .7rem;
  font-weight: 800;
  color: #a855f7;
  text-shadow: 0 0 8px rgba(168,85,247,.4);
  min-width: 80px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.bento-case-name {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
}
.bento-case-vehicle {
  font-size: .72rem;
  color: var(--text-dim);
  margin-top: 1px;
}
.bento-empty-row {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: .82rem;
}

/* Activity feed */
.bento-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bento-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  position: relative;
  opacity: 0;
  animation: slideIn .3s ease forwards;
}
.bento-act-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168,85,247,.6);
  flex-shrink: 0;
  margin-top: 4px;
}
.bento-act-line {
  position: absolute;
  left: 7px; top: 20px; bottom: -2px;
  width: 1px;
  background: linear-gradient(180deg, rgba(168,85,247,.3), transparent);
}
.bento-activity-row:last-child .bento-act-line { display: none; }
.bento-act-body { flex: 1; min-width: 0; }
.bento-act-who {
  font-size: .75rem;
  font-weight: 700;
  color: #d8b4fe;
  margin-right: 5px;
}
.bento-act-what {
  font-size: .75rem;
  color: var(--text-muted);
}
.bento-act-time {
  font-size: .68rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* btn-xs */
.btn-xs { padding: 4px 10px; font-size: .72rem; border-radius: 7px; }

/* SVG gradient def (injected inline on mount) */
.bento-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── USER PILL ── */
.user-pill:hover {
  background: rgba(168,85,247,0.15) !important;
  border-color: rgba(168,85,247,0.3) !important;
}

/* ── SETTINGS PAGE ── */
.settings-section {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}
.settings-section h3 {
  font-size: .875rem; font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── STORAGE LOTS ── */
.lot-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 18px;
  transition: transform .18s, border-color .18s;
}
.lot-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168,85,247,0.25);
}

/* ── SKIP TRACE PANEL ── */
.skip-trace-wrap {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
}

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 900px) {
  .bento-cell--total    { grid-column: span 12; grid-row: span 1; }
  .bento-cell--rate     { grid-column: span 6; }
  .bento-cell--active   { grid-column: span 6; }
  .bento-cell--located  { grid-column: span 6; }
  .bento-cell--pipeline { grid-column: span 12; }
  .bento-cell--urgent   { grid-column: span 12; grid-row: span 1; }
  .bento-cell--activity { grid-column: span 12; grid-row: span 1; }
  .sidebar { width: 64px; }
  .sidebar .logo-text,
  .sidebar .nav-section,
  .sidebar .sidebar-footer,
  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .page-content { padding: 16px 12px 60px; }
}

@media (max-width: 600px) {
  .bento-cell--rate,
  .bento-cell--active,
  .bento-cell--located { grid-column: span 12; }
}

/* ── LIGHT THEME BENTO OVERRIDES ── */
[data-theme="light"] .bento-cell {
  background: rgba(255,255,255,0.65) !important;
  border-color: rgba(168,85,247,0.15) !important;
  box-shadow: 0 4px 24px rgba(100,0,200,0.08), inset 0 1px 0 rgba(255,255,255,0.9) !important;
}
[data-theme="light"] .bento-cell:hover {
  border-color: rgba(168,85,247,0.35) !important;
  box-shadow: 0 12px 40px rgba(100,0,200,0.15) !important;
}
[data-theme="light"] .bento-big-num {
  background: linear-gradient(135deg, #1e0a3c, #7c3aed, #a855f7);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 8px rgba(168,85,247,.2));
}
[data-theme="light"] .bento-med-num { color: #7c3aed; text-shadow: 0 0 12px rgba(124,58,237,.2); }
[data-theme="light"] .bento-ring-fill { filter: drop-shadow(0 0 4px rgba(168,85,247,.4)); }
[data-theme="light"] .bento-case-row:hover { background: rgba(168,85,247,0.07); }


/* ── PAGE TRANSITION ── */
.page-enter {
  animation: slideIn .35s cubic-bezier(.34,1.1,.64,1) both;
}

/* ── USER DROPDOWN MENU ── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(20,8,40,0.92);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(168,85,247,0.08);
  z-index: 200;
  animation: modalIn .15s cubic-bezier(.34,1.56,.64,1);
}
.user-dropdown-item {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: .84rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; gap: 8px;
}
.user-dropdown-item:hover { background: rgba(168,85,247,0.12); color: var(--text); }
.user-dropdown-item.danger:hover { background: rgba(244,63,94,0.12); color: #f43f5e; }
.user-dropdown-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 6px 0; }

/* ── ASSIGNMENT DETAIL VIEW ── */
.assign-detail-header {
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 24px;
}
.assign-detail-title {
  font-size: 1.3rem; font-weight: 900; letter-spacing: -.03em;
  color: var(--text);
}
.assign-detail-meta { font-size: .8rem; color: var(--text-dim); margin-top: 4px; }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 8px 14px;
  backdrop-filter: blur(12px);
  transition: border-color .18s, box-shadow .18s;
}
.search-bar:focus-within {
  border-color: rgba(168,85,247,0.4);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: .875rem; flex: 1;
}
.search-bar input::placeholder { color: var(--text-dim); }

/* ── INVITE / TEAM ── */
.team-member-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.team-member-row:last-child { border-bottom: none; }
.team-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff;
  box-shadow: 0 0 12px rgba(168,85,247,0.35);
  flex-shrink: 0;
}

/* ── TOPBAR TITLE (for non-dashboard pages) ── */
.topbar-title {
  font-size: .9rem; font-weight: 700; color: var(--text);
}

/* ── MARKETING SITE NAV (trurepo.com) ── */
.site-nav {
  backdrop-filter: blur(20px) !important;
  background: rgba(13,6,24,0.8) !important;
  border-bottom: 1px solid rgba(168,85,247,0.15) !important;
}
