/* UK Live control panel. Palette and layout follow the Phase 1 mockups. */
:root {
  --navy: #0B2347;
  --gold: #FFC72C;
  --red: #C8102E;
  --ground: #EEF2F9;
  --line: #D5DDE9;
  --line-soft: #E3E9F2;
  --muted: #55627A;
  --ink: #14213A;
  --link-hover: #1F5FA8;
  --ok-bg: #E7F6EC; --ok-ink: #135C2F;
  --warn-bg: #FFF1C2; --warn-ink: #5C4300;
  --urgent-bg: #FDECEE; --urgent-ink: #8A1023;
  --check-bg: #E6EEFB; --check-ink: #12397A;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Segoe UI", Helvetica, Arial, sans-serif;
  /* Phase 8 polish: one type scale and one spacing scale for every screen. */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 26px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 22px; --space-6: 32px;
  --focus: #1F5FA8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; }
h1 { margin: 0; font-size: var(--fs-xl); line-height: 1.25; font-weight: 800; color: var(--navy); }
h2 { margin: 0 0 var(--space-3); font-size: var(--fs-lg); line-height: 1.3; font-weight: 800; color: var(--navy); }
h3 { margin: var(--space-5) 0 var(--space-2); font-size: var(--fs-md); font-weight: 800; color: var(--navy); }
h4 { margin: var(--space-4) 0 var(--space-2); font-size: var(--fs-base); font-weight: 800; color: var(--navy); }
p { margin: 0 0 12px; }
a { color: var(--navy); font-weight: 600; }
a:hover { color: var(--link-hover); }
code { font-family: Consolas, "Courier New", monospace; font-size: var(--fs-sm); overflow-wrap: anywhere; }
a { text-underline-offset: 2px; }

/* Focus: always visible, navy on light backgrounds and gold on the dark menu. */
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--navy); }
.btn:focus-visible, .tab:focus-visible { outline-offset: 3px; }
.sidebar :focus-visible, .account-header :focus-visible { outline-color: var(--gold); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 10; padding: 8px 14px; border-radius: 999px; background: var(--gold); color: var(--navy); }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }

/* Shell: menu on the left, stacked on top on phones */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.sidebar { flex: 1 1 220px; max-width: 260px; background: var(--navy); color: #DFE8F7; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; }
.content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.content main { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-2) clamp(16px, 3vw, 36px) 40px; min-width: 0; }
.content main > * { min-width: 0; }
.content main:focus { outline: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { color: #FFFFFF; font-size: 15px; }
.brand-text span { font-size: 12px; color: #B9CBEA; }

.menu-toggle { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 600; color: #DFE8F7; }
.nav-link:hover { color: #FFFFFF; background: rgba(255, 255, 255, .08); }
.nav-link.active { background: #FFFFFF; color: var(--navy); }
.nav-later { padding: 1px 8px; border-radius: 999px; border: 1px solid #8FA6CC; font-size: 11px; font-weight: 700; color: #DFE8F7; }
.nav-link.active .nav-later { color: var(--navy); border-color: var(--navy); }

.user-box { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-direction: column; gap: 2px; }
.user-box strong { color: #FFFFFF; font-size: 14px; }
.user-box span { font-size: 12px; color: #B9CBEA; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 20px; padding: 22px clamp(16px, 3vw, 36px) 8px; }
.topbar-search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 520px; }
.topbar-search input { flex: 1; }
.env-pill { padding: 6px 12px; border-radius: 999px; background: var(--urgent-bg); color: var(--urgent-ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; }

/* Page building blocks */
.page-header { display: flex; flex-direction: column; gap: 2px; }
.page-header p { margin: 0; }
.card { background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.card-heading h2 { margin: 0; }
.card.inset { background: var(--ground); border-color: var(--line-soft); }
.notice-card { border-color: var(--gold); background: #FFFBEB; }
.columns { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.column-wide { flex: 3 1 460px; min-width: 0; }
.column-narrow { flex: 2 1 320px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile { background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.tile-note { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Buttons: pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; font: inherit; font-size: 14px; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-primary:hover { background: #F5B800; color: var(--navy); }
.btn-secondary { background: #FFFFFF; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--ground); }
.btn-danger { background: var(--red); color: #FFFFFF; border-color: var(--red); }
.btn-danger:hover { background: #A50D26; border-color: #A50D26; color: #FFFFFF; }
.btn-link { background: none; border: none; padding: 0; min-height: 32px; color: var(--navy); text-decoration: underline; font-weight: 700; }
.btn-on-dark { color: #FFFFFF; justify-content: flex-start; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn[disabled]:hover { background-color: inherit; }
.btn-primary[disabled]:hover { background: var(--gold); }
.btn-secondary[disabled]:hover { background: #FFFFFF; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field label, fieldset legend { font-size: 14px; font-weight: 700; color: var(--ink); }
input:not([type=checkbox]):not([type=radio]), select { height: 44px; padding: 0 14px; border: 1.5px solid #8A96AB; border-radius: 12px; font: inherit; font-size: var(--fs-base); background: #FFFFFF; color: var(--ink); width: 100%; }
textarea { display: block; width: 100%; min-height: 88px; padding: 10px 14px; border: 1.5px solid #8A96AB; border-radius: 12px; font: inherit; font-size: var(--fs-base); line-height: 1.5; background: #FFFFFF; color: var(--ink); resize: vertical; }
::placeholder { color: #6B778C; opacity: 1; }
input[type=radio] { width: 20px; height: 20px; accent-color: var(--navy); }
input[aria-invalid=true], .input-validation-error { border-color: var(--red); }
.field-error { color: var(--red); font-size: 13px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.search-form { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.search-form .field { flex: 1 1 280px; }
.search-form .btn { margin-bottom: 12px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; align-items: end; }
.filters .button-row { margin-bottom: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0; }
.role-picker { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.role-picker legend { padding: 0 4px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--navy); }

/* Notices and pills */
.notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; }
.notice > :last-child { margin-bottom: 0; }
.notice p { margin: 0 0 6px; }
.notice-info { background: var(--check-bg); color: var(--check-ink); }
.notice-warn { background: #FFF6D6; border: 1px solid var(--gold); color: var(--warn-ink); }
.notice-error { background: var(--urgent-bg); color: var(--urgent-ink); }
.notice ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); line-height: 1.6; font-weight: 800; letter-spacing: .03em; white-space: nowrap; vertical-align: baseline; }
.pill-neutral { background: var(--ground); color: var(--muted); }
/* Empty lists and tables: one calm, recognisable style everywhere. */
.empty-state { margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: #FAFBFD; color: var(--muted); font-size: 14px; }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill-urgent { background: var(--urgent-bg); color: var(--urgent-ink); }
.pill-check { background: var(--check-bg); color: var(--check-ink); }

/* Tables */
/* position: relative keeps hidden labels inside the scrolling box, so a wide table never widens the page. */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
td input:not([type=checkbox]):not([type=radio]), td select { height: 38px; }
th:first-child, td:first-child { padding-left: 4px; }
th:last-child, td:last-child { padding-right: 4px; }
tbody tr:hover > * { background-color: #F7F9FC; }
th.num, td.num { text-align: right; }
caption { text-align: left; font-weight: 700; color: var(--navy); padding-bottom: var(--space-2); }
/* Payouts: every prize tier's table lines up with the next one. */
.payout-lines { table-layout: fixed; }
.payout-lines thead th:nth-child(1) { width: 24%; }
.payout-lines thead th:nth-child(2) { width: 22%; }
.payout-lines thead th:nth-child(3), .payout-lines thead th:nth-child(4), .payout-lines thead th:nth-child(5) { width: 14%; }
.payout-lines thead th:nth-child(6) { width: 12%; }
thead th { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; vertical-align: bottom; line-height: 1.35; }
thead th.num, thead th:not(:only-child) { max-width: 16em; }
tbody th { font-weight: 700; color: var(--navy); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.negative { color: var(--urgent-ink); }
.numbers { font-family: Consolas, "Courier New", monospace; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-panel td { background: var(--ground); }
.details-json { display: block; max-width: 320px; white-space: pre-wrap; word-break: break-word; color: var(--muted); }
.progress-cell { display: flex; align-items: center; gap: 8px; }
progress { flex: 1 1 60px; height: 8px; appearance: none; border: none; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line-soft); border-radius: 99px; }
progress::-webkit-progress-value { background: #1E7B45; border-radius: 99px; }
progress::-moz-progress-bar { background: #1E7B45; border-radius: 99px; }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.pager-status { font-size: 13px; color: var(--muted); }

/* Player record */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.tab { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #FFFFFF; color: var(--navy); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tab:hover { border-color: var(--navy); }
.tab.is-selected { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.tab-panel:focus-visible { outline-offset: 6px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; margin: 0; }
.details dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.details dd { margin: 2px 0 0; font-size: var(--fs-base); overflow-wrap: anywhere; }
.balances dd { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.notes p { margin: 4px 0 0; white-space: pre-wrap; }
.note-meta { font-size: 13px; color: var(--muted); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--ground); font-size: 14px; }
.activity-time { flex: none; width: 46px; color: var(--muted); font-variant-numeric: tabular-nums; }

.role-list { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.role-list dt { font-weight: 800; color: var(--navy); }
.role-list dd { margin: 0; color: var(--muted); font-size: 14px; }

/* Account pages (sign-in) */
.account-header { display: flex; align-items: center; gap: 10px; padding: 14px clamp(16px, 4vw, 32px); background: var(--navy); }
.account-header .env-pill { margin-left: auto; }
.account-main { display: flex; justify-content: center; padding: 32px 16px; }
.account-card { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 4px; }
.account-card h1 { margin-bottom: 12px; font-size: 24px; }
.account-card form .btn-primary { width: 100%; margin-top: 4px; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.qr { display: block; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; image-rendering: pixelated; }
.key { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--ground); word-spacing: 4px; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 16px; }
.recovery-codes code { display: block; padding: 6px 10px; border-radius: 8px; background: var(--ground); font-size: 15px; text-align: center; }

/* Blazor error bar */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px 20px; background: var(--urgent-bg); color: var(--urgent-ink); font-weight: 600; }
#blazor-error-ui .dismiss { position: absolute; right: 12px; top: 6px; background: none; border: none; font-size: 22px; color: var(--urgent-ink); cursor: pointer; }
#blazor-error-ui .reload { margin-left: 8px; }

/* After navigation, Blazor moves focus to the page heading so screen readers announce the new page.
   That programmatic focus is not drawn; real controls keep their visible focus ring. */
h1:focus:not(:focus-visible),
h1[tabindex="-1"]:focus,
main[tabindex="-1"]:focus { outline: none; }

/* ---------- Phase 2: draws, verification and payouts (mockups DrawResults / PayoutApproval) ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); }
.draw-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.draw-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: #FFFFFF; font-size: 13px; font-weight: 700; color: var(--muted); }
.draw-step-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--ground); color: var(--muted); }
.draw-step-done .draw-step-dot { background: #1E7B45; color: #FFFFFF; }
.draw-step-now { border-color: var(--gold); color: var(--navy); }
.draw-step-now .draw-step-dot { background: var(--gold); color: var(--navy); }
.ball-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ball { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--navy); color: #FFFFFF; }
.ball-bonus { background: var(--gold); color: var(--navy); }
.source-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 0; border-top: 1px solid var(--ground); }
.source-name { flex: 0 1 240px; display: flex; flex-direction: column; gap: 2px; }
.agree-ok { font-size: 13px; font-weight: 700; color: #1E7B45; }
.agree-warn { font-size: 13px; font-weight: 700; color: var(--urgent-ink); }
.row-disputed td, .row-disputed th { background: #FFF6D6; }
.row-disputed td.num { color: #8A4B00; font-weight: 800; }
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; font-weight: 700; }
.rate input { width: 130px; height: 36px; }
.input-money { width: 150px; height: 36px; }
.input-count { width: 120px; height: 36px; }
tfoot th, tfoot td { font-weight: 800; color: var(--navy); border-bottom: none; }
.email-preview { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--ground); font-size: 14px; max-height: 420px; overflow: auto; }
.email-preview p { margin: 0 0 6px; }
.email-html { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 300px; overflow: auto; background: var(--ground); padding: 10px; border-radius: 10px; }
.prize-basis { margin: 0; }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.report-list li { display: flex; flex-direction: column; gap: 2px; }
.report-notes { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.total-row td { font-weight: 800; border-top: 2px solid var(--line); }
.tile-link { font-size: 13px; font-weight: 700; }
/* Phase 5: content previews */
.html-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--ground); overflow-wrap: anywhere; }
.html-preview img { max-width: 100%; height: auto; }
.news-preview { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; }
.news-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.news-card h4 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.news-card .html-preview { display: inline; border: 0; padding: 0; background: none; }
.news-date { font-size: 12px; color: var(--muted); }
.news-more { font-size: 13px; font-weight: 700; text-decoration: underline; }
.news-page { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.news-page-head { margin: 0 0 8px; font-size: 20px; }
.editor { width: 100%; min-height: 260px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.version-text { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 220px; overflow: auto; background: var(--ground); padding: 8px; border-radius: 8px; }
@media (max-width: 800px) { .news-preview, .diff-cols { grid-template-columns: 1fr; } }

/* Phase 7: ticket queue cut-off colours (near = amber, passed = red). */
.tile-warn { border-color: var(--gold); background: #FFF6D6; }
.tile-urgent { border-color: var(--urgent-ink); background: var(--urgent-bg); }
tr.row-warn > * { background: #FFF6D6; }
tr.row-urgent > * { background: var(--urgent-bg); }

/* Phase 8: player email status panel. */
.email-status { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: var(--space-3); }
.email-status h3 { margin: 0; }
.email-status h4 { margin: var(--space-2) 0 0; }
.email-status .notice { margin: 0; }
.group-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.group-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.reasons { margin: 0; padding-left: 18px; }
.reasons li + li { margin-top: 2px; }
.email-status form { margin-top: var(--space-2); }
.email-status form h4 { margin: 0; }
.email-status fieldset { display: flex; flex-direction: column; gap: 2px; }

/* Accessibility: respect a request for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Phones (kept last so it wins over the rules above): the menu folds into one compact bar (brand and "Menu"); the staff box shows only with the open menu. */
@media (max-width: 760px) {
  .sidebar { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 10px 16px; }
  .brand { padding: 0; }
  .brand-mark { width: 30px; height: 30px; font-size: 14px; }
  .menu-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid #DFE8F7; background: transparent; color: #FFFFFF; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
  .sidebar > ul, .nav-list { flex-basis: 100%; }
  .nav-list { display: none; padding-top: var(--space-2); }
  .nav-list.is-open { display: flex; }
  .user-box { display: none; flex-basis: 100%; margin-top: var(--space-2); }
  .sidebar:has(.nav-list.is-open) .user-box { display: flex; }
  .topbar { justify-content: flex-start; padding: var(--space-3) 16px var(--space-1); gap: var(--space-2); }
  .topbar-search { flex-basis: 100%; max-width: none; }
  .topbar-search input { min-width: 0; }
  .content main { padding: var(--space-2) 16px 32px; gap: var(--space-4); }
  h1 { font-size: 22px; }
  .card { padding: var(--space-4); border-radius: 14px; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
  .tile-value { font-size: 24px; }
  .card-heading { flex-wrap: wrap; }
  /* Wide tables keep readable columns and scroll inside their own box, never the whole page. */
  .table-wrap table:has(thead th:nth-child(4)) { min-width: 520px; }
  .table-wrap table:has(thead th:nth-child(6)) { min-width: 680px; }
  .btn-small { min-height: 40px; }
  .details { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; }
}
