:root {
  --navy: #0b2a5b;
  --navy-2: #123a75;
  --gold: #f2b705;
  --gold-2: #d4a017;
  --ink: #16233a;
  --muted: #5b6b82;
  --line: #dbe2ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --danger: #b3261e;
  --ok: #1e7d32;
  --warn-bg: #fff4d6;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
}
.topbar {
  background: var(--navy); color: #fff; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: .2px; }
.brand::after { content: ""; }
.club-name { font-size: 13px; color: #ffd75e; margin-right: 8px; }
.app { max-width: 860px; margin: 0 auto; padding: 14px 12px 90px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.hidden { display: none !important; }
h1 { font-size: 22px; margin: 4px 0 10px; }
h2 { font-size: 18px; margin: 18px 0 8px; }
h3 { font-size: 15px; margin: 14px 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 10px 0;
}
.card.gold { border-top: 4px solid var(--gold); }
.card.warn { background: var(--warn-bg); border-color: #ecd27a; }
.card.danger { border-color: #e5b3b0; background: #fdf3f2; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.btn {
  display: inline-block; border: 1px solid var(--navy); background: var(--navy);
  color: #fff; border-radius: 9px; padding: 10px 16px; font-size: 15px;
  cursor: pointer; text-decoration: none; font-weight: 600;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.gold { background: var(--gold); border-color: var(--gold-2); color: #241a00; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.btn.block { display: block; width: 100%; text-align: center; margin: 8px 0; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--ink); margin: 4px 0 10px;
}
label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-top: 6px; }
textarea { min-height: 80px; resize: vertical; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; background: #e8edf3; color: var(--navy); white-space: nowrap;
}
.badge.gold { background: #fdf0c0; color: #7a5b00; }
.badge.red { background: #fbe3e1; color: var(--danger); }
.badge.green { background: #dcf2e2; color: var(--ok); }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; overflow-x: auto; padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; min-width: 64px; border: 0; background: none; padding: 10px 4px 9px;
  font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 600;
}
.tabs button.active { color: var(--navy); border-top: 3px solid var(--gold); padding-top: 7px; }
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 9px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 90vw; text-align: center; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.name-btn { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 12px; font-size: 16px; margin: 4px 0; cursor: pointer; }
.name-btn:hover { border-color: var(--navy); }
.big { font-size: 28px; font-weight: 800; }
.balance-owes { color: var(--danger); }
.balance-credit { color: var(--ok); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-word; background: #f1f4f8; padding: 10px; border-radius: 8px; }
.order-item { display: flex; align-items: center; gap: 6px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.order-item .pos { font-weight: 800; color: var(--navy); min-width: 26px; text-align: center; }
.order-item .mv { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 8px; font-size: 15px; cursor: pointer; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal .day { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; background: #fff; cursor: default; }
.cal .day.session { background: #fdf0c0; border-color: var(--gold-2); font-weight: 700; cursor: pointer; }
.cal .day.today { outline: 2px solid var(--navy); }
.cal .day.empty { background: transparent; border-color: transparent; }
.cal .day .dot { font-size: 9px; color: #7a5b00; }
@media (min-width: 700px) { .app { padding-bottom: 40px; } .tabs { position: static; max-width: 860px; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; } }
