/* dobl Ops Console — unified stylesheet
   One design language for every section (Overview · Approvals · Game Ops · Business Ops · Settings).
   Brand blue #7DAAE8, deep blue #4a7fc9, yellow #FFD429, green #A4DB57,
   purple #8e57db, grey #C4C9D4, background #FAFAFA. Font: Nunito (Google Fonts).
   This is the single superset — sections never ship their own CSS. */

/* Nunito loaded via Google Fonts CDN in index.html — no @font-face blocks needed. */

:root {
    --blue: #7DAAE8;
    --blue-deep: #4a7fc9;
    --yellow: #FFD429;
    --green: #A4DB57;
    --purple: #8e57db;
    --grey: #C4C9D4;
    --bg: #FAFAFA;
    --card: #ffffff;
    --ink: #1e293b;
    --ink-soft: #475569;
    --ink-faint: #94a3b8;
    --line: #e2e8f0;
    --border: #e2e8f0;
    --red: #ef4444;
    --amber: #f59e0b;
    --teal: #0d9488;
    --shadow: 0 1px 3px rgba(30, 41, 59, 0.07), 0 4px 14px rgba(30, 41, 59, 0.05);
    --font-sans: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --card: #131d2e;
        --ink: #f8fafc;
        --ink-soft: #cbd5e1;
        --ink-faint: #64748b;
        --line: #1e293b;
        --border: #1e293b;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    padding-bottom: env(safe-area-inset-bottom);
}

/* ── Sticky header ── */
.sticky-top { position: sticky; top: 0; z-index: 30; }

.hdr {
    background: var(--blue);
    color: #fff;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow);
}
.hdr h1 { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: 0.2px; white-space: nowrap; }
.hdr .grow { flex: 1; }
.hdr .stamp { font-size: 11px; opacity: 0.85; font-weight: 600; white-space: nowrap; }
.hdr button {
    background: rgba(255, 255, 255, 0.18); border: none; color: #fff;
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
    font-size: 16px; display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
}
.hdr button:active { background: rgba(255, 255, 255, 0.32); }
.hdr button.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header section tabs (scrollable; replaces the dropdown switcher) ──
   The nav lives in the header itself: a horizontal, left-right scrollable row of
   pill tabs. The active tab snaps into view and highlights. Works the same on
   desktop (all tabs visible) and narrow/mobile (scroll to reach each one). */
.hdr-tabs {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 2px;
    overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.hdr-tabs::-webkit-scrollbar { display: none; }
/* Scoped under .hdr so these beat the `.hdr button { width:34px;height:34px }`
   icon-button rule (which would otherwise squash the tabs into 34px squares). */
.hdr .hdr-tab {
    flex: 0 0 auto; width: auto; height: auto; display: flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
    border: none; border-radius: 9px; padding: 7px 12px; white-space: nowrap;
    color: rgba(255, 255, 255, 0.72); background: transparent;
}
.hdr .hdr-tab:hover { color: #fff; }
.hdr .hdr-tab.on { color: #fff; background: rgba(255, 255, 255, 0.22); }
.hdr-cnt {
    background: rgba(255, 255, 255, 0.25); color: #fff;
    font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 9px;
    min-width: 18px; text-align: center;
}
.hdr .hdr-tab.on .hdr-cnt { background: #fff; color: var(--blue-deep); }

/* ── Section dropdown switcher ── */
.dropdown { position: relative; flex: 0 0 auto; }
.dropdown-btn {
    background: rgba(255, 255, 255, 0.18); border: none; color: #fff; cursor: pointer;
    padding: 8px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.dropdown-btn:active, .dropdown.open .dropdown-btn { background: rgba(255, 255, 255, 0.32); }
.dropdown-btn svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropdown-menu {
    /* Anchor to the button's right edge so it opens leftward and never spills off-screen;
       clamp to the viewport on narrow phones. */
    position: absolute; top: calc(100% + 6px); right: 0; left: auto;
    min-width: 188px; max-width: calc(100vw - 24px);
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22); padding: 6px; z-index: 40;
    display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    background: none; border: none; font-family: inherit; font-size: 14px; font-weight: 700;
    color: var(--ink-soft); padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.dropdown-menu button:hover { background: var(--bg); }
.dropdown-menu button.on { background: rgba(125, 170, 232, 0.15); color: var(--blue-deep); font-weight: 800; }
.dropdown-menu button.on .ico svg { stroke: var(--blue-deep); }
.dropdown-menu button .ico { flex: 0 0 auto; display: flex; }
.dropdown-menu button .ico svg { width: 18px; height: 18px; display: block; fill: none; stroke: var(--ink-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropdown-menu button .lbl { flex: 1; }
.dropdown-menu button .badge-cnt {
    margin-left: auto; background: var(--red); color: #fff;
    font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 9px;
    min-width: 18px; text-align: center;
}

/* ── Tabs (within-section sub-navigation) ── */
.tabs {
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    padding: 8px 12px 0; background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 0 0 auto; padding: 8px 14px; font-size: 13px; font-weight: 800;
    color: var(--ink-faint); border: none; background: none; cursor: pointer;
    font-family: inherit; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0;
    display: flex; align-items: center; gap: 6px;
}
.tab.on { color: var(--blue-deep); border-bottom-color: var(--blue-deep); }
.tab .cnt {
    background: var(--blue-deep); color: #fff; font-size: 10px; font-weight: 800;
    padding: 1px 7px; border-radius: 9px; min-width: 18px; text-align: center;
}
.tab .cnt.red { background: var(--red); }

/* ── Filter bar ── */
.filters {
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 8px 12px; display: flex; flex-direction: column; gap: 7px;
}
.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; padding: 5px 12px; border-radius: 14px;
    background: var(--bg); color: var(--ink-soft);
    font-size: 12px; font-weight: 700; border: 1px solid var(--line);
    cursor: pointer; font-family: inherit; white-space: nowrap;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on.blue { background: var(--blue-deep); border-color: var(--blue-deep); }
.chip.on.purple { background: var(--purple); border-color: var(--purple); }
.chip-label { font-size: 11px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.5px; flex: 0 0 auto; }

/* ── Layout ── */
.wrap { max-width: 1400px; margin: 0 auto; padding: 14px 12px 60px; }
.wrap.narrow { max-width: 720px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.card {
    grid-column: span 12; background: var(--card); border-radius: 16px;
    padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.card h3 {
    margin: 0 0 8px; font-size: 12px; font-weight: 800; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.6px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card h3 .grow { flex: 1; }
.section-title {
    grid-column: span 12; font-size: 13px; font-weight: 800; color: var(--ink-soft);
    text-transform: uppercase; letter-spacing: 0.6px; margin: 6px 2px -2px;
}

/* ── Coloured card header band (design-synced 2026-07-02) ──
   Full-width banner heading that bleeds to the card's edges: centred white bold
   title, ~30% larger than the .card h3 eyebrow, no text-shadow, tight 7px gap to
   the first row, top corners matched to the card radius. Background is set per
   card (inline, e.g. style="background:var(--blue)"). Reusable across sections —
   pair with a matching `border-left` on the .card. */
.card-band {
    display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap;
    margin: -14px -16px 7px; padding: 11px 16px; border-radius: 16px 16px 0 0;
    color: #fff; font-weight: 800; font-size: 20px; letter-spacing: 0.3px;
    text-align: center; text-shadow: none;
}
/* Status pills that read on a coloured band — translucent white for status ("Live"),
   solid white for counts / attention so they stand out. */
.band-pill {
    background: rgba(255, 255, 255, 0.25); color: #fff;
    font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 9px;
    letter-spacing: 0; white-space: nowrap; text-decoration: none;
}
.band-pill.solid { background: #fff; color: var(--ink); }
/* A card-titled-but-unbanded header (e.g. IDE skills): the larger, non-uppercase
   section title without the colour band. */
.card h3.card-title, .card-title { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: 0; color: var(--ink); text-transform: none; }
@media (min-width: 640px) {
    .kpi { grid-column: span 6 !important; }
    .card.half { grid-column: span 6; }
    .card.third { grid-column: span 6; }
}
@media (min-width: 1024px) {
    .kpi { grid-column: span 3 !important; }
    .card.half { grid-column: span 6; }
    .card.third { grid-column: span 4; }
    /* Dense metric cards go 2-up only once there's room for the TD/YD/7D/30D row +
       sparkline in half the width; below 1024 they stay full-width single-column. */
    .card.wide-half { grid-column: span 6; }
    .wrap { padding: 20px 24px 80px; }
}

/* ── KPI cards ── */
.kpi { grid-column: span 6; padding: 12px 14px; border-top: 3px solid var(--blue); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-top-color: var(--blue-deep); }
.kpi.alert-kpi { border-top-color: var(--red); }
.kpi .t { font-size: 11px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.kpi .v { font-size: 28px; font-weight: 800; margin: 3px 0 1px; color: var(--ink); }
.kpi .v.warn { color: var(--amber); }
.kpi .v.ok { color: #16a34a; }
.kpi .d { font-size: 12px; font-weight: 700; color: var(--ink-faint); }

/* ── Chart cards ── */
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 180px; }

/* ── Worker status dot ── */
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.dot.ok { background: #22c55e; }
.dot.stale { background: var(--amber); }
.dot.error { background: var(--red); }
.dot.none { background: var(--grey); }

/* ── Cost mini-bars ── */
.cost-bar-track { flex: 1; background: var(--bg); border-radius: 6px; height: 8px; overflow: hidden; min-width: 60px; }
.cost-bar { height: 100%; border-radius: 6px; background: var(--blue); }
.cost-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.cost-row + .cost-row { border-top: 1px solid var(--line); }
.cost-lbl { font-size: 12px; font-weight: 700; color: var(--ink-soft); width: 110px; flex: 0 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-val { font-size: 12px; font-weight: 800; color: var(--ink); width: 56px; text-align: right; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.cost-total { border-top: 2px solid var(--line) !important; margin-top: 4px; padding-top: 8px !important; }
.cost-total .cost-lbl { color: var(--ink); font-weight: 800; }
.cost-total .cost-val { color: var(--ink); }

/* ── Badges ── */
.badge {
    font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 9px;
    text-transform: uppercase; letter-spacing: 0.3px; flex: 0 0 auto; white-space: nowrap;
}
.badge.ok { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.badge.error { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.badge.running { background: rgba(125, 170, 232, 0.2); color: var(--blue-deep); }
.badge.l0 { background: var(--bg); color: var(--ink-faint); border: 1px solid var(--line); text-transform: none; }
.badge.l1 { background: rgba(245, 158, 11, 0.14); color: #b45309; text-transform: none; }
.badge.l2 { background: rgba(125, 170, 232, 0.15); color: var(--blue-deep); text-transform: none; }
.badge.worker { background: rgba(142, 87, 219, 0.14); color: var(--purple); text-transform: none; }
.badge.action { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); text-transform: none; }
.badge.reversible { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge.irreversible { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.badge.severity-info { background: rgba(125, 170, 232, 0.2); color: var(--blue-deep); }
.badge.severity-warning { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.badge.severity-critical { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge.phase2 { background: rgba(142, 87, 219, 0.1); color: var(--purple); }
.badge.phase3 { background: rgba(13, 148, 136, 0.1); color: var(--teal); }
.badge.scaffold { background: var(--bg); color: var(--ink-faint); border: 1px solid var(--line); }

/* ── Tables ── */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left; font-size: 10px; font-weight: 800; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 8px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ── Approval cards ── */
.approval-card { border-left: 3px solid var(--blue-deep); }
.approval-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.approval-summary { font-size: 15px; font-weight: 700; color: var(--ink); margin: 8px 0; line-height: 1.4; }
.approval-payload { margin: 8px 0; }
.approval-actions { display: flex; gap: 10px; margin-top: 12px; }
/* Plain-English Problem / Fix / Next-steps */
.approval-detail { margin: 10px 0 4px; }
.ap-field { display: flex; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.ap-field:first-child { border-top: none; }
.ap-label { flex: 0 0 96px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-faint); padding-top: 2px; }
.ap-value { flex: 1; font-size: 13.5px; line-height: 1.5; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ap-value code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.ap-list { margin: 0; padding-left: 18px; }
.ap-list li { margin-bottom: 4px; }
.ap-muted { color: var(--ink-faint); }
.ap-link { color: var(--blue-deep); font-weight: 700; text-decoration: none; }
.ap-link:hover { text-decoration: underline; }
.ap-note { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); background: var(--bg); border-radius: 8px; padding: 8px 11px; }
.approval-raw { margin-top: 10px; }
.approval-raw > summary { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-faint); cursor: pointer; list-style: revert; }
.approval-raw[open] > summary { margin-bottom: 6px; }
/* Routine/clean-day cards (nothing to decide) collapse their detail behind one line */
.approval-detail-toggle { margin: 8px 0 4px; }
.approval-detail-toggle > summary { font-size: 12.5px; color: var(--ink-soft); cursor: pointer; list-style: revert; }
.approval-detail-toggle[open] > summary { margin-bottom: 4px; color: var(--ink-faint); }

/* ── Raw/code box ── */
.raw-box {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11.5px;
    line-height: 1.5; color: var(--ink-soft); background: var(--bg);
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px;
}

/* ── Scaffold cards ── */
.scaffold-card { opacity: 0.75; }
.scaffold-card h3 { color: var(--ink-faint); }
.scaffold-desc { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.5; margin: 4px 0 10px; }

/* ── Settings control table ── */
.settings-table td input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue-deep); cursor: pointer; }
.settings-table td input[type="text"],
.settings-table td input[type="number"] {
    font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink);
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    padding: 4px 8px; width: 100%; outline: none;
}
.settings-table td input:focus { border-color: var(--blue); }
.settings-table td select {
    font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink-soft);
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px;
}

/* ── Buttons ── */
.btn {
    font-family: inherit; font-size: 13px; font-weight: 800; padding: 9px 16px;
    border-radius: 11px; border: 1px solid var(--line); background: var(--card);
    color: var(--ink-soft); cursor: pointer;
}
.btn.primary { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.btn.green, .btn.approve { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.warn { background: var(--card); color: var(--red); border-color: #fecaca; }
.btn.warn:hover { background: rgba(239, 68, 68, 0.08); }
.btn.ghost { background: var(--bg); color: var(--ink-soft); }
.btn.sm { font-size: 12px; padding: 6px 12px; border-radius: 9px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.kill-switch { border: 1.5px solid #fecaca; color: var(--red); background: rgba(239, 68, 68, 0.06); }
.kill-switch:hover { background: rgba(239, 68, 68, 0.12); }

/* ── Auth screen ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--blue); }
.auth-card {
    background: var(--card); border-radius: 24px; padding: 32px 28px; width: 100%;
    max-width: 380px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); text-align: center;
}
.auth-card .logo { font-size: 32px; margin-bottom: 10px; }
.auth-card h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.auth-card p { margin: 0 0 18px; color: var(--ink-faint); font-size: 13px; font-weight: 600; }
.auth-card input {
    width: 100%; padding: 12px 14px; margin-bottom: 10px; font-family: inherit;
    font-size: 15px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg); color: var(--ink); outline: none;
}
.auth-card input:focus { border-color: var(--blue-deep); }
.auth-card button {
    width: 100%; padding: 13px; font-family: inherit; font-size: 15px; font-weight: 800;
    background: var(--blue-deep); color: #fff; border: none; border-radius: 12px; cursor: pointer;
}
.auth-card button:disabled { opacity: 0.6; }
.auth-card .err { color: var(--red); font-size: 13px; font-weight: 700; margin-top: 10px; min-height: 18px; }

/* ── Misc ── */
.loading { text-align: center; padding: 40px; color: var(--ink-faint); font-weight: 700; }
.spinner {
    width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--blue-deep);
    border-radius: 50%; margin: 0 auto 10px; animation: spin 0.8s linear infinite;
}
.empty { color: var(--ink-faint); font-size: 13px; font-weight: 600; padding: 18px 0; text-align: center; }
.hint {
    background: rgba(255, 212, 41, 0.15); border: 1px solid rgba(255, 212, 41, 0.5);
    border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.note { font-size: 13px; color: var(--ink-faint); line-height: 1.5; margin: 0 0 8px; }
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
    padding: 11px 20px; border-radius: 12px; z-index: 100; box-shadow: var(--shadow);
    max-width: 90vw; pointer-events: none;
}
.toast.err { background: var(--red); }
.init-fail { text-align: center; padding-top: 35vh; font-family: 'Nunito', sans-serif; }
.init-fail p { color: var(--ink-faint); margin-bottom: 16px; font-weight: 700; }
.init-fail button {
    padding: 10px 24px; background: var(--blue-deep); color: #fff; border: none;
    border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 800;
}

/* ── Segmented control (curator choices) ── */
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink-soft); background: none; border: none; border-right: 1px solid var(--line); padding: 7px 11px; cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s; }
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--bg); }
.seg button.on { background: var(--blue-deep); color: #fff; }

/* ── Form fields (Expenses review controls) ── */
.field { margin-top: 10px; }
.field > label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-faint); margin-bottom: 4px; }
.field select, .field input {
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
    background: var(--card); border: 1px solid var(--line); border-radius: 9px;
    padding: 9px 11px; width: 100%; outline: none;
}
.field select:focus, .field input:focus { border-color: var(--blue); }
.field.warn > label { color: var(--amber); }
.field.warn input { border-color: var(--amber); }
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; margin-top: 0; }
.receipt-frame { width: 100%; min-height: 360px; border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; background: #fff; }
.kvline { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.kvline .k { color: var(--ink-faint); }
