/* mytrapclub — shared desk styles. Tokens first; every page builds on these. */
:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --panel-2: #f9f8f5;
  --ink: #1d1f22;
  --ink-2: #5b6068;
  --line: #dedad2;
  --brand: #b4471f;        /* clay-target orange */
  --brand-ink: #ffffff;
  --accent: #23533f;       /* field green */
  --ok: #2f7a4a;
  --warn: #a8660b;
  --bad: #b3261e;
  --focus: #2a6fdb;
  --chip: #efe9df;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --panel: #1e2125; --panel-2: #24282d; --ink: #eceae6; --ink-2: #a3a8b0; --line: #343941;
    --brand: #e0703f; --accent: #5fae8a; --ok: #5fbf80; --warn: #e3a03a; --bad: #ff6b60; --chip: #2b2f35;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --panel: #1e2125; --panel-2: #24282d; --ink: #eceae6; --ink-2: #a3a8b0; --line: #343941;
  --brand: #e0703f; --accent: #5fae8a; --ok: #5fbf80; --warn: #e3a03a; --bad: #ff6b60; --chip: #2b2f35;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--focus); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 54px;
  background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand .disc { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--bg) 0 22%, var(--brand) 23% 100%); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: var(--chip); color: var(--ink); }
.event-pill { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.event-pill b { color: var(--brand); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); display: inline-block; margin-right: 6px; }
.live-dot.on { background: var(--ok); }

main { padding: 16px; max-width: 1500px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* controls */
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
button:hover, .btn:hover { background: var(--panel-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.primary:hover { filter: brightness(1.06); }
button.good { background: var(--ok); border-color: var(--ok); color: #fff; }
button.danger { color: var(--bad); }
button.big { padding: 14px 20px; font-size: 1.1rem; }
button.small { padding: 4px 9px; font-size: 13px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 500; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--panel); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 700; }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.chip.brand { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }

/* toast + modal */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--panel); padding: 12px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 600; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast .row { margin-top: 8px; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .dlg-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 1.05rem; }
dialog .dlg-body { padding: 16px 18px; display: grid; gap: 12px; }
dialog .dlg-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.empty { padding: 28px; text-align: center; color: var(--ink-2); }
@media (max-width: 700px) { .event-pill { display: none; } main { padding: 12px; } }

/* print frame is rendered off-screen */
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }
@media print { .no-print, .topbar, #toasts { display: none !important; } body { background: #fff; } }
