:root {
  --bg: #1B1410;
  --surface: #241B15;
  --surface2: #2E241C;
  --border: #3D2F23;
  --brass: #C9A227;
  --brass-dim: #8F7420;
  --cream: #F2E9D8;
  --cream-dim: #B7AA92;
  --green: #4F8F5B;
  --green-dim: #2E4F35;
  --red: #C1503F;
  --red-dim: #4F2A24;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--cream);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input { font-family: inherit; }

.px-4 { padding-left: 16px; padding-right: 16px; }
.pt-4 { padding-top: 16px; }
.pt-8 { padding-top: 32px; }
.pb-24 { padding-bottom: 96px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.topbar-eyebrow { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--brass-dim); }
.topbar-title { font-weight: 900; font-size: 14px; color: var(--cream); }

.sync-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--green); background: var(--green-dim); color: #BFE3C6; cursor: pointer;
}
.sync-badge.sync-warn { border-color: var(--red); background: var(--red-dim); color: #F2C9C2; }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.week-nav-label { text-align: center; }
.week-num { font-size: 24px; font-weight: 900; color: var(--cream); }
.label-xs { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--cream-dim); margin-bottom: 6px; margin-top: 12px; }
.dim-sm { font-size: 13px; color: var(--cream-dim); }
.dim-sm.green { color: var(--green); }

.icon-btn {
  background: var(--surface2); border: none; color: var(--cream);
  width: 36px; height: 36px; border-radius: 999px; font-size: 16px; cursor: pointer;
}
.icon-btn:disabled { opacity: .3; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.card.center { text-align: center; }
.pot-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.pot-amount { font-size: 42px; font-weight: 900; color: var(--brass); line-height: 1; font-variant-numeric: tabular-nums; }
.winner-box { text-align: right; }
.winner-name { font-weight: 700; color: var(--cream); font-size: 14px; }

.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--cream); font-size: 16px; margin-bottom: 8px;
}
.input-amount { font-size: 18px; font-weight: 700; color: var(--brass); }
.input::placeholder { color: var(--cream-dim); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-card {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  color: inherit; text-align: left; cursor: pointer;
}
.row-card-static { cursor: default; }
.row-dim { opacity: .5; }
.row-title { font-weight: 700; color: var(--cream); }
.row-title-btn { background: none; border: none; text-align: left; color: inherit; cursor: pointer; padding: 0; flex: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.row-flex { display: flex; align-items: center; gap: 12px; }
.rank { width: 20px; }
.amount-strong { font-weight: 900; color: var(--brass); }
.section-title { font-size: 20px; font-weight: 900; color: var(--cream); margin: 0; }

.pill { padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pill-paid { background: var(--green-dim); color: #BFE3C6; }
.pill-owe { background: var(--red-dim); color: #F2C9C2; }
.pill-exempt { background: var(--surface2); color: var(--cream-dim); }

.empty-note { text-align: center; padding: 40px 0; color: var(--cream-dim); font-size: 14px; }

.btn {
  padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; border: none; cursor: pointer;
}
.btn-brass { background: var(--brass); color: #241B0D; }
.btn-green { background: var(--green); color: #0E1A10; }
.btn-red { background: var(--red); color: #2A0E09; }
.btn-outline { background: transparent; color: var(--cream); border: 1px solid var(--border); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.stack-narrow { display: flex; flex-direction: column; gap: 8px; max-width: 280px; margin: 0 auto; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700;
  background: var(--surface2); color: var(--cream); border: 1px solid var(--border); cursor: pointer;
}
.chip-active { background: var(--brass); color: #241B0D; }
.chip-input {
  width: 56px; padding: 8px; border-radius: 10px; text-align: center;
  background: var(--surface2); color: var(--cream); border: 1px solid var(--border);
}

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--cream-dim); margin: 12px 0; }

/* toggle switch — used for active/inactive on the Roster screen */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-slider {
  position: absolute; inset: 0; border-radius: 999px; transition: .15s;
  background: var(--surface2); border: 1px solid var(--border); pointer-events: none;
}
.switch-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  border-radius: 50%; background: var(--cream-dim); transition: .15s;
}
.switch input:checked + .switch-slider { background: var(--green-dim); border-color: var(--green); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: var(--green); }

/* Excel import control + result note */
.import-btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.import-btn input { display: none; }
.import-note {
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--cream-dim);
}
.import-note-ok { background: var(--green-dim); border-color: var(--green); color: #BFE3C6; }
.import-note-err { background: var(--red-dim); border-color: var(--red); color: #F2C9C2; }

.alert-box {
  border-radius: 12px; padding: 12px; margin-bottom: 12px; font-size: 14px;
  background: var(--red-dim); border: 1px solid var(--red); color: #F2C9C2;
}

.scroll-list { max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; font-size: 14px; background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--cream); cursor: pointer;
}
.pick-row-active { background: var(--green-dim); color: #BFE3C6; }

.cell-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cell {
  border-radius: 10px; padding: 10px 4px; text-align: center; background: var(--surface);
  border: 1px solid var(--border); cursor: pointer; color: var(--cream-dim);
}
.cell-paid { background: var(--green-dim); color: var(--cream); }
.cell-week { font-size: 10px; }
.cell-val { font-size: 13px; font-weight: 700; }

.back-link { background: none; border: none; color: var(--cream-dim); font-size: 14px; margin-bottom: 12px; cursor: pointer; padding: 0; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around; padding: 8px 0;
  background: var(--surface); border-top: 1px solid var(--border);
}
.nav-btn { background: none; border: none; color: var(--cream-dim); font-size: 11px; font-weight: 700; padding: 6px 12px; cursor: pointer; }
.nav-btn-active { color: var(--brass); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px 20px 0 0;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 16px; }
  .modal-sheet { border-radius: 20px; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.modal-header h2 { font-size: 18px; font-weight: 800; margin: 0; color: var(--cream); }
.modal-body { padding: 20px; }
.big-amount { font-size: 30px; font-weight: 900; color: var(--brass); }
