/* ---------- Tokens ---------- */
:root {
    --accent: #0071E3;
    --bg: #F5F5F7; --surface: #FFFFFF; --surface-2: #FAFAFC; --side: #FBFBFD; --line: #E8E8ED; --line2: #D2D2D7;
    --text: #1D1D1F; --muted: #6E6E73; --faint: #8E8E93; --tint: #F0F0F3; --hover: rgba(0,0,0,.04);
    --ok: #1E8E3E; --ok-soft: #E6F4EA; --warn: #B06000; --warn-soft: #FEF7E0; --bad: #C5221F; --bad-soft: #FCE8E6;
    --shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.035);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.05);
    --accent-ink: color-mix(in srgb, var(--accent) 82%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
    --accent-ring: color-mix(in srgb, var(--accent) 22%, transparent);
    --side-w: 240px;
    color-scheme: light;
}
[data-palette="ocean"] { --accent: #0071E3; }
[data-palette="royal"] { --accent: #6E56CF; }
[data-palette="emerald"] { --accent: #0F9D74; }
[data-palette="rose"] { --accent: #D6457A; }
[data-palette="saffron"] { --accent: #D9780A; }
[data-palette="graphite"] { --accent: #48484A; }

:root[data-mode="dark"] {
    --bg: #0E0E10; --surface: #1C1C1F; --surface-2: #232327; --side: #151517; --line: #2C2C31; --line2: #3A3A40;
    --text: #F2F2F5; --muted: #A1A1A8; --faint: #7C7C84; --tint: #2A2A2F; --hover: rgba(255,255,255,.05);
    --ok: #4ADE80; --ok-soft: #12301E; --warn: #FBBF24; --warn-soft: #33270B; --bad: #F87171; --bad-soft: #3A1616;
    --shadow: 0 0 0 1px rgba(255,255,255,.06); --shadow-lg: 0 24px 64px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
    --accent-ink: color-mix(in srgb, var(--accent) 65%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface));
    color-scheme: dark;
}
:root[data-mode="dark"][data-palette="graphite"] { --accent: #AEAEB2; }
@media (prefers-color-scheme: dark) {
    :root[data-mode="system"] {
        --bg: #0E0E10; --surface: #1C1C1F; --surface-2: #232327; --side: #151517; --line: #2C2C31; --line2: #3A3A40;
        --text: #F2F2F5; --muted: #A1A1A8; --faint: #7C7C84; --tint: #2A2A2F; --hover: rgba(255,255,255,.05);
        --ok: #4ADE80; --ok-soft: #12301E; --warn: #FBBF24; --warn-soft: #33270B; --bad: #F87171; --bad-soft: #3A1616;
        --shadow: 0 0 0 1px rgba(255,255,255,.06); --shadow-lg: 0 24px 64px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
        --accent-ink: color-mix(in srgb, var(--accent) 65%, #fff);
        --accent-soft: color-mix(in srgb, var(--accent) 20%, var(--surface));
        color-scheme: dark;
    }
    :root[data-mode="system"][data-palette="graphite"] { --accent: #AEAEB2; }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14.5px; letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; line-height: 1.45; }
a { color: var(--accent-ink); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0; outline: none; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--tint); padding: 1px 5px; border-radius: 6px; }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line2); border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface); }
.ti { font-size: 18px; line-height: 1; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s ease; }
html.sb-col { --side-w: 68px; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 16px 10px 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow: hidden; z-index: 20; }
.navscroll { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 10px; margin: 0 -4px; padding: 0 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.brand b { font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .brand small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.navgroup { display: flex; flex-direction: column; gap: 1px; }
.navgroup .over { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 4px 12px 4px; }
.navlink { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; border: 0; background: none; cursor: pointer; width: 100%; text-align: left; position: relative; min-height: 38px; }
.navlink .ti { font-size: 19px; flex: none; }
.navlink:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.navlink.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 980px; padding: 0 7px; min-width: 20px; text-align: center; line-height: 18px; }
.lbl { min-width: 0; overflow: hidden; }
.collapse-btn { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 12px; }
html.sb-col .lbl, html.sb-col .over { display: none; }
html.sb-col .navlink { justify-content: center; padding: 8px; }
html.sb-col .brand { justify-content: center; padding-left: 0; padding-right: 0; }
html.sb-col .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 0 4px; line-height: 16px; font-size: 10px; }
html.sb-col .navgroup + .navgroup { border-top: 1px solid var(--line); padding-top: 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 28px; min-height: 64px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(18px); position: sticky; top: 0; z-index: 10; }
.title-area { min-width: 0; }
.title-area h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-area .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-back { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.crumb-back .ti { font-size: 14px; }
.search-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--line2); border-radius: 980px; background: var(--surface); color: var(--muted); cursor: pointer; min-width: 180px; }
.search-pill kbd { margin-left: auto; }
.search-pill:hover { border-color: var(--accent); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.icon-btn .ti { font-size: 20px; }
.bell .dot { position: absolute; top: 3px; right: 2px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 980px; display: grid; place-items: center; padding: 0 4px; }
.usermenu { position: relative; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.menu { position: absolute; right: 0; top: 44px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 31; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 9px; border: 0; background: none; cursor: pointer; color: var(--text); font-size: 14px; text-align: left; }
.menu-item:hover { background: var(--hover); text-decoration: none; }
.menu-item.danger { color: var(--bad); }
.page { padding: 24px 28px 56px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; width: 100%; }
.mobile-only { display: none; }
.scrim-drawer { display: none; }
.tabbar { display: none; }

/* ---------- Primitives ---------- */
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card.flush > .card-h { padding: 16px 18px 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.b { font-weight: 600; } .right { text-align: right; } .grow { flex: 1; } .nowrap { white-space: nowrap; }
.big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }

.btn { height: 36px; padding: 0 16px; border-radius: 980px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn .ti { font-size: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn.tonal { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.link { background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 0; font-size: 13px; }
.link:hover { text-decoration: underline; }

.seg { display: inline-flex; background: var(--tint); border-radius: 980px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 980px; cursor: pointer; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 980px; font-size: 12px; font-weight: 600; background: var(--tint); color: var(--muted); white-space: nowrap; }
.chip.blue { background: var(--accent-soft); color: var(--accent-ink); } .chip.green { background: var(--ok-soft); color: var(--ok); }
.chip.amber { background: var(--warn-soft); color: var(--warn); } .chip.red { background: var(--bad-soft); color: var(--bad); }
.chip .ti { font-size: 13px; vertical-align: -2px; }

/* ---------- Forms ---------- */
.input, select.input, textarea.input { height: 40px; border: 1px solid var(--line2); border-radius: 11px; padding: 0 12px; background: var(--surface); width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:hover { border-color: color-mix(in srgb, var(--line2) 50%, var(--muted)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input.invalid, .field:has(.field-error) .input { border-color: var(--bad); }
.input.invalid:focus, .field:has(.field-error) .input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 20%, transparent); }
.input:disabled { background: var(--tint); color: var(--muted); }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--tint); border: 1px solid var(--line2); border-right: 0; border-radius: 11px 0 0 11px; color: var(--muted); font-size: 13px; }
.input-group .input { border-radius: 0 11px 11px 0; }

/* Combo — themed searchable dropdown (replaces native select) */
.combo { position: relative; width: 100%; }
.combo.auto { width: auto; display: inline-block; min-width: 130px; }
.combo.sm .combo-trigger { height: 32px; font-size: 13px; border-radius: 9px; padding: 0 10px; }
.combo-trigger { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.combo-trigger:disabled { cursor: default; }
.combo.open .combo-trigger { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.combo-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-val.muted { color: var(--muted); }
.combo-ico { color: var(--muted); font-size: 16px; flex: none; }
.combo-ava { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 11px; font-weight: 650; flex: none; }
.combo-caret { color: var(--muted); font-size: 16px; flex: none; transition: transform .12s; }
.combo.open .combo-caret { transform: rotate(180deg); }
.combo-badge { margin-left: auto; }
.combo-backdrop { position: fixed; inset: 0; z-index: 40; }
.combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 41; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .14s ease; }
.combo.auto .combo-pop { right: auto; width: max-content; max-width: 320px; }
.combo-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.combo-search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--text); }
.combo-list { max-height: 300px; overflow: auto; padding: 6px; }
.combo-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; color: var(--text); font: inherit; font-size: 14px; }
.combo-item.nav { background: var(--hover); }
.combo-item.on { background: var(--accent-soft); color: var(--accent-ink); }
.combo-item-text { flex: 1; min-width: 0; }
.combo-item-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item-sub { display: block; font-size: 12px; color: var(--muted); }
.combo-item.on .combo-item-sub { color: var(--accent-ink); opacity: .8; }
.combo-tick { color: var(--accent-ink); font-size: 16px; flex: none; }
.combo-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.req { color: var(--bad); }
.field-hint { font-size: 12px; color: var(--faint); }
.field-error { font-size: 12.5px; color: var(--bad); display: flex; gap: 5px; align-items: flex-start; }
.field-error .ti { font-size: 15px; vertical-align: -2px; flex: none; margin-top: 1px; }
.validation-message { display: none; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 980px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.banner .ti { font-size: 19px; flex: none; }
.banner.danger { background: var(--bad-soft); color: var(--bad); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--accent-soft); color: var(--accent-ink); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 6px 0 -4px; }

/* ---------- Data ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 650; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--hover); }
.t .num { text-align: right; white-space: nowrap; }
.t tfoot td { background: var(--surface-2); font-weight: 600; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .label .ti { font-size: 16px; color: var(--accent); }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; }
.kpi .sub { font-size: 12px; color: var(--faint); }
.bar { height: 6px; background: var(--tint); border-radius: 980px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 980px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.icon-tile { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; }
.icon-tile.amber { background: var(--warn-soft); color: var(--warn); } .icon-tile.red { background: var(--bad-soft); color: var(--bad); } .icon-tile.green { background: var(--ok-soft); color: var(--ok); }
.empty-state { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 6px; }
.empty-icon .ti { font-size: 26px; }
.page-loading { display: grid; place-items: center; padding: 80px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--tint); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--tint) 25%, var(--hover) 50%, var(--tint) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.32); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s ease; }
.scrim.top { place-items: start center; padding-top: 12vh; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal { background: var(--surface); border-radius: 20px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .16s ease; display: flex; flex-direction: column; }
.modal.wide { width: min(780px, 100%); }
.modal.confirm { width: min(440px, 100%); }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal .mb { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
.modal-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.modal-icon.danger { background: var(--bad-soft); color: var(--bad); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1D1D1F; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; z-index: 60; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: pop .18s ease; max-width: calc(100vw - 32px); }
.toast.success .ti { color: #4ADE80; } .toast.error { background: var(--bad); } .toast.info .ti { color: #93C5FD; }
:root[data-mode="dark"] .toast:not(.error) { background: #F2F2F5; color: #1D1D1F; }
.palette { width: min(620px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .14s ease; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; }
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); }
.palette-item.on { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Auth pages ---------- */
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-card.wide { width: min(560px, 100%); }
.steps { display: flex; gap: 6px; }
.steps i { height: 4px; flex: 1; border-radius: 980px; background: var(--tint); }
.steps i.on { background: var(--accent); }

/* ---------- Calendar ---------- */
.cal { display: grid; position: relative; }
.cal-head { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 10px; font-size: 13px; font-weight: 600; z-index: 2; display: flex; align-items: center; gap: 8px; }
.cal-hour { font-size: 11px; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-slot { border-top: 1px solid var(--line); cursor: pointer; } .cal-slot:hover { background: var(--accent-soft); }
.cal-slot.past { background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--hover) 6px 7px); cursor: default; }
.appt { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 5px 8px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 3px solid; line-height: 1.3; }
.appt.Booked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.appt.InService { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.appt.Completed { background: var(--tint); border-color: var(--line2); color: var(--muted); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #FF3B30; z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #FF3B30; }
.floor-row { display: grid; grid-template-columns: 130px minmax(0,1fr); align-items: center; gap: 12px; padding: 7px 0; }
.floor-track { position: relative; height: 30px; background: var(--surface-2); border-radius: 8px; }
.floor-track .blk { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; font-size: 11px; padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.blk.Booked { background: var(--accent-soft); color: var(--accent-ink); } .blk.InService { background: var(--ok); color: #fff; } .blk.Completed { background: var(--tint); color: var(--muted); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 84px; transition: border-color .12s, background .12s; color: var(--text); }
.tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.tile:disabled { opacity: .45; cursor: not-allowed; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 980px; }
.qty button { border: 0; background: none; width: 30px; height: 30px; cursor: pointer; font-size: 16px; color: var(--text); }
.qty span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 600; }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; gap: 12px; }
.sum-row.total { font-size: 21px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-opt { border: 1px solid var(--line2); background: var(--surface); border-radius: 12px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12.5px; color: var(--muted); }
.pay-opt .ti { font-size: 20px; }
.pay-opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* ---------- Receipt ---------- */
.receipt { width: 380px; margin: 0 auto; background: #fff; color: #111; padding: 24px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; line-height: 1.55; border-radius: 12px; box-shadow: var(--shadow); }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Theme picker ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatch { border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.swatch .chips { display: flex; gap: 4px; } .swatch .chips span { width: 24px; height: 24px; border-radius: 7px; }
.mode-opt { flex: 1; border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--surface); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; color: var(--text); }
.mode-opt.on { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Display (TV) ---------- */
.tv { min-height: 100vh; padding: 40px; display: flex; flex-direction: column; gap: 28px; background: var(--bg); }
.tv .big-clock { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; }
.tv .card { font-size: 20px; }

@media print {
    .side, .topbar, .no-print, .toast { display: none !important; }
    .shell { display: block; } .page { padding: 0; } body { background: #fff; }
    .receipt { box-shadow: none; width: 80mm; padding: 0; }
}
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-main, .pos { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
    html.sb-col .side .lbl, html.sb-col .side .over { display: initial; }
    html.drawer-open .side { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
    html.drawer-open .scrim-drawer { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 15; }
    .collapse-btn { display: none; }
    .mobile-only { display: inline-grid; }
    /* Drawer: fits the visible screen even with the browser's address bar showing, scrolls on its own, and never drags the page behind. */
    .side { height: 100vh; height: 100dvh; width: min(300px, 86vw); padding-bottom: calc(12px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
    .navscroll { overscroll-behavior: contain; padding-bottom: 8px; }
    html.drawer-open, html.drawer-open body { overflow: hidden; }
    .drawer-close { margin-left: auto; }
    .navlink { min-height: 46px; font-size: 15px; }
    .navgroup .over { padding-top: 8px; }
    /* A desktop "collapsed menu" choice must not squash the phone drawer. */
    html.sb-col .side .navlink { justify-content: flex-start; padding: 8px 12px; }
    html.sb-col .side .brand { justify-content: flex-start; padding: 2px 6px 12px; }
    html.sb-col .side .navgroup + .navgroup { border-top: 0; padding-top: 0; }
    html.sb-col .side .nav-badge { position: static; margin-left: auto; min-width: 20px; padding: 0 7px; line-height: 18px; font-size: 11px; }
    /* Bottom bar for the everyday screens. */
    .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
    .tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 2px; border: 0; background: none; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 500; cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
    .tab span:not(.nav-badge) { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tab .ti { font-size: 23px; }
    .tab:hover { text-decoration: none; }
    .tab:active { background: var(--hover); }
    .tab.active { color: var(--accent-ink); }
    .tab.active .ti { color: var(--accent); }
    .tab .nav-badge { position: absolute; top: 3px; left: calc(50% + 5px); margin: 0; min-width: 17px; padding: 0 5px; line-height: 17px; font-size: 10px; }
    .shell:has(.tabbar) .page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
    .topbar, .page { padding-left: 16px; padding-right: 16px; }
    .search-pill { min-width: 0; padding: 0 10px; }
    .hide-sm { display: none !important; }
    .auth { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; } .pay-grid { grid-template-columns: repeat(2, 1fr); } .page { gap: 14px; } }

#blazor-error-ui { background: var(--warn-soft); color: var(--warn); bottom: 0; display: none; left: 0; padding: .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- Settings centre ---------- */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.hub-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); transition: transform .1s, box-shadow .1s; }
.hub-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.08), var(--shadow); }
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.settings-body { display: flex; flex-direction: column; gap: 16px; max-width: 920px; min-width: 0; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } }
.logo.img { object-fit: cover; background: var(--surface); }
.opt-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.opt-row:last-child { border-bottom: 0; }
.color-dot { width: 22px; height: 22px; border-radius: 7px; flex: none; border: 1px solid var(--line2); padding: 0; cursor: pointer; }
input[type=color].color-dot { -webkit-appearance: none; appearance: none; overflow: hidden; }
input[type=color].color-dot::-webkit-color-swatch-wrapper { padding: 0; } input[type=color].color-dot::-webkit-color-swatch { border: 0; border-radius: 6px; }
.perm-grid th, .perm-grid td { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }
.perm-grid input { width: 18px; height: 18px; accent-color: var(--accent); }
.hours-row { display: grid; grid-template-columns: 110px 90px 1fr 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.placeholder-chip { font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--tint); border: 0; cursor: pointer; color: var(--text); }
.placeholder-chip:hover { background: var(--accent-soft); color: var(--accent-ink); }
.wa-preview { background: #E7FFDB; color: #111; border-radius: 12px 12px 12px 2px; padding: 10px 12px; white-space: pre-wrap; font-size: 13.5px; box-shadow: 0 1px 1px rgba(0,0,0,.1); max-width: 420px; }
.receipt.mm58 { width: 300px; font-size: 11px; }
.receipt.a4 { width: 640px; font-family: inherit; font-size: 13px; }
.receipt .logo-img { max-height: 56px; max-width: 160px; margin: 0 auto 6px; display: block; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 980px; font-size: 11.5px; font-weight: 600; border: 1px solid currentColor; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
@media print { .receipt.a4 { width: 100%; } .receipt.mm58 { width: 58mm; } }

.cal-slot.off { background: repeating-linear-gradient(-45deg, var(--tint) 0 6px, transparent 6px 12px); }

/* ---------- Multi-branch / platform ---------- */
.support-bar { display: flex; align-items: center; gap: 10px; padding: 8px 28px; background: #1D1D1F; color: #fff; font-size: 13px; position: sticky; top: 0; z-index: 11; }
.support-bar .btn { background: #fff; color: #1D1D1F; border-color: #fff; }
.support-bar form { margin: 0; }
.branch-switch { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 12px; border: 1px solid var(--line2); border-radius: 980px; background: var(--surface); color: var(--muted); margin: 0; }
.branch-switch select { border: 0; background: transparent; font-weight: 600; color: var(--text); cursor: pointer; max-width: 160px; padding: 0 4px; height: 32px; }
.branch-switch select:focus { outline: none; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.plan-chip { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 900px) { .support-bar { padding: 8px 16px; } .branch-switch select { max-width: 110px; } }
/* Phones: segmented controls scroll sideways instead of pushing the page wider; hours rows wrap onto two lines. */
.seg { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.spread > .row, .row > .seg { min-width: 0; max-width: 100%; }
.hours-row .input { min-width: 0; }
@media (max-width: 640px) {
  .hours-row { grid-template-columns: 1fr 1fr; row-gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .hours-row > label { justify-self: end; }
}
.grid > * { min-width: 0; }
/* Phones: header action buttons collapse to icons (text stays as the accessible name) so the page title keeps its room. */
@media (max-width: 640px) {
  .topbar { gap: 6px; }
  .topbar > .btn, .topbar > form > .btn { font-size: 0; gap: 0; width: 38px; padding: 0; justify-content: center; flex: none; }
  .topbar > .btn .ti, .topbar > form > .btn .ti { font-size: 18px; margin: 0; }
  .topbar > .seg { flex: 0 1 auto; }
  .title-area h1 { font-size: 18px; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .title-area { flex: 1 1 120px; }
  .search-pill { flex: none; }
  .topbar > .branch-switch { order: 10; flex: 1 1 100%; }
  .topbar > .branch-switch select { max-width: none; flex: 1; }
}
.mobile-inline { display: none; }
@media (max-width: 900px) { .mobile-inline { display: inline; } }
.cal-layout { grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
.inv-layout { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 900px) { .cal-layout, .inv-layout { grid-template-columns: minmax(0, 1fr); } }
.receipt-layout { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
@media (max-width: 900px) { .receipt-layout { grid-template-columns: minmax(0, 1fr); } .receipt-layout .receipt { max-width: 100%; } }

/* Notification panel */
.notif-panel { width: 380px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 90px)); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; flex: 1; padding: 4px 6px; }
.notif-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 10px 4px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); position: relative; }
.notif-item:hover { background: var(--hover); }
.notif-item .icon-tile { width: 32px; height: 32px; font-size: 16px; }
.notif-item .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 13.5px; line-height: 1.35; }
.notif-item.unread .notif-title { font-weight: 600; }
.notif-body { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.notif-empty { text-align: center; padding: 34px 20px; display: grid; gap: 6px; justify-items: center; }
.notif-empty .ti { font-size: 30px; color: var(--ok); }
.notif-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.notif-foot a { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 640px) { .notif-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-width: none; } }

/* WhatsApp settings */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.provider-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.provider-card:hover { border-color: var(--accent); }
.provider-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.wa-link-box { border-top: 1px dashed var(--line2); padding-top: 12px; }
pre.approval { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--tint); border-radius: 10px; padding: 10px 12px; margin: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
.notif-prefs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 18px; }
/* Narrow desktops and tablets: the search pill shrinks to its icon so the page title keeps its room. */
@media (max-width: 1180px) { .search-pill > span, .search-pill > kbd { display: none; } .search-pill { min-width: 0; padding: 0 10px; } .title-area { min-width: 120px; } }
.txn-start td { border-top: 2px solid var(--line2); }

/* ---------- Sign-in, setup, no access ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { background: var(--accent); color: #fff; padding: 44px 48px; display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; border: 60px solid rgba(255,255,255,.06); right: -170px; bottom: -170px; pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand b { display: block; font-size: 19px; letter-spacing: -0.01em; }
.auth-brand small { display: block; font-size: 13px; opacity: .85; }
.auth-logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--accent); display: grid; place-items: center; font-size: 22px; flex: none; }
.auth-pitch h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; max-width: 460px; margin: 0; }
.auth-pitch p { margin: 10px 0 0; opacity: .88; font-size: 15px; }
.auth-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-tools span { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 22px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.auth-feats li { background: rgba(255,255,255,.1); border-radius: 12px; padding: 11px 12px; font-size: 13.5px; display: flex; align-items: center; gap: 9px; }
.auth-feats .ti { font-size: 18px; flex: none; }
.auth-foot { margin-top: auto; font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 7px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-head h1 { font-size: 28px; letter-spacing: -0.02em; }
.auth-head .muted { margin-top: 4px; }
.input-icon { position: relative; }
.input-icon > .ti { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }
.input-icon > .input.has-reveal { padding-right: 44px; }
.reveal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.reveal-btn:hover { background: var(--hover); color: var(--text); }
.caps-warn { display: none; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); }
.caps-warn.on { display: flex; }
.auth-help summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; list-style: none; }
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help p { margin: 8px 0 0; font-size: 13px; color: var(--muted); background: var(--tint); border-radius: 10px; padding: 10px 12px; }
.auth-note { border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.btn.is-busy { pointer-events: none; opacity: .75; }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-art { padding: 20px 20px 22px; gap: 14px; }
  .auth-art::after { display: none; }
  .auth-pitch h2 { font-size: 21px; }
  .auth-pitch p, .auth-tools, .auth-feats, .auth-foot { display: none; }
  .auth-form { place-items: start center; padding: 28px 20px 40px; }
}

/* ---------- WhatsApp module ---------- */
.wa-chat { background: #ECE5DD; border-radius: 14px; padding: 14px; }
:root[data-mode="dark"] .wa-chat { background: #0B141A; }
.wa-bubble { background: #D9FDD3; color: #111B21; border-radius: 10px 10px 10px 2px; padding: 8px 10px 20px; position: relative; max-width: 340px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.13); word-break: break-word; }
:root[data-mode="dark"] .wa-bubble { background: #005C4B; color: #E9EDEF; }
.wa-time { position: absolute; right: 8px; bottom: 3px; font-size: 10px; color: #667781; }
:root[data-mode="dark"] .wa-time { color: #8FB1A9; }
.wa-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.wa-row-main { flex: 1; min-width: 0; }
.wa-row-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.wa-snippet { font-size: 13px; color: var(--muted); background: var(--tint); border-radius: 10px; padding: 8px 10px; margin-top: 6px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wa-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.steps-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.steps-bar span { flex: 1; padding: 6px 10px; border-radius: 999px; background: var(--tint); font-size: 12px; font-weight: 650; color: var(--muted); text-align: center; }
.steps-bar span.on { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 640px) { .wa-row { flex-direction: column; } .wa-row-act { justify-content: flex-start; } }

/* Collapsed sidebar: a themed label flyout on hover (positioned by JS so the scrolling side panel can't clip it). */
.navtip { position: fixed; z-index: 2000; background: var(--text); color: var(--surface); font-size: 13px; font-weight: 500; line-height: 1; padding: 7px 11px; border-radius: 8px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lg); opacity: 0; transform: translateX(-4px); transition: opacity .1s ease, transform .1s ease; }
.navtip.on { opacity: 1; transform: none; }
.navtip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; transform: translateY(-50%) rotate(45deg); background: var(--text); border-radius: 1px; }
@media (max-width: 860px) { .navtip { display: none; } }

/* WhatsApp-green button (public bill page, contact links). */
.btn-wa { background: #25D366; color: #fff; border-color: #25D366; }
.btn-wa:hover { background: #1EBE5A; border-color: #1EBE5A; color: #fff; }
