/* ==========================================================================
   Neolina CRM — shared stylesheet
   Design tokens + login screen + app shell (sidebar/topbar/cards/tables)
   Reused across every page in /pages/. Keep this as the single source of
   truth for colors/spacing so the whole app stays visually consistent.

   DESIGN SYSTEM v2 (Phase 2) — inspired by Linear/Stripe/Notion/Vercel/Arc.
   Philosophy: near-black surfaces, hairline borders, ONE restrained accent
   color used only where it means something, confident typography, motion
   that explains rather than decorates. See design-mockups/ for the
   approved visual direction this implements.
   ========================================================================== */

@font-face{font-family:'Inter'; src:url('../fonts/Inter-Regular.woff2') format('woff2'); font-weight:400; font-display:swap;}
@font-face{font-family:'Inter'; src:url('../fonts/Inter-Medium.woff2') format('woff2'); font-weight:500; font-display:swap;}
@font-face{font-family:'Inter'; src:url('../fonts/Inter-SemiBold.woff2') format('woff2'); font-weight:600; font-display:swap;}
@font-face{font-family:'Inter'; src:url('../fonts/Inter-Bold.woff2') format('woff2'); font-weight:700; font-display:swap;}
@font-face{font-family:'Inter'; src:url('../fonts/Inter-ExtraBold.woff2') format('woff2'); font-weight:800; font-display:swap;}
@font-face{font-family:'JetBrains Mono'; src:url('../fonts/JetBrainsMono-Medium.woff2') format('woff2'); font-weight:500; font-display:swap;}
@font-face{font-family:'JetBrains Mono'; src:url('../fonts/JetBrainsMono-SemiBold.woff2') format('woff2'); font-weight:600; font-display:swap;}

:root{
  /* ---------- Surface layers (near-black, not navy) ---------- */
  --navy-deep:#08090C;
  --navy-elev:#14171D;
  --navy-elev-2:#1B1E26;
  /* ---------- The ONE accent — used sparingly, on purpose ---------- */
  --teal:#14B8A6;
  --teal-glow:#5EEAD4;
  --white:#F4F5F7;
  --muted:#9497A3;
  --amber:#FBBF24;
  --rose:#F87171;
  --emerald:#34D399;
  /* ---------- Hairline-first borders (almost invisible at rest) ---------- */
  --border:rgba(255,255,255,0.07);
  --border-hi:rgba(94,234,212,0.35);
  --nav-active-bg:rgba(94,234,212,0.1);
  --bg:var(--navy-deep);
  --surface:var(--navy-elev);
  --surface2:var(--navy-elev-2);
  --text:var(--white);
  --text-muted:var(--muted);
  /* ---------- Shadows kept minimal — cards separate via border, not shadow.
     Reserved for genuinely "lifted" overlays (modals, dropdowns, palette). */
  --shadow:0 1px 2px rgba(0,0,0,0.4);
  --shadow-lifted:0 24px 60px rgba(0,0,0,0.45);
  /* Text color to use ON TOP of accent-colored buttons/badges — dark text on
     the bright dark-mode accent, white text on light-mode's deeper accent. */
  --on-accent:#04211C;

  /* ---------- 8px-grid spacing scale ----------
     --sp-1 = 4px (tight, icon gaps) ... --sp-6 = 32px (section separation) */
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:24px;
  --sp-6:32px;
  --radius-sm:8px;
  --radius-md:12px;
  --radius-lg:14px;

  /* ---------- Motion ---------- */
  --ease:cubic-bezier(.16,1,.3,1);
  --dur-fast:120ms;
  --dur-base:220ms;
}

/* ============================================================
   LIGHT THEME — toggled via .light class on <html>, applied
   before first paint (see the inline script in layout_top.php /
   index.php) to avoid a flash of the wrong theme.
   Same restrained-accent philosophy as dark mode, translated:
   near-white surfaces, near-black text, a deeper accent shade
   (needs to carry white button-text, unlike dark mode's accent).
   ============================================================ */
html.light{
  --navy-deep:#F7F8FA;
  --navy-elev:#FFFFFF;
  --navy-elev-2:#F1F4F6;
  --teal:#0F766E;
  --teal-glow:#0F766E;
  --white:#0F172A;
  --muted:#64748B;
  --amber:#D97706;
  --rose:#DC2626;
  --emerald:#059669;
  --border:rgba(15,23,42,0.09);
  --border-hi:rgba(15,118,110,0.35);
  --nav-active-bg:rgba(15,118,110,0.1);
  --shadow:0 1px 3px rgba(15,23,42,0.06);
  --shadow-lifted:0 24px 50px rgba(15,23,42,0.16);
  --on-accent:#FFFFFF;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family:'Inter',-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
}
h1,h2,h3,.display{font-family:'Inter',sans-serif; font-weight:700; letter-spacing:-0.02em;}
.mono{font-family:'JetBrains Mono',monospace;}
::-webkit-scrollbar{height:8px; width:8px;}
::-webkit-scrollbar-thumb{background:var(--surface2); border-radius:8px;}
::-webkit-scrollbar-track{background:transparent;}

/* ---------- LOGIN ---------- */
.login-wrap{
  position:relative; min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:var(--navy-deep);
  background-image:radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size:28px 28px;
  overflow:hidden;
}
.blob{position:absolute; border-radius:50%; filter:blur(90px); opacity:.5; pointer-events:none;}
.blob1{width:520px; height:520px; background:radial-gradient(circle, rgba(94,234,212,0.10) 0%, transparent 65%); top:-18%; left:50%; transform:translateX(-50%);}
.blob2{width:0; height:0;}
.blob3{width:0; height:0;}
.grid-overlay{display:none;}
.login-card{
  position:relative; width:380px; max-width:92vw; padding:40px 36px 32px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lifted);
  animation:rise .5s var(--ease);
}
@keyframes rise{from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);}}
.brand-mark{
  width:60px; height:60px; border-radius:14px; background:var(--teal-glow);
  display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--on-accent); font-size:26px;
  margin:0 0 22px;
}
.login-title{text-align:left; font-size:20px; font-weight:600; color:var(--text); letter-spacing:-.02em;}
.login-sub{text-align:left; font-size:13.5px; color:var(--text-muted); margin-top:6px;}
.alert-box{
  margin-top:18px; padding:10px 13px; border-radius:9px; font-size:12.5px; font-weight:500;
  background:rgba(248,113,113,0.1); border:1px solid rgba(248,113,113,0.3); color:#fca5a5;
}
.field{margin-top:18px;}
.field label{display:block; font-size:12.5px; color:var(--text-muted); margin-bottom:7px; font-weight:500;}
.field .input-wrap{position:relative;}
.field input, .field select{
  width:100%; padding:10px 14px 10px 38px; background:var(--navy-elev);
  border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-size:13.5px; font-family:'Inter',sans-serif;
  transition:border-color var(--dur-fast) var(--ease);
}
.field input::placeholder{color:var(--text-muted);}
.field input:focus, .field select:focus{outline:none; border-color:var(--teal-glow);}
.field i{position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:13px;}
.login-btn{
  width:100%; margin-top:22px; padding:10px; background:var(--teal-glow);
  border:none; border-radius:var(--radius-sm); color:var(--on-accent); font-weight:600; font-size:14px; cursor:pointer;
  transition:background var(--dur-fast) var(--ease);
}
.login-btn:hover{background:#79F0DD;}
.login-btn:disabled{opacity:.6; cursor:not-allowed;}
.login-foot{text-align:center; margin-top:20px; font-size:11.5px; color:var(--text-muted); opacity:.7;}

/* ---------- APP SHELL ---------- */
.app{display:flex; min-height:100vh;}
.sidebar{width:250px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; transition:width .25s ease; position:relative; z-index:20;}
.sidebar.collapsed{width:74px;}
.side-logo{display:flex; align-items:center; gap:11px; padding:20px 18px; border-bottom:1px solid var(--border);}
.side-logo .brand-mark{width:44px; height:44px; font-size:17px; margin:0; flex-shrink:0;}
.side-logo span{font-family:'Inter',sans-serif; font-weight:700; font-size:15.5px; white-space:nowrap; overflow:hidden;}
.sidebar.collapsed .side-logo span, .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-chevron{display:none;}
.side-nav{flex:1; overflow-y:auto; padding:14px 12px;}
.nav-group-title{font-size:10px; text-transform:uppercase; letter-spacing:.09em; color:var(--text-muted); padding:14px 10px 6px; font-weight:700;}
.sidebar.collapsed .nav-group-title{display:none;}
.nav-item{display:flex; align-items:center; gap:12px; padding:9px 12px; border-radius:9px; cursor:pointer; color:var(--text-muted); font-size:13.5px; font-weight:500; margin-bottom:2px; position:relative; white-space:nowrap; transition:background .15s, color .15s; text-decoration:none;}
.nav-item:hover{background:rgba(148,163,184,0.08); color:var(--text);}
.nav-item.active{background:var(--nav-active-bg); color:var(--teal-glow);}
.nav-item.active::before{content:''; position:absolute; left:-12px; top:6px; bottom:6px; width:2px; background:var(--teal-glow); border-radius:0 2px 2px 0;}
.nav-item i:first-child{width:16px; text-align:center; font-size:14px;}
.nav-badge{margin-left:auto; background:var(--rose); color:#fff; font-size:10px; font-weight:700; padding:1px 6px; border-radius:20px; font-family:'JetBrains Mono',monospace;}
.side-collapse-btn{margin:12px; padding:9px; border-radius:9px; border:1px solid var(--border); background:transparent; color:var(--text-muted); cursor:pointer; font-size:13px; display:flex; align-items:center; justify-content:center; gap:8px;}
.side-collapse-btn:hover{color:var(--teal-glow); border-color:var(--border-hi);}

.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{height:66px; flex-shrink:0; display:flex; align-items:center; gap:16px; padding:0 26px; border-bottom:1px solid var(--border); background:var(--surface); position:sticky; top:0; z-index:15;}
.breadcrumb{font-family:'Inter',sans-serif; font-weight:700; font-size:16.5px;}
.breadcrumb span{color:var(--text-muted); font-weight:500; font-size:13px; margin-left:8px;}
.search-box{margin-left:auto; display:flex; align-items:center; gap:9px; background:var(--surface2); border:1px solid var(--border); border-radius:9px; padding:8px 13px; width:280px; color:var(--text-muted); font-size:13px;}
.search-box input{background:none; border:none; outline:none; color:var(--text); font-size:13px; width:100%; font-family:'Inter';}
.icon-btn{width:38px; height:38px; border-radius:9px; border:1px solid var(--border); background:var(--surface2); color:var(--text-muted); display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative; transition:color .15s, border-color .15s;}
.icon-btn:hover{color:var(--teal-glow); border-color:var(--border-hi);}
.dot-badge{position:absolute; top:-3px; right:-3px; width:16px; height:16px; border-radius:50%; background:var(--rose); color:#fff; font-size:9px; font-weight:700; display:flex; align-items:center; justify-content:center; border:2px solid var(--surface); font-family:'JetBrains Mono',monospace;}
.avatar-chip{display:flex; align-items:center; gap:9px; padding-left:12px; border-left:1px solid var(--border); cursor:pointer;}
.avatar-circ{width:34px; height:34px; border-radius:50%; background:var(--teal-glow); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; color:var(--on-accent); font-family:'Inter';}
.avatar-chip .name{font-size:13px; font-weight:600; line-height:1.2;}
.avatar-chip .role{font-size:11px; color:var(--text-muted);}
.content{padding:26px; max-width:1440px; width:100%; margin:0 auto;}

/* ---------- STAT CARDS / PANELS ---------- */
.stat-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; margin-bottom:22px;}
.stat-card{background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:16px 17px; position:relative; overflow:hidden; transition:transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);}
.stat-card:hover{transform:translateY(-1px); border-color:var(--border-hi);}
.stat-card.clickable{cursor:pointer;}
.stat-card.clickable:hover{border-color:var(--teal);}
.stat-card.active-filter{border-color:var(--teal); box-shadow:inset 0 0 0 1px var(--teal);}
.stat-icon{width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:14px; margin-bottom:12px;}
.stat-label{font-size:11.5px; color:var(--text-muted); font-weight:500; letter-spacing:.02em; margin-bottom:5px;}
.stat-value{font-family:'JetBrains Mono',monospace; font-size:25px; font-weight:600; letter-spacing:-.02em;}
.panel{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); margin-bottom:var(--sp-4); overflow:hidden;}
.panel-head{display:flex; align-items:center; gap:var(--sp-3); padding:var(--sp-4);}
.panel-head h3{font-size:14.5px; font-weight:600;}
.panel-body{padding:0 var(--sp-4) var(--sp-4);}

/* ---------- TABLES ---------- */
table{width:100%; border-collapse:collapse; font-size:12.5px;}
thead th{text-align:left; padding:var(--sp-3); color:var(--text-muted); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid var(--border); white-space:nowrap;
  position:sticky; top:0; background:var(--surface); z-index:5;}
tbody td{padding:var(--sp-3); border-bottom:1px solid var(--border); vertical-align:middle;}
tbody tr:hover{background:rgba(148,163,184,0.05);}
.badge{font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:20px; display:inline-block;}
.live-dot{width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; background:var(--emerald); animation:heartbeat 1.6s ease-in-out infinite; box-shadow:0 0 6px var(--emerald);}
@keyframes heartbeat{0%,100%{transform:scale(1); opacity:1;} 14%{transform:scale(1.35); opacity:1;} 28%{transform:scale(1); opacity:.85;} 42%{transform:scale(1.25); opacity:1;} 70%{transform:scale(1); opacity:.85;}}

/* ---------- TOASTS ---------- */
.toast-stack{position:fixed; top:20px; right:20px; z-index:999; display:flex; flex-direction:column; gap:10px;}
.toast{min-width:260px; padding:13px 16px; border-radius:10px; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow); font-size:13px; display:flex; align-items:center; gap:10px; animation:toastIn .25s ease;}
.toast.success{border-color:rgba(16,185,129,0.4);} .toast.success i{color:var(--emerald);}
.toast.error{border-color:rgba(244,63,94,0.4);} .toast.error i{color:var(--rose);}
.toast.warning{border-color:rgba(245,158,11,0.4);} .toast.warning i{color:var(--amber);}
@keyframes toastIn{from{opacity:0; transform:translateX(30px);} to{opacity:1; transform:translateX(0);}}

/* ---------- FILTERS / BUTTONS / MODAL (Leads module) ---------- */
.filter-select{
  padding:var(--sp-2) var(--sp-3); border-radius:9px; border:1px solid var(--border); background:var(--surface2);
  color:var(--text); font-size:12.5px; font-family:'Inter'; outline:none; cursor:pointer;
}
.filter-select:focus{border-color:var(--border-hi);}
.btn-primary{
  display:inline-flex; align-items:center; gap:var(--sp-2); padding:var(--sp-2) var(--sp-4); border:none; border-radius:9px;
  background:var(--teal-glow); color:var(--on-accent); font-weight:600; font-size:13px;
  cursor:pointer; transition:background var(--dur-fast) var(--ease);
}
.btn-primary:hover{background:#79F0DD;}
.btn-sm{
  padding:var(--sp-2) var(--sp-3); border-radius:8px; border:1px solid var(--border); background:var(--surface2); color:var(--text);
  font-size:12px; font-weight:600; cursor:pointer; transition:all .15s;
}
.btn-sm:hover{border-color:var(--border-hi); color:var(--teal-glow);}
.btn-sm.danger{border-color:rgba(244,63,94,0.4); color:var(--rose);}
.btn-sm.danger:hover{background:rgba(244,63,94,0.12);}
.btn-sm.warn{border-color:rgba(245,158,11,0.4); color:var(--amber);}
.btn-sm.warn:hover{background:rgba(245,158,11,0.12);}
.btn-sm.ghost{background:transparent;}

.view-toggle{display:flex; border:1px solid var(--border); border-radius:9px; overflow:hidden;}
.vt-btn{padding:8px 12px; background:var(--surface2); border:none; color:var(--text-muted); cursor:pointer; border-right:1px solid var(--border); font-size:12.5px;}
.vt-btn:last-child{border-right:none;}
.vt-btn.active{background:var(--teal); color:var(--on-accent);}

.bulk-bar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:var(--surface2);
  border:1px solid var(--border-hi); border-radius:12px; padding:10px 16px; margin-bottom:16px; font-size:12.5px; color:var(--text-muted);
}

.pagination-bar{display:flex; align-items:center; justify-content:center; gap:6px; padding:16px; flex-wrap:wrap;}
.page-btn{
  min-width:32px; height:32px; padding:0 8px; border-radius:8px; border:1px solid var(--border); background:var(--surface2);
  color:var(--text-muted); cursor:pointer; font-size:12.5px; font-family:'JetBrains Mono';
}
.page-btn.active{background:var(--teal); border-color:var(--teal); color:var(--on-accent); font-weight:700;}
.page-btn:disabled{opacity:.4; cursor:not-allowed;}

.card-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px;}
.lead-card{background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:16px; box-shadow:var(--shadow); transition:transform .15s, border-color .15s; cursor:pointer;}
.lead-card:hover{transform:translateY(-3px); border-color:var(--border-hi);}

.modal-overlay{
  position:fixed; inset:0; background:rgba(5,10,20,0.65); backdrop-filter:blur(4px); z-index:100;
  display:flex; align-items:center; justify-content:center; padding:20px; animation:fadeIn .2s ease;
}
@keyframes fadeIn{from{opacity:0;} to{opacity:1;}}
.modal-box{
  width:640px; max-width:100%; max-height:88vh; display:flex; flex-direction:column;
  background:var(--surface); border:1px solid var(--border); border-radius:16px; box-shadow:0 30px 80px rgba(0,0,0,0.5);
  animation:rise .3s cubic-bezier(.2,.8,.2,1);
}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border);}
.modal-head h3{font-size:16px; font-weight:700;}
.modal-close{cursor:pointer; color:var(--text-muted); width:30px; height:30px; display:flex; align-items:center; justify-content:center; border-radius:8px;}
.modal-close:hover{background:rgba(148,163,184,0.1); color:var(--text);}
.modal-body{padding:20px 22px; overflow-y:auto;}
.modal-foot{display:flex; justify-content:flex-end; gap:10px; padding:16px 22px; border-top:1px solid var(--border);}
.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px 16px;}
@media (max-width:560px){.form-grid{grid-template-columns:1fr;}}
.form-grid .field{margin-top:0;}
.modal-body .field select{padding:12px 14px 12px 40px; width:100%; background:rgba(255,255,255,0.04); border:1px solid rgba(148,163,184,0.18); border-radius:10px; color:#fff; font-size:13.5px; font-family:'Inter'; appearance:none;}
/* Fix: native <option> elements ignore the parent's translucent background and
   inherited white text, rendering as white-on-white in the browser's native
   dropdown popup. Force explicit dark background + light text on every option. */
select option{background-color:#14171D; color:#F4F5F7;}
select option:checked, select option:hover{background-color:#0F3D38; color:#ffffff;}

.tabs-row{display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:20px;}
.tab-btn{padding:11px 16px; font-size:13.5px; font-weight:600; color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;}
.tab-btn.active{color:var(--teal-glow); border-color:var(--teal-glow);}
.history-timeline{position:relative; padding-left:8px;}
.history-item{position:relative; display:flex; gap:14px; padding:0 0 20px 26px;}
.history-item::before{content:''; position:absolute; left:9px; top:20px; bottom:0; width:1px; background:var(--border);}
.history-item:last-child::before{display:none;}
.history-dot{position:absolute; left:0; top:0; width:20px; height:20px; border-radius:50%; background:var(--surface2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.history-dot i{font-size:9px; color:var(--text-muted);}
.history-dot.accent{background:rgba(94,234,212,0.12); border-color:rgba(94,234,212,0.35);}
.history-dot.accent i{color:var(--teal-glow);}
.history-meta{font-size:11px; color:var(--text-muted); margin-bottom:3px;}
.history-msg{font-size:13px;}
.info-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px 24px;}
@media (max-width:640px){.info-grid{grid-template-columns:1fr;}}
.info-row{display:flex; flex-direction:column; gap:3px; padding:10px 0; border-bottom:1px solid var(--border);}
.info-row .k{font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:600;}
.info-row .v{font-size:13.5px; font-weight:500;}
.empty-state{display:flex; flex-direction:column; align-items:center; justify-content:center; padding:50px 20px; color:var(--text-muted); text-align:center; gap:var(--sp-2);}
.empty-state i{font-size:26px; color:var(--border-hi);}
.empty-state .empty-title{font-size:13.5px; font-weight:600; color:var(--text);}
.empty-state .empty-sub{font-size:12px; max-width:320px;}

/* ---------- SKELETON LOADING (Phase 1 design system) ----------
   Use skeletonRows(colCount, rowCount) from app-shared.js instead of a
   spinner/"Loading…" text — shows the shape of what's coming, feels faster. */
.skel{
  display:inline-block; height:12px; border-radius:6px; width:100%;
  background:linear-gradient(90deg, var(--surface2) 25%, rgba(148,163,184,0.14) 37%, var(--surface2) 63%);
  background-size:400% 100%; animation:skelShimmer 1.4s ease-in-out infinite;
}
.skel.skel-sm{height:10px; width:60%;}
.skel.skel-circle{border-radius:50%; width:32px; height:32px;}
@keyframes skelShimmer{0%{background-position:100% 50%;} 100%{background-position:0% 50%;}}

/* ---------- LEAD HOVER CARD (Phase 1 design system) ---------- */
.lead-name-trigger{cursor:pointer; border-bottom:1px dashed transparent; transition:border-color .15s;}
.lead-name-trigger:hover{border-bottom-color:var(--teal-glow);}
.lead-hover-card{
  position:fixed; z-index:9999; width:260px; background:var(--surface); border:1px solid var(--border-hi);
  border-radius:var(--radius-md); box-shadow:0 20px 50px rgba(0,0,0,0.5); padding:var(--sp-4);
  display:none; animation:hoverCardIn .15s ease;
}
.lead-hover-card.open{display:block;}
@keyframes hoverCardIn{from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:translateY(0);}}
.lead-hover-card .lhc-name{font-weight:700; font-size:14px; margin-bottom:2px;}
.lead-hover-card .lhc-company{font-size:11.5px; color:var(--text-muted); margin-bottom:10px;}
.lead-hover-card .lhc-row{display:flex; justify-content:space-between; align-items:center; font-size:12px; padding:5px 0; border-bottom:1px solid var(--border);}
.lead-hover-card .lhc-row:last-of-type{border-bottom:none;}
.lead-hover-card .lhc-label{color:var(--text-muted);}
.lead-hover-card .lhc-value{font-weight:600; font-family:'JetBrains Mono',monospace;}
.lead-hover-card .lhc-actions{display:flex; gap:8px; margin-top:12px;}
.lead-hover-card .lhc-actions a, .lead-hover-card .lhc-actions button{
  flex:1; text-align:center; padding:7px; border-radius:8px; border:1px solid var(--border); background:var(--surface2);
  color:var(--text); font-size:12px; cursor:pointer; text-decoration:none;
}
.lead-hover-card .lhc-actions a:hover, .lead-hover-card .lhc-actions button:hover{border-color:var(--border-hi); color:var(--teal-glow);}

/* ---------- COMMAND PALETTE (Cmd+K / Ctrl+K) ---------- */
.cmdk-overlay{
  display:none; position:fixed; inset:0; z-index:9998; background:rgba(4,10,20,0.6); backdrop-filter:blur(3px);
  align-items:flex-start; justify-content:center; padding-top:12vh;
}
.cmdk-overlay.open{display:flex;}
.cmdk-box{
  width:100%; max-width:560px; background:var(--surface); border:1px solid var(--border-hi); border-radius:var(--radius-md);
  box-shadow:0 30px 80px rgba(0,0,0,0.55); overflow:hidden; animation:cmdkIn .15s ease;
}
@keyframes cmdkIn{from{opacity:0; transform:translateY(-8px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);}}
.cmdk-input-row{display:flex; align-items:center; gap:var(--sp-3); padding:var(--sp-4); border-bottom:1px solid var(--border); color:var(--text-muted);}
.cmdk-input-row input{flex:1; background:none; border:none; outline:none; color:var(--text); font-size:14.5px; font-family:'Inter';}
.cmdk-kbd{font-size:10px; padding:2px 7px; border-radius:5px; border:1px solid var(--border); color:var(--text-muted);}
.cmdk-results{max-height:360px; overflow-y:auto; padding:var(--sp-2);}
.cmdk-item{display:flex; align-items:center; gap:var(--sp-3); padding:10px var(--sp-3); border-radius:8px; cursor:pointer; font-size:13px;}
.cmdk-item i{width:16px; text-align:center; color:var(--text-muted);}
.cmdk-item.active{background:rgba(6,182,212,0.12);}
.cmdk-item.active i{color:var(--teal-glow);}
.cmdk-item .cmdk-meta{margin-left:auto; font-size:11px; color:var(--text-muted);}
.cmdk-section-label{font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); padding:8px 12px 4px;}

/* ---------- DASHBOARD TABS / PILLS ---------- */
.dash-tabs{display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:22px; overflow-x:auto;}
.dash-tab{padding:11px 16px; font-size:13.5px; font-weight:600; color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; transition:color .15s, border-color .15s;}
.dash-tab:hover{color:var(--text);}
.dash-tab.active{color:var(--teal-glow); border-color:var(--teal-glow);}
.filter-pills{display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap;}

/* ---------- MINI TABS (in-panel sub-tab groups, e.g. Needs Attention / Breakdown) ---------- */
.mini-tabs{display:flex; gap:2px; overflow-x:auto;}
.mini-tab{padding:9px 13px; font-size:12.5px; font-weight:600; color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; transition:color .15s, border-color .15s; background:none; border-top:none; border-left:none; border-right:none;}
.mini-tab:hover{color:var(--text);}
.mini-tab.active{color:var(--teal-glow); border-bottom-color:var(--teal-glow);}
.mini-tab .badge-count{display:inline-block; margin-left:6px; padding:1px 6px; border-radius:9px; font-size:10.5px; font-weight:700; background:var(--surface2); color:var(--text-muted);}
.mini-tab.active .badge-count{background:rgba(34,211,238,0.18); color:var(--teal-glow);}
.mini-pane{display:none;}
.mini-pane.active{display:block;}

/* ---------- Dashboard header quick-action icon buttons ---------- */
.qa-icon-btn{display:flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:10px; background:var(--surface2); border:1px solid var(--border); color:var(--text-muted); text-decoration:none; transition:all .15s; flex-shrink:0;}
.qa-icon-btn:hover{color:var(--teal-glow); border-color:var(--border-hi); transform:translateY(-1px);}

/* ---------- Dashboard two-column layout ---------- */
.dash-2col{display:grid; grid-template-columns:1.6fr 1fr; gap:16px; align-items:start;}
@media (max-width: 1100px){.dash-2col{grid-template-columns:1fr;}}
.pill{padding:7px 14px; border-radius:20px; font-size:12.5px; font-weight:600; border:1px solid var(--border); color:var(--text-muted); cursor:pointer; background:var(--surface2); transition:all .15s;}
/* ---------- Row action icons (Call/WhatsApp/Edit/Delete across every table) ----------
   Previously had NO styling at all — relied entirely on the icon glyph's own
   size for visibility/click-target, no hover feedback. Small but real UX gap. */
.row-act{
  display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px;
  border-radius:7px; color:var(--text-muted); cursor:pointer; text-decoration:none;
  transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.row-act:hover{background:var(--surface2); color:var(--teal-glow);}
.row-act + .row-act{margin-left:2px;}

.pill.active{background:var(--teal); border-color:var(--teal); color:var(--on-accent);}
.pill:hover:not(.active){border-color:var(--border-hi); color:var(--text);}
.biz-card{grid-column:span 2; background:linear-gradient(135deg, rgba(6,182,212,0.12), var(--surface) 60%); border:1px solid var(--border-hi);}
@media (max-width:720px){.biz-card{grid-column:span 1;}}
.biz-card .stat-value{font-size:30px; color:var(--teal-glow);}
.chev{color:var(--text-muted); transition:transform .2s;}
.chev.open{transform:rotate(180deg);}
.bar-row{display:flex; align-items:center; gap:12px; margin-bottom:11px; font-size:12.5px;}
.bar-row .lbl{width:150px; flex-shrink:0; color:var(--text-muted); font-weight:500;}
.bar-track{flex:1; height:8px; background:var(--surface2); border-radius:6px; overflow:hidden;}
.bar-fill{height:100%; border-radius:6px;}
.bar-row .val{width:34px; text-align:right; font-family:'JetBrains Mono',monospace; font-weight:700; font-size:12px;}

/* toggle switch (Permissions tab) */
.switch{position:relative; display:inline-block; width:40px; height:22px;}
.switch input{opacity:0; width:0; height:0;}
.switch span{position:absolute; cursor:pointer; inset:0; background:var(--surface2); border:1px solid var(--border); border-radius:22px; transition:.2s;}
.switch span::before{content:''; position:absolute; height:16px; width:16px; left:2px; bottom:2px; background:var(--text-muted); border-radius:50%; transition:.2s;}
.switch input:checked + span{background:rgba(6,182,212,0.25); border-color:var(--teal);}
.switch input:checked + span::before{transform:translateX(18px); background:var(--teal-glow);}

/* ---------- Update Here tab (Quick Update redesign) ---------- */
.status-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0 18px; max-width:420px;}
.status-pill{
  display:flex; align-items:center; justify-content:center; gap:8px; padding:13px 10px;
  border:1px solid var(--border); border-radius:12px; font-size:13.5px; font-weight:600;
  cursor:pointer; background:var(--surface2); color:var(--text-muted); transition:all .15s;
}
.status-pill input{position:absolute; opacity:0; pointer-events:none;}
.status-pill:has(input:checked){background:var(--teal-glow); color:var(--on-accent); border-color:var(--teal);}
.status-pill:hover:not(:has(input:checked)){border-color:var(--border-hi); color:var(--text);}
.schedule-row{background:var(--surface2); border:1px solid var(--border); border-radius:12px; padding:14px 16px; margin-top:4px;}
.schedule-grid{display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px;}
@media (max-width:560px){.schedule-grid{grid-template-columns:1fr;}}
.update-bottom-row{display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-top:20px; padding-top:16px; border-top:1px solid var(--border);}
.chip-toggle{display:flex; align-items:center; gap:7px; padding:9px 14px; border:1px solid var(--border); border-radius:20px; font-size:12.5px; font-weight:600; color:var(--text-muted); cursor:pointer; background:var(--surface2); transition:all .15s;}
.chip-toggle input{position:absolute; opacity:0; pointer-events:none;}
.chip-toggle:has(input:checked){border-color:var(--border-hi); color:var(--teal-glow); background:rgba(6,182,212,0.1);}
.update-bottom-row .btn-primary{margin-left:auto;}
.update-success-flash{
  display:flex; align-items:center; gap:8px; justify-content:center; margin-top:14px; padding:12px;
  background:rgba(16,185,129,0.12); border:1px solid rgba(16,185,129,0.4); border-radius:10px;
  color:var(--emerald); font-weight:700; font-size:13.5px; opacity:0; transform:translateY(-6px);
  height:0; overflow:hidden; transition:opacity .3s, transform .3s;
}
.update-success-flash.show{opacity:1; transform:translateY(0); height:auto; padding:12px;}

/* ---------- Rich Kanban card (Sales Pipeline, UX 5) ---------- */
.kcard-rich{padding:13px 14px; transition:transform .18s, border-color .18s, box-shadow .18s; box-shadow:0 2px 8px rgba(0,0,0,0.15);}
.kcard-rich:hover{transform:translateY(-2px); border-color:var(--border-hi); box-shadow:0 8px 20px rgba(0,0,0,0.3);}
.k-name-lg{font-size:13.5px; font-weight:700; margin-bottom:7px;}
.k-row{display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--text-muted); margin-bottom:4px;}
.k-row-bottom{display:flex; align-items:center; justify-content:space-between; margin-top:8px;}
.k-amt{font-family:'JetBrains Mono',monospace; color:var(--emerald); font-weight:700; font-size:11.5px;}
.k-updated{font-size:10px; color:var(--text-muted); margin-top:6px; opacity:.75;}

/* ---------- Location autocomplete (State/District/City, UX 1) ---------- */
.loc-ac-wrap{position:relative;}
.loc-ac-list{
  display:none; position:absolute; z-index:20; top:calc(100% + 4px); left:0; right:0;
  background:var(--surface2); border:1px solid var(--border-hi); border-radius:9px; max-height:200px; overflow-y:auto;
  box-shadow:var(--shadow-lifted);
}
.loc-ac-item{padding:9px 14px; font-size:12.5px; color:var(--text); cursor:pointer;}
.loc-ac-item:hover{background:rgba(94,234,212,0.12); color:#fff;}

/* ---------- Global search + notification bell (topbar) ---------- */
.gs-results{
  display:none; position:absolute; z-index:50; top:calc(100% + 8px); left:0; right:0;
  background:var(--surface); border:1px solid var(--border-hi); border-radius:12px; max-height:320px; overflow-y:auto;
  box-shadow:0 20px 50px rgba(0,0,0,0.4);
}
.gs-item{display:flex; justify-content:space-between; align-items:center; padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--border); font-size:13px;}
.gs-item:last-child{border-bottom:none;}
.gs-item:hover{background:rgba(148,163,184,0.08);}
.gs-item .name{font-weight:600;}
.gs-item .meta{font-size:11px; color:var(--text-muted); margin-top:2px;}
.notif-dropdown{
  display:none; position:absolute; z-index:50; top:calc(100% + 10px); right:0; width:320px;
  background:var(--surface); border:1px solid var(--border-hi); border-radius:12px;
  box-shadow:0 20px 50px rgba(0,0,0,0.4); text-align:left; cursor:default;
}
.notif-dropdown.open{display:block;}
.notif-dropdown-head{display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid var(--border); font-size:12.5px; font-weight:700;}
.notif-mark-all{font-size:11px; font-weight:600; color:var(--teal-glow); cursor:pointer;}
.notif-list-inner{max-height:340px; overflow-y:auto;}
.notif-item{display:flex; gap:10px; padding:12px 16px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .15s;}
.notif-item:last-child{border-bottom:none;}
.notif-item:hover{background:rgba(148,163,184,0.06);}
.notif-item.unread{background:rgba(6,182,212,0.06);}
.notif-item .notif-dot{width:8px; height:8px; border-radius:50%; background:var(--teal-glow); margin-top:5px; flex-shrink:0;}
.notif-item.read .notif-dot{background:transparent;}
.notif-item .notif-title{font-size:12.5px; font-weight:600;}
.notif-item .notif-msg{font-size:11.5px; color:var(--text-muted); margin-top:2px;}
.notif-item .notif-time{font-size:10px; color:var(--text-muted); margin-top:4px; opacity:.7;}

/* ---------- India state grid map (Locations page) ---------- */
.india-map-wrap{background:var(--navy-deep,#08090C); border:1px solid var(--border); border-radius:14px; padding:18px;}
.india-grid{display:grid; gap:4px; aspect-ratio:8/9; max-height:480px; margin:0 auto;}
.india-tile{
  border-radius:5px; display:flex; align-items:center; justify-content:center; text-align:center;
  font-size:9.5px; font-weight:700; color:rgba(255,255,255,0.85); cursor:pointer; padding:2px;
  transition:fill .3s ease, background .3s ease, transform .15s ease; border:1.5px solid rgba(255,255,255,0.06);
  line-height:1.15; overflow:hidden;
}
.india-tile:hover{transform:scale(1.08); z-index:2; border-color:rgba(255,255,255,0.4);}
.india-tile.selected{border-color:#F59E0B; border-width:2px; box-shadow:0 0 0 1px #F59E0B;}
.india-tile.small{font-size:7px;}
.india-tooltip{
  position:fixed; display:none; z-index:9999; background:var(--surface2); color:#fff; border:1px solid var(--border-hi);
  border-radius:8px; padding:8px 12px; font-size:12px; pointer-events:none; max-width:220px; box-shadow:var(--shadow-lifted);
}
.india-legend{display:flex; gap:14px; flex-wrap:wrap; margin-top:14px; justify-content:center;}
.india-legend-item{display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-muted);}
.india-legend-swatch{width:12px; height:12px; border-radius:3px; display:inline-block;}
.filter-clear-pill{display:inline-flex; align-items:center; gap:8px; background:rgba(251,191,36,0.12); border:1px solid rgba(251,191,36,0.35); color:var(--amber); padding:6px 12px; border-radius:20px; font-size:12px; font-weight:600; cursor:pointer;}

.mobile-backdrop{display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:19;}
.mobile-backdrop.show{display:block;}
@media (max-width:900px){
  .sidebar{position:fixed; left:-260px; top:0; bottom:0; box-shadow:0 0 40px rgba(0,0,0,0.5); transition:left .25s; z-index:20;}
  .sidebar.mobile-open{left:0;}
  .search-box{display:none;}
  #mobileMenuBtn{display:flex !important;}
  .side-collapse-btn{display:none;}
  .content{padding:16px;}
  table{display:block; overflow-x:auto; -webkit-overflow-scrolling:touch;}
}


/* ---------- Sales Pipeline Kanban board layout (fix: was rendering as stacked blocks) ---------- */
.kanban-scroll{display:flex; gap:14px; overflow-x:auto; align-items:flex-start; padding:4px 4px 14px;}
.kanban-col{flex:0 0 272px; width:272px; background:var(--surface2); border:1px solid var(--border); border-radius:12px; padding:10px; display:flex; flex-direction:column; max-height:calc(100vh - 300px); min-height:200px;}
.kanban-col-head{display:flex; align-items:center; justify-content:space-between; padding:4px 6px 10px; margin-bottom:6px; border-bottom:1px solid var(--border); flex:0 0 auto;}
.kanban-col-head .name{font-size:13px; font-weight:700;}
.kanban-col-head .count{background:rgba(255,255,255,0.08); color:var(--text-muted); border-radius:10px; padding:2px 9px; font-size:11.5px; font-weight:600;}
.kanban-col > .kcard, .kanban-col > .kcard-rich{margin:0 2px 10px;}
.kanban-col-body, .kanban-col{overflow-y:auto;}


.mic-btn{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; border:1px solid rgba(148,163,184,0.4); background:rgba(255,255,255,0.08); color:var(--text); cursor:pointer; margin-left:6px; font-size:13px; vertical-align:middle; transition:all .15s;}
.mic-btn i{position:static !important; transform:none !important; left:auto !important; top:auto !important; color:inherit !important; font-size:13px !important;}
.mic-btn:hover{background:rgba(255,255,255,0.12); color:var(--text);}
.mic-btn.listening{background:#ef4444; border-color:#ef4444; color:#fff; animation:micPulse 1.2s infinite;}
@keyframes micPulse{0%{box-shadow:0 0 0 0 rgba(239,68,68,0.6);} 70%{box-shadow:0 0 0 8px rgba(239,68,68,0);} 100%{box-shadow:0 0 0 0 rgba(239,68,68,0);}}
