/* 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"); }
/* Manrope (variable, latin) — headings & figures, OFL licence */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/manrope-var-latin.woff2") format("woff2"); }

/* ==========================================================================
   Omniwings — 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 — Ocean Blue === */
  --brand: #0284c7;
  --brand-600: #0369a1;
  --brand-700: #075985;
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;
  --brand-200: #bae6fd;

  /* === BACKGROUND — Clean neutral, very slight warm === */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e1e7ef;
  --border-strong: #c7d2de;
  --text: #0d1520;
  --text-2: #253147;
  --text-3: #516278;
  --text-4: #8fa3b5;

  /* === STATUS COLORS — Vivid: Green, Orange, Red, Blue === */
  --success: #16a34a;  --success-50: #f0fdf4;  --success-100: #dcfce7;
  --warning: #ea580c;  --warning-50: #fff7ed;  --warning-100: #fed7aa;
  --danger:  #dc2626;  --danger-50:  #fef2f2;  --danger-100:  #fecaca;
  --info:    #0284c7;  --info-50:    #f0f9ff;  --info-100:    #e0f2fe;
  --purple:  #7c3aed;  --purple-50:  #f5f3ff;  --purple-100:  #ede9fe;
  --amber:   #d97706;  --amber-50:   #fffbeb;  --amber-100:   #fde68a;
  --teal:    #0d9488;  --teal-50:    #f0fdfa;  --teal-100:    #ccfbf1;
  --vital:   #16a34a;

  /* === KPI ACCENT COLORS (cycling through cards) === */
  --kpi-blue:   #0284c7;
  --kpi-green:  #16a34a;
  --kpi-orange: #ea580c;
  --kpi-red:    #dc2626;

  /* === RADII === */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* === SHADOWS === */
  --shadow-xs: 0 1px 3px rgba(2,132,199,.05), 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 8px rgba(2,132,199,.09), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 18px rgba(2,132,199,.12), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 48px -8px rgba(13,21,32,.18), 0 8px 16px -4px rgba(0,0,0,.08);
  --shadow-xl: 0 32px 64px -12px rgba(13,21,32,.22), 0 12px 24px -6px rgba(0,0,0,.10);

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

  /* === GRADIENTS === */
  --grad-brand:   linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --grad-success: linear-gradient(135deg, #16a34a 0%, #0d9488 100%);
  --grad-warning: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
  --grad-danger:  linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --grad-warm:    linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  --grad-cool:    linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  --grad-hero:    linear-gradient(135deg, #0c1a2e 0%, #0f2d4a 45%, #0c2340 100%);
}

*, *::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;
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(2,132,199,.05), transparent);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
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: 7px 10px; border-radius: var(--radius-sm);
  color: var(--sb-text); font-weight: 500; font-size: 13.5px;
}
.nav__link svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav__link:hover { background: var(--sb-hover); color: var(--sb-strong); }
.nav__link.is-active { background: var(--sb-active); color: var(--sb-strong); }
.nav__link.is-active svg { color: var(--sb-accent); 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 */
.app, .app[data-sidebar="dark"] {
  --sb-bg: #0a1628; --sb-text: #94b4cc; --sb-strong: #fff; --sb-muted: #4d6d88; --sb-border: rgba(255,255,255,.07);
  --sb-hover: rgba(255,255,255,.07); --sb-active: rgba(255,255,255,.11); --sb-accent: #38bdf8; --sb-scroll: rgba(255,255,255,.16);
}
.app[data-sidebar="light"] {
  --sb-bg: #ffffff; --sb-text: #3d5368; --sb-strong: #0d1520; --sb-muted: #8fa3b5; --sb-border: #e1e7ef;
  --sb-hover: #f0f5f9; --sb-active: var(--brand-50); --sb-accent: var(--brand); --sb-scroll: #c7d2de;
}
.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,.14);
  --sb-hover: rgba(255,255,255,.11); --sb-active: rgba(255,255,255,.2); --sb-accent: #fff; --sb-scroll: rgba(255,255,255,.32);
}
.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: 34px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13.5px; white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); border-color: var(--brand-200); color: var(--text); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--grad-brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(2,132,199,.35); }
.btn--primary:hover { background: linear-gradient(135deg, #0369a1 0%, #075985 100%); border-color: var(--brand-600); color: #fff; box-shadow: 0 4px 16px rgba(2,132,199,.45); }
.btn--danger { color: var(--danger); }
.btn--danger-solid { background: linear-gradient(135deg, #dc2626, #b91c1c); border-color: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.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: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; box-shadow: var(--shadow-xs);
}
.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: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; border: 1px solid; background: #fff; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.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: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card__head p { color: var(--text-3); font-size: 12.5px; }
.card__body { padding: 18px; }
.card__foot { padding: 12px 18px; 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(170px, 1fr)); gap: 14px; }
.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); }
.kpi { padding: 18px 20px; display: block; color: inherit; position: relative; overflow: hidden; }
a.kpi:hover { border-color: var(--brand-200); color: inherit; background: var(--brand-50); }
a.kpi:hover .kpi__value { color: var(--brand); }
.kpi__label { font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .04em; }
.kpi__value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi__sub { font-size: 12px; color: var(--text-4); margin-top: 4px; }
.kpi--alert .kpi__value { color: var(--danger); }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.table-wrap--flat { max-height: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 500; font-size: 12px;
  color: var(--text-3); padding: 9px 12px; 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: 10px 12px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.table tbody tr { cursor: default; }
.table tbody tr:hover td { background: #fafbfd; }
.table tbody tr.is-selected td { background: var(--brand-50); }
.table tbody tr.is-open td { background: #f1f8fb; }
.table .cell-strong { font-weight: 500; 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: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar .input { max-width: 280px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 13px; }
.lead-link { background: none; border: 0; padding: 0; text-align: left; color: var(--text); font-weight: 500; }
.lead-link:hover { color: var(--brand); }
.overdue { color: var(--danger); font-weight: 500; }
.today { color: var(--warning); font-weight: 500; }

.presets { display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px 0; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.preset { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.preset:hover { border-color: var(--border-strong); }
.preset.is-active { background: var(--text); border-color: var(--text); color: #fff; }

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

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.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(16,24,40,.35); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 92vw); background: var(--bg); z-index: 61;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.drawer__head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px 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; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); 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 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal__body { padding: 18px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; height: 38px; padding: 0 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; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); }
.tab.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.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; }
.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; }
.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: 44px 16px; color: var(--text-3); }
.empty__icon { width: 44px; height: 44px; border-radius: 12px; background: #f2f4f7; display: grid; place-items: center; margin: 0 auto 12px; color: var(--text-4); }
.empty__icon svg { width: 22px; height: 22px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.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%; } }
.alert { padding: 10px 12px; border-radius: var(--radius); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; border: 1px solid; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.alert--warning { background: var(--warning-50); color: #93370d; border-color: #fedf89; }
.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: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.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: 13px 16px; border-radius: var(--radius-lg); background: #0f1129; color: #fff; box-shadow: var(--shadow-xl); font-size: 13.5px; border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(12px); }
.toast--error { background: linear-gradient(135deg, #7f1d1d, #991b1b); }
.toast--success { background: linear-gradient(135deg, #064e3b, #065f46); }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth__card { width: min(380px, 100%); }
.auth__side { background: #0b1b24; color: #c3d0d8; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background-image: radial-gradient(circle at 80% 20%, rgba(15,110,140,.45), transparent 50%); }
.auth__side h2 { color: #fff; font-size: 26px; line-height: 1.25; max-width: 420px; }
.auth__points { display: grid; gap: 14px; margin-top: 28px; max-width: 420px; }
.auth__points div { display: flex; gap: 10px; align-items: flex-start; }
.auth__points svg { width: 18px; height: 18px; color: #7fd3ea; flex: none; margin-top: 2px; }

/* 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; }
  .auth__side { display: none; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-3); padding: 4px 0; position: relative; }
  .bottomnav a svg { width: 20px; height: 20px; }
  .bottomnav a.is-active { color: var(--brand); }
  .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(--brand-50); }
.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; }

/* ==========================================================================
   Phase 5 — Omniwings (industry templates, records, platform console, onboarding)
   ========================================================================== */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.count { display: inline-block; font-size: 11px; background: #eef0f3; color: var(--text-2); border-radius: 9px; padding: 0 6px; line-height: 17px; font-weight: 500; }
.linklike { border: 0; background: none; color: var(--text-3); text-decoration: underline; cursor: pointer; font: inherit; }
.sidebar__logo--img { object-fit: contain; background: #fff; padding: 2px; }
button.switch { border: 0; background: none; padding: 0; cursor: pointer; }
button.switch:disabled { opacity: .45; cursor: not-allowed; }
.switch.is-on span { background: var(--brand); }
.switch.is-on span::after { transform: translateX(14px); }
.list { display: flex; flex-direction: column; }
.list__item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--border); }
.list__item:first-child { border-top: 0; }

/* Industry KPI strip (dashboard) */
.industry-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.industry-kpi { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: inherit; box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .2s, transform .2s; }
.industry-kpi:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.industry-kpi__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-brand); color: #fff; flex: none; box-shadow: 0 4px 12px rgba(2,132,199,.3); }
.industry-kpi__body { display: flex; flex-direction: column; min-width: 0; }
.industry-kpi__label { font-size: 11.5px; color: var(--text-3); line-height: 1.3; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.industry-kpi__value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--text); }
.industry-kpi__sub { font-size: 11.5px; color: var(--text-4); }

/* Modules grid (settings + platform) */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.module-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.module-tile.is-on { background: var(--surface); border-color: var(--brand-100); }
.module-tile__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #eef0f3; color: var(--text-3); flex: none; }
.module-tile.is-on .module-tile__icon { background: var(--brand-50); color: var(--brand); }
.module-tile__icon svg { width: 16px; height: 16px; }
.module-tile__name { flex: 1; font-weight: 500; font-size: 13.5px; min-width: 0; }
.module-tile__name small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-4); }
.icon-pick { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--text-3); }
.icon-pick.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.diff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.diff-list li { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); }
.diff-list li.is-add { background: var(--success-50); color: var(--success); }
.diff-list li.is-remove { background: var(--warning-50); color: var(--warning); }

/* Plan usage */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; }
.usage__bar { height: 6px; border-radius: 3px; background: #eef0f3; margin-top: 6px; overflow: hidden; }
.usage__bar span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.plan-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.template-card { border-top: 3px solid var(--ind); }
.tpl-field-row { display: grid; grid-template-columns: 1.3fr 1fr 130px 1.4fr 1fr 44px 34px; gap: 8px; align-items: center; }

/* Onboarding / registration wizard */
.wizard-body { background: var(--bg); min-height: 100vh; }
.wizard-top { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.wizard-main { padding: 32px 16px 60px; }
.wizard { max-width: 980px; margin: 0 auto; }
.wizard__head { text-align: center; margin-bottom: 24px; }
.wizard__head h1 { font-size: 26px; letter-spacing: -.01em; }
.wizard__head p { max-width: 620px; margin: 8px auto 0; }
.wizard__card { max-width: 760px; margin: 0 auto; }
.steps { display: flex; justify-content: center; gap: 6px 18px; flex-wrap: wrap; list-style: none; padding: 0; margin: 20px 0 0; }
.steps li, .steps li button { display: inline-flex; align-items: center; gap: 8px; color: var(--text-4); font-size: 13px; font-weight: 500; border: 0; background: none; padding: 0; font-family: inherit; cursor: default; }
.steps li button { cursor: pointer; }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #eef0f3; font-size: 12px; }
.steps li.is-current, .steps li.is-current button { color: var(--text); }
.steps li.is-current span { background: var(--brand); color: #fff; }
.steps li.is-done span { background: var(--success-50); color: var(--success); }
.steps--compact { gap: 6px 12px; }
.industry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.industry-grid--sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.industry-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 16px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.industry-card:hover:not(:disabled) { border-color: var(--ind, var(--brand)); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.industry-card.is-selected { border-color: var(--ind, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ind, var(--brand)) 18%, transparent); }
.industry-card:disabled { opacity: .5; cursor: not-allowed; }
.industry-card__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--ind, var(--brand)); background: color-mix(in srgb, var(--ind, var(--brand)) 12%, #fff); flex: none; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatch.is-active { box-shadow: 0 0 0 2px var(--text); }
.theme-pick { display: flex; gap: 10px; align-items: center; padding: 8px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 500; }
.theme-pick.is-active { border-color: var(--brand); }
.theme-pick__prev { width: 46px; height: 34px; border-radius: 6px; border: 1px solid var(--border); display: grid; gap: 3px; padding: 6px; }
.theme-pick__prev i { height: 3px; border-radius: 2px; opacity: .7; display: block; }
.theme-preview { display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px dashed var(--border); border-radius: 10px; }
.logo-preview { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.people-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr 1fr 34px; gap: 8px; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.source-pick { padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.source-pick.is-on { background: var(--surface); border-color: var(--brand-100); }
.finish-badge { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--success-50); color: var(--success); }
.checklist { display: grid; gap: 8px; }
.checklist__item { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); font-weight: 500; }
.checklist__item:hover { border-color: var(--brand-100); color: var(--brand); }
@media (max-width: 760px) {
  .people-row { grid-template-columns: 1fr 1fr; }
  .tpl-field-row { grid-template-columns: 1fr 1fr; }
  .wizard__head h1 { font-size: 21px; }
  .industry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Phase 5.3 — lead types, quick status, performance reports ===== */
.btn--xs { height: 22px; padding: 0 7px; font-size: 11.5px; border-radius: 6px; }
.btn--xs.btn--icon { width: 22px; padding: 0; }
.avatar--xs { width: 22px; height: 22px; font-size: 9px; box-shadow: 0 0 0 2px var(--surface, #fff); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -4px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; max-height: 260px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.card--soft { background: var(--brand-50); border-color: var(--brand-100); }
.text-danger { color: var(--danger); }
.text-ok { color: #067647; }
.status-btn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 2px 4px 2px 0; border-radius: 999px; cursor: pointer; color: var(--text-3, #667085); }
.status-btn:hover .badge { box-shadow: 0 0 0 2px var(--brand-100); }
.qs { display: flex; flex-direction: column; gap: 8px; }
.qs__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qs__label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.qs__statuses { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.qs__status { --c: #64748b; display: flex; align-items: center; gap: 7px; text-align: left; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); font-size: 13px; cursor: pointer; color: var(--text); }
.qs__status:hover { border-color: var(--c); }
.qs__status.is-active { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); box-shadow: inset 0 0 0 1px var(--c); font-weight: 600; }
.qs__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.qs__now { margin-left: auto; font-size: 10.5px; color: var(--text-3, #667085); font-weight: 500; }
.qs__lost { padding: 10px; border: 1px solid #fecdca; background: #fef3f2; border-radius: 8px; }
.qs__row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.chip-btn { --c: var(--brand); height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface, #fff); font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.chip-btn:hover { border-color: var(--c); color: var(--c); }
.chip-btn.is-active { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-weight: 600; }
@media (max-width: 640px) { .qs__statuses { grid-template-columns: 1fr 1fr; } }
.mb-3 { margin-bottom: 12px; }
.delta { font-size: 11.5px; font-weight: 600; margin-right: 4px; white-space: nowrap; }
.delta--good { color: #067647; }
.delta--bad { color: var(--danger); }
.medal { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11.5px; font-weight: 700; color: #fff; }
.medal--1 { background: #d4a106; } .medal--2 { background: #94a3b8; } .medal--3 { background: #b4692f; }
.score-pill { --s: 50; display: inline-block; min-width: 34px; text-align: center; padding: 2px 7px; border-radius: 999px; font-weight: 700; font-size: 12px;
  background: color-mix(in srgb, hsl(calc(var(--s) * 1.2) 70% 42%) 14%, transparent); color: hsl(calc(var(--s) * 1.2) 70% 32%); }
.table--perf th, .table--perf td { padding-left: 8px; padding-right: 8px; }
.table__group th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); text-align: center; border-bottom: 0; padding-top: 8px; padding-bottom: 0; background: none; }
.heat { display: grid; grid-template-columns: 38px repeat(24, minmax(18px, 1fr)); gap: 3px; min-width: 560px; }
.heat__h { font-size: 10.5px; color: var(--text-4); text-align: center; }
.heat__d { font-size: 11.5px; color: var(--text-3); align-self: center; }
.heat__c { --a: 0; height: 20px; border-radius: 4px; background: color-mix(in srgb, var(--brand) calc(var(--a) * 100%), var(--surface-2)); }
.stackbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 1px; }
.table--perf td:nth-child(2) { min-width: 190px; }
.table--perf .who > div { white-space: nowrap; }
.table--perf td.num { white-space: nowrap; }
.icon-tile { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand); flex: none; }
.mention-box { position: relative; }
.mention-menu { position: absolute; left: 0; top: 84px; z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.mention-menu .menu__item.is-active { background: var(--brand-50); color: var(--brand); }
.mention { color: var(--brand); font-weight: 600; background: var(--brand-50); border-radius: 4px; padding: 0 3px; }
.badge--purple { background: var(--purple-50); color: var(--purple); }
.card--ask { border-color: #d9d6fe; box-shadow: 0 0 0 3px #f4f3ff; }
.card--nba { border-color: #fde68a; }
.nba { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--info); background: var(--info-50); }
.nba > span { flex: 1; }
.nba--danger { border-left-color: var(--danger); background: var(--danger-50); }
.nba--warning { border-left-color: var(--warning); background: var(--warning-50); }
.qs__won { padding: 10px; border: 1px solid #abefc6; background: var(--success-50); border-radius: 8px; }
.biz-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.biz-kpi { padding: 16px 18px; border-top: 3px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.biz-kpi--pipe { border-top-color: var(--brand); background: linear-gradient(180deg, var(--brand-50) 0%, transparent 60%); }
.biz-kpi--fc { border-top-color: var(--purple); background: linear-gradient(180deg, var(--purple-50) 0%, transparent 60%); }
.biz-kpi--won { border-top-color: var(--success); background: linear-gradient(180deg, var(--success-50) 0%, transparent 60%); }
.biz-kpi--due { border-top-color: var(--warning); background: linear-gradient(180deg, var(--warning-50) 0%, transparent 60%); }
@media (max-width: 900px) { .biz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.biz-strip { display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); overflow-x: auto; color: inherit; }
.biz-strip:hover { border-color: var(--brand-100); color: inherit; }
.biz-strip__item { flex: 1; min-width: 150px; padding: 12px 16px; display: flex; flex-direction: column; gap: 1px; border-right: 1px solid var(--border); }
.biz-strip__item span { font-size: 12px; color: var(--text-3); } .biz-strip__item b { font-size: 19px; font-weight: 700; } .biz-strip__item small { font-size: 11.5px; color: var(--text-4); }
.biz-strip__go { display: flex; align-items: center; gap: 4px; padding: 0 16px; color: var(--brand); font-weight: 600; font-size: 13px; white-space: nowrap; }
.kanban-value { font-size: 12px; font-weight: 600; padding: 0 6px 8px; color: var(--text-2); }

/* ===== Phase 5.4 — help center, help panel, tour, checklist ===== */
.tour-wrap { display: contents; }
.help-hero { padding: 16px; }
.help-hero__search { position: relative; display: flex; align-items: center; }
.help-hero__search svg { position: absolute; left: 12px; color: var(--text-3); }
.help-hero__search .input { padding-left: 38px; height: 44px; font-size: 15px; }
.help-featured { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.help-card { text-align: left; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; color: inherit; font: inherit; }
.help-card:hover { border-color: var(--brand); }
.help-card b { font-size: 14px; } .help-card span { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.help-card em { font-style: normal; align-self: flex-start; margin-top: 4px; height: 18px; font-size: 10.5px; }
.help-card--feat { background: linear-gradient(180deg, var(--brand-50), var(--surface)); border-color: var(--brand-100); }
.help-card__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff !important; margin-bottom: 4px; }
.help-cat { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 22px 0 10px; color: var(--text-2); }
.help-article h2 { font-size: 19px; margin: 8px 0 4px; }
.help-article__lead { color: var(--text-3); margin: 0 0 12px; }
.help-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.help-steps li { counter-increment: s; position: relative; padding-left: 34px; line-height: 1.5; font-size: 13.5px; }
.help-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.help-tip { display: flex; gap: 8px; padding: 10px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.help-tip svg { color: #b54708; flex: none; margin-top: 1px; }
.help-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--brand); font: inherit; font-size: 13.5px; cursor: pointer; }
.help-link:hover { background: var(--brand-50); }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 71; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.help-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.help-panel__head b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.help-panel__body { padding: 14px 18px 30px; overflow-y: auto; flex: 1; }
.help-panel__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); margin: 16px 0 6px; }
.tour-box { position: fixed; z-index: 90; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55), 0 0 0 3px var(--brand); pointer-events: none; transition: all .25s ease; }
.tour-tip { position: fixed; z-index: 91; background: var(--surface); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-lg); transition: top .25s, left .25s; }
.tour-tip b { font-size: 15px; } .tour-tip p { margin: 6px 0 12px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.tour-tip__count { font-size: 11px; color: var(--text-4); font-weight: 600; margin-bottom: 4px; }
.tour-tip__btns { display: flex; align-items: center; gap: 6px; }
.checklist { padding: 14px 16px; }
.checklist__bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0 10px; }
.checklist__bar span { display: block; height: 100%; background: var(--success); border-radius: 999px; }
.checklist__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 14px; }
.checklist__item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: inherit; padding: 6px 8px; border-radius: 8px; }
.checklist__item:hover { background: var(--surface-2); color: inherit; }
.checklist__item i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; display: grid; place-items: center; }
.checklist__item.is-done { color: var(--text-3); text-decoration: line-through; }
.checklist__item.is-done i { background: var(--success); border-color: var(--success); color: #fff; }
@media (max-width: 1100px) { .help-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); } .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .help-grid, .help-featured { grid-template-columns: 1fr; } }
.help-hero__search svg { width: 18px; height: 18px; }

/* ===== Phase 6 ===== */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.seg button.is-active { background: var(--brand); color: #fff; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed var(--border-strong); border-radius: 12px; cursor: pointer; text-align: center; color: var(--text-2); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-50); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.quote-items { display: flex; flex-direction: column; gap: 6px; }
.quote-items__head, .quote-items__row { display: grid; grid-template-columns: 1fr 70px 120px 70px 34px; gap: 6px; align-items: start; }
.quote-items__head { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.quote-total { display: flex; gap: 14px; align-items: baseline; font-size: 13px; color: var(--text-2); } .quote-total b { font-size: 17px; color: var(--text); }
.mt-1 { margin-top: 4px; }
@media (max-width: 640px) { .quote-items__head { display: none; } .quote-items__row { grid-template-columns: 1fr 1fr 1fr 34px; } .quote-items__row > div { grid-column: 1 / -1; } }

/* ==========================================================================
   Design v3 — "Dynamic Brand" — all accent colors driven by CSS variables.
   Purple removed. Hero, sidebar, buttons, trace all use --brand variants.
   ========================================================================== */
body { background: var(--bg); font-size: 14px; letter-spacing: -.003em; }
h1, h2, .display { font-family: var(--display); letter-spacing: -.02em; }
h1 { font-size: 24px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 15.5px; font-weight: 700; }
h3 { font-weight: 600; }
::selection { background: var(--brand-100); }

/* Sidebar — Dynamic brand dark by default */
.app, .app[data-sidebar="dark"] {
  --sb-bg: #0a1628; --sb-text: #94b4cc; --sb-strong: #ffffff; --sb-muted: #4d6d88; --sb-border: rgba(255,255,255,.07);
  --sb-hover: rgba(255,255,255,.07); --sb-active: rgba(255,255,255,.11); --sb-accent: var(--brand-200); --sb-scroll: rgba(255,255,255,.16);
}
.app[data-sidebar="light"] { --sb-bg: #ffffff; --sb-text: #3d5368; --sb-strong: var(--text); --sb-muted: var(--text-4); --sb-border: var(--border); --sb-hover: var(--surface-3); --sb-active: var(--brand-50); --sb-accent: var(--brand); --sb-scroll: var(--border-strong); }
.sidebar__brand { height: var(--topbar-h); padding: 0 18px; gap: 11px; }
.sidebar__logo { width: 34px; height: 34px; border-radius: 10px; font-family: var(--display); font-weight: 800; font-size: 14px; background: var(--grad-brand) !important; box-shadow: 0 4px 14px rgba(2,132,199,.4), inset 0 0 0 1px rgba(255,255,255,.18); }
.sidebar__name { font-family: var(--display); font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; line-height: 1.2; }
.sidebar__name small { font-family: var(--font); margin-top: 2px; }
.nav { padding: 6px 12px 18px; }
.nav__section { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 700; padding: 18px 10px 6px; }
.nav__link { position: relative; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; gap: 11px; transition: background .15s, color .15s; }
.nav__link svg { width: 18px; height: 18px; opacity: .75; }
.nav__link.is-active { font-weight: 700; background: var(--brand-50); }
.nav__link.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: var(--sb-accent); }
.nav__link.is-active svg { opacity: 1; color: var(--sb-accent); }
.nav__count { font-weight: 700; }
.nav__count--alert { background: #ef4444; }
.sidebar__foot { padding: 10px 12px; }
.sidebar__foot button { height: 32px; border-radius: 9px; }

/* Topbar */
.topbar { background: rgba(255,255,255,.92); border-bottom-color: var(--border); padding: 0 26px; gap: 14px; backdrop-filter: saturate(200%) blur(12px); }
.gsearch { max-width: 560px; }
.gsearch input { height: 40px; border-radius: 999px; background: var(--surface-2); border-color: transparent; box-shadow: inset 0 0 0 1.5px var(--border); padding-left: 40px; transition: box-shadow .2s, background .2s; }
.gsearch input:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 4px var(--brand-100); }
.gsearch__icon { left: 14px; }
.gsearch__panel { border-radius: var(--radius-xl); }
.content { padding: 28px 30px 52px; }
.page-head { margin-bottom: 22px; align-items: flex-end; }
.page-head p { font-size: 13.5px; margin-top: 4px; color: var(--text-3); }

/* Controls */
.btn { height: 38px; padding: 0 16px; border-radius: var(--radius); border-color: var(--border-strong); font-weight: 600; box-shadow: var(--shadow-xs); transition: all .15s; }
.btn:hover { background: var(--surface-3); border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--grad-brand); border-color: var(--brand); box-shadow: 0 2px 10px rgba(2,132,199,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.btn--primary:hover { background: var(--grad-brand); filter: brightness(0.9); border-color: var(--brand-600); box-shadow: 0 4px 16px rgba(2,132,199,.45); }
.btn--ghost { box-shadow: none; border-color: transparent; }
.btn--ghost:hover { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.btn--sm { height: 32px; padding: 0 11px; border-radius: 9px; }
.btn--icon { width: 38px; padding: 0; }
.btn--sm.btn--icon { width: 32px; }
.input, .select, .textarea { height: 38px; border-radius: var(--radius); border-color: var(--border-strong); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; }
.input--sm, .select--sm { height: 33px; border-radius: 9px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-200); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.field label, .label { font-weight: 600; color: var(--text-2); }

/* Badges */
.badge { height: 24px; padding: 0 10px; border-radius: 999px; font-weight: 600; }
.badge--success { background: var(--success-100); color: var(--success); }
.badge--danger { background: var(--danger-100); color: var(--danger); }
.badge--warning { background: var(--warning-100); color: var(--warning); }
.badge--info { background: var(--info-100); color: var(--info); }
.badge--purple { background: var(--purple-100); color: var(--purple); }
.chip { border-radius: 7px; }

/* Cards */
.card { border-radius: var(--radius-lg); border-color: var(--border); box-shadow: var(--shadow-xs); }
.card__head { padding: 16px 20px; border-bottom-color: var(--border); }
.card__head h2 { font-size: 15px; }
.card__body { padding: 20px; }
.card__foot { border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: 13px 20px; }
.card__head a.small { font-weight: 700; color: var(--brand); }

/* KPIs — individual floating cards with gradient accents */
.grid--kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; background: transparent; border: 0; border-radius: 0; overflow: visible; box-shadow: none; }
.grid--kpi > .card { flex: 1 1 180px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin: 0; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.grid--kpi > .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.grid--kpi > .card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad-brand); }
.kpi { padding: 18px 20px 16px; transition: background .15s; }
a.kpi:hover { background: var(--brand-50); }
.kpi__label { font-size: 11.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi__value { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.04em; margin-top: 8px; line-height: 1; color: var(--text); }
.kpi__value .muted { font-weight: 600; color: var(--text-4); }
.kpi--alert > .kpi > .kpi__value { color: var(--danger); }
.kpi--alert::before { background: var(--grad-warm); }
.biz-strip { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.biz-strip__item b { font-family: var(--display); font-size: 22px; letter-spacing: -.025em; font-weight: 800; }
.industry-kpi { border-radius: var(--radius-lg); }
.industry-kpi__value { font-family: var(--display); letter-spacing: -.025em; font-weight: 800; }
.stat-row { border-bottom-color: var(--border); }

/* Tables */
.table th { background: var(--surface-3); font-weight: 700; font-size: 11.5px; color: var(--text-3); padding: 11px 16px; border-bottom-color: var(--border); text-transform: uppercase; letter-spacing: .04em; }
.table td { padding: 12px 16px; border-bottom-color: var(--border); }
.table tbody tr:hover td { background: var(--brand-50); }
.table tbody tr.is-open td { background: var(--brand-100); }
.table-toolbar { padding: 13px 16px; }
.presets { padding: 13px 16px 0; gap: 6px; }
.preset { height: 32px; border-radius: 999px; font-weight: 600; transition: all .15s; }
.preset.is-active { background: var(--grad-brand); border-color: var(--brand); color: #fff; }
.pager { padding: 12px 16px; }
.lead-link { font-weight: 700; color: var(--brand); }
.lead-link:hover { color: var(--brand-600); text-decoration: underline; }

/* Tabs, menus, drawer, modal */
.tab { font-weight: 550; height: 42px; }
.tab.is-active { font-weight: 650; }
.tab.is-active::after { height: 2.5px; }
.menu { border-radius: 12px; padding: 5px; }
.menu__item { border-radius: 8px; padding: 8px 10px; }
.overlay { background: rgba(13,43,46,.38); }
.drawer { box-shadow: -24px 0 60px -20px rgba(13,43,46,.35); }
.drawer__head { padding: 16px 22px 0; }
.drawer__title h2 { font-size: 20px; }
.drawer__body { padding: 20px 22px 44px; }
.modal { border-radius: 16px; }
.modal__head { padding: 16px 20px; }
.modal__head h2, .modal__head b { font-family: var(--display); }
.modal__body { padding: 20px; }
.modal__foot { padding: 12px 20px; background: var(--surface-2); border-radius: 0 0 16px 16px; }
.toast { background: #0d2b2e; border-radius: 12px; }
.toast--error { background: #7a2618; }
.avatar { background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand-600); font-family: var(--display); font-weight: 700; }
.empty__icon { border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.bar { background: color-mix(in srgb, var(--text) 7%, transparent); }
.timeline::before { background: color-mix(in srgb, var(--border) 80%, transparent); }

/* ---------- Pulse hero (dashboard) — Dynamic Brand version ---------- */
.pulse {
  position: relative; overflow: hidden; border-radius: 22px;
  background: var(--grad-hero);
  color: var(--brand-200); padding: 28px 30px 72px; margin-bottom: -48px; isolation: isolate;
  box-shadow: 0 24px 64px -16px rgba(2,132,199,.3), 0 8px 24px rgba(0,0,0,.14);
}
.pulse::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(rgba(2,132,199,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(2,132,199,.08) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(180deg, transparent 30%, #000 100%);
}
.pulse::after {
  content: ""; position: absolute; top: -60px; right: -60px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(2,132,199,.3) 0%, transparent 70%);
  z-index: -1;
}
.pulse__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; position: relative; }
.pulse h1 { color: #fff; font-size: 30px; letter-spacing: -.04em; text-shadow: 0 2px 20px rgba(2,132,199,.4); }
.pulse__sub { margin-top: 6px; font-size: 13.5px; color: var(--brand-200); }
.pulse__stat { display: flex; align-items: baseline; gap: 12px; margin-top: 20px; position: relative; }
.pulse__stat b { font-family: var(--display); font-size: 48px; font-weight: 800; color: #fff; letter-spacing: -.05em; line-height: 1; text-shadow: 0 0 30px rgba(2,132,199,.5); }
.pulse__stat span { font-size: 13.5px; color: var(--brand-200); max-width: 460px; }
.pulse__trace { position: absolute; left: 0; right: 0; bottom: 40px; height: 120px; z-index: -1; pointer-events: none; }
.pulse__trace svg { width: 100%; height: 100%; display: block; }
.pulse__trace polyline { fill: none; stroke: var(--brand-200); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 8px rgba(2,132,199,.8)); stroke-dasharray: 1; stroke-dashoffset: 1; animation: trace 1.8s .2s ease-out forwards; }
.pulse__trace .pulse__area { fill: url(#pulseFill); stroke: none; filter: none; animation: none; }
.pulse__beat { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--brand-200); box-shadow: 0 0 0 0 rgba(2,132,199,.6); animation: livepulse 2s 1.8s infinite; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.pulse .select { background-color: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.18); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23bae6fd' stroke-width='2'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E"); backdrop-filter: blur(8px); }
.pulse .select option { color: var(--text); }
.pulse .btn--primary { background: var(--brand); border-color: var(--brand-600); color: #fff; box-shadow: 0 4px 16px rgba(2,132,199,.5); }
.pulse .btn--primary:hover { background: var(--brand-600); border-color: var(--brand-700); box-shadow: 0 6px 20px rgba(2,132,199,.6); }
.pulse + .grid--kpi { position: relative; margin: 0 20px; }
@media (prefers-reduced-motion: reduce) { .pulse__trace polyline { animation: none; stroke-dashoffset: 0; } .pulse__beat, .live-dot { animation: none; } }

/* Auth screen */
.auth__side { background: var(--grad-hero); position: relative; overflow: hidden; }
.auth__side::before { content: ""; position: absolute; top: -80px; right: -80px; width: 320px; height: 320px; background: radial-gradient(circle, rgba(2,132,199,.3) 0%, transparent 70%); }
.auth__side h2 { font-family: var(--display); font-size: 32px; letter-spacing: -.04em; color: #fff; }
.auth__trace { position: absolute; left: 0; right: 0; bottom: 22%; height: 120px; opacity: .9; pointer-events: none; }
.auth__trace polyline { fill: none; stroke: var(--brand-200); stroke-width: 2.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 8px rgba(2,132,199,.7)); }
.auth__card h1 { font-size: 28px; letter-spacing: -.03em; }

@media (max-width: 1024px) { .nav__link.is-active::before { left: -12px; } }
@media (max-width: 760px) {
  .content { padding: 16px 12px 92px; }
  .pulse { padding: 18px 16px 56px; border-radius: 14px; }
  .pulse h1 { font-size: 22px; }
  .pulse__stat b { font-size: 32px; }
  .pulse + .grid--kpi { margin: 0 8px; }
  .grid--kpi > .card { flex-basis: 45%; }
  .kpi__value { font-size: 23px; }
}
