/* Inter (variable, latin) — self-hosted, OFL licence */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-var-latin.woff2") format("woff2"); }

/* ==========================================================================
   MEDX CRM — Design System
   Hand-written CSS (no build step → deploys on shared hosting as-is).
   Tokens on :root; company brand colour overrides --brand via inline style.
   ========================================================================== */

:root {
  --brand: #0f6e8c;
  --brand-600: #0c5d77;
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #f1f5f9;
  --border-strong: #e2e8f0;
  --text: #1e293b;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;

  --success: #10b981; --success-50: #ecfdf5;
  --warning: #f59e0b; --warning-50: #fffbeb;
  --danger:  #ef4444; --danger-50:  #fef2f2;
  --info:    #3b82f6; --info-50:    #eff6ff;
  --purple:  #8b5cf6; --purple-50:  #f5f3ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 2px 10px rgba(15, 23, 42, 0.03);
  --shadow-sm: 0 4px 20px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);

  --sidebar-w: 244px;
  --topbar-h: 62px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 24px; } h2 { font-size: 18px; font-weight: 600; } h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
[x-cloak] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
/* Sidebar is FIXED to the viewport and scrolls on its own; the page scrolls independently. */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--sb-bg); color: var(--sb-text); display: flex; flex-direction: column; z-index: 40;
  border-right: 1px solid var(--sb-border);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; height: var(--topbar-h); flex: none; border-bottom: 1px solid var(--sb-border); }
.sidebar__logo { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.sidebar__name { color: var(--sb-strong); font-weight: 600; letter-spacing: .02em; }
.sidebar__name small { display: block; font-size: 11px; color: var(--sb-muted); font-weight: 500; letter-spacing: 0; }
.nav { padding: 8px 10px 16px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--sb-scroll) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--sb-scroll); border-radius: 3px; }
.nav__section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sb-muted); padding: 14px 10px 6px; }
.nav__link {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  color: var(--sb-text); font-weight: 500; font-size: 13.5px; transition: all 0.2s; border-left: 3px solid transparent;
}
.nav__link svg { width: 18px; height: 18px; flex: none; opacity: .85; transition: all 0.2s; }
.nav__link:hover { background: var(--sb-hover); color: var(--sb-strong); transform: translateX(2px); }
.nav__link.is-active { background: var(--sb-active); color: var(--sb-strong); border-left-color: var(--brand); }
.nav__link.is-active svg { color: var(--brand); opacity: 1; }
.nav__count { margin-left: auto; font-size: 11px; background: var(--sb-hover); color: var(--sb-strong); padding: 0 7px; border-radius: 10px; line-height: 18px; }
.nav__count--alert { background: #d9480f; color: #fff; }
.nav__sub { padding-left: 27px; }
.nav__sub .nav__link { font-size: 13px; padding: 5px 10px; }
.sidebar__foot { flex: none; border-top: 1px solid var(--sb-border); padding: 8px 10px; display: flex; gap: 6px; align-items: center; }
.sidebar__foot button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border-radius: 6px; border: 1px solid var(--sb-border); background: transparent; color: var(--sb-text); font-size: 12px; }
.sidebar__foot button.is-active { background: var(--sb-active); color: var(--sb-strong); }
.sidebar__foot svg { width: 14px; height: 14px; }

/* Sidebar themes — set by admin (Settings → Company) and optionally per person (My profile) */
.app, .app[data-sidebar="dark"] {
  --sb-bg: #0b1b24; --sb-text: #c3d0d8; --sb-strong: #fff; --sb-muted: #6c8594; --sb-border: rgba(255,255,255,.06);
  --sb-hover: rgba(255,255,255,.07); --sb-active: rgba(255,255,255,.11); --sb-accent: #7fd3ea; --sb-scroll: rgba(255,255,255,.18);
}
.app[data-sidebar="light"] {
  --sb-bg: #ffffff; --sb-text: #475467; --sb-strong: #101828; --sb-muted: #98a2b3; --sb-border: #e4e7ec;
  --sb-hover: #f2f4f7; --sb-active: var(--brand-50); --sb-accent: var(--brand); --sb-scroll: #d0d5dd;
}
.app[data-sidebar="light"] .nav__link.is-active { color: var(--brand); }
.app[data-sidebar="brand"] {
  --sb-bg: var(--brand); --sb-text: rgba(255,255,255,.82); --sb-strong: #fff; --sb-muted: rgba(255,255,255,.6); --sb-border: rgba(255,255,255,.12);
  --sb-hover: rgba(255,255,255,.1); --sb-active: rgba(255,255,255,.18); --sb-accent: #fff; --sb-scroll: rgba(255,255,255,.3);
}
.app[data-sidebar="brand"] .sidebar__logo { background: rgba(255,255,255,.2); }

.main { min-width: 0; display: flex; flex-direction: column; margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
}
.topbar .topbar__menu { display: none; }
.content { padding: 20px 24px 40px; max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--text-3); margin-top: 2px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Global search ---------- */
.gsearch { position: relative; flex: 1; max-width: 520px; }
.gsearch input { padding-left: 34px; background: var(--surface-2); }
.gsearch__icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-4); }
.gsearch__kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.gsearch__panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; padding: 6px; }
.gsearch__group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); padding: 8px 10px 4px; }
.gsearch__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); width: 100%; background: none; border: 0; text-align: left; }
.gsearch__item:hover { background: var(--brand-50); }
.gsearch__meta { color: var(--text-3); font-size: 12px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: #ffffff; color: var(--text-2);
  font-weight: 600; font-size: 13.5px; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all .2s ease;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.btn svg { width: 16px; height: 16px; color: var(--text-4); transition: color .15s; }
.btn:hover svg { color: var(--brand); }
.btn--quick { height: 42px; border-radius: 10px; justify-content: flex-start; padding: 0 16px; background: var(--surface-2); border: 1px solid transparent; color: var(--text-2); box-shadow: none; font-size: 13.5px; }
.btn--quick svg { color: var(--text-4); }
.btn--quick:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-2px); }

.btn--quick-blue { background: #f0f9ff; color: #0369a1; } .btn--quick-blue svg { color: #0284c7; }
.btn--quick-blue:hover { background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); }

.btn--quick-green { background: #f0fdf4; color: #15803d; } .btn--quick-green svg { color: #16a34a; }
.btn--quick-green:hover { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); }

.btn--quick-purple { background: #faf5ff; color: #7e22ce; } .btn--quick-purple svg { color: #9333ea; }
.btn--quick-purple:hover { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); }

.btn--quick-orange { background: #fff7ed; color: #c2410c; } .btn--quick-orange svg { color: #ea580c; }
.btn--quick-orange:hover { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); }

.btn--quick-pink { background: #fdf2f8; color: #be185d; } .btn--quick-pink svg { color: #db2777; }
.btn--quick-pink:hover { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }

.btn--quick-teal { background: #f0fdfa; color: #0f766e; } .btn--quick-teal svg { color: #0d9488; }
.btn--quick-teal:hover { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.btn--primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn--primary:hover { background: var(--brand-600); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,0.2); transform: translateY(-2px); }
.btn--danger { color: var(--danger); }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn--ghost:hover { background: #eef0f3; border-color: transparent; }
.btn--sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn--icon { width: 34px; padding: 0; }
.btn--sm.btn--icon { width: 28px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn .spinner { display: none; }
.btn.is-loading .spinner, [wire\:loading].spinner { display: inline-block; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 8px;
  background: #ffffff; color: var(--text); font: inherit; font-size: 13.5px; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px #bfdbfe;
}
.textarea { height: auto; padding: 8px 10px; min-height: 80px; resize: vertical; }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.input--sm, .select--sm { height: 30px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error { font-size: 12px; color: var(--danger); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { display: inline-block; vertical-align: middle; position: relative; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd4dc; border-radius: 20px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-xs); transition: .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(14px); }

.kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; color: var(--text-3); background: var(--surface); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; background: #f2f4f7; color: var(--text-2); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-50); color: var(--success); }
.badge--warning { background: var(--warning-50); color: var(--warning); }
.badge--danger { background: var(--danger-50); color: var(--danger); }
.badge--info { background: var(--info-50); color: var(--info); }
.badge--purple { background: var(--purple-50); color: var(--purple); }
.badge--brand { background: var(--brand-50); color: var(--brand); }
.badge--outline { background: transparent; border: 1px solid var(--border); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; border: none; background: var(--surface-2); white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; }
.prio i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.prio--urgent i { background: #d92d20; } .prio--high i { background: #f79009; } .prio--medium i { background: #2e90fa; } .prio--low i { background: #98a2b3; }
.reports-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--success-50); color: var(--success); font-weight: 600; font-size: 12.5px; border: 1px solid #abefc6; }
.reports-pill:hover { background: #d1fadf; color: var(--success); }
.reports-none { color: var(--text-4); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: all 0.2s ease; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card__head p { color: var(--text-4); font-size: 12.5px; margin-top: 2px; }
.card__body { padding: 20px; }
.card__foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.kpi { padding: 20px; display: flex; flex-direction: column; color: inherit; background: var(--surface); border-radius: var(--radius-lg); position: relative; overflow: hidden; border: 1px solid var(--border); transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
.kpi::before { display: none; }
a.kpi:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.06); transform: translateY(-3px); }
.kpi--blue { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border-color: #bae6fd; }
.kpi--blue .kpi__value { color: #0369a1; } .kpi--blue .kpi__label { color: #0284c7; }
.kpi--green { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #bbf7d0; }
.kpi--green .kpi__value { color: #15803d; } .kpi--green .kpi__label { color: #16a34a; }
.kpi--purple { background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); border-color: #e9d5ff; }
.kpi--purple .kpi__value { color: #7e22ce; } .kpi--purple .kpi__label { color: #9333ea; }
.kpi--orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border-color: #fed7aa; }
.kpi--orange .kpi__value { color: #c2410c; } .kpi--orange .kpi__label { color: #ea580c; }
.kpi--pink { background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%); border-color: #fbcfe8; }
.kpi--pink .kpi__value { color: #be185d; } .kpi--pink .kpi__label { color: #db2777; }
.kpi--teal { background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%); border-color: #99f6e4; }
.kpi--teal .kpi__value { color: #0f766e; } .kpi--teal .kpi__label { color: #0d9488; }
.kpi--indigo { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); border-color: #c7d2fe; }
.kpi--indigo .kpi__value { color: #4338ca; } .kpi--indigo .kpi__label { color: #4f46e5; }
.kpi--alert { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); border-color: #fecaca; }
.kpi--alert .kpi__value { color: #b91c1c; } .kpi--alert .kpi__label { color: #dc2626; }
.kpi__label { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi__value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi__sub { font-size: 12.5px; color: var(--text-4); margin-top: 4px; font-weight: 500; mix-blend-mode: multiply; opacity: 0.8; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row b { font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); background: #ffffff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.02); margin-top: 12px; }
.table-wrap--flat { max-height: none; box-shadow: none; border: none; margin-top: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 2; background: #f8fafc; text-align: left; font-weight: 600; font-size: 12px;
  color: var(--text-2); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th button { background: none; border: 0; padding: 0; color: inherit; font-weight: inherit; display: inline-flex; gap: 4px; align-items: center; }
.table th button:hover { color: var(--text); }
.table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr { cursor: default; transition: background 0.2s; }
.table tbody tr:hover td { background: #f8fafc; }
.table tbody tr.is-selected td { background: var(--brand-50); }
.table tbody tr.is-open td { background: #f0f9ff; }
.table .cell-strong { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12px; color: var(--text-3); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: #ffffff; }
.table-toolbar .input { max-width: 280px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #f0f9ff; border-bottom: 1px solid #bae6fd; font-size: 13.5px; color: #0369a1; font-weight: 500; }
.lead-link { background: none; border: 0; padding: 0; text-align: left; color: var(--text); font-weight: 600; }
.lead-link:hover { color: var(--brand); }
.overdue { color: var(--danger); font-weight: 600; }
.today { color: var(--warning); font-weight: 600; }

.presets { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.preset { height: 32px; padding: 0 14px; border-radius: 16px; border: none; background: #f1f5f9; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; transition: all 0.2s; }
.preset:hover { background: var(--brand-50); color: var(--brand-600); }
.preset.is-active { background: var(--brand); color: #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); flex-wrap: wrap; background: #ffffff; }
.pager__btns { display: flex; gap: 4px; }

/* Mobile lead cards */
.lead-cards { display: none; }
.lead-card { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.lead-card__top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lead-card__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

/* ---------- Drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 60; transition: all 0.3s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 92vw); background: #f8fafc; z-index: 61;
  box-shadow: -8px 0 32px rgba(0,0,0,0.08); display: flex; flex-direction: column;
}
.drawer__head { background: #ffffff; border-bottom: 1px solid var(--border); padding: 18px 24px 0; }
.drawer__title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer__title h2 { font-size: 18px; }
.drawer__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; color: var(--text-3); font-size: 12.5px; }
.drawer__actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.drawer__head { flex: none; }
.drawer__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 18px 20px 40px; }
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { background: #ffffff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.12); width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column; position: relative; z-index: 81; }
.modal--lg { width: min(760px, 100%); }
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; }
.modal__body { padding: 20px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--border); background: #f8fafc; display: flex; justify-content: flex-end; gap: 12px; border-radius: 0 0 16px 16px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 8px -4px 0; padding-bottom: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; height: 38px; padding: 0 16px; border-radius: 10px; border: 0; background: none; color: var(--text-3); font-weight: 500; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.tab.is-active::after { display: none; }
.tab .count { font-size: 11px; background: #eef0f3; color: var(--text-2); border-radius: 9px; padding: 0 6px; line-height: 17px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; z-index: 50; }
.menu--left { left: 0; right: auto; }
.menu__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--text); font-size: 13.5px; text-align: left; }
.menu__item:hover { background: #f2f4f7; color: var(--text); }
.menu__item svg { width: 15px; height: 15px; color: var(--text-3); }
.menu__sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu__label { font-size: 11px; color: var(--text-4); text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px 2px; }

/* Notifications */
.bell { position: relative; }
@keyframes dotPulse { 0% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.4); } 70% { box-shadow: 0 0 0 4px rgba(217, 45, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0); } }
.bell__dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #d92d20; color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; border: 2px solid #fff; animation: dotPulse 2s infinite; }
.notif-panel { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.notif { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f0f2f5; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.notif:hover { background: var(--surface-2); }
.notif.is-unread { background: #f5fbfd; }
.notif__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.notif__icon svg { width: 16px; height: 16px; }
.notif__title { font-weight: 500; font-size: 13px; color: var(--text); }
.notif__body { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.notif__time { font-size: 11.5px; color: var(--text-4); margin-top: 3px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-day { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); margin: 14px 0 8px -26px; padding-left: 26px; }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item__dot { position: absolute; left: -26px; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: grid; place-items: center; color: var(--text-3); }
.tl-item__dot svg { width: 11px; height: 11px; }
.tl-item__dot--brand { border-color: var(--brand); color: var(--brand); }
.tl-item__dot--success { border-color: var(--success); color: var(--success); }
.tl-item__dot--danger { border-color: var(--danger); color: var(--danger); }
.tl-item__dot--warning { border-color: #f79009; color: #f79009; }
.tl-item__title { font-weight: 500; font-size: 13.5px; }
.tl-item__desc { color: var(--text-2); font-size: 13px; margin-top: 2px; white-space: pre-line; }
.tl-item__meta { color: var(--text-4); font-size: 12px; margin-top: 2px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: 520px; }
.chat__stream { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f3f5f7; background-image: radial-gradient(#e6e9ee 1px, transparent 1px); background-size: 18px 18px; }
.bubble { max-width: 72%; padding: 8px 11px 6px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-xs); word-wrap: break-word; }
.bubble__text { white-space: pre-wrap; }
.bubble--in { align-self: flex-start; background: #fff; border-top-left-radius: 3px; }
.bubble--out { align-self: flex-end; background: #dff4ea; border-top-right-radius: 3px; }
.bubble__meta { display: flex; justify-content: flex-end; gap: 4px; align-items: center; font-size: 11px; color: var(--text-4); margin-top: 3px; }
.bubble__meta .read { color: #1570ef; }
.bubble__media { display: flex; align-items: center; gap: 8px; padding: 8px; background: rgba(0,0,0,.04); border-radius: 6px; margin-bottom: 4px; }
.bubble__img { max-width: 240px; max-height: 240px; border-radius: 6px; display: block; margin-bottom: 4px; }
.chat__composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); align-items: flex-end; }
.chat__composer .textarea { min-height: 38px; max-height: 140px; }

/* ---------- Misc ---------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); display: inline-grid; place-items: center; font-weight: 600; font-size: 11.5px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }
.who { display: inline-flex; align-items: center; gap: 7px; }
.empty { text-align: center; padding: 60px 16px; color: var(--text-3); }
.empty__icon { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); display: grid; place-items: center; margin: 0 auto 16px; color: #0284c7; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15); }
.empty__icon svg { width: 28px; height: 28px; }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 16px; }
.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 4px; height: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.alert { padding: 12px 14px; border-radius: 8px; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; border: 1px solid; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert--warning { background: #fefce8; color: #a16207; border-color: #fef08a; }
.alert--danger { background: var(--danger-50); color: #912018; border-color: #fecdca; }
.alert--info { background: var(--info-50); color: #194185; border-color: #b2ddff; }
.alert--success { background: var(--success-50); color: #05603a; border-color: #abefc6; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text); word-break: break-word; }
.muted { color: var(--text-3); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; } .row--between { justify-content: space-between; } .row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack--sm { gap: 6px; } .stack--lg { gap: 20px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mb-3 { margin-bottom: 12px; }
.w-full { width: 100%; } .ml-auto { margin-left: auto; } .nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #bae6fd 0%, #0284c7 100%); border-radius: 6px; transition: width 0.4s ease; }
.funnel-row:nth-child(1) .bar > span { background: linear-gradient(90deg, #bae6fd 0%, #0284c7 100%); } /* Blue */
.funnel-row:nth-child(2) .bar > span { background: linear-gradient(90deg, #e9d5ff 0%, #7e22ce 100%); } /* Purple */
.funnel-row:nth-child(3) .bar > span { background: linear-gradient(90deg, #fed7aa 0%, #ea580c 100%); } /* Orange */
.funnel-row:nth-child(4) .bar > span { background: linear-gradient(90deg, #bbf7d0 0%, #16a34a 100%); } /* Green */
.funnel-row:nth-child(5) .bar > span { background: linear-gradient(90deg, #fbcfe8 0%, #db2777 100%); } /* Pink */
.funnel-row { display: grid; grid-template-columns: 150px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.health { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; }
.health i { width: 8px; height: 8px; border-radius: 50%; }
.health--healthy i { background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
.health--degraded i { background: #f79009; box-shadow: 0 0 0 3px #fef0c7; }
.health--down i, .health--error i { background: #f04438; box-shadow: 0 0 0 3px #fee4e2; }
.health--unknown i, .health--disconnected i { background: #98a2b3; }
.drop { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 18px; text-align: center; color: var(--text-3); background: var(--surface-2); cursor: pointer; }
.drop.is-over { border-color: var(--brand); background: var(--brand-50); }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.doc__icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #fef3f2; color: #d92d20; font-size: 10px; font-weight: 700; flex: none; }
.doc__icon--img { background: #eff8ff; color: #1570ef; }
.doc__name { font-weight: 500; font-size: 13.5px; }
.chart { width: 100%; height: 240px; position: relative; }

/* Toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 420px; padding: 11px 14px; border-radius: var(--radius); background: #101828; color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; }
.toast--error { background: #7a271a; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* Auth */
.auth {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: #ffffff;
}
.auth__side {
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  background: #081720;
  color: #cbd5e1;
  padding: clamp(24px, 3.8vh, 44px) clamp(28px, 3.8vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(22, 167, 119, 0.22), transparent 45%),
    radial-gradient(circle at 85% 65%, rgba(15, 110, 140, 0.3), transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(22, 167, 119, 0.12), transparent 40%);
}
.auth__side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.6;
}
.auth__side-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: auto 0;
  padding-top: clamp(20px, 4vh, 48px);
}
.auth__brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(22, 167, 119, 0.15);
  border: 1px solid rgba(22, 167, 119, 0.35);
  color: #4ade80;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
}
.auth__brand-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
}
.auth__hero-text h2 {
  color: #ffffff;
  font-size: clamp(21px, 1.8vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}
.auth__side-subtext {
  color: #94a3b8;
  font-size: 13.5px;
  line-height: 1.48;
  margin: 0 0 18px 0;
}
.auth__features {
  display: grid;
  gap: 10px;
}
.auth__feature-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}
.auth__feature-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(22, 167, 119, 0.35);
  transform: translateX(3px);
}
.auth__feature-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(22, 167, 119, 0.18);
  border: 1px solid rgba(22, 167, 119, 0.32);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth__feature-icon svg {
  width: 15px;
  height: 15px;
}
.auth__feature-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.auth__feature-body strong {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
}
.auth__feature-body span {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}
.auth__side-footer {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.auth__security-badge {
  font-size: 12px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
}
.auth__panel {
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vh, 48px) 36px;
  background: #ffffff;
}
.auth__card {
  width: min(390px, 100%);
  display: flex;
  flex-direction: column;
}
.auth__card-logo {
  margin-bottom: 22px;
}
.auth__card-logo-img {
  height: 50px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
}
.auth__welcome {
  margin-bottom: 20px;
}
.auth__welcome-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0d825c;
  background: rgba(22, 167, 119, 0.1);
  border: 1px solid rgba(22, 167, 119, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.auth__welcome-title {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0 0 5px 0;
  line-height: 1.2;
}
.auth__welcome-sub {
  color: #64748b;
  font-size: 13.5px;
  margin: 0;
  line-height: 1.45;
}

/* Bottom nav (mobile) */
.bottomnav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid--main-side { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 64px; }
  .sidebar__name, .nav__section, .nav__link span, .nav__count, .nav__sub { display: none; }
  .nav__link { justify-content: center; padding: 9px; }
  .sidebar__brand { justify-content: center; padding: 0; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app.nav-open .sidebar { width: 244px; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar__name, .app.nav-open .nav__section, .app.nav-open .nav__link span { display: block; }
  .app.nav-open .nav__link { justify-content: flex-start; }
  .sidebar__foot span { display: none; }
  .app.nav-open .sidebar__foot span { display: inline; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .main { margin-left: 0; }
  .sidebar { width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; width: 264px; }
  .app.nav-open .sidebar__name, .app.nav-open .nav__section, .app.nav-open .nav__link span, .app.nav-open .nav__count, .app.nav-open .nav__sub { display: block; }
  .app.nav-open .nav__link { display: flex; justify-content: flex-start; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .topbar__menu { display: inline-flex; }
  .gsearch__kbd { display: none; }
  .content { padding: 14px 12px 90px; }
  .grid--2, .grid--3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap--leads { display: none; }
  .lead-cards { display: block; }
  .drawer { width: 100vw; overflow-y: auto; overscroll-behavior: contain; }
  .drawer__body { flex: none; overflow: visible; min-height: auto; }
  .drawer__head { padding: 12px 14px 0; }
  .drawer__body { padding: 14px 12px 90px; }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .bubble { max-width: 88%; }
  .auth { grid-template-columns: 1fr; height: auto; min-height: 100vh; max-height: none; overflow: visible; }
  .auth__side { display: none; }
  .auth__panel { height: auto; min-height: 100vh; max-height: none; overflow: visible; padding: 32px 20px; }
  .bottomnav { 
    display: grid; grid-template-columns: repeat(5, 1fr); 
    position: sticky; bottom: 0; left: 0; right: 0; z-index: 35;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); 
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
  }
  .bottomnav a { 
    display: flex; flex-direction: column; align-items: center; gap: 3px; 
    font-size: 11px; font-weight: 500; color: var(--text-4); padding: 6px 0; position: relative; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .bottomnav a:active { transform: scale(0.92); }
  .bottomnav a svg { width: 22px; height: 22px; transition: color 0.2s; }
  .bottomnav a.is-active { color: var(--brand); }
  .bottomnav a.is-active svg { fill: color-mix(in srgb, var(--brand) 15%, transparent); stroke-width: 2.5px; }
  .toasts { left: 12px; right: 12px; bottom: 76px; }
  .toast { min-width: 0; max-width: none; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
  .page-head h1 { font-size: 18px; }
}
@media print { .sidebar, .topbar, .bottomnav, .page-head__actions { display: none !important; } .main { margin-left: 0; } }
@media (max-width: 760px) { .hide-sm { display: none; } }

/* Settings layout */
.settings-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.settings-nav { padding: 6px; position: sticky; top: 72px; }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 2px; }
  .settings-nav .menu__item { white-space: nowrap; width: auto; }
  .settings-nav .menu__sep { display: none; }
}

/* Lead score pill */
.score { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-variant-numeric: tabular-nums; background: #f2f4f7; color: var(--text-2); }
.score b { font-weight: 600; }
.score--warm { background: #fef0c7; color: #93370d; }
.score--hot { background: #fee4e2; color: #b42318; }
.score span { font-weight: 500; }
.scorebar { display: grid; grid-template-columns: 1fr 44px; gap: 12px 10px; align-items: center; font-size: 12.5px; }
.scorebar .bar { height: 6px; }

/* Click-to-WhatsApp phone links */
.wa-link { display: inline-flex; align-items: center; gap: 4px; color: #128c4a; font-weight: 500; white-space: nowrap; }
.wa-link:hover { color: #0b6b37; text-decoration: underline; }
.wa-link svg { flex: none; }

/* Input with a fixed prefix (country dial code) */
.input-group { display: flex; align-items: stretch; }
.input-group__prefix { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface-2); color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; }
.input-group .input { border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; }

/* Team live */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #12b76a; margin-right: 6px; vertical-align: 2px; box-shadow: 0 0 0 0 rgba(18,183,106,.5); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(18,183,106,.45); } 70% { box-shadow: 0 0 0 8px rgba(18,183,106,0); } 100% { box-shadow: 0 0 0 0 rgba(18,183,106,0); } }
.live-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.live-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; border: 0; border-right: 1px solid var(--border); background: none; text-align: left; font: inherit; }
.live-stat:last-child { border-right: 0; }
.live-stat b { font-size: 20px; font-weight: 600; line-height: 1.1; }
.live-stat span { font-size: 12px; color: var(--text-3); }
button.live-stat:hover, .live-stat.is-active { background: var(--surface-2); }
.live-stat--green.is-active, button.live-stat--green:hover { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); }
.live-stat--orange.is-active, button.live-stat--orange:hover { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); }
.live-stat--gray.is-active, button.live-stat--gray:hover { background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); }
.live-stat--blue.is-active, button.live-stat--blue:hover { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); }
.live-stat--alert.is-active, button.live-stat--alert:hover { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); }
.live-stat--purple.is-active, button.live-stat--purple:hover { background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); }
.avatar-wrap { position: relative; display: inline-flex; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; background: #d0d5dd; }
.presence--online { background: #12b76a; } .presence--idle { background: #f79009; } .presence--leave { background: #7a5af8; }
@media (max-width: 760px) { .live-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .live-stat { border-bottom: 1px solid var(--border); } }
.health--purple i { background: #7a5af8; }
