:root {
  --bg: #f3f7f1; --panel: #ffffff; --ink: #13301a; --muted: #5d6e60; --line: #dfe8dc;
  --green: #2a8c2a; --green2: #48b048; --deep: #0f3d0f; --gold: #d9a21b; --sky: #2f8fd6;
  --tangerine: #f08a24; --berry: #c2417a; --warn: #c25a2b; --shadow: 0 6px 20px rgba(15, 61, 15, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1c0c; --panel: #11291a; --ink: #eef6ec; --muted: #a7bca9; --line: #22442a;
    --green: #4fb54f; --green2: #7fd37f; --gold: #f0c04a; --sky: #6db7ef; --tangerine: #f6a65a; --berry: #ec7fb0; --warn: #f0a07a;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--green); }

/* ── header ─────────────────────────────────────────────── */
.top {
  background: radial-gradient(1200px 300px at 10% -40%, #3fa63f 0%, transparent 60%), linear-gradient(160deg, #1c6a1c 0%, #0a2e0a 100%);
  color: #fff; padding: 16px 16px 0; position: relative; overflow: hidden;
}
.top::after { /* a little fairway stripe pattern */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.08;
  background: repeating-linear-gradient(115deg, #fff 0 22px, transparent 22px 44px);
}
.top .in { max-width: 1160px; margin: 0 auto; position: relative; z-index: 1; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.top .mascot { width: 54px; height: 54px; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.top h1 { font-size: 20px; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.top .greet { font-size: 13px; color: #b8ecb8; margin: 2px 0 0; }
.spacer { flex: 1; }
.top select, .top button { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.28); }
.top select option { color: #000; }
nav.views { display: flex; gap: 6px; overflow-x: auto; margin-top: 14px; padding-bottom: 0; scrollbar-width: none; }
nav.views button {
  border: 0; border-radius: 12px 12px 0 0; background: rgba(255,255,255,0.12); color: #e6f6e6;
  padding: 10px 14px; font-weight: 700; white-space: nowrap; display: flex; gap: 6px; align-items: center;
}
nav.views button.on { background: var(--bg); color: var(--ink); }
nav.views .badge { background: var(--tangerine); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }

main { max-width: 1160px; margin: 0 auto; padding: 18px 16px 56px; }
button, select, input, textarea {
  font: inherit; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 12px;
}
button { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
button:hover:not([disabled]) { transform: translateY(-1px); }
button.primary { background: linear-gradient(180deg, #f0be3a, #d9a21b); color: #1a1a1a; border-color: #c99417; font-weight: 800; box-shadow: 0 3px 10px rgba(217,162,27,0.35); }
button.go { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
button.ghost { background: transparent; }
button.danger { color: var(--warn); }
button[disabled] { opacity: 0.55; cursor: default; }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--green); }

h2 { font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--green); margin: 28px 0 10px; display: flex; gap: 8px; align-items: center; }
h2:first-child { margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.err { color: var(--warn); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.two { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; } .three { grid-template-columns: 2fr 1fr; } }
.three { display: grid; gap: 12px; grid-template-columns: 1fr; }

/* ── stat tiles ─────────────────────────────────────────── */
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; margin-bottom: 8px; }
.tile b { display: block; font-size: 28px; font-weight: 850; letter-spacing: -0.5px; overflow-wrap: anywhere; }
.tile span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.tile em { display: inline-block; font-style: normal; font-size: 12px; font-weight: 700; margin-top: 6px; padding: 2px 8px; border-radius: 10px; background: rgba(42,140,42,0.12); color: var(--green); }
.tile em.down { background: rgba(194,90,43,0.12); color: var(--warn); }
.tile svg.spark { position: absolute; right: 10px; top: 14px; opacity: 0.9; }
.c-green { background: rgba(42,140,42,0.14); } .c-gold { background: rgba(217,162,27,0.18); } .c-sky { background: rgba(47,143,214,0.15); }
.c-tan { background: rgba(240,138,36,0.16); } .c-berry { background: rgba(194,65,122,0.14); }

/* ── lists, chips, forms ────────────────────────────────── */
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .big { font-size: 26px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(42,140,42,0.1); flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .body b { overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 2px 9px; background: rgba(127,127,127,0.14); }
.chip.ok { background: rgba(42,140,42,0.15); color: var(--green); }
.chip.warn { background: rgba(194,90,43,0.14); color: var(--warn); }
.chip.gold { background: rgba(217,162,27,0.2); color: #8a6200; }
@media (prefers-color-scheme: dark) { .chip.gold { color: var(--gold); } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
textarea { width: 100%; }
.flash { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; background: rgba(42,140,42,0.12); color: var(--green); font-weight: 700; }

/* ── charts ─────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 8px; }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bar i { display: block; width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--green2), var(--green)); min-height: 3px; transition: height 0.6s cubic-bezier(.2,.8,.2,1); }
.bar:hover i { filter: brightness(1.1); }
.bar small { font-size: 10px; color: var(--muted); margin-top: 5px; white-space: nowrap; }
.bar s { text-decoration: none; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.heat { display: grid; grid-template-columns: 40px repeat(14, 1fr); gap: 4px; font-size: 11px; color: var(--muted); align-items: center; }
.heat .c { height: 24px; border-radius: 6px; background: rgba(127,127,127,0.1); transition: transform 0.15s ease; }
.heat .c:hover { transform: scale(1.12); }
.legend { display: flex; gap: 4px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 8px; }
.legend i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.meter { height: 10px; border-radius: 6px; background: rgba(127,127,127,0.14); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), #f6d36b); }
.stars { display: grid; grid-template-columns: 34px 1fr 36px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }

/* tee sheet timeline + order board */
.slotrow { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.slotrow:last-child { border-bottom: 0; }
.slotrow .t { font-weight: 800; font-variant-numeric: tabular-nums; }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lane { background: rgba(127,127,127,0.06); border-radius: 16px; padding: 10px; min-height: 120px; }
.lane h4 { margin: 2px 4px 10px; font-size: 13px; display: flex; justify-content: space-between; }
.ticket { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.ticket .code { font-family: ui-monospace, Menlo, monospace; font-weight: 800; font-size: 15px; }
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

/* empty states */
.empty { text-align: center; padding: 18px 10px; color: var(--muted); }
.empty img { width: 84px; height: 84px; display: block; margin: 0 auto 8px; border-radius: 50%; background: #fff; }

/* pairing */
.pair { max-width: 580px; margin: 30px auto; text-align: center; }
.code { font-size: 46px; letter-spacing: 6px; font-weight: 850; font-family: ui-monospace, Menlo, monospace; margin: 12px 0 6px; overflow-wrap: anywhere; }
ol.steps { text-align: left; line-height: 1.7; margin: 18px auto; max-width: 440px; }
form.email { display: grid; gap: 8px; max-width: 360px; margin: 10px auto 0; text-align: left; }
details { margin-top: 26px; }
summary { cursor: pointer; color: var(--muted); }
.linkbox { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; overflow-wrap: anywhere; font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.num { text-align: right; white-space: nowrap; }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 20px; }

/* confetti */
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 50; pointer-events: none; border-radius: 2px; animation: fall 1.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0.6; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
main > * { animation: pop 0.25s ease both; }
@media (prefers-reduced-motion: reduce) { main > *, .bar i { animation: none; transition: none; } .confetti { display: none; } }
@media print { .top, nav.views, button { display: none !important; } body { background: #fff; } .card, .tile { box-shadow: none; } }
