:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11,11,11,0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --navy: #16324f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--page); color: var(--ink); font-size: 14.5px; }
a { color: var(--series-1); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { background: #fff; color: var(--navy); font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: .5px; }
.brand-name { font-weight: 650; }
.brand-sub { font-weight: 400; opacity: .75; font-size: 12.5px; margin-left: 6px; }
.userbox { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.venue-chip { background: rgba(255,255,255,.14); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.link-muted { color: #cfd8e3; }

.mainnav { display: flex; gap: 2px; padding: 0 14px; background: #fff; border-bottom: 1px solid var(--grid); overflow-x: auto; }
.mainnav a { padding: 11px 13px; color: var(--ink-2); font-weight: 550; white-space: nowrap; border-bottom: 2.5px solid transparent; }
.mainnav a:hover { text-decoration: none; color: var(--ink); }
.mainnav a.active { color: var(--series-1); border-bottom-color: var(--series-1); }

.page { max-width: 1200px; margin: 0 auto; padding: 20px 22px 40px; }
.page-title { font-size: 21px; margin: 6px 0 16px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

.flash { background: #e8f1fc; border: 1px solid #b7d3f6; color: #16324f; padding: 9px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-error { background: #fdecec; border-color: #f2b8b8; color: #7a1f1f; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.card h2 { font-size: 14px; margin: 0 0 10px; color: var(--ink-2); font-weight: 650; text-transform: uppercase; letter-spacing: .4px; }

.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tile .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.tile .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tile.ok .value { color: var(--good-text); }
.tile.warn .value { color: #8a5a00; }
.tile.bad .value { color: var(--critical); }

table.data { width: 100%; border-collapse: collapse; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--grid); background: #f5f5f2; }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--grid); }
table.data tr:last-child td { border-bottom: none; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: #f7f9fc; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.badge-star { background: #e2f6ed; color: #0b6b47; }
.badge-plowhorse { background: #fdf0e8; color: #9a4112; }
.badge-puzzle { background: #e8f1fc; color: #1c5cab; }
.badge-dog { background: #fdecec; color: #a12626; }
.badge-food { background: #eef1f6; color: #3c4a5d; }
.badge-beverage { background: #f3edfa; color: #5b3a8e; }
.badge-na_beverage { background: #e9f6f3; color: #14684d; }
.badge-supplies { background: #f5f5f2; color: #52514e; }
.badge-other { background: #f5f5f2; color: #52514e; }
.badge-status { background: #f5f5f2; color: #52514e; }
.badge-warn { background: #fdf6e3; color: #8a5a00; }

.btn { display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f3f3f0; text-decoration: none; }
.btn-primary { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.btn-primary:hover { background: #1c5cab; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--critical); }

form.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
input, select { display: block; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--baseline); border-radius: 7px; font-size: 13.5px; background: #fff; width: 100%; }
form.inline label { min-width: 120px; }
form.inline input, form.inline select { width: auto; min-width: 130px; }
input.qty { width: 90px; text-align: right; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .left, .toolbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12.5px; }
.section-gap { margin-top: 22px; }
.chart-box { position: relative; height: 260px; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--navy); }
.login-card { background: var(--surface-1); border-radius: 14px; padding: 34px 36px; width: 360px; text-align: center; }
.login-card h1 { margin: 10px 0 2px; font-size: 20px; }
.login-sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.login-card form { text-align: left; display: grid; gap: 12px; }
.login-brand .brand-mark { background: var(--navy); color: #fff; font-size: 18px; padding: 8px 12px; }

details.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px; margin-bottom: 14px; }
details.panel summary { cursor: pointer; font-weight: 650; color: var(--ink-2); }
.nav-pill { background: var(--critical); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.nav-tabs { display: inline-flex; gap: 2px; margin-left: 8px; }
.tab { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.tab:hover { background: #f3f3f0; text-decoration: none; }
.tab.active { background: var(--navy); color: #fff; }
table.fin { font-size: 12.5px; }
table.fin td, table.fin th { padding: 5px 9px; white-space: nowrap; }
table.fin td.tot { font-weight: 700; border-left: 1px solid var(--grid); }
table.fin tr.sec td { background: #f0f2f5; font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .4px; color: var(--ink-2); }
table.fin tr.subtotal td { font-weight: 650; border-top: 1px solid var(--baseline); background: #fafafa; }
table.fin tr.grand td { font-weight: 750; background: #eef1f6; border-top: 2px solid var(--baseline); }
table.fin tr.grand.net td { background: var(--navy); color: #fff; }
input.needs { background: #fdf6e3; border-color: #e8c96a; }
table.fin td.ln { padding-left: 24px; }
details.panel .inner { padding-top: 12px; }

/* ---- events (Phase 3) ---- */
table.data td.c, table.data th.c { text-align: center; }
table.fin tr.subhead td { background: #f6f7f9; font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-2); }
table.fin td.neg { color: var(--critical); font-weight: 650; }
table.fin td form.inline { display: inline-flex; gap: 4px; align-items: center; margin: 0; flex-wrap: nowrap; }
table.fin td input, table.fin td select { display: inline-block; margin: 0; padding: 3px 5px; font-size: 12px; min-width: 0; width: auto; }
table.fin td input.qty { width: 62px; }
table.data td form { display: inline-block; margin: 0; }
.grid > .card, .grid > div { min-width: 0; }
.grid > .card { overflow-x: auto; }
table.fin td.wrap { white-space: normal; max-width: 780px; line-height: 1.45; }
