/* app.css — Reachant "Midnight" design system (dark + light).
   Ported from the Claude Design handoff (app-styles + app-screens + app-screens2).
   Server-rendered reskin: same class names as the prototype for fidelity. */

/* ---------- Tokens ---------- */
:root {
  --r: 12px; --r-sm: 8px; --r-lg: 18px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
  --side-w: 248px;
}

[data-mode="dark"] {
  --bg: #15120e; --surface: #1d1813; --surface-2: #262019; --surface-3: #2f2820;
  --ink: #ede5d6; --ink-2: #a59a89; --ink-3: #6f6657;
  --line: rgba(237,229,214,0.11); --line-2: rgba(237,229,214,0.06);
  --accent: #cdeb5a; --accent-2: #d9f06f; --accent-ink: #1a1710; --accent-soft: rgba(205,235,90,0.13);
  --accent-text: var(--accent); --accent-edge: transparent;
  --ok: #8fd86a; --ok-soft: rgba(143,216,106,0.14);
  --warn: #e8b04a; --info: #6fb0e8;
  --shadow: 0 24px 60px -36px rgba(0,0,0,0.8);
}
[data-mode="light"] {
  --bg: #f3efe6; --surface: #fffdf8; --surface-2: #f7f2e8; --surface-3: #ede6d8;
  --ink: #1f1b14; --ink-2: #6c6354; --ink-3: #9a917f;
  --line: rgba(31,27,20,0.12); --line-2: rgba(31,27,20,0.06);
  --accent: #c2e24a; --accent-2: #b3d63a; --accent-ink: #1f2606; --accent-soft: rgba(154,184,40,0.16);
  --accent-text: color-mix(in oklab, var(--accent) 58%, #1f2806); --accent-edge: color-mix(in oklab, var(--accent) 52%, #1c2405);
  --ok: #4f9a3e; --ok-soft: rgba(79,154,62,0.14);
  --warn: #b6791a; --info: #2f74b0;
  --shadow: 0 24px 60px -40px rgba(40,30,15,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.006em;
  overflow: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
button { font-family: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; flex: none; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ---------- Brand symbol swap ---------- */
.brand-symbol{height:26px;width:auto;vertical-align:middle;flex:none}
.brand-symbol.is-light{display:none}
[data-mode="light"] .brand-symbol.is-dark{display:none}
[data-mode="light"] .brand-symbol.is-light{display:inline-block}
.brand-word{font-family:var(--font-display);font-weight:600;font-size:inherit;letter-spacing:-0.02em}

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; }

/* Sidebar */
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; }
.side-logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.04em; padding: 8px 10px 18px; }
.side-logo .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.side-logo b { font-weight: 600; }
.side-logo .lt { color: var(--ink-2); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; font-size: 14.5px; transition: color .15s; border: none; background: transparent; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--ink); }
.nav-item.active svg { color: var(--accent-text); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .badge { margin-left: auto; font-family: var(--font-mono); font-size: 11px; background: var(--surface-3); color: var(--ink-2); padding: 1px 7px; border-radius: 100px; }
.side-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.side-foot { margin-top: auto; }
.credits-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.credits-card .lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.credits-card .val { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin-top: 4px; }
.credits-card .val span { font-size: 14px; color: var(--ink-3); }
.cbar { height: 5px; border-radius: 100px; background: var(--surface-3); margin: 10px 0 6px; overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--accent); border-radius: 100px; }
.credits-card .sub { font-size: 12px; color: var(--ink-2); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; }
.user-row .ava { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; font-family: var(--font-display); }
[data-mode="light"] .user-row .ava { color: var(--accent-ink); background: var(--accent); }
.user-row .nm { font-size: 13.5px; font-weight: 600; line-height: 1.1; }
.user-row .em { font-size: 11.5px; color: var(--ink-3); }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: 64px; flex: none; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px); position: relative; z-index: 40; }
.topbar h1 { font-size: 19px; }
.topbar .crumb { color: var(--ink-3); font-size: 13px; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.topbar .spacer { flex: 1; }
.search-mini { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px; padding: 8px 14px; color: var(--ink-3); font-size: 13px; width: 220px; }
.search-mini svg { width: 16px; height: 16px; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.lang-tgl { display: inline-flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; font-family: var(--font-mono); font-size: 12px; }
.lang-tgl button, .lang-tgl a { border: none; background: transparent; color: var(--ink-3); padding: 8px 12px; cursor: pointer; font-family: inherit; letter-spacing: 0.05em; transition: color .15s; display: inline-block; }
.lang-tgl button:hover, .lang-tgl a:hover { color: var(--ink); }
.lang-tgl button:first-child, .lang-tgl a:first-child { border-radius: 100px 0 0 100px; }
.lang-tgl button:last-child, .lang-tgl a:last-child { border-radius: 0 100px 100px 0; }
.lang-tgl button.on, .lang-tgl a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
[data-mode="light"] .lang-tgl button.on, [data-mode="light"] .lang-tgl a.on { box-shadow: inset 0 0 0 1px var(--accent-edge); }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
[data-mode="dark"] .ic-moon { display: none; }
[data-mode="light"] .ic-sun { display: none; }
.scroll { flex: 1; overflow-y: auto; }
.page { padding: 32px 28px 64px; max-width: 1160px; margin: 0 auto; width: 100%; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid transparent; transition: filter .15s, background .15s, border-color .15s, transform .12s; white-space: nowrap; letter-spacing: -0.01em; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Generic cards / chips ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 100px; background: var(--surface-2); color: var(--ink-2); letter-spacing: 0.03em; border: 1px solid var(--line); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: rgba(232,176,74,0.16); color: var(--warn); border-color: transparent; }
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.flag { font-size: 13px; }

/* flash alerts */
.flashes { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: 90vw; }
.alert { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 11px 18px; border-radius: var(--r-sm); font-size: 13.5px; box-shadow: var(--shadow); }
.alert-error { border-color: color-mix(in srgb, #e0795a 50%, var(--line)); color: #e0795a; }
.alert-success { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }

/* fade-in entrance: base visible, transform-only so it never hides content */
.fade { }
@media (prefers-reduced-motion: no-preference) { .fade { animation: fadeUp .5s ease both; } }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0.5; } }

/* ============================================================
   SCREEN-SPECIFIC
   ============================================================ */

/* ---------- Dashboard ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h2 { font-size: 30px; letter-spacing: -0.03em; }
.page-head p { color: var(--ink-2); margin-top: 6px; font-size: 14.5px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stat .lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.stat .lbl svg { width: 14px; height: 14px; color: var(--accent-text); }
.stat .num { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin-top: 10px; letter-spacing: -0.03em; }
.stat .delta { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.stat .delta b { color: var(--ok); }

.cta-banner { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-lg); padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; position: relative; overflow: hidden; }
.cta-banner h3 { font-size: 24px; letter-spacing: -0.03em; }
.cta-banner p { font-size: 14.5px; opacity: 0.8; margin-top: 4px; max-width: 46ch; }
.cta-banner .btn { background: var(--accent-ink); color: var(--accent); }
.cta-banner .ghost-arrow { width: 200px; height: 200px; border-radius: 50%; border: 28px solid color-mix(in srgb, var(--accent-ink) 12%, transparent); position: absolute; right: -60px; top: -60px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.section-title h3 { font-size: 17px; }
.section-title a { font-size: 13px; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.section-title a:hover { color: var(--accent-text); }

/* recent searches list */
.rs-list { display: flex; flex-direction: column; }
.rs-row { display: grid; grid-template-columns: 1.6fr 1fr 0.8fr 0.8fr auto; gap: 16px; align-items: center; padding: 15px 18px; border: 1px solid var(--line); border-top: none; background: var(--surface); transition: background .15s; }
.rs-row:first-child { border-top: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.rs-row:last-child { border-radius: 0 0 var(--r) var(--r); }
.rs-row:hover { background: var(--surface-2); }
.rs-row .q { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rs-row .q > div { min-width: 0; }
.rs-row .q .ic { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.rs-row .q .ic svg { width: 17px; height: 17px; }
.rs-row:hover .q .ic { background: var(--accent-soft); color: var(--accent-text); }
.rs-row .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row .meta { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }
.rs-row .cell-lbl { display: none; }
.rs-row .val { font-size: 13.5px; }
.rs-row .val small { color: var(--ink-3); display: block; font-size: 11px; font-family: var(--font-mono); margin-top: 1px; }

.empty-state { padding: 40px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: var(--r); }
.empty-state p { margin-bottom: 16px; }

/* ---------- New search ---------- */
.search-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .search-grid { grid-template-columns: 1fr; } }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.field { margin-bottom: 24px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field .hint { color: var(--ink-3); font-size: 12.5px; margin-bottom: 12px; }

.combo { position: relative; }
.combo-input { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; cursor: text; }
.combo-input svg { width: 17px; height: 17px; color: var(--ink-3); }
.combo-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 14.5px; }
.combo-input input::placeholder { color: var(--ink-3); }
.combo-input .chev { transform: rotate(90deg); color: var(--ink-3); margin-left: auto; }
.combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); z-index: 30; max-height: 260px; overflow-y: auto; padding: 6px; }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 7px; font-size: 14px; cursor: pointer; }
.combo-opt:hover, .combo-opt.hl { background: var(--surface-2); }
.combo-opt .c { color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; margin-left: auto; }

/* selected segment chips (multi-select) */
.seg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--accent-soft); color: var(--ink); border: 1px solid transparent; padding: 6px 8px 6px 12px; border-radius: 100px; font-size: 13px; font-weight: 500; }
[data-mode="light"] .seg-chip { border-color: var(--accent-edge); }
.seg-chip button { border: none; background: transparent; color: var(--ink-2); display: grid; place-items: center; padding: 0; line-height: 1; }
.seg-chip button:hover { color: var(--ink); }
.seg-chip button svg { width: 14px; height: 14px; }

.seg-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.seg-toggle button { border: none; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 6px; display: flex; align-items: center; gap: 8px; transition: color .15s; white-space: nowrap; }
.seg-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
[data-mode="dark"] .seg-toggle button.on { background: var(--surface-3); }

.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); padding: 8px 14px; border-radius: 100px; font-size: 13.5px; font-weight: 500; transition: color .15s, border-color .15s; white-space: nowrap; }
.pick:hover { border-color: var(--ink-3); color: var(--ink); }
.pick.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

/* location inputs (real city/state/zip) */
.loc-grid { display: grid; grid-template-columns: 1.4fr 0.7fr 1fr; gap: 12px; }
@media (max-width: 560px) { .loc-grid { grid-template-columns: 1fr; } }
.txt-input { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; transition: border-color .15s; }
.txt-input:focus-within { border-color: var(--accent); }
.txt-input svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.txt-input input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--ink); font-size: 14.5px; }
.txt-input input::placeholder { color: var(--ink-3); }
.field-sub-lbl { font-size: 11px; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }

.qty-row { display: flex; align-items: center; gap: 18px; }
.qty-val { font-family: var(--font-display); font-size: 34px; font-weight: 600; min-width: 90px; letter-spacing: -0.03em; }
.range { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 100px; background: var(--surface-3); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: pointer; }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: pointer; }

/* estimate panel */
.estimate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; position: sticky; top: 0; }
.estimate h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.est-rows { margin: 16px 0; display: flex; flex-direction: column; gap: 11px; }
.est-rows .r { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.est-rows .r .k { color: var(--ink-2); white-space: nowrap; }
.est-rows .r .v { font-family: var(--font-mono); white-space: nowrap; }
.est-total { border-top: 1px dashed var(--line); padding-top: 16px; display: flex; align-items: baseline; justify-content: space-between; }
.est-total .lbl { font-size: 13px; color: var(--ink-2); }
.est-total .amt { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; white-space: nowrap; }
.est-note { font-size: 12px; color: var(--ink-3); margin-top: 12px; display: flex; gap: 8px; line-height: 1.4; }
.est-note svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--accent-text); }
.estimate .btn { width: 100%; justify-content: center; margin-top: 16px; padding: 13px; }

/* ---------- Running ---------- */
.run-wrap { max-width: 600px; margin: 40px auto; text-align: center; }
.run-orb { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 26px; background: var(--accent-soft); display: grid; place-items: center; position: relative; }
.run-orb::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; }
@media (prefers-reduced-motion: no-preference) { .run-orb::after { animation: spin 1s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.run-orb svg { width: 36px; height: 36px; color: var(--accent-text); }
.run-wrap h2 { font-size: 26px; }
.run-wrap .sub { color: var(--ink-2); margin-top: 8px; }
.run-bar { height: 8px; border-radius: 100px; background: var(--surface-3); margin: 28px 0 8px; overflow: hidden; }
.run-bar i { display: block; height: 100%; background: var(--accent); border-radius: 100px; transition: width .4s ease; }
.run-pct { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.run-steps { margin-top: 30px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.run-step { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-3); }
.run-step.done { color: var(--ink); }
.run-step.active { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.run-step .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.run-step.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.run-step.active .tick { border-color: var(--accent-text); }
.run-step .tick svg { width: 12px; height: 12px; }
.run-step .cnt { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* ---------- Leads list ---------- */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.list-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 13px; }
.list-search input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 14px; }
.list-search svg { width: 16px; height: 16px; color: var(--ink-3); }
.filter-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.filter-btn:hover { color: var(--ink); }
.filter-btn.on { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }

.lead-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.lt-head, .lt-row { display: grid; grid-template-columns: 26px 2.1fr 1.7fr 1fr 1.1fr 30px; gap: 14px; align-items: center; padding: 13px 18px; }
.lt-head { border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.lt-row { border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.lt-row:last-child { border-bottom: none; }
.lt-row:hover { background: var(--surface-2); }
.lt-check { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line); display: grid; place-items: center; }
.lt-check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lt-check svg { width: 11px; height: 11px; }
.lt-co { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lt-co .ava { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; font-family: var(--font-display); flex: none; }
[data-mode="light"] .lt-co .ava { color: var(--accent-ink); background: var(--accent); }
.lt-co .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-co .sub { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); white-space: nowrap; }
.lt-star { display: inline-flex; align-items: center; vertical-align: middle; color: var(--warn); }
.lt-star svg { width: 11px; height: 11px; }
.dr-rating { display: inline-flex; align-items: center; gap: 4px; }
.dr-rating .lt-star svg { width: 13px; height: 13px; }
.lt-dm .nm { font-weight: 600; font-size: 13.5px; }
.lt-dm .role { font-size: 11.5px; color: var(--ink-2); }
.lt-dm .none { color: var(--ink-3); font-size: 13px; }
.lt-loc { font-size: 13px; }
.lt-loc .flag { margin-right: 5px; }
.lt-ch { display: flex; gap: 5px; }
.lt-ch i { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.lt-ch i svg { width: 13px; height: 13px; }
.lt-arrow { color: var(--ink-3); display: grid; place-items: center; }
.lt-row:hover .lt-arrow { color: var(--accent-text); }
.list-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px 0; font-size: 13px; color: var(--ink-2); }

/* sticky select-bar */
.selbar { position: sticky; bottom: 16px; margin: 18px auto 0; background: var(--ink); color: var(--bg); border-radius: 100px; padding: 10px 12px 10px 20px; display: flex; align-items: center; gap: 16px; width: fit-content; box-shadow: var(--shadow); }
[data-mode="dark"] .selbar { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); }
.selbar .n { font-weight: 600; font-size: 14px; }
.selbar .btn { padding: 8px 14px; }

/* ---------- Lead drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 50; }
@media (prefers-reduced-motion: no-preference) { .drawer-scrim { animation: fade .2s ease; } }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw; background: var(--bg); border-left: 1px solid var(--line); z-index: 51; display: flex; flex-direction: column; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slideIn .28s cubic-bezier(.2,.7,.2,1); } }
@keyframes slideIn { from { transform: translateX(40px); } }
.dr-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.dr-head .ava { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 17px; font-family: var(--font-display); flex: none; }
[data-mode="light"] .dr-head .ava { color: var(--accent-ink); background: var(--accent); }
.dr-head h3 { font-size: 20px; }
.dr-head .meta { font-size: 13px; color: var(--ink-2); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dr-head .close { margin-left: auto; }
.dr-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 24px 28px; }
.dr-sec { padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.dr-sec:last-child { border-bottom: none; }
.dr-sec .st { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-sec .st .badge { margin-left: auto; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; }
.kv dt { font-size: 13px; color: var(--ink-2); }
.kv dd { font-size: 13.5px; font-weight: 500; word-break: break-word; }
.kv dd a { color: var(--info); }
.kv dd.mono { font-family: var(--font-mono); font-size: 12.5px; }
.dm-card { display: flex; gap: 13px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; }
.dm-card .ava { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); flex: none; }
.dm-card > div { flex: 1; min-width: 0; }
.dm-card .nm { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-card .role { font-size: 12.5px; color: var(--ink-2); }
.dm-card .in-link { margin-left: auto; color: var(--info); }
.social-row { display: flex; gap: 8px; flex-wrap: wrap; }
.social-row a { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); transition: all .15s; }
.social-row a:hover { color: var(--accent-text); border-color: var(--accent-text); }
.social-row a svg { width: 17px; height: 17px; }
.dr-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.dr-foot .btn { flex: 1; justify-content: center; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 13px 20px; border-radius: 100px; font-size: 14px; font-weight: 500; z-index: 80; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
[data-mode="dark"] .toast { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); }
.toast svg { width: 17px; height: 17px; color: var(--ok); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toastIn .3s cubic-bezier(.2,.7,.2,1); } }
@keyframes toastIn { from { transform: translate(-50%, 16px); } }

/* ---------- Light-mode accent edge: a subtle darker ring on every lime fill ---------- */
[data-mode="light"] .btn-primary { border-color: var(--accent-edge); }
[data-mode="light"] .pick.on { border-color: var(--accent-edge); }
[data-mode="light"] .lt-check.on { border-color: var(--accent-edge); }
[data-mode="light"] .filter-btn.on { border-color: var(--accent-edge); }
[data-mode="light"] .chip.accent { border-color: var(--accent-edge); }
[data-mode="light"] .cta-banner,
[data-mode="light"] .lt-co .ava,
[data-mode="light"] .dr-head .ava,
[data-mode="light"] .user-row .ava,
[data-mode="light"] .run-orb { box-shadow: inset 0 0 0 1px var(--accent-edge); }
[data-mode="light"] .cbar i,
[data-mode="light"] .run-bar i { box-shadow: inset 0 0 0 1px var(--accent-edge); }
[data-mode="light"] .range::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent-edge), 0 2px 6px rgba(40,30,15,0.25); }
[data-mode="light"] .range::-moz-range-thumb { box-shadow: 0 0 0 1px var(--accent-edge); }

/* ============================================================
   AUTH / MY LISTS / SETTINGS
   ============================================================ */

/* ---------- Auth ---------- */
.auth { height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-brand { display: none; } }
.auth-brand { position: relative; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
[data-mode="dark"] .auth-brand { background: linear-gradient(165deg, var(--surface-2), var(--bg)); }
.auth-brand .logo { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.04em; display: flex; align-items: center; gap: 9px; position: relative; z-index: 2; }
.auth-brand .logo .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.auth-brand-mid { position: relative; z-index: 2; }
.auth-brand-mid h2 { font-size: clamp(28px, 3vw, 42px); max-width: 14ch; letter-spacing: -0.03em; line-height: 1.05; }
.auth-brand-mid p { color: var(--ink-2); margin-top: 18px; max-width: 38ch; font-size: 16px; }
.auth-brand-foot { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.auth-glow { position: absolute; width: 520px; height: 520px; right: -180px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }

.auth-form-wrap { position: relative; display: grid; place-items: center; padding: 32px; overflow-y: auto; }
.auth-tools { position: absolute; top: 24px; right: 28px; display: flex; gap: 10px; align-items: center; }
.auth-card { width: 100%; max-width: 384px; }
.auth-card h1 { font-size: 28px; }
.auth-sub { color: var(--ink-2); margin: 6px 0 26px; }
.auth-google { width: 100%; justify-content: center; }
.auth-or { text-align: center; margin: 18px 0; position: relative; color: var(--ink-3); font-size: 12px; }
.auth-or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.auth-or span { background: var(--bg); padding: 0 12px; position: relative; }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.auth-input { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; transition: border-color .15s; }
.auth-input:focus-within { border-color: var(--accent); }
.auth-input svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.auth-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 14.5px; min-width: 0; }
.auth-forgot { display: inline-block; font-size: 13px; color: var(--accent-text); margin-bottom: 18px; }
.auth-submit { width: 100%; justify-content: center; padding: 13px; }
.auth-terms { font-size: 11.5px; color: var(--ink-3); margin-top: 14px; line-height: 1.45; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--ink-2); }
.auth-switch a { color: var(--accent-text); font-weight: 600; }
.auth-verify-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 18px; }
.auth-verify-ic svg { width: 26px; height: 26px; color: var(--accent-text); }
.code-row { display: flex; gap: 10px; margin: 22px 0; }
.code-box { width: 100%; aspect-ratio: 1; text-align: center; font-family: var(--font-display); font-size: 24px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); outline: none; transition: border-color .15s; }
.code-box:focus { border-color: var(--accent); }
.auth-verify-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; }
.auth-verify-foot a { color: var(--accent-text); cursor: pointer; }
.auth-dev-note { margin-top: 16px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 9px 12px; }
.auth-dev-note b { color: var(--accent-text); }

/* sidebar logout */
.user-logout { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; flex: none; transition: all .15s; }
.user-logout:hover { background: var(--surface-2); color: var(--ink); }
.user-logout svg { width: 16px; height: 16px; }

/* ---------- My lists ---------- */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; transition: border-color .15s; }
.list-card:hover { border-color: var(--ink-3); }
.lc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lc-ava { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); }
[data-mode="light"] .lc-ava { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.lc-title { font-size: 17px; }
.lc-loc { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.lc-stats { display: flex; gap: 24px; margin: 16px 0; padding: 14px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.lc-stats b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.lc-stats span { display: block; font-size: 11.5px; color: var(--ink-3); }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lc-foot .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.lc-actions { display: flex; gap: 6px; }
.lc-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 7px 11px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.lc-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.lc-btn svg { width: 14px; height: 14px; }
.lc-btn.danger:hover { color: #e0795a; border-color: #e0795a; }

/* ---------- Settings ---------- */
.set-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 820px) { .set-grid { grid-template-columns: 1fr; } }
.set-tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; }
@media (max-width: 820px) { .set-tabs { flex-direction: row; flex-wrap: wrap; position: static; } }
.set-tab { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--r-sm); border: none; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; cursor: pointer; text-align: left; transition: color .15s; }
.set-tab:hover { background: var(--surface-2); color: var(--ink); }
.set-tab.on { background: var(--accent-soft); color: var(--ink); }
.set-tab.on svg { color: var(--accent-text); }
.set-tab svg { width: 17px; height: 17px; }
.set-panel { min-width: 0; }
.set-h { font-size: 15px; margin: 28px 0 14px; }
.set-hint { color: var(--ink-2); font-size: 13px; }
.set-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }

.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.plan-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.plan-price { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-top: 12px; }
.plan-renews { color: var(--ink-3); font-size: 13px; }
.plan-credits { min-width: 220px; flex: 1; max-width: 300px; }
.pc-lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pc-val { font-size: 15px; margin: 6px 0 8px; }
.pc-val span { color: var(--ink-3); }
.plan-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.stripe-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.stripe-note svg { width: 13px; height: 13px; }
.inv-table { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.inv-head, .inv-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 40px; gap: 12px; align-items: center; padding: 13px 16px; }
.inv-head { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.inv-row { border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.inv-row:last-child { border-bottom: none; }

.team-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.team-row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.team-row:last-child { border-bottom: none; }
.team-row.pending { opacity: .65; }
.team-ava { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); font-size: 13px; flex: none; }
.team-info { flex: 1; min-width: 0; }
.team-info .nm { font-weight: 600; font-size: 14px; }
.you-tag { color: var(--ink-3); font-weight: 400; }
.team-info .em { font-size: 12.5px; color: var(--ink-3); }
.role-chip { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 100px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.role-chip.admin { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

.intg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.intg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.intg-top { display: flex; align-items: center; justify-content: space-between; }
.intg-ava { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.intg-nm { font-weight: 600; font-size: 15px; }
.intg-desc { font-size: 12.5px; color: var(--ink-2); flex: 1; line-height: 1.4; }
.intg-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

.acc-form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.acc-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .acc-2col { grid-template-columns: 1fr; } }
.acc-lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.acc-form .seg-toggle { display: flex; width: 100%; }
.acc-form .seg-toggle button { flex: 1; justify-content: center; }
.acc-form .seg-toggle a { flex: 1; justify-content: center; display: flex; align-items: center; border: none; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 6px; }
.acc-form .seg-toggle a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
[data-mode="dark"] .acc-form .seg-toggle a.on { background: var(--surface-3); }
.danger-zone { margin-top: 32px; padding: 18px; border: 1px solid color-mix(in srgb, #e0795a 38%, var(--line)); border-radius: var(--r); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dz-t { font-weight: 600; font-size: 14px; color: #e0795a; }
.danger-btn { color: #e0795a; border-color: color-mix(in srgb, #e0795a 38%, var(--line)); }
.danger-btn:hover { background: color-mix(in srgb, #e0795a 12%, transparent); }

/* "em breve" badge on integration cards */
.soon-chip { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; padding: 3px 8px; border-radius: 100px; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

/* ---------- Admin (superadmin console) — Midnight idiom ---------- */
.admin-sec { margin-bottom: 30px; }
.admin-sec > h3 { font-size: 17px; margin-bottom: 14px; }
.admin-filters { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.admin-select, .admin-input { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; color: var(--ink); font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s; }
.admin-select:focus, .admin-input:focus { border-color: var(--accent); }

.admin-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table thead th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table tbody td, .admin-table tbody th { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tbody tr:last-child td, .admin-table tbody tr:last-child th { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table tbody th { text-align: left; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.admin-table a { color: var(--accent-text); font-weight: 600; }
.admin-table a:hover { text-decoration: underline; }
.admin-table.kv-table tbody tr:hover { background: transparent; }
.admin-num { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }

.admin-badge { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 100px; letter-spacing: 0.03em; white-space: nowrap; }
.admin-badge.ok { background: var(--ok-soft); color: var(--ok); }
.admin-badge.danger { background: rgba(224,121,90,0.16); color: #e0795a; }
.admin-badge.muted { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.admin-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.admin-action-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.admin-action-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.admin-action-form .admin-input { width: 90px; }
.btn-danger { background: transparent; border: 1px solid color-mix(in srgb, #e0795a 38%, var(--line)); color: #e0795a; }
.btn-danger:hover { background: color-mix(in srgb, #e0795a 12%, transparent); }

.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 30px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.metric-card .mc-lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.metric-card .mc-val { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-top: 8px; letter-spacing: -0.03em; }

.admin-pagination { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-size: 13px; color: var(--ink-2); font-family: var(--font-mono); }

/* --- Topbar quick-search + notifications --- */
.search-mini { position: relative; }
.search-mini input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--ink); font-size: 13px; font-family: inherit; padding: 0; }
.search-mini input::placeholder { color: var(--ink-3); }
.qs-results, .notif-panel { position: absolute; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 12px 32px rgba(0,0,0,.28); z-index: 60; }
.qs-results { left: 0; width: 300px; max-height: 360px; overflow-y: auto; padding: 6px; }
.qs-group { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 8px 10px 4px; }
.qs-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-item:hover { background: var(--surface-2); }
.qs-empty { padding: 14px 12px; color: var(--ink-3); font-size: 13px; text-align: center; }
.notif-wrap { position: relative; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.notif-panel { right: 0; width: 320px; max-height: 380px; overflow-y: auto; padding: 6px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.notif-item:hover { background: var(--surface-2); }
.notif-stat { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.notif-stat.ok { background: var(--accent); }
.notif-stat.warn { background: var(--warn); }
.notif-stat.alert { background: #e0533d; }
.notif-body { display: flex; flex-direction: column; min-width: 0; }
.notif-cat { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-meta { font-size: 12px; color: var(--ink-3); }

/* Invoice list (settings → plano) */
.inv-list{display:flex;flex-direction:column;gap:2px}
.inv-row{display:grid;grid-template-columns:1fr auto auto auto;gap:14px;align-items:center;padding:10px 12px;border:1px solid var(--line,#2a2a3a);border-radius:10px;font-size:14px}
.inv-row+.inv-row{margin-top:6px}
.inv-date{color:var(--ink,#e8e8f0)}
.inv-amt{font-variant-numeric:tabular-nums;font-weight:600}
.inv-status{text-transform:capitalize;color:var(--muted,#8a8aa0);font-size:12px}
.inv-status.ok{color:#3ddc84}
.inv-dl a{color:var(--accent,#c6f432);text-decoration:none;font-size:13px}
.inv-dl a:hover{text-decoration:underline}

/* ===================================================================
   Mobile shell — collapse sidebar into a bottom nav (≤768px)
   =================================================================== */
.bottom-nav { display: none; }
.topbar-acct { display: none; }

@media (max-width: 768px) {
  /* Single column: sidebar out, bottom nav in. 100dvh tracks the iOS Safari
     toolbar so the layout matches the visible viewport. */
  .app { grid-template-columns: 1fr; height: 100dvh; }
  .side { display: none; }

  /* Tighter topbar: drop title block + lang toggle, give search the room */
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar > div:first-child { display: none; }   /* crumb + h1 */
  .topbar .spacer { display: none; }
  .lang-tgl { display: none; }
  .search-mini { width: auto; flex: 1; min-width: 0; }

  /* Mobile account/logout in the topbar */
  .topbar-acct {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    color: var(--ink-3); text-decoration: none;
  }
  .topbar-acct .ava {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: grid; place-items: center; font-weight: 700; font-size: 12px;
    font-family: var(--font-display);
  }
  [data-mode="light"] .topbar-acct .ava { color: var(--accent-ink); background: var(--accent); }
  .topbar-acct svg { width: 18px; height: 18px; }

  /* Clear the fixed bottom nav (nav height + iOS home indicator) at the end
     of scrollable content, so the last items are never hidden behind it. */
  .scroll { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .page { padding: 20px 16px 0; }

  /* Fixed bottom navigation */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
  }
  .bn-item {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border-radius: 12px;
    color: var(--ink-3); text-decoration: none;
    font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .bn-item svg { width: 22px; height: 22px; flex: none; }
  .bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .bn-item.active { color: var(--accent); }
  [data-mode="light"] .bn-item.active { color: var(--accent-ink); }
}

/* ===================================================================
   Mobile auth (≤900px) — placed AFTER the base .auth-brand rule so it
   actually wins by source order (the earlier in-block display:none was
   overridden by the later `.auth-brand{display:flex}` base rule).
   =================================================================== */
@media (max-width: 900px) {
  .auth { height: 100dvh; grid-template-columns: 1fr; }
  .auth-brand { display: none !important; }
  /* The form column is the scroll container (body is overflow:hidden). Top-align
     so a tall form (signup) isn't clipped/uncentred; pad for the absolute tools. */
  .auth-form-wrap {
    place-items: start center;
    padding: 72px 20px 48px;
    overflow-y: auto;
  }
}

/* ===================================================================
   Mobile polish — leads list as cards + settings tabs as a pill strip
   =================================================================== */
@media (max-width: 768px) {
  /* Leads list: the 6-column grid overlaps on phones — restack as a card
     (checkbox | stacked content | chevron). */
  .lt-head { display: none; }
  .lt-row {
    grid-template-columns: 22px 1fr 18px;
    column-gap: 12px; row-gap: 7px;
    align-items: start; padding: 14px 16px;
  }
  .lt-row > .lt-check { grid-column: 1; grid-row: 1 / -1; align-self: start; margin-top: 3px; }
  .lt-row > .lt-arrow { grid-column: 3; grid-row: 1 / -1; align-self: center; }
  .lt-co, .lt-dm, .lt-loc, .lt-ch { grid-column: 2; min-width: 0; }
  .lt-co .nm  { white-space: normal; }
  .lt-co .sub { white-space: normal; }
  .lt-dm:empty { display: none; }
  .lt-loc { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
  .lt-ch { justify-content: flex-start; }
}

@media (max-width: 820px) {
  /* Settings tabs: horizontal scrollable pill strip instead of an uneven wrap */
  .set-tabs {
    flex-direction: row; flex-wrap: nowrap; position: static;
    gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 0 -16px 4px; padding: 2px 16px 8px;
    scrollbar-width: none;
  }
  .set-tabs::-webkit-scrollbar { display: none; }
  .set-tab {
    flex: 0 0 auto; white-space: nowrap;
    border: 1px solid var(--line); border-radius: 100px; padding: 9px 15px;
  }
  .set-tab.on { border-color: transparent; }
}

/* Password reveal toggle — injected by app.js into every .auth-input password field */
.pw-toggle { background: none; border: 0; padding: 0; margin: 0 0 0 4px; flex: none;
  display: inline-flex; align-items: center; cursor: pointer; color: var(--ink-3); transition: color .15s; }
.pw-toggle:hover { color: var(--ink); }
.pw-toggle svg { width: 17px; height: 17px; color: inherit; }
