/* LeadFlow styles — "Deep teal" theme (Dec 2026).
   Frame: one rounded deep-teal shell; the sidebar sits on the shell and the page content sits in an
   inset mint-white canvas with white cards (no shadows, separation by contrast).
   Palette: teal-green family for brand + surfaces, bright green for positive data, orange for highlight data,
   muted red only for "down". Greys carry a slight green tint. Light and dark themes come from the variables below. */

:root {
  /* brand shell */
  --frame: #0a3b3f;
  --frame-2: #154245;
  --frame-ink: #e4efec;
  --frame-muted: #8fb0aa;
  --deep: #0b1e22;
  /* surfaces */
  --bg: #e3e9e7;
  --panel: #f3f7f6;
  --side: transparent;
  --card: #ffffff;
  --soft: #eef4f2;
  --soft2: #e2ebe8;
  --line: #e1e9e6;
  --ink: #1a2127;
  --muted: #5e716b;
  --pill: #1a2127;
  --pill-ink: #ffffff;
  /* accents */
  --accent: #0a6752;
  --accent-soft: #e2f3ec;
  --lime: #42d678;
  --mint: #68b888;
  --orange: #d86a35;
  --peach: #f6dccd;
  --sky: #ffffff;
  --fog: #ffffff;
  --good: #17804a;
  --good-soft: #e1f5ea;
  --warn: #c2680f;
  --bad: #b5414e;
  --hot-bg: #fbe8e0; --hot-ink: #b04a1c;
  --won-bg: #e1f5ea; --won-ink: #17804a;
  --new-bg: #e3eef6; --new-ink: #24628f;
  --bar-ghost: #e2ebe8; --bar-mid: #68b888; --bar-off1: #cfdad6; --bar-off2: #f1f5f4;
  --ring-track: #dceae5;
  --shadow: 0 1px 2px rgba(10, 40, 40, 0.04), 0 18px 40px -28px rgba(10, 40, 40, 0.35);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --frame: #071d20;
  --frame-2: #0f2f33;
  --frame-ink: #dcebe8;
  --frame-muted: #7f9d97;
  --deep: #04120f;
  --bg: #050c0d;
  --panel: #0d1a1c;
  --card: #132628;
  --soft: #183033;
  --soft2: #1f393c;
  --line: #213a3d;
  --ink: #e6f0ee;
  --muted: #92aba5;
  --pill: #e6f0ee;
  --pill-ink: #0b1e22;
  --accent: #4fd08a;
  --accent-soft: #143a2c;
  --lime: #4fd08a;
  --mint: #5aa97c;
  --orange: #e98552;
  --peach: #3b2a20;
  --sky: #132628;
  --fog: #132628;
  --good: #4fd08a;
  --good-soft: #143a2c;
  --warn: #f0a24a;
  --bad: #f07a85;
  --hot-bg: #3a231a; --hot-ink: #ff9f73;
  --won-bg: #143a2c; --won-ink: #5fe09a;
  --new-bg: #172e40; --new-ink: #8cc4ef;
  --bar-ghost: #1f393c; --bar-mid: #3f8a62; --bar-off1: #2a4447; --bar-off2: #152a2c;
  --ring-track: #21393b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -28px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; transition: background 0.2s; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Backdrop + panel (kept minimal) ---------- */
.stage { min-height: 100vh; padding: 16px; display: grid; place-items: start center; }
/* The frame: deep-teal shell, sidebar on it, content in an inset canvas ("card inside a card"). */
.app { width: min(1360px, 100%); display: grid; grid-template-columns: 236px minmax(0, 1fr); background: var(--frame); border-radius: 32px; box-shadow: var(--shadow); overflow: hidden; }

/* ---------- Sidebar (sits on the dark shell) ---------- */
.sidebar { padding: 24px 16px 18px; display: flex; flex-direction: column; gap: 4px; background: var(--side); color: var(--frame-ink); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.sidebar .brand { margin: 0 -16px 8px; padding: 2px 26px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; background: linear-gradient(140deg, var(--lime), #0a6752); }
.nav-label { margin: 16px 12px 8px; font-size: 10.5px; font-weight: 600; color: var(--frame-muted); text-transform: uppercase; letter-spacing: 0.08em; align-self: flex-start; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 99px; font-weight: 500; font-size: 13.5px; color: var(--frame-ink); transition: background 0.15s, color 0.15s; }
.nav-item .ic { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.07); color: var(--frame-ink); transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active { background: var(--frame-2); color: #fff; font-weight: 600; }
.nav-item.active .ic { background: #fff; color: var(--frame); }
.nav-item .pill { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; text-align: center; background: var(--lime); color: var(--deep); }
.nav-item.active .pill { background: rgba(255, 255, 255, 0.2); color: inherit; }
.plan-card { margin-top: auto; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); color: #fff; }
.plan-card small { color: var(--frame-muted); font-weight: 600; }
.plan-card strong { display: block; margin: 2px 0 10px; font-size: 15px; font-weight: 600; }
.plan-card .meter { background: rgba(255, 255, 255, 0.12); }
.plan-card .meter i { background: var(--lime); }
.side-user { margin: auto -16px 0; padding: 14px 26px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.plan-card + .side-user { margin-top: 14px; }
.side-user .nav-label { margin: 0 0 10px; }
.side-user .who { gap: 10px; }
.side-user .who b { color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--frame-muted); }
.side-user .avatar { box-shadow: 0 0 0 2px var(--lime); }
.meter { height: 6px; border-radius: 99px; background: var(--soft2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 72%; border-radius: 99px; background: var(--accent); }
.meter.big { height: 8px; margin: 2px 0 8px; }

/* ---------- Main canvas + top bar ---------- */
.main { margin: 10px 10px 10px 0; padding: 22px 26px 28px; min-width: 0; background: var(--panel); border-radius: 24px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.search { flex: 1; min-width: 0; max-width: 440px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--muted); cursor: text; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-weight: 500; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.kbd { padding: 2px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 12px; font-weight: 600; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg { display: flex; padding: 3px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.seg button { padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--pill); color: var(--pill-ink); }
.lg-short { display: none; }
.agent-status { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.agent-status.s-bad .dot { background: var(--bad); box-shadow: 0 0 0 4px var(--hot-bg); }
.agent-status.s-warn .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--hot-bg); }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); flex: none; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn .badge { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--card); }
.ic-sun { display: none; }
[data-theme="dark"] .ic-sun { display: block; }
[data-theme="dark"] .ic-moon { display: none; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(140deg, #42d678, #0a6752); flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 12px; }
.avatar.a2 { background: linear-gradient(140deg, #f0a27a, #d86a35); }
.avatar.a3 { background: linear-gradient(140deg, #6fb7c9, #1f6f86); }

/* ---------- Page scaffolding ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1, .greeting h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.sub, .greeting p { margin-top: 2px; color: var(--muted); font-weight: 500; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.range { font-weight: 700; white-space: nowrap; }
.content { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.spaced { margin-top: 20px; }

/* Page note */
.note { border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin-bottom: 18px; }
.col > .note { margin-bottom: 0; }
.note summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.note summary::-webkit-details-marker { display: none; }
.note-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.note-ico .ic { width: 17px; height: 17px; }
.note-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.note-main b { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.note-line { font-weight: 600; }
.note .chev { transition: transform 0.2s; color: var(--muted); }
.note[open] .chev { transform: rotate(180deg); }
.note-body { padding: 0 16px 14px 58px; }
.note-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.note ol { padding-left: 18px; display: grid; gap: 4px; font-weight: 500; }

/* Buttons + chips */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; white-space: nowrap; background: var(--card); border: 1px solid var(--line); transition: filter 0.15s, transform 0.1s; }
.btn:hover { filter: brightness(0.96); }
.btn:active { transform: scale(0.98); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--pill); color: var(--pill-ink); border-color: transparent; }
.btn.accent { background: var(--accent); color: #fff; border-color: transparent; }
[data-theme="dark"] .btn.accent { color: var(--deep); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.big { padding: 14px 26px; font-size: 16px; }
.select { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; background: var(--card); }
.select .ic { width: 16px; height: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.card > .chips { margin-bottom: 16px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; background: var(--card); white-space: nowrap; }
.fchip b { font-size: 12px; opacity: 0.6; }
.fchip.on { background: var(--pill); color: var(--pill-ink); border-color: transparent; }
.chip { display: inline-block; white-space: nowrap; margin-top: 12px; padding: 4px 10px; border-radius: 99px; background: var(--good-soft); color: var(--good); font-size: 12px; font-weight: 600; }
.chip.plain { margin: 0; padding: 7px 12px; background: var(--soft2); color: var(--ink); font-weight: 600; }

/* Cards */
.card { padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid transparent; }
[data-theme="dark"] .card { border-color: var(--line); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-head p { color: var(--muted); font-size: 13px; font-weight: 500; }
.hint { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 500; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
/* KPI card: small grey label -> big number (unit lighter) -> trend line; optional meter / mini bars on the right */
.stat { position: relative; padding: 18px 20px; min-height: 132px; border-radius: 18px; display: flex; flex-direction: column; background: var(--card); border: 1px solid transparent; }
[data-theme="dark"] .stat { border-color: var(--line); }
.stat.peach, .stat.sky, .stat.fog { background: var(--card); }
.stat h3 { font-size: 12.5px; font-weight: 500; color: var(--muted); align-self: flex-start; }
.stat small { color: var(--muted); font-weight: 500; font-size: 12px; }
.stat .num { margin-top: auto; padding-top: 14px; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.num .unit, .big-num .unit, .gauge-num .unit { font-size: 0.5em; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 0.3em; }
.stat .delta { align-self: flex-start; margin-top: 8px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.stat .delta b { color: var(--good); font-weight: 600; }
.stat .delta b.down { color: var(--bad); }
.stat .meter { margin-top: 10px; }
.stat .meter i { background: var(--lime); }
.stat .go, .promo .go { position: absolute; display: grid; place-items: center; border-radius: 50%; background: var(--pill); color: var(--pill-ink); transition: transform 0.15s; }
.stat .go { right: 16px; top: 16px; width: 34px; height: 34px; }
.stat .go .ic { width: 16px; height: 16px; }
.stat .go:hover, .promo .go:hover { transform: translate(2px, -2px); }
/* Mini bar chart beside a KPI number: <span class="minibars"><i style="--h:60%"></i>…</span> */
.minibars { position: absolute; right: 20px; bottom: 20px; display: flex; align-items: flex-end; gap: 4px; height: 38px; }
.minibars i { width: 7px; height: var(--h); border-radius: 2px; background: var(--mint); opacity: 0.55; }
.minibars i:last-child { opacity: 1; background: var(--lime); }
.minibars.down i { background: var(--bad); }

/* Progress ring: <span class="ring" style="--p:72"><b>76</b></span> */
.ring { --size: 58px; --w: 5px; --c: var(--lime); position: relative; width: var(--size); height: var(--size); display: grid; place-items: center; flex: none; }
.ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p, 0) * 1%), var(--ring-track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w) + 1px)); mask: radial-gradient(farthest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w) + 1px)); }
.ring b { position: relative; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring.orange { --c: var(--orange); }

/* Half-circle gauge: <div class="gauge" style="--p:72"></div> */
.gauge { --c: var(--lime); position: relative; width: 170px; height: 85px; margin: 6px auto 0; overflow: hidden; }
.gauge::before { content: ""; position: absolute; left: 0; top: 0; width: 170px; height: 170px; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--c) calc(var(--p, 0) * 0.5%), var(--deep) 0 50%, transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 26px), #000 calc(100% - 25px)); mask: radial-gradient(farthest-side, transparent calc(100% - 26px), #000 calc(100% - 25px)); }
[data-theme="dark"] .gauge::before { background: conic-gradient(from -90deg, var(--c) calc(var(--p, 0) * 0.5%), var(--soft2) 0 50%, transparent 0); }
.gauge-card { text-align: center; }
.gauge-card h2 { font-size: 14px; font-weight: 600; }
.gauge-num { display: block; margin: 14px 0 4px; font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-foot { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.gauge-foot b { color: var(--ink); font-weight: 600; }

/* Dot legend list */
.dots { display: grid; gap: 10px; margin-top: 14px; }
.dots li { list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.dots li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--lime)); flex: none; }
.dots li span { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Dashboard grid (reference layout: 3 KPIs / gauge + list + wide card / pills + promo) */
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: stretch; }
.dash-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.pill-stack { display: grid; gap: 14px; align-content: start; }

/* Week chart */
.chart { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: end; }
.chart-total { padding: 16px; border-radius: 18px; background: var(--soft); }
.chart-total strong { display: block; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.chart-total small { color: var(--muted); font-weight: 500; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; height: 190px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; height: var(--h); border-radius: 99px; background: var(--bar-ghost); transition: filter 0.15s; cursor: default; }
.bar.strong { background: linear-gradient(180deg, var(--lime), #1f9d5b); }
.bar.mid { background: var(--bar-mid); }
.bar.off { background: repeating-linear-gradient(135deg, var(--bar-off1) 0 2px, var(--bar-off2) 2px 7px); }
.bar:hover { filter: brightness(0.92); }
.bar-col span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { text-align: left; padding: 0 12px 12px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
td { padding: 13px 12px; border-top: 1px solid var(--line); font-weight: 500; vertical-align: middle; white-space: nowrap; }
td:first-child { white-space: normal; }
.who { display: flex; align-items: center; gap: 12px; }
.who b { display: block; font-weight: 700; }
.who small { color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { display: inline-block; white-space: nowrap; padding: 3px 10px; border-radius: 99px; background: var(--soft2); font-size: 12px; font-weight: 600; }
.tag.hot { background: var(--hot-bg); color: var(--hot-ink); }
.tag.won { background: var(--won-bg); color: var(--won-ink); }
.tag.new { background: var(--new-bg); color: var(--new-ink); }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--good); }
.status.soon { color: var(--warn); }
.status.late { color: var(--bad); }
.call-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--pill-ink); flex: none; }
.call-btn .ic { width: 16px; height: 16px; }

/* List rows */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.card-head + .row, .tabs + .tabpane > .row:first-child, .tabpane > .row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 700; }
.row-main small { color: var(--muted); font-weight: 500; }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--soft); margin-bottom: 14px; max-width: 100%; overflow-x: auto; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 99px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs button b { font-size: 12px; padding: 0 7px; border-radius: 99px; background: var(--soft2); }
.tabs button.on { background: var(--pill); color: var(--pill-ink); }

/* Right rail */
.pill-dark, .pill-light { display: flex; align-items: center; gap: 16px; padding: 10px 24px 10px 10px; border-radius: 99px; }
.pill-dark { background: var(--deep); color: #fff; }
.pill-light { background: var(--card); border: 1px solid transparent; }
[data-theme="dark"] .pill-light { border-color: var(--line); }
.pill-dark .ring { --c: var(--orange); --ring-track: rgba(255, 255, 255, 0.12); }
.pill-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }
.pill-light .pill-ico { background: var(--soft2); color: var(--ink); }
.pill-dark strong, .pill-light strong { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.pill-dark small, .pill-light small { display: block; font-size: 12px; font-weight: 400; opacity: 0.65; }
.pill-state { margin-left: auto; font-size: 13px; font-weight: 600; opacity: 0.85; white-space: nowrap; }
/* Promo card: saturated green with soft leaf-like glows (pure CSS, no image) */
.promo { position: relative; overflow: hidden; padding: 22px; min-height: 172px; border-radius: 22px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  background: radial-gradient(120px 160px at 88% 78%, rgba(66, 214, 120, 0.55), transparent 70%), radial-gradient(90px 120px at 74% 30%, rgba(66, 214, 120, 0.35), transparent 70%), linear-gradient(135deg, #0b7058, #085848); }
.promo-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; opacity: 0.95; }
.promo-brand .brand-mark { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.promo .tagline { position: absolute; padding: 5px 11px; border-radius: 8px; background: rgba(255, 255, 255, 0.94); color: var(--frame); font-size: 11px; font-weight: 600; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.5); }
.promo .tagline.t1 { right: 70px; top: 64px; transform: rotate(-6deg); background: #c9f3d8; }
.promo .tagline.t2 { right: 24px; bottom: 48px; }
.promo h3 { position: relative; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; max-width: 240px; }
.promo p { position: relative; font-size: 12.5px; opacity: 0.85; max-width: 250px; }
.promo .go { top: 16px; right: 16px; width: 36px; height: 36px; background: transparent; color: #fff; }
.promo .go .ic { width: 22px; height: 22px; }
.alert { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--soft); }
.alert + .alert { margin-top: 12px; }
.alert-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.alert-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.alert-ico .ic { width: 15px; height: 15px; }
.alert-ico.p { background: var(--accent); }
.alert-ico.o { background: var(--orange); }
.alert-ico.g { background: #1f9d5b; }
.alert p { color: var(--muted); font-size: 13px; font-weight: 500; }
.alert a { color: var(--accent); font-weight: 700; font-size: 13px; align-self: flex-start; }
.leader { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.leader + .leader { border-top: 1px solid var(--line); }
.leader .rank { width: 22px; font-weight: 800; color: var(--muted); }
.leader:first-of-type .rank, .tabpane .leader:first-child .rank { color: var(--orange); }
.leader b { display: block; font-weight: 700; }
.leader small { color: var(--muted); font-weight: 500; }
.leader .won-count { margin-left: auto; text-align: right; font-weight: 800; font-size: 16px; min-width: 36px; }
.leader .won-count small { display: block; font-size: 11px; }
.leader .hbar { width: 28%; }

/* Horizontal bars (reports, targets, leaderboard) */
.hbar { height: 8px; border-radius: 99px; background: var(--soft2); overflow: hidden; }
.hbar i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--mint); }
.hbar.good i { background: var(--good); }
.hrow { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 7px 0; }
.hrow span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow b { text-align: right; font-variant-numeric: tabular-nums; }
.stackbar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; gap: 3px; }
.stackbar i { width: var(--w); }
.s1 { background: var(--good); } .s2 { background: var(--bad); } .s3 { background: var(--warn); } .s4 { background: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.legend > span { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.legend > span i { width: 10px; height: 10px; border-radius: 3px; }
.legend > span b { color: var(--muted); }

/* Targets */
.target-head, .trow { display: grid; grid-template-columns: 170px repeat(3, minmax(0, 1fr)); gap: 18px; align-items: center; }
.target-head { padding-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.trow { padding: 12px 0; border-top: 1px solid var(--line); }
.trow .who b { white-space: nowrap; }
.tcell { display: grid; gap: 4px; }
.tcell small { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Dialer */
.dialer { display: flex; flex-direction: column; }
.timer { margin: 16px 0; font-size: 44px; font-weight: 800; text-align: center; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--muted); }
.dialer.live .timer { color: var(--good); }
.dial-actions { display: flex; justify-content: center; }
.outcomes { display: grid; gap: 12px; }
.outcomes .btn { justify-self: start; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini { padding: 14px; border-radius: 16px; background: var(--soft); }
.mini strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.mini small { color: var(--muted); font-weight: 600; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-day { min-height: 230px; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cal-day h4 { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); }
.cal-day h4 small { font-size: 20px; font-weight: 800; color: var(--ink); }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-day.off { background: repeating-linear-gradient(135deg, var(--soft) 0 6px, var(--card) 6px 14px); }
.today-pill { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: #fff; }
.ev { display: grid; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--accent-soft); font-size: 12px; font-weight: 600; cursor: default; }
.ev b { font-size: 12px; color: var(--accent); }
.ev em { font-style: normal; color: var(--warn); font-weight: 700; }
.ev.pending { background: var(--hot-bg); }
.ev.off, .ev.empty { background: none; color: var(--muted); padding: 4px 0; }

/* WhatsApp */
.grid-wa { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.tpl-list { display: grid; gap: 8px; }
.tpl { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--soft); border: 1px solid transparent; }
.tpl small { color: var(--muted); font-weight: 500; }
.tpl.on { border-color: var(--accent); background: var(--accent-soft); }
.phone-bg { padding: 22px; border-radius: 18px; background: var(--soft); min-height: 150px; }
.bubble { max-width: 440px; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: #dcf8c6; color: #15141b; font-weight: 500; }
[data-theme="dark"] .bubble { background: #144d37; color: #eaf7ef; }
.wa-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Scripts */
.script h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.script h3:first-child { margin-top: 0; }
.script p, .script li { font-weight: 500; max-width: 680px; }
.script ul { padding-left: 18px; display: grid; gap: 4px; }

/* Settings: switches + checkboxes */
.switch, .check { position: relative; display: inline-block; flex: none; cursor: pointer; }
.switch input, .check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { display: block; width: 42px; height: 24px; border-radius: 99px; background: var(--soft2); transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(18px); }
.check i { display: block; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); background: var(--card); }
.check input:checked + i { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--card); }
.switch input:focus-visible + i, .check input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tooltip + toast */
.tt { position: fixed; z-index: 100; left: 0; top: 0; max-width: 270px; padding: 8px 11px; border-radius: 12px; background: var(--pill); color: var(--pill-ink); font-size: 12.5px; font-weight: 600; line-height: 1.4; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45); }
.tt.on { opacity: 1; transform: none; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 99px; background: var(--pill); color: var(--pill-ink); font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Bottom bar + sheet (phone only) */
.bottom-nav, .sheet-back { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .content { grid-template-columns: minmax(0, 1fr); }
  .rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .rail .widgets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .cal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal-day { min-height: 0; }
  .lg-full { display: none; } .lg-short { display: inline; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 20px 12px; align-items: center; }
  .brand { padding: 0 0 14px; }
  .brand-name, .nav-label, .nav-item span, .nav-item .pill, .plan-card, .side-user .who > div { display: none; }
  .nav-item { padding: 4px; }
  .sidebar .brand { margin: 0 -12px 8px; padding: 0 0 16px; justify-content: center; }
  .side-user { margin: auto -12px 0; padding: 14px 0 0; display: grid; place-items: center; }
  .plan-card + .side-user { margin-top: auto; }
  .dash-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-row > .wide { grid-column: 1 / -1; }
  .dash-row-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 12px; }
  .grid2, .grid-wa { grid-template-columns: minmax(0, 1fr); }
  .agent-status span { display: none; }
}
@media (max-width: 720px) {
  .stage { padding: 0; display: block; }
  .app { grid-template-columns: minmax(0, 1fr); border-radius: 0; border: 0; min-height: 100vh; box-shadow: none; background: var(--panel); }
  .main { margin: 0; border-radius: 0; }
  .dash-row { grid-template-columns: minmax(0, 1fr); }
  .minibars { height: 30px; }
  .promo h3 { font-size: 21px; }
  .promo .tagline { display: none; }
  .sidebar, .avatar:not(.sm), .agent-status, .search .kbd { display: none; }
  .main { padding: 14px 14px 104px; }
  .topbar { gap: 8px; margin-bottom: 14px; }
  .top-actions { gap: 8px; }
  .search { height: 40px; padding: 0 12px; }
  .icon-btn { width: 40px; height: 40px; }
  .seg button { padding: 5px 9px; }
  .page-head h1, .greeting h1 { font-size: 24px; }
  .note-body { padding-left: 16px; }
  .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -14px; padding: 0 14px 4px; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 74%; scroll-snap-align: start; min-height: 128px; }
  .stat .num { font-size: 28px; }
  .chart { grid-template-columns: minmax(0, 1fr); }
  .chart-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .chart-total .chip { margin-top: 0; }
  .bars { height: 150px; gap: 8px; }
  .rail, .rail .widgets { grid-template-columns: minmax(0, 1fr); }
  .rail .widgets { gap: 12px; }
  .card { padding: 16px; border-radius: 20px; }
  .mini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mini { padding: 10px; }
  .mini strong { font-size: 18px; }
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-day { flex-direction: column; }
  .hrow { grid-template-columns: 96px minmax(0, 1fr) 36px; }
  .target-head { display: none; }
  .trow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .trow .who { grid-column: 1 / -1; }
  .row { flex-wrap: wrap; }
  .row .row-main { min-width: 50%; }
  .leader .hbar { display: none; }
  .head-actions { width: 100%; }

  /* Dashboard follow-up table turns into cards */
  .fu-table, .fu-table tbody, .fu-table tr, .fu-table td { display: block; min-width: 0; }
  .fu-table thead { display: none; }
  .fu-table tr { position: relative; padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
  .fu-table tr:first-child { border-top: 0; padding-top: 0; }
  .fu-table td { padding: 0; border: 0; }
  .fu-table td:nth-child(1) { grid-column: 1 / 2; }
  .fu-table td:nth-child(5) { grid-column: 2 / 3; grid-row: 1; align-self: start; }
  .fu-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .fu-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; color: var(--muted); font-size: 13px; }
  .fu-table td:nth-child(4) { display: none; }
  .fu-table td:nth-child(6) { position: absolute; right: 0; bottom: 14px; }

  .bottom-nav { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-radius: 24px; background: var(--frame); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.45); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--frame-muted); }
  .bottom-nav .active { color: #fff; font-weight: 600; }
  .bottom-nav .active .ic { color: var(--lime); }
  .bottom-nav .active .ic { stroke-width: 2.2; }
  .bottom-nav .dial { width: 54px; height: 54px; margin: -26px auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--pill-ink); border: 4px solid var(--card); padding: 0; }
  .bottom-nav .dial.active { color: var(--pill-ink); }
  .sheet-back { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.35); }
  .sheet-back[hidden] { display: none !important; }
  .sheet { width: 100%; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--card); }
  .sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
  .sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: var(--soft); font-size: 12px; font-weight: 600; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Dashboard follow-up table: fit inside the card without sideways scroll */
@media (min-width: 721px) {
  .fu-table { min-width: 0; }
  .fu-table th, .fu-table td { padding-left: 8px; padding-right: 8px; }
  .fu-table td:last-child { width: 1%; padding-right: 0; }
  .fu-table .who { gap: 10px; }
}


/* =================== LeadFlow app additions =================== */
.app { min-height: calc(100vh - 32px); }
.app > .main { min-height: calc(100% - 20px); }
.sidebar .nav-item { border: 0; width: 100%; text-align: left; }
.nav-group { display: contents; }
.main > .flash, .main > .banner { margin-bottom: 14px; }
.top-title { font-weight: 600; font-size: 15px; color: var(--muted); }
.tenant-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; }

/* Flash + banners */
.flash { padding: 12px 16px; border-radius: 14px; font-weight: 600; background: var(--good-soft); color: var(--good); }
.flash.err { background: var(--hot-bg); color: var(--bad); }
.flash ul { margin: 0; padding-left: 18px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; font-weight: 600; background: var(--accent-soft); }
.banner.warning { background: var(--hot-bg); color: var(--hot-ink); }
.banner.success { background: var(--won-bg); color: var(--won-ink); }
.banner.danger { background: var(--bad); color: #fff; }
.banner .grow { flex: 1; min-width: 200px; }
.banner form { margin: 0; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 500; outline: none; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 420px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .help { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .error, .error-text { font-size: 12.5px; color: var(--bad); font-weight: 700; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.checkline { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }
.checkline input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.inline-form { display: inline; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link { color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.stack-sm > * + * { margin-top: 8px; }
.vstack > * + * { margin-top: 20px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tag.warn { background: var(--hot-bg); color: var(--warn); }
.tag.bad { background: var(--hot-bg); color: var(--bad); }
.tag.ok { background: var(--won-bg); color: var(--won-ink); }
.empty { padding: 26px; text-align: center; color: var(--muted); font-weight: 600; }
table.plain { min-width: 0; }
.table-wrap table { min-width: 560px; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 10px; background: var(--soft); font-weight: 700; font-size: 13px; }
.pager .on { background: var(--pill); color: var(--pill-ink); }
.pager a, .pager span { border-radius: 8px; }
.checklist { display: grid; gap: 8px; }
.checklist a, .checklist div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--soft); font-weight: 500; font-size: 13px; line-height: 1.35; }
.checklist a:hover { background: var(--accent-soft); }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); flex: none; }
.checklist .done .tick { background: var(--good); border-color: var(--good); color: #fff; }
.checklist .done span { text-decoration: line-through; color: var(--muted); }
.big-num { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.thread { display: grid; gap: 12px; }
.msg { padding: 12px 14px; border-radius: 14px; background: var(--soft); max-width: 760px; }
.msg.admin { background: var(--accent-soft); margin-left: auto; }
.msg .who-line { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.choice { position: relative; display: block; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice b { display: block; }
.choice small { color: var(--muted); font-weight: 500; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.steps-bar { display: flex; gap: 8px; margin-bottom: 18px; }
.steps-bar span { flex: 1; height: 6px; border-radius: 99px; background: var(--soft2); }
.steps-bar span.on { background: var(--accent); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 14px; border-radius: 14px; background: var(--soft); }
.qr { width: 200px; height: 200px; padding: 10px; border-radius: 16px; background: #fff; }
.qr svg, .qr img { width: 100%; height: 100%; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; border: 1px solid var(--line); }
.legal { max-width: 760px; }
.legal h2 { font-size: 18px; margin: 20px 0 6px; }
.legal p, .legal li { margin: 6px 0; font-weight: 500; }
.legal blockquote { padding: 10px 14px; border-radius: 12px; background: var(--hot-bg); color: var(--hot-ink); }
.legal ul { padding-left: 20px; }

/* Guest (login / sign-up) */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(600px 400px at 85% 110%, rgba(66, 214, 120, 0.18), transparent 70%), radial-gradient(500px 360px at 0% -10%, rgba(10, 103, 82, 0.16), transparent 70%), var(--panel); }
.guest-card { width: min(460px, 100%); padding: 30px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.guest-card.wide { width: min(720px, 100%); }
.guest-card .brand { padding: 0 0 18px; }
.guest-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.guest-card .sub { margin-bottom: 18px; }
.guest-top { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; }
.guest-foot { margin-top: 16px; text-align: center; color: var(--muted); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Invoice (printable) */
.invoice { max-width: 760px; margin: 24px auto; padding: 34px; border-radius: 20px; background: #fff; color: #15141b; border: 1px solid #ebebf0; }
.invoice table { min-width: 0; }
@media print { body { background: #fff; } .no-print { display: none !important; } .invoice { border: 0; margin: 0; } }

@media (max-width: 960px) {
  .form-grid, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .tenant-chip { display: none; }
  .guest-card { padding: 22px; }
  .main { padding-bottom: 104px; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.term { border-bottom: 1px dashed currentColor; cursor: help; }
.avatar-btn { border-radius: 50%; }

/* System pages (updates, backups) */
.log { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--deep); color: #cfe6df; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
.filelist { list-style: none; display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.filelist li { display: flex; gap: 10px; align-items: baseline; }
.op { width: 16px; text-align: center; font-weight: 700; }
.op-add { color: var(--good); } .op-chg { color: var(--warn); } .op-del { color: var(--bad); }
.steps { padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.copyable { user-select: all; padding: 1px 6px; border-radius: 6px; background: var(--soft); overflow-wrap: anywhere; }

/* Team pages */
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 99px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs a.on { background: var(--pill); color: var(--pill-ink); }
.grid-team { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { width: auto; flex: 1; min-width: 160px; }
.toolbar select.input { flex: 0 1 200px; }
.member { border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.member > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.member > summary::-webkit-details-marker { display: none; }
.member.off > summary { opacity: 0.6; }
.member[open] .chev { transform: rotate(180deg); }
.member .chev { color: var(--muted); transition: transform 0.2s; }
.member-edit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; padding: 4px 0 14px; }
.member-edit .form-actions { margin: 0; }
.member-del { padding-bottom: 12px; }
.add-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.add-row .form-actions { margin: 0; }
.side-user a.who { color: inherit; }
a.avatar { color: #fff; }
@media (max-width: 1180px) { .grid-team { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .member-edit, .add-row { grid-template-columns: minmax(0, 1fr); }
}

/* Web installer */
.checks-list { list-style: none; display: grid; gap: 6px; }
.checks-list li { display: flex; gap: 10px; align-items: baseline; font-weight: 500; }
.checks-list b { width: 18px; text-align: center; }
.checks-list .ok b { color: var(--good); } .checks-list .bad { color: var(--bad); } .checks-list .warn b { color: var(--warn); }
