/* HB Cafe – shared design system. 1.1.0: HB dark glass (Foundation Handbook §7, tokens from HB Budget).
   Dark is the default; light = :root[data-theme="light"]. RTL-safe (logical properties). Fonts are self-hosted (app/fonts). */
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('../fonts/sora-latin-var.woff2') format('woff2'); }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url('../fonts/cairo-arabic-var.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url('../fonts/cairo-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/jetbrains-mono-400.woff2') format('woff2'); }

:root {
  /* HB Budget tokens – dark (default) */
  --brand: #018445; --brand2: #00a35a; --lime: #98ca3d;
  --bg: #06140e; --bg2: #0b2018; --card: rgba(255, 255, 255, .055); --card-b: rgba(152, 202, 61, .18); --card-h: rgba(255, 255, 255, .09);
  --tx: #f1f7f2; --mut: #9fb8a8; --inc: #98ca3d; --exp: #f87171; --acc: #018445; --acc2: #00a35a; --warn: #fbbf24; --blu: #7cc4ff;
  --r: 16px; --glow1: #0f4d2e; --glow2: #2c4a12; --th: #0c2419; --sheet1: #0f2a1d; --sheet2: #081a12;
  --navbg: rgba(6, 20, 14, .7); --onacc: #fff; --inp: rgba(2, 12, 8, .55);
  /* HB Cafe additions */
  --accent-ink: #98ca3d;                 /* icons and links on surfaces: lime on dark, deep green on light (never lime on green) */
  --bad-fill: #c62828; --info-fill: #1b5e9e; /* solid fills behind white text */
  --call: #8a5a00; --call-ink: #F0B04A;   /* room calls: fill / text-icon colour */
  /* existing HB Cafe names, mapped to the HB tokens so the rest of the CSS keeps working */
  --green: var(--brand); --green-dark: #016b38; --pale: rgba(152, 202, 61, .14); --cream: rgba(251, 191, 36, .12);
  --ink: var(--tx); --olive: #b9d49a; --muted: var(--mut);
  --good: var(--inc); --bad: var(--exp); --info: var(--blu);
  --surface: var(--card); --surface-2: rgba(255, 255, 255, .08); --line: rgba(255, 255, 255, .08); --line-strong: var(--card-b);
  --nav-bg: var(--navbg); --nav-ink: var(--mut); --nav-active-bg: var(--brand); --nav-active-ink: #fff;
  --focus: 0 0 0 3px rgba(152, 202, 61, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  --radius: var(--r); --font: 'Sora', 'Cairo', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f8f4; --bg2: #ffffff; --card: #ffffff; --card-b: #d7e6dc; --card-h: #f0f7f2;
  --tx: #10241a; --mut: #5b7466; --inc: #3f7d12; --exp: #c62828; --warn: #b26a00; --blu: #1565c0;
  --glow1: #e3f2e8; --glow2: #eef6dd; --th: #eaf3ed; --sheet1: #ffffff; --sheet2: #f6faf7; --navbg: rgba(255, 255, 255, .85); --inp: #ffffff;
  --accent-ink: #016b38; --call-ink: #8a5a00;
  --pale: #EDF4DC; --cream: #FFF6D9; --olive: #3F6B2F; --surface-2: #F4F8F3; --line: #e3ece6;
  --shadow: 0 1px 2px rgba(16, 36, 26, .06), 0 4px 16px rgba(16, 36, 26, .05); --shadow-lg: 0 8px 28px rgba(16, 36, 26, .18);
  color-scheme: light;
}
/* Teams high contrast (set by core.js) and Windows contrast themes: solid surfaces, white lines, no glows. */
:root.hc { --bg: #000; --bg2: #000; --card: #000; --card-b: #fff; --card-h: #1a1a1a; --tx: #fff; --mut: #e6e6e6; --line: #fff; --glow1: #000; --glow2: #000;
  --navbg: #000; --sheet1: #000; --sheet2: #000; --inp: #000; --th: #000; --accent-ink: #fff200; --pale: #1a1a1a; --surface-2: #1a1a1a; }
[dir="rtl"] { --font: 'Cairo', 'Sora', 'Segoe UI', system-ui, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
/* HB icon style (Handbook §7.8): outline, 19 px, stroke 1.8, round caps, currentColor */
svg.i { width: 19px; height: 19px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; } svg.i.lg { width: 24px; height: 24px; }
/* drink, option, call-reason and room icons: unchanged from 1.0.x (D-48) */
svg.ct { width: 18px; height: 18px; stroke-width: 2; } /* low specificity: every sized rule (cards, kiosk, picker) still wins */
.mono { font-family: 'JetBrains Mono', Consolas, monospace; }

/* ── layout ── */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 230px; max-width: 100%; background: var(--nav-bg); color: var(--nav-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; font-weight: 800; font-size: 17px; color: #fff; }
.nav .brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav .group { font-size: 11px; font-weight: 700; color: var(--lime); padding: 12px 10px 4px; letter-spacing: .06em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--nav-ink); text-decoration: none; padding: 9px 10px; border-radius: 9px; min-height: 40px; }
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a.active { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 700; }
.nav a .count { margin-inline-start: auto; background: var(--cream); color: #8a5a00; border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: 12px; }
.nav .spacer { flex: 1; }
.nav .foot { font-size: 12px; color: var(--lime); padding: 12px 10px 0; display: flex; flex-direction: column; gap: 8px; }
.nav .foot .row { display: flex; gap: 6px; flex-wrap: wrap; }
.nav .foot button { background: transparent; border: 1px solid rgba(172, 204, 93, .6); color: var(--nav-ink); border-radius: 8px; min-height: 34px; padding: 0 10px; cursor: pointer; }
.main { flex: 999 1 560px; min-width: 0; padding: 22px 26px 60px; display: flex; flex-direction: column; gap: 14px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { align-content: flex-start; }
  .nav { flex-basis: 100%; padding: 10px 12px; }
  .nav.collapsed > :not(.brand) { display: none; }
  .nav .brand { padding-bottom: 0; }
  .menu-btn { display: inline-flex; margin-inline-start: auto; }
  .main { padding: 16px 14px 60px; }
}

/* ── page header & toolbar ── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.page-head .titles { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.crumb { font-size: 12px; color: var(--muted); }
h1 { margin: 0; font-size: 24px; color: var(--tx); font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; min-height: 40px; flex: 1 1 220px; }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; min-height: 38px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); min-height: 38px; padding: 0 14px; cursor: pointer; }
.seg button.on { background: var(--green); color: #fff; font-weight: 700; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: inherit; white-space: nowrap; }
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 40px; padding: 0; }

/* ── cards, tables ── */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { background: var(--green); color: #fff; text-align: start; padding: 10px 12px; font-weight: 700; white-space: nowrap; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.sel td { background: var(--pale); }
td.check, th.check { width: 36px; cursor: default; }
td .ar, .ar { font-family: "Cairo", system-ui, sans-serif; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }

/* ── badges, chips ── */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.badge.good { color: var(--good); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); } .badge.muted { color: var(--muted); } .badge.info { color: var(--info); }
.chip { display: inline-block; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 7px; margin: 1px; font-size: 12px; }
.missing { color: var(--warn); font-weight: 700; }

/* ── bulk bar ── */
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--ink); color: var(--surface); border-radius: 12px; padding: 8px 12px; }
.bulk strong { flex: 1; }
.bulk .btn { background: transparent; color: inherit; border-color: var(--lime); }
.bulk .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ── drawer (edit form) ── */
.drawer-back { position: fixed; inset: 0; background: rgba(10, 20, 12, .35); z-index: 40; }
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(460px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border-inline-start: 4px solid var(--lime); }
.drawer header { display: flex; align-items: center; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 18px; flex: 1; }
.drawer .body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.drawer footer .grow { flex: 1; }

/* ── form fields ── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--bad); font-weight: 600; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .input {
  min-height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); padding: 6px 10px; background: var(--surface); width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.field.req > label::after { content: " *"; color: var(--bad); }
.field.req input, .field.req select { border-width: 2px; border-color: var(--green); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .hours { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(198, 40, 40, .15); }
.field.highlight { animation: hl 1.6s ease 2; border-radius: 10px; }
@keyframes hl { 50% { box-shadow: 0 0 0 4px var(--lime); } }
.switch { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.switch input { width: 20px; height: 20px; }
.grid2 { display: flex; flex-wrap: wrap; gap: 10px; } .grid2 > * { flex: 1 1 160px; }
.checks-list { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.checks-list label { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.hours { border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.hours .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 36px; }
.hours .row .day { width: 110px; display: flex; gap: 6px; align-items: center; }
.hours input[type="time"] { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 6px; background: var(--surface); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--green-dark); }
.icon-pick button.on { border: 2px solid var(--green); background: var(--pale); }
.icon-pick svg.i { width: 26px; height: 26px; stroke-width: 1.7; }
.icon-pick button { position: relative; }
.icon-pick svg.i.ci { width: 36px; height: 36px; }
/* colour icons (1.0.2): they carry their own fills and outlines */
svg.i.ci { stroke: none; fill: none; }
:root:not([data-theme="light"]) svg.i.ci { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); }
.meta-line { font-size: 12px; color: var(--muted); }

/* ── notices, toasts, dialog ── */
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 14px; border: 1px solid; }
.notice.warn { background: var(--cream); border-color: #E8D9A8; color: inherit; }
.notice.bad { background: rgba(198, 40, 40, .08); border-color: var(--bad); }
.notice.good { background: var(--pale); border-color: var(--good); }
.toasts { position: fixed; inset-block-end: 16px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 24px)); }
[dir="rtl"] .toasts { transform: translateX(50%); }
.toast { background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; }
.toast.bad { background: var(--bad); color: #fff; } .toast.good { background: var(--green); color: #fff; }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100% - 24px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 20, 12, .45); }
dialog .d-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
dialog .d-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.code-box { background: var(--ink); color: var(--surface); border-radius: 14px; padding: 18px; text-align: center; }
.code-box .code { font-size: 44px; font-weight: 800; letter-spacing: 8px; font-variant-numeric: tabular-nums; direction: ltr; }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.status-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.status-grid .card { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; flex-direction: column; gap: 6px; }
.check-item .refs { display: flex; flex-wrap: wrap; gap: 6px; }
.check-item .refs a { cursor: pointer; text-decoration: underline; }
pre.json { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: 8px; padding: 8px; font-size: 12px; margin: 0; max-height: 220px; overflow: auto; }
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.signin .card { max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ── drag-and-drop order (0.7.3) ── */
.ro-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.reorder { display: flex; flex-direction: column; gap: 6px; }
.ro-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.ro-group { display: flex; flex-direction: column; gap: 6px; }
.ro-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; box-shadow: var(--shadow); min-height: 48px; }
.ro-item.dragging { border: 2px solid var(--green); background: var(--pale); box-shadow: var(--shadow-lg); opacity: .95; }
.ro-item svg.i { color: var(--accent-ink); }
.ro-name { font-weight: 700; flex: 1; min-width: 0; }
.ro-ar { color: var(--muted); }
.ro-grip { width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); cursor: grab; display: inline-flex; align-items: center; justify-content: center; touch-action: none; color: var(--muted); }
.ro-grip:active { cursor: grabbing; }
.ro-grip svg.i { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.ro-grip { color: var(--olive); }

/* ── CSV import (0.9.0) ── */
dialog.wide { width: min(900px, calc(100% - 24px)); max-height: calc(100vh - 40px); }
dialog.wide > div { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
dialog.wide .d-body { overflow: auto; }
.imp-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.imp-cols summary { cursor: pointer; font-weight: 700; }
.imp-cols > div { margin-top: 6px; }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-strong); border-radius: 14px; cursor: pointer; text-align: center; background: var(--surface-2); }
.imp-drop svg.i { width: 34px; height: 34px; color: var(--accent-ink); }
.imp-drop.over, .imp-drop:hover, .imp-drop:focus-visible { border-color: var(--green); background: var(--pale); outline: none; }
.imp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.imp-stat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.imp-stat strong { font-size: 24px; }
.imp-stat span { font-size: 13px; color: var(--muted); }
.imp-stat.good strong { color: var(--accent-ink); } .imp-stat.bad strong { color: #B42318; } .imp-stat.info strong { color: #1D5FA8; }
.imp-table { max-height: 46vh; overflow: auto; box-shadow: none; }
.imp-table tr.err td { background: rgba(180, 35, 24, .06); }
.imp-bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.imp-bar > div { height: 100%; width: 0; background: var(--green); transition: width .3s; }
.d-foot .grow { flex: 1; }

/* credit line (1.0.3) */
footer.credit { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; padding: 22px 12px 14px; margin-top: 18px; border-top: 1px solid var(--line); }
footer.credit .v { opacity: .8; font-size: 11px; margin-top: 2px; }
.credit-side { font-size: 10.5px; line-height: 1.4; opacity: .75; margin-top: 4px; }

/* working hours mode (1.0.8) */
.hours .hmodes { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.hours .hmode { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }

/* ═════════ 1.1.0 – HB dark glass skin (Foundation Handbook §7.2). Overrides only: no layout or behaviour change. ═════════ */
body { background: radial-gradient(1200px 600px at 10% -10%, var(--glow1) 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, var(--glow2) 0%, transparent 55%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; }
/* glass surfaces: cards and tables (blur 14), navigation (blur 16) */
.card, .table-wrap { background: var(--card); border: 1px solid var(--card-b); box-shadow: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav { background: var(--navbg); color: var(--tx); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-inline-end: 1px solid var(--card-b); }
@media (min-width: 861px) { .nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; } }
@media (max-width: 860px) { .nav { border-inline-end: 0; border-bottom: 1px solid var(--card-b); } }
.nav .brand { color: var(--tx); font-weight: 700; }
.nav .group { color: var(--accent-ink); }
.nav a { color: var(--mut); font-weight: 600; border-radius: 12px; min-height: 42px; padding: 10px 12px; }
.nav a:hover { background: var(--card); color: var(--tx); }
.nav a.active { background: var(--brand); color: #fff; font-weight: 700; }
.nav a.active svg.i { stroke: var(--lime); }
.nav a .count { background: var(--warn); color: #2b1d00; }
.nav .foot { color: var(--mut); }
.nav .foot button { border-color: var(--card-b); color: var(--tx); background: var(--card); border-radius: 12px; }
.nav .foot button:hover { background: var(--card-h); }
.menu-btn { color: var(--tx); }
/* controls */
.search { background: var(--inp); border-color: var(--card-b); border-radius: 12px; min-height: 42px; }
.search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(152, 202, 61, .3); }
.seg { border-color: var(--card-b); border-radius: 12px; }
.seg button { background: transparent; color: var(--mut); font-weight: 600; }
.seg button.on { background: var(--brand); color: #fff; }
.btn { background: var(--card); border-color: var(--card-b); color: var(--tx); border-radius: 12px; min-height: 42px; }
.btn:hover { background: var(--card-h); border-color: var(--lime); }
/* gradient ends darker than Budget's --acc2 so white text keeps AA 4.5:1 (D-47) */
.btn.primary { background: linear-gradient(135deg, var(--acc2), var(--acc) 45%, #016b38); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgba(1, 132, 69, .35); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { border-color: var(--bad); color: var(--bad); background: rgba(248, 113, 113, .1); }
.btn.danger.solid { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 34px; border-radius: 10px; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .input, .hours input[type="time"] {
  background: var(--inp); border-color: var(--card-b); color: var(--tx); border-radius: 12px; min-height: 42px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(152, 202, 61, .3); outline: none; }
.field.req input, .field.req select { border-color: var(--brand2); }
.hours, .checks-list { border-color: var(--card-b); }
select option { background: var(--bg2); color: var(--tx); }
input[type="checkbox"] { accent-color: var(--brand); }
.icon-pick button { background: var(--inp); border-color: var(--card-b); color: var(--accent-ink); border-radius: 12px; }
.icon-pick button.on { border: 2px solid var(--lime); background: var(--pale); }
/* tables */
th { background: var(--th); color: var(--mut); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
td { border-top-color: var(--line); }
tbody tr:hover td { background: rgba(255, 255, 255, .04); }
tbody tr.sel td { background: rgba(152, 202, 61, .12); }
.chip { background: var(--surface-2); border-color: var(--card-b); }
.badge svg.i, .missing svg.i, td > svg.i:not(.ct) { width: 14px; height: 14px; vertical-align: -2px; }
.bulk { background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.bulk .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); color: #fff; }
.bulk .btn.danger { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
/* drawer, dialog, toasts, notices */
.drawer-back { background: rgba(3, 6, 18, .6); }
.drawer { background: linear-gradient(180deg, var(--sheet1), var(--sheet2)); color: var(--tx); border-inline-start: 3px solid var(--lime); }
.drawer header, .drawer footer, dialog .d-foot { border-color: var(--line); }
dialog { background: linear-gradient(180deg, var(--sheet1), var(--sheet2)); color: var(--tx); border: 1px solid var(--card-b); border-radius: 20px; }
dialog::backdrop { background: rgba(3, 6, 18, .7); }
.toast { background: var(--sheet1); color: var(--tx); border: 1px solid var(--card-b); border-radius: 14px; font-weight: 600; }
.toast.bad { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.toast.good { background: var(--brand); border-color: var(--brand); color: #fff; }
.notice.warn { background: var(--cream); border-color: rgba(251, 191, 36, .5); }
.notice.bad { background: rgba(248, 113, 113, .1); }
.code-box { background: var(--inp); border: 1px solid var(--card-b); color: var(--tx); }
pre.json { background: var(--surface-2); }
.ro-bar { background: var(--bg); }
.ro-item { background: var(--card); border-color: var(--card-b); box-shadow: none; }
.ro-item.dragging { border-color: var(--lime); }
.ro-grip { background: var(--surface-2); border-color: var(--card-b); color: var(--mut); }
.imp-drop { background: var(--surface-2); border-color: var(--card-b); }
.imp-drop.over, .imp-drop:hover, .imp-drop:focus-visible { border-color: var(--lime); }
.imp-stat { border-color: var(--card-b); }
.imp-stat.bad strong { color: var(--bad); } .imp-stat.info strong { color: var(--info); }
.imp-bar { background: var(--surface-2); border-color: var(--card-b); } .imp-bar > div { background: var(--brand2); }
.imp-table tr.err td { background: rgba(248, 113, 113, .08); }
footer.credit { border-top-color: var(--line); }
/* no blur support: solid fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .table-wrap, .nav, .e-bar, .where, .stat, .col, .sendbar { background: var(--bg2); }
}
/* light theme: no blur, soft shadow (Budget) */
:root[data-theme="light"] .card, :root[data-theme="light"] .table-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--shadow); }
:root[data-theme="light"] th { color: #3d5a49; }
:root[data-theme="light"] tbody tr:hover td { background: #f3f9f5; }
:root[data-theme="light"] dialog::backdrop, :root[data-theme="light"] .drawer-back { background: rgba(16, 36, 26, .35); }
:root[data-theme="light"] .notice.bad { background: #fdecee; }
/* high contrast: no glass at all */
:root.hc *, :root.hc *::before { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
:root.hc body { background: #000; }
@media (forced-colors: active) {
  .card, .table-wrap, .nav, .btn, .toast, dialog, .drawer { border: 1px solid CanvasText; backdrop-filter: none; }
  .nav a.active { outline: 2px solid Highlight; }
}
