/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #0d1117;
  --surface:       #161b22;
  --surface2:      #21262d;
  --border:        #30363d;
  --text:          #e6edf3;
  --text-muted:    #8b949e;
  --text-secondary:#8b949e;
  --green:         #1a7f37;
  --green-dark:    #196127;
  --gold:          #e3b341;
  --gold-dark:     #9e7c0c;
  --accent:        #e3b341;
  --red:           #da3633;
  --blue:          #1d9bf0;
  --venmo:         #008cff;
  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,0.4);
}

/* ── Light mode theme ───────────────────────────────────────────────────────── */
html.light-mode {
  --bg:             #f6f8fa;
  --surface:        #ffffff;
  --surface2:       #eaeef2;
  --border:         #d0d7de;
  --text:           #1f2328;
  --text-muted:     #656d76;
  --text-secondary: #656d76;
  --gold:           #9a6700;
  --gold-dark:      #7d5400;
  --accent:         #9a6700;
  --blue:           #0969da;
  --shadow:         0 1px 3px rgba(0,0,0,0.12);
}
/* Element-specific light mode overrides */
html.light-mode .data-table tbody tr:hover          { background: rgba(0,0,0,0.04) !important; }
html.light-mode .itm-row                            { background: rgba(227,179,65,0.10) !important; }
html.light-mode .itm-row:hover                      { background: rgba(227,179,65,0.18) !important; }
html.light-mode .unmatched-row                      { background: rgba(220,60,60,0.07) !important; }
html.light-mode .unmatched-row:hover                { background: rgba(220,60,60,0.13) !important; }
html.light-mode .rank-gold-row                      { background: rgba(255,215,0,0.13)   !important; }
html.light-mode .rank-silver-row                    { background: rgba(100,100,100,0.09) !important; }
html.light-mode .rank-bronze-row                    { background: rgba(170,100,30,0.09)  !important; }
html.light-mode .search-result-item:hover           { background: rgba(154,103,0,0.10); }
html.light-mode .auth-card                          { box-shadow: 0 4px 24px rgba(0,0,0,0.10); }
html.light-mode .modal-box                          { box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
html.light-mode .pricing-card                       { box-shadow: 0 4px 24px rgba(0,0,0,0.10); }
html.light-mode .club-menu                          { box-shadow: 0 8px 24px rgba(0,0,0,0.14); }
html.light-mode .tournament-card:hover              { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
html.light-mode .navbar-club-btn:hover              { background: rgba(0,0,0,0.06); }
html.light-mode .club-menu-item:hover               { background: rgba(0,0,0,0.05); }
html.light-mode .navbar-right                       { box-shadow: 0 8px 24px rgba(0,0,0,0.14); }
html.light-mode ::-webkit-scrollbar-track          { background: var(--surface2); }
html.light-mode ::-webkit-scrollbar-thumb          { background: #c0c8d0; border-radius: 4px; }
html.light-mode ::-webkit-scrollbar-thumb:hover    { background: #9aa3ac; }
html.light-mode input:-webkit-autofill,
html.light-mode input:-webkit-autofill:hover,
html.light-mode input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #eaeef2 inset !important;
  -webkit-text-fill-color: #1f2328 !important;
  border-color: #d0d7de !important;
}

/* ── Theme toggle button ────────────────────────────────────────────────────── */
.btn-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  margin-left: 8px;
  opacity: 0.65;
  transition: opacity 0.15s;
  vertical-align: middle;
}
.btn-theme-toggle:hover { opacity: 1; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-brand:hover { opacity: 0.85; text-decoration: none; }
.navbar-logo {
  height: 48px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
}
.navbar-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
}
.navbar-club-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-align: center;
}

/* Club switcher (multi-club users) */
.navbar-club-switcher {
  position: relative;
  text-align: center;
}
.navbar-club-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.navbar-club-btn:hover {
  background: rgba(255,255,255,0.08);
}
.club-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
}
.club-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.club-menu-item:hover {
  background: rgba(255,255,255,0.07);
}
.club-menu-item.active {
  color: var(--gold);
  font-weight: 600;
}
.club-menu-check {
  color: var(--gold);
  margin-left: 8px;
}

.navbar-links a {
  color: var(--text-muted);
  margin-left: 20px;
  font-size: 0.9rem;
}
.navbar-links a:hover { color: var(--text); }

.btn-icon-nav {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  margin-left: 16px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.btn-icon-nav:hover { color: var(--text); }

.field-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 5px;
  line-height: 1.4;
}
.field-hint code { color: var(--gold); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  padding-top: 4px;
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.back-link:hover { color: var(--text); }

.tournament-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.tournament-meta strong { color: var(--text); }
.meta-count { color: var(--text-muted); font-size: 0.8rem; font-weight: 400; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary   { background: var(--green);  color: #fff; border-color: var(--green-dark); }
.btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-warning   { background: #d29922;        color: #000; }
.btn-venmo     { background: var(--venmo);  color: #fff; font-weight: 700; }
.btn-sm        { padding: 4px 10px; font-size: 0.8rem; }
.btn-icon      { padding: 4px 8px; font-size: 1rem; background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-icon:hover { color: var(--text); background: var(--surface2); }
.btn-danger-icon { color: var(--red); }

.mt-sm { margin-top: 8px; }
.ml-sm { margin-left: 8px; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-active   { background: rgba(46,160,67,0.2);  color: #3fb950; border: 1px solid rgba(46,160,67,0.4); }
.badge-complete { background: rgba(227,179,65,0.2); color: var(--gold); border: 1px solid rgba(227,179,65,0.4); }
.badge-paid     { background: rgba(29,155,240,0.2); color: var(--blue); border: 1px solid rgba(29,155,240,0.4); }

.count-badge {
  display: inline-block;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ── Tournament Cards ──────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
}
.card-padded {
  padding: 1.5rem;
}
.tournament-card {
  cursor: pointer;
}
.tournament-card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-weight: 700; font-size: 1rem; color: var(--text); }

.card-body { padding: 12px 16px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.875rem;
}
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 600; color: var(--text); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.card-cta { font-size: 0.85rem; color: var(--gold); font-weight: 600; }

/* ── Section ───────────────────────────────────────────────────────────────── */
.section { margin-top: 8px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

/* ── Data Table ────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table thead tr {
  background: var(--surface2);
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.itm-row { background: rgba(227,179,65,0.06) !important; }
.itm-row:hover { background: rgba(227,179,65,0.1) !important; }
.paid-row { opacity: 0.65; }

.rank-gold-row   { background: rgba(255,215,0,0.08)   !important; }
.rank-silver-row { background: rgba(192,192,192,0.08) !important; }
.rank-bronze-row { background: rgba(205,127,50,0.08)  !important; }

.unmatched-row   { background: rgba(255,80,80,0.06)   !important; }
.unmatched-row:hover { background: rgba(255,80,80,0.12) !important; }
.assign-select   { padding: 0.15rem 0.3rem; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* Scrape review modal — color-code by fuzzy-match confidence */
.review-row-high { background: rgba(64,200,80,0.10)  !important; }
.review-row-med  { background: rgba(240,190,40,0.12) !important; }
.review-row-low  { background: rgba(255,80,80,0.12)  !important; }
.review-select   { padding: 0.2rem 0.35rem; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.review-reentry  { border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* Participant search input on tournament page */
.participant-search-wrap { position: relative; }
#participantSearch {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  min-width: 220px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
#participantSearch:focus { outline: 2px solid var(--gold); outline-offset: 0; }

/* Sortable table headers */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gold); }
th.sortable.sorted { color: var(--gold); }
.sort-indicator { font-size: 0.75em; opacity: 0.35; margin-left: 3px; }
th.sortable:hover .sort-indicator { opacity: 0.85; }
th.sortable.sorted .sort-indicator { opacity: 1; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}
.rank-gold   { background: #e3b341; color: #000; }
.rank-silver { background: #94a3b8; color: #000; }
.rank-bronze { background: #cd7f32; color: #000; }
.rank-default { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

.player-name {
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}
.player-name:hover { color: var(--gold); text-decoration: underline; }

.money  { font-family: 'SF Mono', Consolas, monospace; color: #3fb950; font-weight: 600; }
.muted  { color: var(--text-muted); }
.center { text-align: center; }

/* ── PAID column ─────────────────────────────────────────────────────────── */
.paid-cell { white-space: nowrap; }

.paid-input {
  width: 90px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.85rem;
  padding: 2px 6px;
  text-align: right;
  transition: border-color 0.15s, background 0.15s;
}
.paid-input:hover  { border-color: var(--border); background: var(--surface2); }
.paid-input:focus  { border-color: var(--gold); background: var(--surface2); outline: none; }
.paid-input::placeholder { color: var(--text-muted); text-align: center; }

.paid-status {
  display: block;
  font-size: 0.7rem;
  margin-top: 2px;
  font-weight: 500;
}
.paid-status.paid-full  { color: #3fb950; }
.paid-status.paid-short { color: #d29922; }
.paid-status.paid-over  { color: #79c0ff; }

.paid-venmo-link {
  display: inline-flex;
  align-items: center;
  color: #008cff;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.paid-venmo-link:hover { opacity: 1; }

.paid-paypal-link {
  display: inline-flex;
  align-items: center;
  color: #003087;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.paid-paypal-link:hover { opacity: 1; }

/* ── Editable payout amount ─────────────────────────────────────────────── */
.payout-edit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.payout-input {
  width: 80px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 5px;
  text-align: right;
  transition: border-color 0.15s, background 0.15s;
  cursor: text;
}
.payout-input:hover  { border-color: var(--border); background: var(--surface2); }
.payout-input:focus  { border-color: var(--gold);   background: var(--surface2); outline: none; }

.paid-email-link {
  display: inline-block;
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.paid-email-link:hover { opacity: 1; color: var(--gold); }

.venmo-link { color: var(--venmo); font-weight: 500; }

.hidden { display: none !important; }

/* ── Modals ────────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-lg { max-width: 620px; }

.modal-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input[type=text], input[type=number], input[type=email],
input[type=tel], input[type=date], input[type=password], select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
}
/* Password field — explicit override so browser defaults don't win */
input[type="password"] {
  width: 100% !important;
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}
input[type="password"]:focus {
  outline: none !important;
  border-color: var(--gold-dark) !important;
}
/* Override browser autofill styling (Chrome/Edge inject their own colors) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #21262d inset;
  -webkit-text-fill-color: #e6edf3;
  transition: background-color 5000s ease-in-out 0s;
  border: 1px solid #30363d;
  border-radius: var(--radius);
}
textarea { resize: vertical; font-family: inherit; }
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
  margin-top: 8px;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Progress ──────────────────────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 6px;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
  animation: progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
#progressText { font-size: 0.82rem; color: var(--text-muted); }

/* ── Search Results ────────────────────────────────────────────────────────── */
.search-results {
  margin-top: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.search-result-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(227,179,65,0.1); }

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state p { font-size: 0.95rem; }

/* ── Auth Pages ────────────────────────────────────────────────────────────── */
body.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-icon { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.auth-logo { width: 220px; height: auto; border-radius: 0; object-fit: contain; display: block; margin: 0 auto 16px; }
.auth-header h1 { font-size: 1.4rem; margin: 0 0 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.875rem; margin: 0; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.btn-full { width: 100%; margin-top: 6px; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 0.875rem; }
.alert-error   { background: rgba(248,81,73,0.15); border: 1px solid rgba(248,81,73,0.4); color: #f85149; }
.alert-success { background: rgba(63,185,80,0.15); border: 1px solid rgba(63,185,80,0.4); color: #3fb950; }

/* ── Navbar user info ───────────────────────────────────────────────────────── */
.navbar-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 4px;
}
.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-logout:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* ── Impersonation banner ───────────────────────────────────────────────────── */
.impersonation-banner {
  background: #7a3e00;
  border-bottom: 2px solid #d97706;
  color: #fed7aa;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.9rem;
}
.btn-stop-viewing {
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-stop-viewing:hover { background: #b45309; }

/* ── Admin page ─────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge-admin  { background: rgba(210,153,34,0.2); color: #d29922; border: 1px solid rgba(210,153,34,0.4); }
.badge-tenant { background: rgba(99,179,237,0.15); color: #63b3ed; border: 1px solid rgba(99,179,237,0.3); }
.badge-you    { background: rgba(63,185,80,0.15); color: #3fb950; border: 1px solid rgba(63,185,80,0.3);
                border-radius: 8px; padding: 1px 6px; font-size: 0.7rem; margin-left: 6px; }
.row-highlighted { background: rgba(210,153,34,0.07); }

/* ── Pricing ────────────────────────────────────────────────────────────────── */
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.pricing-plan {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
}
.plan-name { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.plan-price { font-size: 2.4rem; font-weight: 700; color: var(--accent); line-height: 1; }
.plan-period { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.plan-features { list-style: none; padding: 0; margin: 16px 0 20px; }
.plan-features li { padding: 5px 0; font-size: 0.9rem; color: var(--text-secondary); }

/* ── Navbar subscription badges ─────────────────────────────────────────────── */
.navbar-sub-badge {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.sub-trial   { background: rgba(210,153,34,0.18); color: #d29922; border: 1px solid rgba(210,153,34,0.4); }
.sub-readonly{ background: rgba(248,81,73,0.15);  color: #f85149; border: 1px solid rgba(248,81,73,0.35); }
.sub-none    { background: var(--accent);          color: #fff; }
.sub-support { background: rgba(248,81,73,0.12);  color: #f08080; border: 1px solid rgba(248,81,73,0.25); }
.sub-support:hover { background: rgba(248,81,73,0.22); }
.navbar-billing { font-size: 1rem; text-decoration: none; opacity: 0.6; }
.navbar-billing:hover { opacity: 1; }

/* ── Agent modal / download ──────────────────────────────────────────────────── */
.agent-platform-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.agent-platform-icon { font-size: 2rem; }
.agent-platform-card p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.agent-job-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  min-height: 100px;
}
.agent-idle p { margin: 0 0 8px; }
.agent-waiting { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notification ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #238636;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 9999;
  animation: fadeInUp 0.25s ease;
}
@keyframes fadeInUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── Hamburger / mobile nav ─────────────────────────────────────────────────── */
.navbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}
.navbar-hamburger:hover { border-color: var(--gold); color: var(--gold); }

/* ── Data table horizontal scroll wrapper ──────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .navbar-hamburger { display: flex; }
  .navbar-right {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }
  .navbar-right.mobile-open { display: flex; }
  .navbar-club-name,
  .navbar-club-btn { font-size: 1rem; margin-bottom: 4px; }
  .navbar-links { display: flex; flex-direction: column; width: 100%; gap: 0; }
  .navbar-links a {
    margin-left: 0;
    padding: 10px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
  }
  .navbar-links a:last-child { border-bottom: none; }
  .navbar-sub-badge { margin-left: 0; margin-top: 4px; }
  .navbar-billing { margin-left: 0; }
  .navbar-user { padding: 10px 0 4px; font-size: 0.9rem; }
  .btn-logout { margin-top: 4px; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .tournament-meta { gap: 10px; }
  .data-table td, .data-table th { padding: 8px 10px; }
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
