/* ── TPC Brand Variables ───────────────────────────────── */
:root {
  --emerald:     #094B34;
  --hunter:      #406B4B;
  --teal:        #4C6C5F;
  --taupe:       #867972;
  --white:       #FEFEFE;
  --off-white:   #F2EDE8;

  /* Semantic aliases */
  --bg:          #071f14;
  --bg-mid:      #0b2b1d;
  --surface:     #0f3524;
  --surface-2:   #163d2b;
  --border:      rgba(64,107,75,0.35);
  --border-hi:   rgba(64,107,75,0.6);
  --text:        #FEFEFE;
  --muted:       rgba(254,254,254,0.5);
  --muted-hi:    rgba(254,254,254,0.72);
  --accent:      #406B4B;
  --accent-hi:   #4e8259;
  --gold:        #c9a84c;
  --gold-light:  #dfc06a;
  --danger:      #ef4444;
  --success:     #22c55e;
  --radius:      10px;
  --radius-sm:   7px;
  --shadow:      0 8px 32px rgba(0,0,0,0.45);
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Montserrat', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-hi); text-decoration: none; }
h1,h2,h3,h4 { font-family: 'Montserrat', sans-serif; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
input, select, textarea, button { font-family: 'Montserrat', sans-serif; }

/* ── Member / Priority Page Header ──────────────────────── */
.site-header {
  background: var(--emerald);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 640px; margin: auto;
  display: flex; align-items: center; gap: 14px;
}
.logo-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--white); color: var(--emerald);
  font-family: 'Montserrat', sans-serif;
  font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: -1px;
}
.site-title {
  font-size: 17px; font-weight: 700;
  color: var(--white); letter-spacing: 0.02em;
  text-transform: uppercase;
}
.site-sub { font-size: 11px; color: var(--muted); margin-top: 1px; text-transform: uppercase; letter-spacing: 0.08em; }

.main-wrap {
  max-width: 640px; margin: 0 auto;
  padding: 24px 16px 56px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── Session Block (member page) ─────────────────────────── */
.session-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.session-header-pub {
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}
.session-day-badge {
  width: 42px; height: 42px; border-radius: 9px;
  background: var(--hunter); color: var(--white);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.session-title-pub { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.session-date-pub  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── State Cards ─────────────────────────────────────────── */
.state-card {
  padding: 36px 24px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px;
}
.state-card h2, .state-card h3 { color: var(--white); font-size: 17px; text-transform: uppercase; letter-spacing: 0.05em; }
.state-card p { color: var(--muted); max-width: 300px; font-size: 13px; }
.state-card.muted { opacity: 0.55; }
.state-card.pending, .state-card.closed { padding: 28px 24px; }
.state-card i.gold, .state-card i { color: var(--hunter); }

/* ── Sign-up Form ────────────────────────────────────────── */
.signup-form { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.priority-banner {
  background: rgba(64,107,75,0.2);
  border: 1px solid rgba(64,107,75,0.5);
  border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: #7ec89a; text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 8px;
}
.waitlist-banner {
  background: rgba(134,121,114,0.15);
  border: 1px solid rgba(134,121,114,0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12px; color: #c4b5a8;
  display: flex; align-items: center; gap: 8px;
}
.form-row { display: flex; gap: 8px; }
.form-row .form-input { flex: 1; }
.signup-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.msg-success  { background: rgba(22,163,74,0.15);  color: #86efac; border: 1px solid rgba(22,163,74,0.35); }
.msg-error    { background: rgba(239,68,68,0.13);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.msg-waitlist { background: rgba(134,121,114,0.15);color: #c4b5a8; border: 1px solid rgba(134,121,114,0.35); }

/* ── Capacity Bar ────────────────────────────────────────── */
.capacity-wrap { display: flex; flex-direction: column; gap: 5px; }
.capacity-bar-bg { height: 5px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.capacity-bar-fill { height: 100%; background: var(--hunter); border-radius: 99px; transition: width 0.4s ease; }
.capacity-text { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; }

/* ── Player List ─────────────────────────────────────────── */
.player-list-card {
  border-top: 1px solid var(--border);
  padding: 14px 18px;
}
.player-list-header {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.waitlist-header { color: var(--taupe); }
.player-list { display: flex; flex-direction: column; gap: 1px; }
.player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.player-row:last-child { border-bottom: none; }
.player-num { font-size: 11px; color: var(--muted); width: 26px; flex-shrink: 0; font-weight: 700; }
.player-name { font-size: 13px; font-weight: 500; }
.waitlist-row { opacity: 0.65; }
.star-badge { color: var(--hunter); font-size: 11px; }
.mt-8 { margin-top: 8px; }
.mb-12 { margin-bottom: 12px; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(64,107,75,0.2);
  border-top-color: var(--hunter);
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form Elements ───────────────────────────────────────── */
.form-input {
  width: 100%; padding: 10px 13px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--hunter); background: rgba(0,0,0,0.4); }
.form-input.sm { padding: 7px 10px; font-size: 12px; }
.form-input::placeholder { color: var(--muted); }
select.form-input option { background: var(--surface-2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; border: none; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.btn.sm { padding: 7px 12px; font-size: 11px; }
.btn-gold { background: var(--hunter); color: var(--white); }
.btn-gold:hover { background: var(--accent-hi); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--muted-hi);
}
.btn-outline:hover { border-color: var(--hunter); color: var(--white); background: rgba(64,107,75,0.1); }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted-hi);
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-icon {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); padding: 5px 7px; border-radius: 6px;
  transition: all 0.15s; font-size: 13px;
}
.btn-icon:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.btn-icon.danger:hover { color: var(--danger); }

/* ── Form Group ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.alert-error   { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.28); }
.alert-success { background: rgba(64,107,75,0.18); color: #86efac; border: 1px solid rgba(64,107,75,0.4); }
.ml-auto { margin-left: auto; }

/* ── Admin header dropdown menu ──────────────────────────── */
.admin-menu-wrap { position: relative; }
.admin-menu-btn {
  background: rgba(64,107,75,0.25);
  border: 1px solid rgba(64,107,75,0.45);
  border-radius: 99px;
  padding: 4px 10px 4px 12px;
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; color: var(--white);
  transition: background 0.15s;
}
.admin-menu-btn:hover { background: rgba(64,107,75,0.4); }
.admin-menu-btn .admin-badge {
  background: none; border: none; padding: 0;
  font-size: 12px; font-weight: 700; color: #7ec89a;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-menu-caret {
  font-size: 10px; color: var(--muted);
  transition: transform 0.2s;
}
.admin-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 180px; z-index: 200;
  overflow: hidden;
}
.admin-dropdown-item {
  width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 12px 16px; font-size: 13px; font-weight: 600;
  color: var(--muted-hi); cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.12s, color 0.12s;
  border-bottom: 1px solid var(--border);
}
.admin-dropdown-item:last-child { border-bottom: none; }
.admin-dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.admin-dropdown-item.danger:hover { color: #fca5a5; background: rgba(239,68,68,0.08); }

/* ── Admin header dropdown menu ──────────────────────────── */
.admin-body { background: var(--bg); }

/* Login */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 40% 60%, var(--surface) 0%, var(--bg) 70%);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px; width: 100%; max-width: 360px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 18px;
}
.login-logo { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-logo h1 { font-size: 18px; color: var(--white); text-transform: uppercase; letter-spacing: 0.08em; }
.login-logo p { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
.logo-circle {
  width: 52px; height: 52px; border-radius: 13px;
  background: var(--emerald); color: var(--white);
  border: 2px solid var(--hunter);
  font-family: 'Montserrat', sans-serif;
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.logo-circle.sm { width: 30px; height: 30px; font-size: 14px; border-radius: 7px; }

/* ── Admin Header ────────────────────────────────────────── */
.admin-header {
  background: var(--emerald);
  border-bottom: 1px solid var(--border);
  padding: 11px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-title { font-weight: 700; font-size: 13px; color: var(--white); text-transform: uppercase; letter-spacing: 0.08em; }
.header-right { display: flex; align-items: center; gap: 10px; }
.admin-badge {
  background: rgba(64,107,75,0.3); color: #7ec89a;
  border: 1px solid rgba(64,107,75,0.5);
  padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── Nav Tabs ────────────────────────────────────────────── */
.admin-nav {
  background: var(--bg-mid);
  border-bottom: 1px solid var(--border);
  display: flex; overflow-x: auto; padding: 0 8px;
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.nav-tab {
  background: transparent; border: none; color: var(--muted);
  padding: 13px 14px; font-size: 11px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.07em;
}
.nav-tab:hover { color: var(--muted-hi); }
.nav-tab.active { color: var(--white); border-bottom-color: var(--hunter); }

/* ── Tab Panes ───────────────────────────────────────────── */
.tab-pane { padding: 20px; max-width: 960px; margin: 0 auto; }
.pane-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.pane-header h2 { font-size: 16px; color: var(--white); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ── Session Cards (admin) ───────────────────────────────── */
.sessions-grid { display: flex; flex-direction: column; gap: 10px; }
.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 17px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s;
}
.session-card:hover { border-color: var(--border-hi); }
.session-card.dimmed { opacity: 0.5; }
.session-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.session-date { font-size: 14px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.04em; }
.session-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.session-counts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.count-chip {
  background: rgba(64,107,75,0.2); color: #7ec89a;
  border: 1px solid rgba(64,107,75,0.4);
  padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em;
}
.count-chip.wl { background: rgba(134,121,114,0.15); color: #c4b5a8; border-color: rgba(134,121,114,0.35); }
.fill-bar { height: 3px; background: rgba(255,255,255,0.07); border-radius: 99px; overflow: hidden; }
.fill-bar-inner { height: 100%; background: var(--hunter); border-radius: 99px; }
.session-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge-on  { background: rgba(64,107,75,0.2); color: #7ec89a; border: 1px solid rgba(64,107,75,0.4); padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-off { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.28); padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-att     { background: rgba(64,107,75,0.18); color: #7ec89a; padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-pending-att { background: rgba(255,255,255,0.06); color: var(--muted); padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-review  { background: rgba(134,121,114,0.2); color: #c4b5a8; padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-new     { background: rgba(76,108,95,0.2); color: #93c5a8; padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-exact   { background: rgba(64,107,75,0.2); color: #7ec89a; padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-auto    { background: rgba(76,108,95,0.2); color: #86c5ad; padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-flag    { background: rgba(239,68,68,0.15); color: #fca5a5; padding: 1px 8px; border-radius: 99px; font-size: 10px; margin-left: 4px; font-weight: 700; }

/* ── Data Tables ─────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; padding: 7px 10px; border-bottom: 1px solid var(--border); font-weight: 700; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .action-cell { display: flex; gap: 4px; justify-content: flex-end; }
.row-flagged td { background: rgba(239,68,68,0.05); }

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle-row { flex-direction: row; align-items: center; justify-content: space-between; }
.toggle-switch { display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider {
  width: 40px; height: 22px; background: rgba(255,255,255,0.12);
  border-radius: 99px; position: relative; transition: background 0.2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--hunter); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ── Search Bar ──────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 13px; margin-bottom: 12px;
  color: var(--muted);
}
.search-bar input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; flex: 1; font-family: 'Montserrat', sans-serif; }
.flag-controls { font-size: 12px; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.flag-controls input { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 2px 7px; font-family: 'Montserrat', sans-serif; }

/* ── Flagged Banner ──────────────────────────────────────── */
.flagged-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.28);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px;
  color: #fca5a5; font-size: 12px; font-weight: 600;
}
.players-table-wrap { overflow-x: auto; }
.wa-link { color: #25d366; display: inline-flex; align-items: center; gap: 4px; }
.text-danger { color: #fca5a5; }

/* ── Attendance Review ───────────────────────────────────── */
.att-textarea { min-height: 150px; resize: vertical; font-family: 'Montserrat', monospace; font-size: 13px; line-height: 1.7; }
.att-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
  margin-bottom: 7px; display: flex; flex-direction: column; gap: 7px;
  background: rgba(0,0,0,0.15);
}
.att-row-main { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.att-raw { font-weight: 700; font-size: 13px; }
.att-arrow { color: var(--muted); font-size: 12px; }
.att-walkin-label { margin-left: auto; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.att-row-override { display: flex; align-items: center; gap: 10px; }
.review-header { margin-bottom: 14px; }
.review-header h3 { color: var(--white); margin-bottom: 4px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.review-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.no-shows-section { margin-top: 14px; background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm); padding: 13px; }
.no-shows-section h4 { font-size: 12px; color: #fca5a5; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.no-shows-section ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.no-shows-section li { font-size: 12px; color: var(--muted); }

/* ── Stats ───────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 600px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 14px;
  text-align: center;
}
.stat-num { font-size: 30px; font-weight: 800; color: var(--white); letter-spacing: -0.02em; }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .stats-two-col { grid-template-columns: 1fr; } }
.mini-bar { display: inline-block; width: 56px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.mini-bar div { height: 100%; background: var(--hunter); }
.flagged-player-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border);
}
.flagged-player-row:last-child { border-bottom: none; }
.flagged-actions { display: flex; gap: 8px; }
.day-breakdown-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.day-breakdown-row:last-child { border-bottom: none; }
.day-label { font-weight: 700; font-size: 13px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.day-stats { display: flex; gap: 16px; font-size: 11px; color: var(--muted); flex-wrap: wrap; font-weight: 600; }
.threshold-ctrl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.threshold-ctrl input { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 2px 7px; font-family: 'Montserrat', sans-serif; }
.gold { color: var(--hunter); }

/* ── Schedule ────────────────────────────────────────────── */
.schedule-grid { display: flex; flex-direction: column; gap: 10px; }
.schedule-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 17px;
}
.schedule-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.schedule-day { font-size: 14px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.05em; }
.schedule-meta { font-size: 11px; color: var(--muted); margin-top: 5px; }
.schedule-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Violet Members ──────────────────────────────────────── */
:root {
  --violet:      #7C3AED;
  --violet-hi:   #9461f7;
  --violet-dim:  rgba(124,58,237,0.18);
  --violet-border: rgba(124,58,237,0.4);
}
.violet-icon { color: var(--violet-hi); }
.btn-violet {
  background: var(--violet); color: #fff;
}
.btn-violet:hover { background: var(--violet-hi); }
.violet-member-row {
  align-items: flex-start;
  border-left: 3px solid var(--violet);
}
.violet-member-info {
  display: flex; flex-direction: column; gap: 3px; flex: 1;
}
.violet-member-name {
  font-size: 14px; font-weight: 700; color: var(--white);
  display: flex; align-items: center; gap: 7px;
}
.violet-member-notes {
  font-size: 11px; color: var(--muted); font-weight: 500;
  padding-left: 21px;
}
.violet-member-actions { display: flex; gap: 4px; flex-shrink: 0; margin-top: 2px; }

/* ── Priority Members ────────────────────────────────────── */
.members-list { display: flex; flex-direction: column; gap: 4px; }
.member-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 15px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Activity Log ────────────────────────────────────────── */
.log-list { display: flex; flex-direction: column; gap: 3px; }
.log-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); margin-bottom: 3px;
}
.log-icon { width: 30px; height: 30px; border-radius: 7px; background: rgba(64,107,75,0.15); color: var(--hunter); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.log-body { flex: 1; font-size: 12px; }
.log-admin { font-weight: 700; color: var(--white); margin-right: 5px; }
.log-detail { color: var(--muted); }
.log-time { font-size: 10px; color: var(--muted); white-space: nowrap; font-weight: 600; }

/* ── Session Detail ──────────────────────────────────────── */
.session-detail-header { font-size: 13px; margin-bottom: 12px; color: var(--muted); }
.list-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 12px 0 6px; font-weight: 700; }
.modal-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-add-row .form-input { flex: 1; min-width: 160px; }

/* ── WhatsApp Preview ────────────────────────────────────── */
.wa-preview {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  font-family: monospace; font-size: 12px; line-height: 1.7;
  white-space: pre-wrap; overflow-x: auto; max-height: 380px; overflow-y: auto;
}

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--surface-2); border: 1px solid var(--border-hi);
  border-radius: var(--radius); width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 14px; color: var(--white); text-transform: uppercase; letter-spacing: 0.06em; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* ── Helpers ─────────────────────────────────────────────── */
.muted { color: var(--muted); }
.muted.sm { font-size: 11px; }
.helper-text { font-size: 11px; color: var(--muted); line-height: 1.55; font-weight: 500; }
.dimmed { opacity: 0.5; }
.text-center { text-align: center; }

/* ── Responsive / Mobile ──────────────────────────────────── */

/* --- Prevent iOS auto-zoom on input focus (font-size must be ≥16px) --- */
.form-input {
  font-size: 16px !important;
}
.form-input.sm { font-size: 14px !important; }

/* --- Public pages: stack form on small screens --- */
@media (max-width: 520px) {
  .form-row {
    flex-direction: column;
    gap: 10px;
  }
  .form-row .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 14px;
  }
  .signup-form { padding: 14px 14px 18px; }
  .main-wrap { padding: 16px 12px 64px; gap: 16px; }
  .session-header-pub { padding: 12px 14px; }
  .player-list-card { padding: 12px 14px; }
  .state-card { padding: 28px 16px; }
  .state-card p { font-size: 14px; }
  .priority-banner { font-size: 11px; }
  .waitlist-banner { font-size: 11px; }
}

/* --- Admin: general small-screen improvements --- */
@media (max-width: 640px) {
  .tab-pane { padding: 14px 12px; }
  .pane-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-two-col { grid-template-columns: 1fr; }

  /* Session cards: stack actions cleanly */
  .session-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .session-actions .btn { flex: 1 1 calc(50% - 6px); justify-content: center; min-width: 100px; }

  /* Session card header: allow wrap */
  .session-card-header { flex-wrap: wrap; }
  .session-counts { flex-direction: row; align-items: center; }

  /* Schedule card actions wrap */
  .schedule-header { flex-wrap: wrap; gap: 10px; }
  .schedule-actions { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  /* Admin nav tabs: larger tap area, hide icon text on very small screens */
  .admin-nav .nav-tab {
    padding: 12px 10px;
    font-size: 10px;
    gap: 4px;
    flex-direction: column;
    min-width: 50px;
    text-align: center;
  }
  .admin-nav .nav-tab i { font-size: 14px; }

  /* Admin header tighter */
  .admin-header { padding: 10px 14px; }
  .header-title { font-size: 12px; }

  /* Tables: horizontal scroll, protect first two columns */
  .players-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 480px; }

  /* Modals: full-screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92vh;
  }

  /* Modal footer: stack buttons */
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 100%; justify-content: center; }

  /* Card padding tighter */
  .card { padding: 14px 13px; }
  .session-card { padding: 13px 13px; }
  .login-card { padding: 30px 22px; }

  /* Attendance textarea taller for paste on mobile */
  .att-textarea { min-height: 120px; font-size: 14px !important; }

  /* Review row wrap better */
  .att-row-main { gap: 6px; }
  .att-walkin-label { margin-left: 0; }

  /* Stats numbers slightly smaller */
  .stat-num { font-size: 26px; }

  /* Priority link box */
  .priority-link-box { flex-direction: column; align-items: stretch !important; }
  .priority-link-box .btn { width: 100%; justify-content: center; }

  /* pane header button fills row */
  .pane-header .btn { width: 100%; justify-content: center; }
}

/* --- Tap target minimum 44px for all interactive elements --- */
.btn { min-height: 44px; }
.btn.sm { min-height: 36px; }
.nav-tab { min-height: 44px; }
.btn-icon { min-width: 36px; min-height: 36px; }

/* --- Safe area insets for notched/home-indicator phones --- */
.main-wrap { padding-bottom: max(56px, env(safe-area-inset-bottom, 56px)); }
.admin-nav  { padding-bottom: env(safe-area-inset-bottom, 0); }
