/* The admin panel (sub-plan 14): the shop's navy and beige, system fonts, light and dark. */
:root {
  --bg: #F7F2EC; --surface: #FFFFFF; --fg: #0B1424; --muted: #5B6476; --line: #E3DCD3;
  --navy: #00276B; --on-navy: #FFFFFF; --green: #3F7F00; --red: #A4262C; --chip: #E8EFF8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0D1320; --surface: #151D2E; --fg: #E8ECF4; --muted: #A3ADC2; --line: #2A3550; --navy: #8FB2FF; --on-navy: #0D1320; --green: #8CCB52; --red: #FF8A8A; --chip: #1E2A44; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-height: 60px; }
.brand { margin: 0; font-weight: 800; color: var(--navy); }
.brand span { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 700; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tab, .link { min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.tab[aria-current="page"] { background: var(--chip); color: var(--navy); }
main { display: grid; gap: 20px; padding-block: 28px 48px; }
main > section { min-width: 0; } /* grid items: the table scrolls in its own box instead of widening the page */
h1 { margin: 0 0 4px; font-size: 26px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.lead { margin: 0; color: var(--muted); max-width: 70ch; }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.narrow { max-width: 420px; margin: 40px auto 0; width: 100%; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.form { display: grid; gap: 8px; }
.form label { font-weight: 600; }
input, select, textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); font: inherit; }
textarea { min-height: 38px; resize: vertical; }
.btn { min-height: 44px; margin-top: 8px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--navy); color: var(--on-navy); font: inherit; font-weight: 700; cursor: pointer; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.message { min-height: 22px; margin: 0; color: var(--muted); }
.message.is-error { color: var(--red); font-weight: 600; }
.message.is-ok { color: var(--green); font-weight: 600; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.segmented button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
.select { display: grid; gap: 4px; font-weight: 600; font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table { width: 100%; min-width: 900px; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.term { font-weight: 700; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.edit { display: grid; gap: 6px; min-width: 220px; }
.edit[aria-busy="true"] { opacity: 0.6; }
.users { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.users li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.runline { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-weight: 600; }
.runline.is-red { border-color: var(--red); color: var(--red); }
.runline:empty { display: none; }
.chip--red { background: var(--red); color: var(--on-navy); }
