/* Old German Beer Hall Stein Club — one small stylesheet for every page.
   Palette and type measured from oldgermanbeerhall.com (Sept 2026): Roboto body,
   EB Garamond headings, Roboto Slab pill buttons, #003399 blue bands with the Bavarian
   lozenge pattern, light #f7fafc page. hofbrauhaus.us shares the royal-blue-on-white tone. */

:root {
  --blue: #003399;          /* site header, footer, buttons */
  --blue-deep: #00297b;     /* hover / pressed */
  --blue-bright: #0043c7;   /* lighter lozenge diamonds */
  --blue-tint: rgba(0, 51, 153, 0.08);
  --page: #f7fafc;          /* body background */
  --ink: #2d3748;           /* body text */
  --ink-strong: #1a202c;    /* headings */
  --muted: #4a5568;
  --line: #cbd5e0;          /* hairline borders */
  --line-soft: #e2e8f0;     /* tracks, table rules */
  --white: #ffffff;
  --danger: #c02b0a;        /* Hofbräuhaus red accent */
  --sans: "Roboto", "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --slab: "Roboto Slab", Georgia, serif;
  --radius: 8px;
  --pill: 40px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { overflow-x: clip; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  padding-block: env(safe-area-inset-top, 0px) calc(72px + env(safe-area-inset-bottom, 0px));
}
body.no-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

.wrap {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding-inline: 16px;
}

/* Bavarian lozenge band, as on the site's header and footer: one tiled rhombus. */
.masthead, .hero-stat, .nav {
  background-color: var(--blue);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='44'><path d='M14 0 28 22 14 44 0 22Z' fill='%230043c7'/></svg>");
  background-size: 28px 44px;
  color: var(--white);
}

/* ---- Header / wordmark ---------------------------------------------------- */
.masthead {
  text-align: center;
  margin-inline: calc(50% - 50vw); /* full-bleed band inside the narrow column */
  padding: 22px 16px 18px;
  box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.12);
}
.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.wordmark {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  color: var(--white);
  text-wrap: balance;
}
.masthead.compact { padding-block: 12px 10px; }
.masthead.compact .wordmark { font-size: 28px; }

/* ---- Cards and panels ----------------------------------------------------- */
.card {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.card + .card { margin-top: 14px; }

h1, h2, h3 { text-wrap: balance; margin: 0; }
h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--ink-strong); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
a { color: var(--blue); }

/* ---- Forms ---------------------------------------------------------------- */
label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; color: var(--ink-strong); }
input[type="password"], input[type="text"], input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
input:focus-visible, button:focus-visible, a:focus-visible, .seg button:focus-visible {
  outline: 3px solid var(--blue-bright);
  outline-offset: 2px;
}
.btn {
  font-family: var(--slab);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--pill);
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
  width: 100%;
  min-height: 48px;
  transition: background-color 120ms ease;
}
.btn:hover { background: var(--blue-deep); }
.btn:disabled { opacity: 0.6; cursor: default; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row > input { flex: 1 1 auto; min-width: 0; }
.row > .btn { width: auto; flex: 0 0 auto; }
.field + .field, .field + .btn { margin-top: 14px; }
.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--danger);
  background: rgba(192, 43, 10, 0.07);
  color: var(--danger);
  font-weight: 600;
  border-radius: 4px;
}
.error:empty { display: none; }

/* ---- Stein card ----------------------------------------------------------- */
.stein-card { padding-top: 16px; }
.stein-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.stein-badge {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--blue);
  color: var(--white);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--blue);
  font-variant-numeric: tabular-nums;
}
.stein-badge small { display: block; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.stein-badge strong { display: block; font-size: 26px; line-height: 1; font-weight: 700; }
.stein-name { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--ink-strong); overflow-wrap: anywhere; }
.stein-rank { font-size: 14px; color: var(--muted); margin-top: 3px; }

.hero-stat {
  margin-top: 16px;
  padding: 14px 16px 12px;
  border-radius: var(--radius);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hero-stat .label { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.hero-stat .value { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stat .unit { font-size: 20px; font-weight: 500; margin-left: 4px; color: rgba(255, 255, 255, 0.85); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.stat {
  background: var(--page);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px 10px 8px;
}
.stat .label { display: block; font-size: 10.5px; letter-spacing: 0.06em; white-space: nowrap; text-transform: uppercase; color: var(--muted); }
.stat .value { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }

.milestone { margin-top: 14px; font-size: 15px; }
.bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

/* ---- Leaderboard ---------------------------------------------------------- */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--line-soft);
  border-radius: var(--pill);
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
}
.seg button {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 9px 6px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.seg button[aria-selected="true"] { background: var(--blue); color: var(--white); }

.totals {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--muted);
}
.totals strong { color: var(--ink-strong); font-variant-numeric: tabular-nums; }

.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid;
  grid-template-columns: 34px 52px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.board li:last-child { border-bottom: 0; }
.board .rank { font-weight: 700; color: var(--muted); text-align: center; }
.board li[data-top="true"] .rank {
  color: var(--white);
  background: var(--blue);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-content: center;
  margin: 0 auto;
}
.board .num { font-size: 13px; color: var(--blue); font-weight: 700; letter-spacing: 0.02em; }
.board .name { font-weight: 500; color: var(--ink-strong); overflow-wrap: anywhere; }
.board .liters { font-weight: 700; font-size: 18px; white-space: nowrap; color: var(--ink-strong); }
.board .liters small { font-size: 13px; font-weight: 500; color: var(--muted); }
.board li.me { background: var(--blue-tint); border-radius: 6px; }
.empty { padding: 24px 0; text-align: center; color: var(--muted); }

/* ---- Bottom nav ----------------------------------------------------------- */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 10;
}
.nav:empty { display: none; }
.nav a, .nav button {
  flex: 1 1 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 14px 6px;
  color: rgba(255, 255, 255, 0.8);
  background: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  min-height: 52px;
}
.nav [aria-current="page"] { color: var(--white); box-shadow: inset 0 3px 0 var(--white); }

.status { margin-top: 12px; font-size: 13px; text-align: center; color: var(--muted); }
.status:empty { display: none; }
.warning {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 51, 153, 0.25);
  background: var(--blue-tint);
  color: var(--blue-deep);
  font-size: 13px;
  text-align: center;
}
.warning:empty { display: none; }
.mock-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.mock-note:empty { display: none; }

.hint { margin: 14px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.hint a { color: var(--blue); }

@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise 220ms ease-out; }
  @keyframes rise { from { opacity: 0.6; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (min-width: 420px) {
  .stein-badge { width: 80px; height: 80px; }
}

/* ---- Staff home, analytics ------------------------------------------------- */
.staff-card h2 { font-size: 28px; }
.linklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.linklist a {
  display: block;
  padding: 12px 22px;
  border-radius: var(--pill);
  background: var(--blue);
  color: var(--white);
  font-family: var(--slab);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.linklist a:hover { background: var(--blue-deep); }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
}
.tile .label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tile .value { display: block; font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.tile.wide { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tile.wide .value { font-size: 36px; }

.chart-card { margin-top: 14px; }
.chart-card h2 { font-size: 22px; }
.chart-card .sub { margin: 2px 0 10px; font-size: 14px; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart text.val { fill: var(--ink-strong); font-weight: 700; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--blue); }
.chart .bar.mine { fill: var(--blue-bright); stroke: var(--ink-strong); stroke-width: 1.5; }
.chart .bar:hover { fill: var(--blue-deep); }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { fill: var(--blue-deep); }
.chart-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line-soft); }
.chart-table td:last-child, .chart-table th:last-child { text-align: right; }
details.table-view summary { cursor: pointer; font-size: 14px; color: var(--blue); font-weight: 700; margin-top: 8px; }

.center { text-align: center; }
.success {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  background: var(--blue-tint);
  color: var(--ink);
  border-radius: 4px;
}
.success:empty { display: none; }

/* ---- Admin portal ------------------------------------------------------------ */
.wrap.wide { max-width: 920px; }
.wordmark-sub { font-family: var(--slab); font-size: 0.55em; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); vertical-align: middle; margin-left: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.subnav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--line-soft);
  border-radius: var(--pill);
  padding: 4px;
  gap: 4px;
  margin: 16px 0 14px;
}
.subnav a {
  font-weight: 700;
  font-size: 15px;
  padding: 9px 6px;
  border-radius: var(--pill);
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.subnav a[aria-current="page"] { background: var(--blue); color: var(--white); }

.admin-tiles { margin-bottom: 14px; }
.tile .value.value-text { font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.tile .tile-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tile .value[data-status="failed"] { color: var(--danger); }
.tile .value[data-status="ok"] { color: var(--blue-deep); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { width: auto; flex: 1 1 200px; }
.btn.secondary { background: var(--white); color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.btn.secondary:hover { background: var(--blue-tint); }
.btn.secondary:disabled { color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); background: var(--white); }
.btn.small { font-size: 14px; min-height: 36px; padding: 6px 14px; width: auto; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.toolbar input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--ink);
}
.toolbar span { white-space: nowrap; }

.acct-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.acct-table th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line-soft); }
.acct-table td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
.acct-table tr:last-child td { border-bottom: 0; }
.acct-table td.empty { text-align: center; }
.acct-table .num { font-weight: 700; color: var(--blue); white-space: nowrap; font-variant-numeric: tabular-nums; }
.acct-table .name { font-weight: 500; color: var(--ink-strong); }
.acct-table .when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: var(--pill);
  background: var(--line-soft);
  color: var(--muted);
  white-space: nowrap;
}
.badge[data-kind="current"], .badge[data-kind="done"] { background: var(--blue-tint); color: var(--blue-deep); }
.badge[data-kind="delinquent"], .badge[data-kind="pending"] { background: rgba(192, 43, 10, 0.08); color: var(--danger); }
.badge[data-kind="exempt"] { background: var(--blue); color: var(--white); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 6px 3px 10px;
  border-radius: var(--pill);
  background: var(--blue);
  color: var(--white);
  white-space: nowrap;
}
.chip button {
  font: inherit;
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  cursor: pointer;
}
.chip button:hover { background: rgba(255, 255, 255, 0.4); }
.chip button:disabled { opacity: 0.5; cursor: default; }
.chips select {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px dashed var(--blue);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
  max-width: 100%;
}
.row-msg { margin: 6px 0 0; font-size: 13px; }
.row-msg.error, .row-msg.success { margin-top: 6px; padding: 6px 10px; }

.checks { border: 0; padding: 0; margin: 14px 0 0; }
.checks legend { font-weight: 700; font-size: 15px; color: var(--ink-strong); padding: 0; margin-bottom: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; margin: 0; padding: 6px 0; }
.checks input { width: 20px; height: 20px; accent-color: var(--blue); }

.audit-table .action { font-weight: 700; color: var(--ink-strong); }
.audit-table .detail { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }

/* Narrow screens: each account becomes a stacked card. */
@media (max-width: 640px) {
  .acct-table thead { display: none; }
  .acct-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .acct-table tr:last-child { border-bottom: 0; }
  .acct-table td { display: flex; gap: 10px; padding: 3px 0; border: 0; }
  .acct-table td::before { content: attr(data-label); flex: 0 0 72px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
  .acct-table td.empty::before { display: none; }
  .acct-table td > .cell { flex: 1 1 auto; min-width: 0; }
}
