/* GribLak admin: dark olive sidebar, olive accents on a pale sage ground, Bricolage Grotesque
   titles over Plus Jakarta Sans. Light and dark themes come from data-theme on <html>. */
:root {
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;

  --bg: #F4F6EF;
  --surface: #FFFFFF;
  --surface-alt: #FBFCF8;
  --tint: #F2F6E6;
  --seg: #E6EADC;
  --line: #E3E8D8;
  --line-soft: #EEF1E6;
  --control: #DCE2CF;
  --ink: #18200F;
  --ink-2: #2B3424;
  --muted: #69715F;
  --muted-2: #4A5340;
  --primary: #4F5D3A;
  --primary-hover: #435032;
  --on-primary: #FFFFFF;
  --side: #1D2618;
  --side-ink: #DDE5CC;
  --side-strong: #F4F7EC;
  --side-muted: #8A967A;
  --lime: #C8DE74;
  --on-lime: #1D2618;
  --hero: #1D2618;
  --on-hero: #F4F7EC;
  --on-hero-muted: #BAC5A4;

  --amber-bg: #FCEFD2; --amber-fg: #7A4E00;
  --red-bg: #FBE4DF; --red-fg: #A33522;
  --blue-bg: #E1ECF6; --blue-fg: #245A86;
  --green-bg: #E3F0D8; --green-fg: #2F6B2B;
  --grey-bg: #EEF1E6; --grey-fg: #4A5340;
  --chart-accepted: #4F5D3A; --chart-expired: #D9A441; --chart-other: #C9CFBB; --chart-grid: #EEF1E6;

  --radius: 14px;
  --radius-card: 22px;
  --shadow-pop: 0 1px 3px rgba(24, 32, 15, 0.12);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12170E;
  --surface: #1A2115;
  --surface-alt: #1E2619;
  --tint: #232D1B;
  --seg: #232B1C;
  --line: #2D3825;
  --line-soft: #26301F;
  --control: #39452F;
  --ink: #EEF2E4;
  --ink-2: #DCE3CF;
  --muted: #A3AD93;
  --muted-2: #BAC3AA;
  --primary: #A9C46A;
  --primary-hover: #BBD47C;
  --on-primary: #15200C;
  --side: #0D1209;
  --hero: #0F150B;
  --amber-bg: #3A2D12; --amber-fg: #F1C873;
  --red-bg: #3D1E18; --red-fg: #F2A493;
  --blue-bg: #17283A; --blue-fg: #9CC4E8;
  --green-bg: #1C3119; --green-fg: #A5D795;
  --grey-bg: #262F20; --grey-fg: #BAC3AA;
  --chart-accepted: #A9C46A; --chart-expired: #D9A441; --chart-other: #4A5540; --chart-grid: #26301F;
  --shadow-pop: 0 1px 3px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 1.45; }
/* What people type (names, comments, places) can be one endless word: it wraps instead of widening
   the page. In tables, user text is cut to one line instead (.one-line, .cell-*). */
body { overflow-wrap: break-word; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
/* A name that links to its page reads as text; the underline comes on hover. */
a.strong { color: var(--ink); text-decoration: none; }
a.strong:hover { color: var(--ink); text-decoration: underline; }
a.sub { text-decoration: none; }
a.sub:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.side { flex: 1 1 236px; padding: 20px 14px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; gap: 18px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--side-strong); text-decoration: none; }
.side-brand:hover { color: var(--side-strong); }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; flex: none; }
.side-brand-name { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.side-brand-sub { display: block; font-size: 12px; color: #9EAA88; }
.side-nav { display: flex; flex-direction: column; gap: 14px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 0 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); }
.side-link { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--side-ink); }
.side-link:hover { color: var(--side-strong); background: rgba(244, 247, 236, 0.06); }
.side-link.active { background: var(--lime); color: var(--on-lime); }
.side-link span:first-child { flex: 1; }
.side-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #B23A26; color: #FFFFFF; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 0; border-top: 1px solid rgba(244, 247, 236, 0.1); }
.side-user { font-size: 13px; font-weight: 700; color: var(--side-strong); word-break: break-all; }
.side-actions { display: flex; gap: 8px; }
.side-btn { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(244, 247, 236, 0.22); background: transparent; color: var(--side-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.side-btn:hover { color: var(--side-strong); border-color: rgba(244, 247, 236, 0.45); }

.main { flex: 999 1 560px; min-width: 0; padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 640px) { .main { padding: 16px 16px 32px; } }

/* Narrow screens: the sidebar becomes a sticky top bar whose menu opens on demand. */
.side-toggle { display: none; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(244, 247, 236, 0.22); background: transparent; color: var(--side-strong); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.side-toggle:hover { border-color: rgba(244, 247, 236, 0.45); }
@media (max-width: 800px) {
  .side { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; position: sticky; top: 0; z-index: 30; }
  .side-brand { flex: 1; padding: 0; }
  .side-toggle { display: inline-flex; }
  .side-nav, .side-foot { display: none; flex-basis: 100%; }
  .side.open { max-height: 100vh; overflow-y: auto; }
  .side.open .side-nav, .side.open .side-foot { display: flex; }
  .side.open .side-foot { margin-top: 4px; }
}

/* ── Page head ─────────────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head-text { flex: 1 1 260px; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.page-title { margin: 2px 0 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { margin: 2px 0 0; font-size: 13.5px; font-weight: 500; color: var(--muted-2); max-width: 70ch; }
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 800; text-decoration: none; }

.search { flex: 1 1 300px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--control); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px; }
.inline-select { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted-2); }
.select, .input, .textarea { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font-size: 14px; }
.textarea { height: auto; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; }
.field-head { display: flex; justify-content: space-between; gap: 8px; }
.field-hint { font-weight: 600; color: var(--muted); }

/* ── Building blocks ───────────────────────────────────────────────────── */
.panel { padding: 18px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-flush { padding: 0; overflow: hidden; gap: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.panel-title { flex: 1; margin: 0; font-size: 15px; font-weight: 800; }
.panel-link { font-size: 13px; font-weight: 800; text-decoration: none; }
.panel-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; align-items: start; }
.cols-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpi { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi-note.up { color: var(--green-fg); }
.kpi-note.down { color: var(--red-fg); }

.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.todo-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.todo-card:hover { color: var(--ink); border-color: var(--control); }
.todo-value { font-family: var(--font-display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.todo-label { font-size: 13px; font-weight: 600; color: var(--muted-2); }

.chip { display: inline-flex; align-items: center; align-self: flex-start; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--grey-bg); color: var(--grey-fg); }
.chip.amber { background: var(--amber-bg); color: var(--amber-fg); }
.chip.red { background: var(--red-bg); color: var(--red-fg); }
.chip.blue { background: var(--blue-bg); color: var(--blue-fg); }
.chip.green { background: var(--green-bg); color: var(--green-fg); }
.chip.on-dark { background: rgba(244, 247, 236, 0.14); color: var(--on-hero); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 800; border: 1px solid var(--control); background: var(--surface); color: var(--ink-2); }
.pill[aria-pressed="true"], .pill[aria-selected="true"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.pill .count { opacity: 0.75; font-variant-numeric: tabular-nums; margin-left: 4px; }

.seg { display: flex; padding: 4px; border-radius: var(--radius); background: var(--seg); }
.seg button { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 800; background: transparent; color: var(--muted-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--ink); border-color: var(--muted); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.primary { border: 0; background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn.danger { border: 0; background: var(--red-bg); color: var(--red-fg); }
.btn.lime { border: 0; background: var(--lime); color: var(--on-lime); }
.btn.on-dark { background: transparent; border-color: rgba(244, 247, 236, 0.3); color: var(--on-hero); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost { border-color: transparent; background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions.ruled { padding-top: 10px; border-top: 1px solid var(--line-soft); }

.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--tint); color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.notice.amber { background: var(--amber-bg); color: var(--amber-fg); }
.notice.red { background: var(--red-bg); color: var(--red-fg); }
.notice.green { background: var(--green-bg); color: var(--green-fg); }
.notice strong { font-weight: 800; }

.hero { position: relative; padding: 20px; border-radius: 24px; background: var(--hero); color: var(--on-hero); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; overflow: hidden; }
.hero-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.hero-sub { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--on-hero-muted); }
.hero-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime); }

.avatar { width: 36px; height: 36px; border-radius: 12px; background: #DCE5C8; color: #2F3A24; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 20px; }
.avatar.xl { width: 64px; height: 64px; border-radius: 20px; font-size: 24px; background: var(--lime); color: var(--on-lime); }
.person-cell { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.person-cell:hover { color: var(--ink); }
.strong { font-weight: 800; }
.sub { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }

/* ── Tables ────────────────────────────────────────────────────────────── */
/* Relative: hidden labels (.sr-only) in a wide table are clipped with it instead of widening the page. */
.table-box { position: relative; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead tr { text-align: left; color: var(--muted); font-size: 12px; background: var(--surface-alt); }
.tbl th { padding: 10px 12px; font-weight: 700; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-alt); }
.tbl tr.selected td { background: var(--tint); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--muted); }
.pager > span.num { flex: 1; }
.pager .pager-num { min-width: 34px; padding: 0 8px; }
.pager .pager-num[aria-current="page"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.pager-gap { padding: 0 2px; }
.pager-top { border-top: 0; border-bottom: 1px solid var(--line-soft); }
.panel:not(.panel-flush) > .pager { margin: 0 -18px -18px; }
/* Long names stay on one line in list tables. */
.tbl .one-line.narrow { max-width: 150px; }
.tbl .one-line { display: block; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Lists, cards, timeline ────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 8px; }
.row-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.row-card:hover { color: var(--ink); }
.select-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 14px; border-radius: 18px; cursor: pointer; text-align: left; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.select-card.selected { border: 2px solid var(--primary); background: var(--tint); padding: 11px 13px; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker-input { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); color: var(--muted); }
.picker-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.picker-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14.5px; }
.picker-list { display: flex; flex-direction: column; padding: 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); max-height: 360px; overflow-y: auto; }
.picker-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.picker-option[aria-selected="true"] { background: var(--tint); }
.picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--primary); background: var(--tint); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { display: block; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-alt); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--control); background: var(--surface); color: var(--ink-2); text-decoration: none; flex: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.icon-btn.whatsapp { color: var(--green-fg); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.red { background: #A33522; } .dot.amber { background: #B7791F; } .dot.olive { background: var(--primary); } .dot.grey { background: #9AA48C; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: 13.5px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feed li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; font-size: 13.5px; line-height: 1.4; }
.feed time { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.party { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); min-width: 0; }
.party:hover { color: var(--ink); }
.party-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.quote { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line-soft); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.meter { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.meter.amber > span { background: #D9A441; } .meter.red > span { background: #A33522; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); font-weight: 600; }
.error-box { padding: 12px 14px; border-radius: var(--radius); background: var(--red-bg); color: var(--red-fg); font-weight: 600; }

/* Bars of the dashboard chart: one column per day, stacked. */
.chart { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; height: 210px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; padding-bottom: 20px; }
.chart-plot { display: flex; flex-direction: column; min-width: 0; }
.chart-bars { flex: 1; display: grid; gap: 6px; align-items: end; border-bottom: 1px solid var(--control); background-image: linear-gradient(to top, var(--chart-grid) 1px, transparent 1px); background-size: 100% 25%; }
.chart-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart-col span { display: block; }
.chart-days { display: grid; gap: 6px; height: 20px; align-items: end; font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; font-weight: 700; color: var(--muted-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar-track { height: 22px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 6px; }

/* Switch */
.switch { position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; cursor: pointer; flex: none; background: var(--control); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; transition: left 0.15s ease; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { left: 23px; }
.switch.on-dark { background: rgba(244, 247, 236, 0.25); }
.switch.on-dark::after { background: var(--hero); }
.switch.on-dark[aria-checked="true"] { background: var(--lime); }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.setting-row > span { flex: 1; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.rule { padding: 12px 14px; border-radius: 16px; background: var(--surface-alt); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.rule-value { font-family: var(--font-display); font-size: 20px; font-weight: 800; }

/* Phone preview of a push */
.phone { width: 320px; max-width: 100%; padding: 18px 14px 26px; border-radius: 38px; background: var(--hero); display: flex; flex-direction: column; gap: 10px; }
.phone-time { align-self: center; font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--on-hero); }
.push { padding: 12px; border-radius: 18px; background: rgba(244, 247, 236, 0.92); color: #18200F; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 10px; }
.push-icon { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; background: #4F5D3A; color: #C8DE74; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; }
.push-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: #4A5340; }
.push-title { display: block; font-size: 13.5px; font-weight: 800; }
.push-body { display: block; font-size: 13px; line-height: 1.4; color: #2B3424; white-space: pre-line; overflow-wrap: anywhere; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; text-align: left; color: var(--ink); border: 1px solid var(--control); background: var(--surface); }
.choice[aria-checked="true"] { border: 2px solid var(--primary); background: var(--tint); padding: 7px 11px; }
.choice small { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Stars, reviews */
.stars { color: #D9A441; letter-spacing: 1px; font-size: 16px; }

/* ── Sign in ───────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-brand { flex: 1 1 420px; position: relative; padding: 48px; background: var(--hero); color: var(--on-hero); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; }
.login-brand h1 { margin: 0; font-family: var(--font-display); font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; max-width: 440px; }
.login-brand p { margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: var(--on-hero-muted); max-width: 440px; }
.login-form-wrap { flex: 1 1 380px; padding: 48px 32px; display: flex; align-items: center; justify-content: center; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-form h2 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.login-form .input { height: 48px; border-radius: var(--radius); font-size: 15px; }
.login-form .btn { height: 50px; border-radius: var(--radius); font-size: 15.5px; }
.zellige { position: absolute; right: -60px; bottom: -60px; width: 420px; height: 420px; opacity: 0.16; pointer-events: none; }
@media (max-width: 640px) { .login-brand { padding: 28px 20px; } .login-brand h1 { font-size: 30px; } .login-form-wrap { padding: 28px 16px; } }

/* ── Classic blocks still used by the request creation page ───────────── */
.card { padding: 18px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title { margin: 0; font-size: 15px; font-weight: 800; }
.card-sub { font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.flex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 13px; font-weight: 800; }
.input-group input, .input-group select, .input-group textarea { height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); }
.input-group textarea { height: auto; padding: 10px 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.table td { padding: 9px 10px; border-top: 1px solid var(--line-soft); }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--grey-bg); color: var(--grey-fg); }
.badge.approved { background: var(--green-bg); color: var(--green-fg); }
.badge.pending { background: var(--amber-bg); color: var(--amber-fg); }
.badge.rejected { background: var(--red-bg); color: var(--red-fg); }
.error { padding: 10px 12px; border-radius: 12px; background: var(--red-bg); color: var(--red-fg); }
.request-map { height: 320px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }

/* ── Public legal pages ────────────────────────────────────────────────── */
.brand-logo { width: 100%; height: 100%; display: block; object-fit: cover; }
.tiny-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.legal-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.legal-topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.legal-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.legal-brand-mark { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-alt); display: grid; place-items: center; overflow: hidden; }
.legal-brand-copy { display: grid; gap: 4px; }
.legal-brand-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.legal-link { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-alt); color: var(--muted); text-decoration: none; }
.legal-link.active, .legal-link:hover { border-color: var(--primary); background: var(--tint); color: var(--ink); }
.legal-main { overflow: auto; padding: 32px 36px 48px; }
.legal-page { max-width: 920px; margin: 0 auto; display: grid; gap: 18px; }
.legal-hero { display: grid; gap: 10px; }
.legal-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.2rem); }
.legal-copy { max-width: 760px; color: var(--muted); font-size: 1.02rem; line-height: 1.7; margin: 0; }
.legal-section { display: grid; gap: 10px; }
.legal-section h2 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; }
.legal-section p { margin: 0; line-height: 1.7; }
.legal-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; line-height: 1.7; }
.legal-note { padding-left: 14px; border-left: 3px solid var(--primary); color: var(--muted); }
.legal-inline-link { color: var(--primary); text-decoration: underline; }
@media (max-width: 640px) { .legal-main { padding: 24px 16px 36px; } .legal-topbar { padding: 18px 16px; } }

#blazor-error-ui { background: var(--amber-bg); color: var(--amber-fg); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.text-danger { color: var(--red-fg); }

/* ── Compact, homogeneous pages ─────────────────────────────────────────────────────
   Lists show 10 rows a page; long text is cut (full text on hover or in a dialog); forms and
   full lists open in a dialog instead of stretching the page. */
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.tbl .strong, .tbl .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.tbl .strong { display: block; }
.tbl td.wrap .strong, .tbl td.wrap .sub { white-space: normal; max-width: none; }
.tbl td { padding: 8px 12px; }
.tbl th { white-space: nowrap; }
.tbl td.num, .tbl th.num { white-space: nowrap; }
.panel-more { align-self: flex-start; }
.tbl .one-line.wide { max-width: 520px; }
.panel-flush > .panel-head { padding: 14px 18px 10px; }
button.panel-link { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; }
button.panel-link:hover { color: var(--primary-hover); text-decoration: underline; }
.tbl .stars { font-size: 14px; white-space: nowrap; }
.tbl td.row-action { width: 1%; white-space: nowrap; text-align: right; cursor: default; }
.pre-line { white-space: pre-line; }

/* Panels side by side on a dashboard end at the same line. */
.cols.even { align-items: stretch; }
/* Master and detail side by side: the detail stays in view and scrolls by itself. */
.cols > .sticky, .cols-wide > .sticky { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }

/* Dialogs */
body:has(.modal-backdrop) { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px; background: rgba(13, 18, 9, 0.45); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(13, 18, 9, 0.28); outline: none; overflow: hidden; }
.modal.modal-sm { width: min(420px, 100%); }
.modal.modal-lg { width: min(960px, 100%); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-title { flex: 1; min-width: 0; margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.modal-close { width: 34px; padding: 0; font-size: 15px; }
.modal-body { padding: 16px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body > .table-box { margin: -16px -18px 0; }
.modal-body > .table-box:last-child { margin-bottom: -18px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); }
.modal-foot .spacer { flex: 1; }
@media (max-width: 640px) {
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal, .modal.modal-sm, .modal.modal-lg { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
}
