/* ============================================================
   VVVCRM — Premium SaaS Design System
   Dark + Light | Gradient cards | Glassmorphism | Micro-interactions
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* brand */
  --brand-1: #6366f1;   /* indigo  */
  --brand-2: #8b5cf6;   /* violet  */
  --brand-3: #06b6d4;   /* cyan    */
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --grad-blue:  linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --grad-rose:  linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);

  /* light surfaces */
  --bg:        #f4f5fb;
  --bg-soft:   #eef0f9;
  --surface:   #ffffff;
  --surface-2: #fafbff;
  --sidebar:   #ffffff;
  --line:      #e6e8f2;
  --line-soft: #eff1f8;

  /* text */
  --ink:      #101322;
  --ink-2:    #4a5170;
  --ink-3:    #8b92ad;

  /* status */
  --ok:   #10b981;
  --warn: #f59e0b;
  --bad:  #ef4444;
  --info: #3b82f6;

  /* shape */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* shadow */
  --sh-1: 0 1px 2px rgba(16,19,34,.05), 0 1px 3px rgba(16,19,34,.04);
  --sh-2: 0 4px 16px rgba(16,19,34,.06), 0 1px 3px rgba(16,19,34,.04);
  --sh-3: 0 18px 45px rgba(16,19,34,.10), 0 4px 12px rgba(16,19,34,.05);
  --sh-brand: 0 12px 30px rgba(99,102,241,.32);

  --glass: rgba(255,255,255,.72);
  --glass-line: rgba(255,255,255,.55);

  --sidebar-w: 260px;
  --topbar-h: 68px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:        #0a0c18;
  --bg-soft:   #0f1222;
  --surface:   #141830;
  --surface-2: #1a1f3c;
  --sidebar:   #10142a;
  --line:      #242a4a;
  --line-soft: #1c2140;

  --ink:   #f1f3fb;
  --ink-2: #a9b1d6;
  --ink-3: #6b7399;

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 4px 18px rgba(0,0,0,.35);
  --sh-3: 0 20px 50px rgba(0,0,0,.5);
  --sh-brand: 0 12px 34px rgba(99,102,241,.45);

  --glass: rgba(20,24,48,.72);
  --glass-line: rgba(255,255,255,.09);
  color-scheme: dark;
}

/* ---------- 2. RESET ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ---------- 3. APP SHELL ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 22px;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -.5px;
  box-shadow: var(--sh-brand);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.brand-sub  { font-size: 10.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  color: var(--ink-3); text-transform: uppercase;
  padding: 16px 12px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10.5px 12px; border-radius: 13px;
  color: var(--ink-2); font-weight: 600; font-size: 14px;
  position: relative; cursor: pointer;
  transition: all .18s ease;
}
.nav-item .ni {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--bg-soft);
  display: grid; place-items: center; font-size: 16px;
  transition: all .18s ease;
  flex: 0 0 34px;
}
.nav-item:hover { background: var(--bg-soft); color: var(--ink); transform: translateX(2px); }
.nav-item.active { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }
.nav-item.active .ni { background: rgba(255,255,255,.2); }
.nav-item .badge-n {
  margin-left: auto; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.nav-item.active .badge-n { background: rgba(255,255,255,.25); }

.sidebar-foot { margin-top: auto; padding-top: 14px; }
.trial-card {
  background: var(--grad-brand); color: #fff;
  border-radius: var(--r); padding: 16px; box-shadow: var(--sh-brand);
}
.trial-card h4 { font-size: 14px; margin-bottom: 4px; }
.trial-card p  { font-size: 12px; opacity: .85; margin: 0 0 12px; }
.trial-card .btn-white {
  display: block; text-align: center; background: #fff; color: var(--brand-1);
  font-weight: 700; font-size: 12.5px; padding: 9px; border-radius: 10px;
}

/* ---------- 4. MAIN + TOPBAR ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.hamburger { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; }
.search {
  flex: 1; max-width: 420px; position: relative;
}
.search input {
  width: 100%; background: var(--bg-soft); border: 1px solid transparent;
  border-radius: 12px; padding: 10px 14px 10px 38px; outline: none;
  transition: all .2s ease; font-size: 13.5px;
}
.search input:focus { border-color: var(--brand-1); background: var(--surface); box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.search .si { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  font-size: 16px; position: relative; transition: all .18s ease;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--brand-1); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  background: var(--bad); border-radius: 50%; border: 2px solid var(--surface);
}
.avatar {
  width: 40px; height: 40px; border-radius: 13px; background: var(--grad-brand);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13.5px;
  box-shadow: var(--sh-brand); cursor: pointer;
}
.who { line-height: 1.2; margin-right: 2px; }
.who b { display: block; font-size: 13.5px; }
.who span { font-size: 11.5px; color: var(--ink-3); }

.content { padding: 26px; flex: 1; }
@media (max-width: 720px) { .content { padding: 16px; } .topbar { padding: 0 14px; } }

/* ---------- 5. PAGE HEAD ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; letter-spacing: -.035em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 6. CARDS ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-2);
  padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 15.5px; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); }
.card-head .right { margin-left: auto; }

.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: 1.15fr 1.6fr 1fr; }
@media (max-width: 1240px) { .g-main { grid-template-columns: 1fr 1fr; } .g-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 860px)  { .g-main, .g-3, .g-2 { grid-template-columns: 1fr; } }
@media (max-width: 520px)  { .g-4 { grid-template-columns: 1fr; } }

/* ---------- 7. STAT CARDS (gradient) ---------- */
.stat {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 20px; color: #fff;
  box-shadow: var(--sh-3);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s ease;
}
.stat:hover { transform: translateY(-5px); box-shadow: 0 24px 55px rgba(99,102,241,.28); }
.stat::after {
  content: ''; position: absolute; right: -30px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.13);
}
.stat::before {
  content: ''; position: absolute; right: 30px; bottom: -60px;
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.stat.s1 { background: var(--grad-brand); }
.stat.s2 { background: var(--grad-blue);  }
.stat.s3 { background: var(--grad-amber); }
.stat.s4 { background: var(--grad-green); }
.stat.s5 { background: var(--grad-rose);  }
.stat .si {
  width: 42px; height: 42px; border-radius: 13px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 19px; margin-bottom: 14px;
  position: relative; z-index: 1;
}
.stat .sv { font-size: 30px; font-weight: 800; letter-spacing: -.04em; position: relative; z-index: 1; }
.stat .sl { font-size: 13px; opacity: .9; font-weight: 600; position: relative; z-index: 1; }
.stat .st {
  position: relative; z-index: 1; margin-top: 10px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 20px;
}

/* neutral stat (surface) */
.stat-plain {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-2);
  transition: transform .2s ease;
}
.stat-plain:hover { transform: translateY(-3px); }
.stat-plain .sv { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.stat-plain .sl { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* ---------- 8. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 13px; border: 1px solid transparent;
  font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(99,102,241,.42); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand-1); color: var(--brand-1); transform: translateY(-2px); }
.btn-soft { background: var(--bg-soft); color: var(--ink-2); }
.btn-soft:hover { background: var(--line-soft); color: var(--ink); }
.btn-green { background: var(--grad-green); color: #fff; box-shadow: 0 10px 26px rgba(16,185,129,.32); }
.btn-green:hover { transform: translateY(-2px); }
.btn-amber { background: var(--grad-amber); color: #fff; box-shadow: 0 10px 26px rgba(245,158,11,.3); }
.btn-rose  { background: var(--grad-rose);  color: #fff; box-shadow: 0 10px 26px rgba(244,63,94,.3); }
.btn-blue  { background: var(--grad-blue);  color: #fff; box-shadow: 0 10px 26px rgba(59,130,246,.3); }
.btn-lg { padding: 15px 24px; font-size: 15px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-xl {
  width: 100%; padding: 18px; font-size: 16px; border-radius: 18px;
  letter-spacing: .01em;
}

/* ---------- 9. TAGS / PILLS ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
}
.tag-hot    { background: rgba(244,63,94,.12);  color: #f43f5e; }
.tag-warm   { background: rgba(245,158,11,.14); color: #d97706; }
.tag-cold   { background: rgba(59,130,246,.12); color: #3b82f6; }
.tag-follow { background: rgba(139,92,246,.13); color: #8b5cf6; }
.tag-demo   { background: rgba(6,182,212,.13);  color: #0891b2; }
.tag-won    { background: rgba(16,185,129,.14); color: #059669; }
.tag-lost   { background: rgba(139,146,173,.15);color: var(--ink-3); }
html[data-theme="dark"] .tag-warm { color: #fbbf24; }
html[data-theme="dark"] .tag-won  { color: #34d399; }
html[data-theme="dark"] .tag-demo { color: #22d3ee; }

.dot-live {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  background: var(--ok); box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: pulse 2s infinite;
}
.dot-off { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ink-3); }
.dot-red { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--bad); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ---------- 10. LEAD CARD ---------- */
.lead-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-2);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative; overflow: hidden;
}
.lead-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad-brand); opacity: 0; transition: opacity .22s ease;
}
.lead-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: transparent; }
.lead-card:hover::before { opacity: 1; }
.lead-card h3 { font-size: 18px; letter-spacing: -.03em; }
.lead-meta { color: var(--ink-3); font-size: 13px; font-weight: 600; margin-top: 2px; }
.lead-tags { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0; }
.lead-cta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 480px) { .lead-cta { grid-template-columns: 1fr; } }

/* ---------- 11. TIMELINE ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand-1);
}
.tl-item.ok::before   { border-color: var(--ok); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.bad::before  { border-color: var(--bad); }
.tl-time { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.tl-title { font-size: 14px; font-weight: 700; margin-top: 1px; }
.tl-text { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

/* ---------- 12. TABLE ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.tbl th {
  text-align: left; padding: 12px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background .15s ease; }
table.tbl tbody tr:hover { background: var(--bg-soft); }
table.tbl tbody tr:last-child td { border-bottom: 0; }

/* ---------- 13. LEADERBOARD ---------- */
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.lb-row:last-child { border-bottom: 0; }
.lb-rank {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 12.5px; background: var(--bg-soft); color: var(--ink-2);
  flex: 0 0 30px;
}
.lb-rank.r1 { background: var(--grad-amber); color: #fff; }
.lb-rank.r2 { background: linear-gradient(135deg,#94a3b8,#cbd5e1); color: #fff; }
.lb-rank.r3 { background: linear-gradient(135deg,#b45309,#d97706); color: #fff; }
.lb-av {
  width: 36px; height: 36px; border-radius: 12px; background: var(--grad-brand);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  flex: 0 0 36px;
}
.lb-name { font-weight: 700; font-size: 13.5px; }
.lb-sub  { font-size: 11.5px; color: var(--ink-3); }
.lb-val  { margin-left: auto; text-align: right; }
.lb-val b { font-size: 15px; }
.lb-val span { display: block; font-size: 11px; color: var(--ink-3); }

/* ---------- 14. PROGRESS / FUNNEL ---------- */
.bar { height: 9px; background: var(--bg-soft); border-radius: 20px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 20px; background: var(--grad-brand);
           transition: width 1s cubic-bezier(.4,0,.2,1); }
.funnel-row { margin-bottom: 15px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-top { display: flex; align-items: center; margin-bottom: 6px; font-size: 13px; }
.funnel-top b { font-weight: 700; }
.funnel-top span { margin-left: auto; color: var(--ink-3); font-weight: 700; font-size: 12.5px; }
.f1 > i { background: var(--grad-brand); }
.f2 > i { background: var(--grad-blue); }
.f3 > i { background: var(--grad-amber); }
.f4 > i { background: linear-gradient(135deg,#f43f5e,#fb7185); }
.f5 > i { background: var(--grad-green); }

/* ---------- 15. MAP CARD ---------- */
.map-card { padding: 0; overflow: hidden; }
.map-head { padding: 18px 20px 14px; display: flex; align-items: center; gap: 10px; }
/* Map load hone tak subtle grid placeholder dikhega */
.map-box {
  height: 300px; width: 100%; position: relative;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0/32px 32px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0/32px 32px,
    var(--bg-soft);
}
.map-box::after {
  content: 'Map load ho raha hai…';
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); pointer-events: none;
}
.map-box .leaflet-container { position: relative; z-index: 1; }
.map-box iframe, .map-box #map { width: 100%; height: 100%; border: 0; }
.staff-strip { display: flex; gap: 10px; padding: 14px 20px; overflow-x: auto; border-top: 1px solid var(--line); }
.staff-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px;
  background: var(--bg-soft); border-radius: 30px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: all .18s ease;
}
.staff-chip:hover { background: var(--surface); box-shadow: var(--sh-2); transform: translateY(-2px); }
.staff-chip .sc-av {
  width: 26px; height: 26px; border-radius: 9px; background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
}

/* ---------- 16. FORMS ---------- */
.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  margin-bottom: 6px; letter-spacing: .01em;
}
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 13px;
  border: 1.5px solid var(--line); background: var(--surface-2);
  outline: none; transition: all .18s ease; font-size: 14px;
}
.input:focus { border-color: var(--brand-1); background: var(--surface); box-shadow: 0 0 0 4px rgba(99,102,241,.13); }
textarea.input { min-height: 90px; resize: vertical; }
select.input { appearance: none; 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 fill='%238b92ad' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- 17. ALERTS ---------- */
.alert {
  padding: 13px 16px; border-radius: 13px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 16px; border: 1px solid;
}
.alert-success { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.3);  color: #059669; }
.alert-error   { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.3);   color: #dc2626; }
.alert-warn    { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.32); color: #d97706; }
.alert-info    { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.3);  color: #2563eb; }
html[data-theme="dark"] .alert-success { color: #34d399; }
html[data-theme="dark"] .alert-error   { color: #f87171; }
html[data-theme="dark"] .alert-warn    { color: #fbbf24; }
html[data-theme="dark"] .alert-info    { color: #60a5fa; }

/* ---------- 18. GLASS MODAL ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(10,12,24,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 18px;
  animation: fadeIn .22s ease;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(26px) saturate(180%); -webkit-backdrop-filter: blur(26px) saturate(180%);
  border-radius: var(--r-xl); box-shadow: var(--sh-3);
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  padding: 26px; animation: popIn .3s cubic-bezier(.34,1.4,.64,1);
}
.modal h3 { font-size: 19px; margin-bottom: 4px; }
.modal .m-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.modal-x {
  position: absolute; top: 20px; right: 20px; width: 34px; height: 34px;
  border-radius: 11px; border: 0; background: var(--bg-soft); cursor: pointer; font-size: 15px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 19. AUTH PAGES ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
@media (max-width: 940px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none !important; } }
.auth-side {
  background: var(--grad-brand); color: #fff; padding: 54px 48px;
  display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.auth-side::before {
  content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: rgba(255,255,255,.1); top: -160px; right: -140px;
}
.auth-side::after {
  content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255,255,255,.07); bottom: -120px; left: -90px;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 36px; line-height: 1.15; letter-spacing: -.04em; margin-bottom: 14px; }
.auth-side p { font-size: 15px; opacity: .9; max-width: 420px; line-height: 1.6; }
.auth-feats { margin-top: 34px; display: flex; flex-direction: column; gap: 14px; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; }
.auth-feat i {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-style: normal; font-size: 17px; flex: 0 0 38px;
}
.auth-main { display: grid; place-items: center; padding: 36px 22px; background: var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
.auth-box h1 { font-size: 27px; letter-spacing: -.035em; }
.auth-box .lead { color: var(--ink-2); margin: 6px 0 26px; font-size: 14px; }
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 11px;
  padding: 13px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: all .18s ease;
}
.btn-google:hover { border-color: var(--brand-1); box-shadow: var(--sh-2); transform: translateY(-2px); }
.or {
  display: flex; align-items: center; gap: 14px; margin: 22px 0;
  color: var(--ink-3); font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
}
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- 20. FIELD / MOBILE APP ---------- */
.mobile { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 92px; }
.m-head {
  background: var(--grad-brand); color: #fff; padding: 22px 20px 66px;
  border-radius: 0 0 28px 28px; position: relative;
}
.m-head .mh-top { display: flex; align-items: center; gap: 12px; }
.m-head .mh-av {
  width: 46px; height: 46px; border-radius: 15px; background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.m-head h2 { font-size: 19px; letter-spacing: -.03em; }
.m-head .mh-sub { font-size: 12.5px; opacity: .88; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.m-stats {
  margin: -48px 16px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  position: relative; z-index: 2;
}
.m-stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 10px; text-align: center; box-shadow: var(--sh-2);
}
.m-stat b { display: block; font-size: 20px; letter-spacing: -.03em; }
.m-stat span { font-size: 10.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.m-body { padding: 20px 16px 0; }
.m-section-title { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
                   color: var(--ink-3); margin: 22px 0 12px; }
.visit-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; margin-bottom: 11px; display: flex; align-items: center; gap: 13px;
  box-shadow: var(--sh-1); transition: transform .18s ease;
}
.visit-item:active { transform: scale(.98); }
.visit-ic {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  font-size: 18px; background: var(--bg-soft); flex: 0 0 42px;
}
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--glass); backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 9px 6px calc(9px + env(safe-area-inset-bottom));
  z-index: 60;
}
button.bn-item { background: none; border: 0; font: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-3); padding: 5px 0;
  border-radius: 12px; transition: all .18s ease;
}
.bn-item .bi { font-size: 19px; }
.bn-item.active { color: var(--brand-1); }
.bn-item.fab { margin-top: -26px; }
.bn-item.fab .bi {
  width: 52px; height: 52px; border-radius: 18px; background: var(--grad-brand);
  color: #fff; display: grid; place-items: center; font-size: 25px;
  box-shadow: var(--sh-brand);
}

/* ---------- 21. THEME TOGGLE ---------- */
.theme-toggle {
  width: 46px; height: 26px; border-radius: 20px; background: var(--bg-soft);
  border: 1px solid var(--line); position: relative; cursor: pointer; padding: 0;
}
.theme-toggle i {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--grad-brand); transition: transform .26s cubic-bezier(.34,1.4,.64,1);
}
html[data-theme="dark"] .theme-toggle i { transform: translateX(20px); }

/* ---------- 22. EMPTY STATE ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .ei { font-size: 46px; margin-bottom: 12px; opacity: .55; }
.empty h4 { font-size: 16px; color: var(--ink-2); margin-bottom: 5px; }
.empty p { font-size: 13.5px; margin: 0; }

/* ---------- 23. CHART ---------- */
.chart-wrap { height: 250px; position: relative; }
.spark { display: flex; align-items: flex-end; gap: 7px; height: 150px; padding-top: 12px; }
.spark .sb {
  flex: 1; border-radius: 8px 8px 4px 4px; background: var(--grad-brand);
  min-height: 6px; position: relative; opacity: .88;
  transition: opacity .18s ease, transform .18s ease;
  animation: growUp .7s cubic-bezier(.4,0,.2,1) backwards;
}
.spark .sb:hover { opacity: 1; transform: scaleY(1.04); }
@keyframes growUp { from { height: 0 !important; opacity: 0; } }
.spark-x { display: flex; gap: 7px; margin-top: 8px; }
.spark-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--ink-3); font-weight: 600; }

/* ---------- 24. UTIL ---------- */
.fade-up { animation: fadeUp .5s cubic-bezier(.4,0,.2,1) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.d1 { animation-delay: .05s } .d2 { animation-delay: .1s } .d3 { animation-delay: .15s }
.d4 { animation-delay: .2s }  .d5 { animation-delay: .25s } .d6 { animation-delay: .3s }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mt0{margin-top:0}.mt8{margin-top:8px}.mt14{margin-top:14px}.mt20{margin-top:20px}
.mb0{margin-bottom:0}.mb8{margin-bottom:8px}.mb14{margin-bottom:14px}.mb20{margin-bottom:20px}
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.text-right { text-align: right; }
.hide { display: none !important; }

/* ---------- 25. MOBILE SIDEBAR ---------- */
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--sh-3); }
  .sidebar.open { transform: none; }
  .hamburger { display: grid; place-items: center; }
  .scrim { position: fixed; inset: 0; background: rgba(10,12,24,.5); backdrop-filter: blur(3px); z-index: 35; display: none; }
  .scrim.open { display: block; }
}
