/* ============================================================
   ADMIN DASHBOARD
   Desktop-first design system
   ============================================================ */

:root {
  --sidebar-w: 240px;
  --topbar-h:  68px;
  --admin-bg-0: #050507;
  --admin-bg-1: #0a0a0c;
  --admin-bg-2: #101014;
  --admin-bg-3: #16161c;
  --admin-bg-4: #1d1d24;
}

.admin-shell {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(var(--brand-rgb),0.06), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, rgba(220,38,38,0.04), transparent 60%),
    var(--admin-bg-0);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  color: var(--text-1);
}

/* ─── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  background: var(--admin-bg-1);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border-1);
}
.sidebar-brand .logo {
  width: 40px; height: 40px;
  background: url('/static/logo.png') center/contain no-repeat;
  flex-shrink: 0;
}
.sidebar-brand .name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}
.sidebar-brand .sub {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-top: 4px;
  font-weight: 600;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-1);
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--admin-bg-3) center/cover no-repeat;
  border: 1px solid var(--border-2);
  flex-shrink: 0;
}
.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .who-name { font-size: 13px; font-weight: 600; }
.sidebar-user .who-role { font-size: 11px; color: var(--text-4); }
.sidebar-user .chev { color: var(--text-4); font-size: 10px; }

.nav-list {
  padding: 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  transition: all .15s;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(var(--brand-rgb),0.18), rgba(var(--brand-rgb),0.04));
  color: var(--brand-bright);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-bright);
  box-shadow: 0 0 12px var(--brand-bright);
}
.nav-item.danger { color: var(--danger-bright); }
.nav-item.danger:hover { background: rgba(239,68,68,0.10); }

.nav-section {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-5);
  padding: 14px 12px 6px;
  font-weight: 700;
}

/* ─── MAIN ───────────────────────────────────────────── */
.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
}
.admin-topbar .page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
}
.admin-topbar .breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-4);
}
.admin-topbar .breadcrumb b { color: var(--text-1); font-weight: 600; }

.admin-search {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  width: 280px;
}
.admin-search input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: var(--text-1);
  font-size: 13px;
}
.admin-search input::placeholder { color: var(--text-4); }
.admin-search i { color: var(--text-4); font-size: 13px; }

.topbar-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  color: var(--text-2);
  position: relative;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.topbar-icon:hover { background: var(--admin-bg-3); color: var(--text-1); }
.topbar-icon .bdg {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--brand-bright);
  border: 2px solid var(--admin-bg-2);
  border-radius: 50%;
}

.admin-content {
  padding: 24px 28px 60px;
  max-width: 100%;
}

/* ─── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-head .actions { display: flex; gap: 8px; }

.btn-icon-sm {
  padding: 6px 10px;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: all .15s;
}
.btn-icon-sm:hover { background: var(--admin-bg-4); color: var(--text-1); }
.btn-icon-sm.primary {
  background: rgba(var(--brand-rgb),0.15);
  border-color: rgba(var(--brand-rgb),0.30);
  color: var(--brand-bright);
}
.btn-icon-sm.primary:hover { background: rgba(var(--brand-rgb),0.22); }

/* ─── KPI GRID (Dashboard) ──────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.02), transparent),
    var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle at top right, var(--kpi-glow, rgba(var(--brand-rgb),0.12)), transparent 60%);
  pointer-events: none;
}
.kpi .kpi-label {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-4);
  font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.kpi .kpi-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--admin-bg-3);
  font-size: 14px;
}
.kpi .kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px; font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi .kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.kpi .kpi-sub .delta { color: var(--brand-bright); font-weight: 600; }
.kpi .kpi-sub .delta.down { color: var(--danger-bright); }

.kpi.green { --kpi-glow: rgba(var(--brand-rgb),0.18); }
.kpi.green .kpi-icon { background: rgba(var(--brand-rgb),0.12); color: var(--brand-bright); }
.kpi.blue  { --kpi-glow: rgba(59,130,246,0.18); }
.kpi.blue  .kpi-icon { background: rgba(59,130,246,0.12); color: #60a5fa; }
.kpi.amber { --kpi-glow: rgba(245,158,11,0.18); }
.kpi.amber .kpi-icon { background: rgba(245,158,11,0.12); color: #fbbf24; }
.kpi.red   { --kpi-glow: rgba(239,68,68,0.18); }
.kpi.red   .kpi-icon { background: rgba(239,68,68,0.12); color: var(--danger-bright); }
.kpi.purple { --kpi-glow: rgba(168,85,247,0.18); }
.kpi.purple .kpi-icon { background: rgba(168,85,247,0.12); color: #c084fc; }

/* ─── DASHBOARD GRID ─────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background .2s;
}
.activity-row:hover { background: rgba(255,255,255,0.02); }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.activity-icon.green { background: rgba(var(--brand-rgb),0.12); color: var(--brand-bright); }
.activity-icon.blue  { background: rgba(59,130,246,0.12); color: #60a5fa; }
.activity-icon.amber { background: rgba(245,158,11,0.12); color: #fbbf24; }
.activity-icon.red   { background: rgba(239,68,68,0.12); color: var(--danger-bright); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-2); }
.activity-time { font-size: 11px; color: var(--text-4); margin-top: 3px; }

/* ─── TABLES ─────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-4);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-1);
}
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-1);
  color: var(--text-2);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.table .player-cell {
  display: flex; align-items: center; gap: 10px;
}
.table .player-cell .av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--admin-bg-3) center/cover no-repeat;
  flex-shrink: 0;
  border: 1px solid var(--border-1);
}
.table .player-cell .meta { min-width: 0; }
.table .player-cell .name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.table .player-cell .sub  { font-size: 11px; color: var(--text-4); }

/* Wrap tables horizontally on small screens to avoid overflow off the phone frame */
.card { overflow-x: hidden; }
.card > .table-wrap,
.card > .table { max-width: 100%; }

/* Mobile-first: collapse data tables into stacked cards on narrow screens */
@media (max-width: 640px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--admin-bg-2);
    border: 1px solid var(--border-1);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .table tr:hover td { background: transparent; }
  .table td {
    border-bottom: 1px dashed var(--border-1);
    padding: 8px 0;
    text-align: left !important;
    white-space: normal !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
  }
  .table td:last-child { border-bottom: none; }
  .table td::before {
    content: attr(data-label);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-4);
    font-weight: 700;
    flex: 0 0 auto;
  }
  .table td .player-cell { width: 100%; }
  .table td.actions-cell { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .table td.actions-cell .btn-icon-sm { padding: 5px 8px; font-size: 11px; }
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pill.present { background: rgba(var(--brand-rgb),0.15); color: var(--brand-bright); }
.pill.absent  { background: rgba(239,68,68,0.15); color: var(--danger-bright); }
.pill.late    { background: rgba(245,158,11,0.15); color: #fbbf24; }
.pill.paid    { background: rgba(var(--brand-rgb),0.15); color: var(--brand-bright); }
.pill.pending { background: rgba(245,158,11,0.15); color: #fbbf24; }
.pill.overdue { background: rgba(239,68,68,0.15); color: var(--danger-bright); }

/* ─── MATCH CARDS ────────────────────────────────────── */

.match-card {
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb),0.06), transparent 60%),
    var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  transition: all .2s;
  cursor: pointer;
  margin-bottom: 12px;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.match-card:hover { border-color: rgba(var(--brand-rgb),0.30); transform: translateY(-1px); }
.match-card .vs {
  display: flex; align-items: center; gap: 12px;
  flex: 1;
}
.team-badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--admin-bg-3);
  display: grid; place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border-2);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
.team-badge.brand { background: url('/static/logo.png') center/contain no-repeat var(--admin-bg-1); border: none; }
.match-card .vs { flex: 0 0 auto; }
.match-info { flex: 1 1 0; min-width: 0; overflow: hidden; }
.match-teams {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-meta {
  font-size: 12px; color: var(--text-3);
  margin-top: 4px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.match-meta > span {
  display: inline-flex; align-items: center;
  white-space: nowrap; min-width: 0;
}
.match-meta i { color: var(--brand-bright); margin-right: 4px; }

/* Action button (Manage / Build Squad) on a match-card row. */
.match-card > .btn-icon-sm,
.match-card > a.btn-icon-sm {
  flex: 0 0 auto;
  align-self: center;
  margin-left: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 8px;
  justify-content: center;
  white-space: nowrap;
}
.match-card > .btn-icon-sm i,
.match-card > a.btn-icon-sm i { font-size: 11px; margin-right: 4px; }

/* Narrow phones: shrink badges and hide button text — icon only. */
@media (max-width: 480px) {
  .match-card { padding: 12px; gap: 10px; }
  .match-card .vs { gap: 8px; }
  .match-card .team-badge { width: 36px; height: 36px; font-size: 12px; }
  .match-card > .btn-icon-sm,
  .match-card > a.btn-icon-sm {
    padding: 6px 8px;
    margin-left: 6px;
    font-size: 0;
  }
  .match-card > .btn-icon-sm i,
  .match-card > a.btn-icon-sm i {
    font-size: 14px; margin-right: 0;
  }
}

/* ─── PLAYER PICKER (Add Players panel) ──────────────── */
.picker-search {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  margin-bottom: 14px;
}
.picker-search input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: var(--text-1);
  font-size: 13px;
}

.picker-tabs {
  display: flex; gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.picker-tab {
  padding: 6px 12px;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all .2s;
}
.picker-tab.active {
  background: rgba(var(--brand-rgb),0.15);
  color: var(--brand-bright);
  border-color: rgba(var(--brand-rgb),0.30);
}

.picker-list { display: flex; flex-direction: column; gap: 8px; }
.picker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  transition: all .15s;
}
.picker-row:hover { background: var(--admin-bg-4); }
.picker-row.selected { border-color: rgba(var(--brand-rgb),0.40); background: rgba(var(--brand-rgb),0.06); }
.picker-row .av {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--admin-bg-2) center/cover no-repeat;
  border: 1px solid var(--border-1);
  flex-shrink: 0;
}
.picker-row .who { flex: 1; min-width: 0; }
.picker-row .who-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.picker-row .who-pos  { font-size: 11px; color: var(--text-4); }
.picker-row .num {
  font-size: 11px; color: var(--text-4); font-weight: 700;
  margin-right: 8px;
}
.picker-row .add-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(var(--brand-rgb),0.15);
  color: var(--brand-bright);
  display: grid; place-items: center;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid rgba(var(--brand-rgb),0.30);
}
.picker-row .add-btn:hover { background: rgba(var(--brand-rgb),0.25); }
.picker-row .remove-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  color: var(--danger-bright);
  display: grid; place-items: center;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid rgba(239,68,68,0.30);
}

/* ─── ATTENDANCE SUMMARY DONUT ─────────────────────────── */
.att-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
.att-donut-wrap {
  position: relative;
  width: 160px; height: 160px;
  margin: 0 auto;
}
.att-donut-wrap canvas { position: absolute; inset: 0; }
.att-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.att-donut-center .num { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 800; }
.att-donut-center .lbl { font-size: 11px; color: var(--text-4); }

.att-legend { display: flex; flex-direction: column; gap: 10px; }
.att-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.att-legend-item .dot { width: 10px; height: 10px; border-radius: 3px; }
.att-legend-item .dot.green { background: var(--brand-bright); }
.att-legend-item .dot.red   { background: var(--danger-bright); }
.att-legend-item .dot.amber { background: #fbbf24; }
.att-legend-item .lbl { color: var(--text-3); flex: 1; }
.att-legend-item .num { font-weight: 700; }
.att-legend-item .pct { color: var(--text-4); font-size: 11px; margin-left: 6px; }

.att-history-list { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-1); }
.att-history-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
}
.att-history-row .date { color: var(--text-3); }
.att-history-row .pct  { font-weight: 700; }

/* ─── TEAM ATTENDANCE BARS ─────────────────────────────── */
.team-bar { margin-bottom: 14px; }
.team-bar-top {
  display: flex; justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.team-bar-top .team { font-weight: 600; color: var(--text-2); }
.team-bar-top .pct  { font-weight: 700; color: var(--text-1); }
.team-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}
.team-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-dim), var(--brand-bright));
  border-radius: 3px;
  width: 0%;
  transition: width 1s cubic-bezier(.22,1,.36,1);
}

/* ─── REPORT HEADER (date range, export) ───────────────── */
.report-controls {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.range-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.range-pill i { color: var(--brand-bright); }

.report-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.report-mini {
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.report-mini .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
}
.report-mini .lbl {
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-4);
  font-weight: 700;
  margin-top: 4px;
}

/* ─── EMPTY / COMING SOON ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-4);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: var(--text-5); }
.empty-state h3 { font-size: 18px; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ─── MOBILE SHRINK ────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.22,1,.36,1);
    width: var(--sidebar-w);
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
  }
  .sidebar.open { transform: translateX(0); }
  .admin-search { display: none; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 0 16px; }
}

/* Burger button - only shown on mobile */
.burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  color: var(--text-1);
  align-items: center; justify-content: center;
  cursor: pointer;
}
@media (max-width: 900px) { .burger { display: flex; } }

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1200px) { .three-col { grid-template-columns: 1fr; } }

/* ─── Phase 7: Match Create / Approvals / Squad Builder ──── */

.callout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 12px; margin-bottom: 14px;
}
.callout-info {
  background: rgba(59,130,246,0.10);
  border: 1px solid rgba(59,130,246,0.35);
  color: #93c5fd;
}
.callout i { font-size: 13px; }

/* Form grid for match create */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field-full { grid-column: 1 / -1; }
.form-field span {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-3);
}
.form-field span em { color: #f87171; font-style: normal; margin-left: 2px; }
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  color: var(--text-1);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand-bright, var(--brand-bright));
  background: var(--bg-3);
}
.form-field textarea { resize: vertical; min-height: 60px; }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 16px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-1);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { color: #f87171; border-color: rgba(239,68,68,0.4); }
.btn-danger:hover { background: rgba(239,68,68,0.10); }

/* Picker section (match create) */
.picker-section {
  border: 1px solid var(--border-1);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg-2);
  margin-top: 8px;
}
.picker-section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.picker-section-title { font-size: 14px; font-weight: 700; }
.picker-section-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.picker-section-actions { display: flex; gap: 6px; }
.picker-empty {
  padding: 16px; text-align: center; font-size: 12px;
  color: var(--text-3); font-style: italic;
}

/* Picker rows with checkbox (match create) */
.picker-list label.picker-row {
  display: grid;
  grid-template-columns: auto 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.picker-list label.picker-row:hover { border-color: var(--border-2); }
.picker-list label.picker-row:has(.mc-pick:checked) {
  border-color: rgba(var(--brand-rgb),0.5);
  background: rgba(var(--brand-rgb),0.08);
}
.picker-list .mc-pick {
  width: 16px; height: 16px;
  accent-color: var(--brand-bright, var(--brand-bright));
}
.picker-list .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-2) center/cover no-repeat;
  border: 1px solid var(--border-1);
}

/* Approvals */
.approval-list { display: flex; flex-direction: column; gap: 10px; }
.approval-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  padding: 14px 16px;
}
.approval-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.approval-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.approval-sub {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: var(--text-3);
}
.approval-sub i { margin-right: 4px; opacity: 0.7; }
.approval-badge {
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.approval-badge.type-training {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.4);
  color: #93c5fd;
}
.approval-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.approval-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--border-1);
  padding-top: 12px;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  font-size: 10px; font-weight: 600; color: var(--text-2);
}
.chip i { font-size: 9px; opacity: 0.7; }
.chip-muted { color: var(--text-3); }
.chip-ok {
  background: rgba(var(--brand-rgb),0.12);
  border-color: rgba(var(--brand-rgb),0.35);
  color: var(--brand-bright, var(--brand-bright));
}

/* ── Player pool chips — circular avatars ────────────────── */

.player-chip {
  display: inline-flex; flex-direction: column;
  align-items: center; gap: 4px;
  width: 56px;
  padding: 4px 2px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  cursor: grab;
  user-select: none;
  transition: opacity .15s, transform .15s;
  text-align: center;
}
.player-chip:hover { transform: translateY(-1px); }
.player-chip.dragging { opacity: 0.4; transform: scale(0.96); }
.player-chip.placed { opacity: 0.35; cursor: default; }
.player-chip.player-chip-muted {
  cursor: not-allowed;
}

/* ============================================================
   PHASE 8 — Attendance checklist + Notifications
   ============================================================ */

/* Event list cards (attendance overview) */
.att-event-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.att-event-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg-2, #111114);
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  text-decoration: none; color: inherit;
  transition: background .15s, border-color .15s, transform .08s;
}
.att-event-card:hover {
  background: var(--bg-3, #18181d);
  border-color: var(--text-4, #71717a);
}
.att-event-card:active { transform: scale(0.997); }
.att-event-type {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(var(--brand-rgb),0.15); color: #4ade80;
  flex-shrink: 0;
}
.att-event-type.match { background: rgba(59,130,246,0.15); color: #60a5fa; }
.att-event-main { flex: 1; min-width: 0; }
.att-event-title { font-weight: 700; font-size: 13.5px; color: var(--text-1, #fff); }
.att-event-meta  { font-size: 11.5px; color: var(--text-3, #a1a1aa); margin-top: 2px; }
.att-event-progress { width: 110px; flex-shrink: 0; }
.att-event-pct { font-size: 11px; color: var(--text-3, #a1a1aa); margin-bottom: 4px; text-align: right; }
.att-event-track {
  height: 4px; border-radius: 4px;
  background: var(--bg-3, #18181d);
  border: 1px solid var(--border-1, rgba(255,255,255,0.06));
  overflow: hidden;
}
.att-event-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  transition: width .25s;
}
.att-event-state {
  display: flex; align-items: center; gap: 8px; font-size: 11px;
  color: var(--text-4, #71717a);
}
.att-state {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
  background: var(--bg-3, #18181d); color: var(--text-2, #d4d4d8);
  border: 1px solid var(--border-1, rgba(255,255,255,0.10));
}
.att-state-open      { background: rgba(56,189,248,0.15);  color: #38bdf8; border-color: rgba(56,189,248,0.30); }
.att-state-pending   { background: rgba(251,191,36,0.15);  color: #fbbf24; border-color: rgba(251,191,36,0.30); }
.att-state-confirmed { background: rgba(var(--brand-rgb),0.15);   color: #4ade80; border-color: rgba(var(--brand-rgb),0.30); }
.att-state-edited    { background: rgba(167,139,250,0.15); color: #a78bfa; border-color: rgba(167,139,250,0.30); }

/* Light-mode restore for the attendance events list */
html[data-theme="light"] .att-event-card {
  background: #f8fafc; border-color: #e5e7eb;
}
html[data-theme="light"] .att-event-card:hover { background: #f1f5f9; border-color: #cbd5e1; }
html[data-theme="light"] .att-event-type { background: rgba(var(--brand-rgb),0.12); color: var(--brand); }
html[data-theme="light"] .att-event-type.match { background: rgba(59,130,246,0.12); color: #2563eb; }
html[data-theme="light"] .att-event-title { color: #0f172a; }
html[data-theme="light"] .att-event-meta { color: #64748b; }
html[data-theme="light"] .att-event-pct { color: #64748b; }
html[data-theme="light"] .att-event-track { background: #e2e8f0; border-color: transparent; }
html[data-theme="light"] .att-state { background: #e2e8f0; color: #475569; border-color: transparent; }
html[data-theme="light"] .att-state-open      { background: #e0f2fe; color: #0369a1; }
html[data-theme="light"] .att-state-pending   { background: #fef3c7; color: #92400e; }
html[data-theme="light"] .att-state-confirmed { background: #dcfce7; color: #166534; }
html[data-theme="light"] .att-state-edited    { background: #ede9fe; color: #6d28d9; }

/* Per-event banners */
.att-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; margin: 12px 0;
}
.att-banner-success { background: rgba(var(--brand-rgb),0.12); color: #4ade80; border: 1px solid rgba(var(--brand-rgb),0.30); }
.att-banner-pending { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.30); }

/* Bulk row */
.att-bulk-row {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 10px; padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-1, rgba(255,255,255,0.08));
}
.att-bulk-label { font-size: 11px; color: var(--text-4); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.att-counter { font-size: 12px; font-weight: 700; color: var(--text-2, #d4d4d8); }

/* Status pills */
.att-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border-1, rgba(255,255,255,0.10));
  background: var(--bg-3, #18181d); color: var(--text-3, #a1a1aa);
  cursor: pointer; transition: all .12s;
}
.att-pill:hover:not(:disabled) { border-color: var(--text-4, #71717a); color: var(--text-1, #fff); }
.att-pill:disabled { opacity: 0.55; cursor: not-allowed; }
.att-pill-present.active { background: rgba(var(--brand-rgb),0.15);  border-color: var(--brand-bright); color: #4ade80; }
.att-pill-late.active    { background: rgba(251,191,36,0.15); border-color: #fbbf24; color: #fbbf24; }
.att-pill-absent.active  { background: rgba(239,68,68,0.15);  border-color: #ef4444; color: #f87171; }

/* Checklist */
.att-checklist { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-2, #111114);
}
.att-row-head {
  display: flex; align-items: center; gap: 12px;
}
.att-row-head .av {
  width: 36px; height: 36px; border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: var(--bg-3, #18181d); flex-shrink: 0;
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
}
.att-row-head .who { flex: 1; min-width: 0; }
.att-row-head .who-name { font-weight: 700; font-size: 13px; color: var(--text-1, #fff); }
.att-row-head .who-name .num {
  display: inline-block;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; background: var(--bg-3, #18181d); color: var(--text-2, #d4d4d8);
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  margin-right: 6px;
}
.att-row-head .who-pos { font-size: 11px; color: var(--text-4); }
.att-status-group { display: flex; gap: 4px; flex-shrink: 0; }
.att-status-group .att-pill { padding: 6px 9px; }
.att-row-extras {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
}
.att-mins-input {
  width: 64px; padding: 5px 8px;
  border: 1px solid var(--border-1, rgba(255,255,255,0.10));
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  background: var(--bg-3, #18181d); color: var(--text-1, #fff);
  color-scheme: dark;
}
.att-comment {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--border-1, rgba(255,255,255,0.10));
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-3, #18181d); color: var(--text-1, #fff);
}
.att-comment::placeholder { color: var(--text-4, #71717a); }
.att-comment:focus, .att-mins-input:focus {
  outline: none; border-color: var(--brand-bright);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.15);
  background: var(--bg-3, #18181d);
}

/* Action footer */
.att-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border-1, rgba(255,255,255,0.08));
}

/* Light-mode restore for the attendance checklist */
html[data-theme="light"] .att-banner-success { background: #dcfce7; color: #166534; border-color: transparent; }
html[data-theme="light"] .att-banner-pending { background: #fef3c7; color: #92400e; border-color: transparent; }
html[data-theme="light"] .att-bulk-row { border-bottom-color: #e5e7eb; }
html[data-theme="light"] .att-counter { color: #334155; }
html[data-theme="light"] .att-pill {
  background: #fff; color: #475569; border-color: #e5e7eb;
}
html[data-theme="light"] .att-pill:hover:not(:disabled) { border-color: #94a3b8; color: #0f172a; }
html[data-theme="light"] .att-pill-present.active { background: #dcfce7; border-color: var(--brand-bright); color: #166534; }
html[data-theme="light"] .att-pill-late.active    { background: #fef3c7; border-color: #fbbf24; color: #92400e; }
html[data-theme="light"] .att-pill-absent.active  { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
html[data-theme="light"] .att-row { background: #fff; border-color: #e5e7eb; }
html[data-theme="light"] .att-row-head .av { background-color: #e2e8f0; border-color: #e5e7eb; }
html[data-theme="light"] .att-row-head .who-name { color: #0f172a; }
html[data-theme="light"] .att-row-head .who-name .num {
  background: #f1f5f9; color: #475569; border-color: transparent;
}
html[data-theme="light"] .att-mins-input,
html[data-theme="light"] .att-comment {
  background: #fff; color: #0f172a; border-color: #e5e7eb; color-scheme: light;
}
html[data-theme="light"] .att-actions { border-top-color: #e5e7eb; }

/* Empty state */
.empty-state {
  padding: 32px; text-align: center; color: var(--text-4);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-state i { font-size: 28px; opacity: 0.5; }
.empty-state p { font-size: 13px; margin: 0; }

/* ──────────────────────────────────────────────────────────
   Notifications — top-bar bell badge + dropdown panel
   ────────────────────────────────────────────────────────── */
.topbar-icon { position: relative; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid var(--bg-1, #0b0b0b);
}
.notif-panel {
  position: fixed; top: 60px; right: 16px;
  width: 360px; max-height: 480px;
  background: var(--bg-2, #111114);
  color: var(--text-1, #f3f4f6);
  border: 1px solid var(--border-2, rgba(255,255,255,0.10));
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  z-index: 9999;
  display: none; flex-direction: column;
  overflow: hidden;
}
.notif-panel.open { display: flex; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1, rgba(255,255,255,0.06));
  font-weight: 700; font-size: 13px;
  color: var(--text-1, #f3f4f6);
}
.notif-mark-all {
  background: transparent; border: 0; cursor: pointer;
  font-size: 11px; font-weight: 700;
  color: var(--brand-bright, var(--brand-bright));
  text-transform: uppercase; letter-spacing: .05em;
}
.notif-list { flex: 1; overflow-y: auto; }
.notif-empty {
  padding: 28px 16px; text-align: center;
  color: var(--text-3, #9ca3af); font-size: 12px;
}
.notif-item {
  display: flex; gap: 12px; padding: 10px 14px;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border-1, rgba(255,255,255,0.06));
  transition: background .12s;
}
.notif-item:hover { background: var(--bg-3, #18181d); }
.notif-item.unread { background: rgba(var(--brand-rgb),0.08); }
.notif-item.unread::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-bright, var(--brand-bright)); flex-shrink: 0; margin-top: 8px;
}
.notif-item i { color: var(--brand-bright, var(--brand-bright)); flex-shrink: 0; margin-top: 3px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 700; color: var(--text-1, #f3f4f6); }
.notif-sub   { font-size: 11.5px; color: var(--text-3, #9ca3af); margin-top: 2px; line-height: 1.4; }
.notif-time  { font-size: 10px; color: var(--text-4, #6b7280); margin-top: 4px; opacity: 0.8; }

/* Light theme overrides */
html[data-theme="light"] .notif-badge { border-color: #fff; }
html[data-theme="light"] .notif-panel {
  background: #fff;
  color: var(--text-1, #0f172a);
  border-color: var(--border, #e5e7eb);
  box-shadow: 0 12px 32px rgba(15,23,42,0.18);
}
html[data-theme="light"] .notif-head { border-bottom-color: var(--border, #e5e7eb); }
html[data-theme="light"] .notif-mark-all { color: var(--brand); }
html[data-theme="light"] .notif-empty { color: var(--text-4, #6b7280); }
html[data-theme="light"] .notif-item { border-bottom-color: #f1f5f9; }
html[data-theme="light"] .notif-item:hover { background: #f8fafc; }
html[data-theme="light"] .notif-item.unread { background: #f0f9ff; }
html[data-theme="light"] .notif-item.unread::before { background: #2563eb; }
html[data-theme="light"] .notif-item i { color: var(--brand); }
html[data-theme="light"] .notif-sub { color: var(--text-4, #6b7280); }
html[data-theme="light"] .notif-time { color: var(--text-4, #6b7280); }

/* ─────────────────────────────────────────────────────────────
   PHASE 10 — Finance ERP UI
───────────────────────────────────────────────────────────── */

/* Modal overlay (shared by invoices/expenses/refunds/reminders) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--surface-1, #fff);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-1, #e5e7eb);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 16px; color: var(--text-3, #6b7280);
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface-2, #f3f4f6); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-body label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--text-3, #6b7280); font-weight: 600;
}
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="date"],
.modal-body select,
.modal-body textarea {
  padding: 8px 10px; border: 1px solid var(--border-1, #e5e7eb);
  border-radius: 8px; font-size: 13px; color: var(--text-1, #0f172a);
  background: var(--surface-1, #fff); font-family: inherit;
}
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: 2px solid var(--brand, var(--brand));
  outline-offset: -2px; border-color: transparent;
}
.modal-body textarea { resize: vertical; min-height: 60px; }
.modal-body .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 10px; padding-top: 12px;
  border-top: 1px solid var(--border-1, #e5e7eb);
}

/* Toggle switch (for reminder rules) */
.switch {
  display: inline-block;
  position: relative;
  width: 38px; height: 22px;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background .2s;
}
.switch .slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* Inline keyboard tags for template-variable docs */
code.kbd {
  display: inline-block;
  padding: 3px 8px; border-radius: 6px;
  background: #f1f5f9; color: #0f172a;
  font-family: 'Space Grotesk', monospace;
  font-size: 11px; font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* Pills for additional finance statuses */
.pill.pending,
.pill.approved,
.pill.completed,
.pill.rejected {
  text-transform: capitalize; font-weight: 600;
}
.pill.pending   { background: #fef3c7; color: #92400e; }
.pill.approved  { background: #dbeafe; color: #1e40af; }
.pill.completed { background: #dcfce7; color: #166534; }
.pill.rejected  { background: #fee2e2; color: #991b1b; }

/* Category pills (expenses) */
.pill.cat-tournament_fee { background: #ede9fe; color: #5b21b6; }
.pill.cat-equipment      { background: #ccfbf1; color: #115e59; }
.pill.cat-salary         { background: #fef3c7; color: #92400e; }
.pill.cat-rent           { background: #fee2e2; color: #991b1b; }
.pill.cat-utilities      { background: #dbeafe; color: #1e40af; }
.pill.cat-travel         { background: #fce7f3; color: #9d174d; }
.pill.cat-other          { background: #f1f5f9; color: #334155; }

/* Danger button-icon variant */
.btn-icon-sm.danger {
  color: #dc2626;
}
.btn-icon-sm.danger:hover {
  background: #fee2e2;
}

/* Tighter table small text */
.muted        { color: var(--text-4, #9ca3af); }
.muted.small  { font-size: 11px; line-height: 1.3; }

/* ─── Phase 11 — Chat / Messaging ───────────────────────────── */
.chat-shell { min-height: 600px; }
.chat-shell.two-col { grid-template-columns: 360px 1fr; gap: 16px; align-items: stretch; }
.chat-side { display: flex; flex-direction: column; max-height: 760px; }
.chat-side .picker-list { flex: 1; overflow-y: auto; }
.chat-thread-list { display: flex; flex-direction: column; gap: 4px; }
.chat-row { cursor: pointer; transition: background 0.15s; padding: 10px 12px; border-radius: 10px; }
.chat-row:hover { background: rgba(255,255,255,0.04); }
.chat-row.selected { background: rgba(var(--brand-rgb),0.10); border-left: 3px solid var(--brand-bright); }
.chat-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 48px; }
.chat-unread-badge {
  background: var(--brand-bright); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; min-width: 18px; text-align: center;
}
.av-initials {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b82f6, var(--brand-bright)); color: #fff;
  font-weight: 700; font-size: 13px;
}

.chat-main { display: flex; flex-direction: column; min-height: 600px; max-height: 760px; padding: 0; overflow: hidden; }
.chat-main .empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.chat-thread-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-thread-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-thread-head .av { width: 40px; height: 40px; }
.chat-thread-head .who { flex: 1; }
.chat-thread-head .who-name { font-weight: 600; font-size: 15px; }
.chat-thread-head .who-pos { font-size: 12px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(0,0,0,0.15);
}
.chat-msg { display: flex; flex-direction: column; max-width: 70%; }
.chat-msg-in  { align-self: flex-start; align-items: flex-start; }
.chat-msg-out { align-self: flex-end;   align-items: flex-end; }
.chat-msg-bubble {
  padding: 9px 13px; border-radius: 14px;
  font-size: 14px; line-height: 1.4; word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-msg-in .chat-msg-bubble {
  background: #1f2937; color: #e5e7eb;
  border-bottom-left-radius: 4px;
}
.chat-msg-out .chat-msg-bubble {
  background: var(--brand-bright); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-meta { font-size: 11px; color: #9ca3af; margin-top: 3px; display: flex; gap: 4px; }

.chat-composer {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.chat-composer input {
  flex: 1; background: rgba(255,255,255,0.06); color: inherit;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 20px;
  padding: 9px 16px; font-size: 14px; outline: none;
}
.chat-composer input:focus { border-color: var(--brand-bright); }

.chat-compose-card { width: 480px; max-width: 92vw; }
.chat-compose-card .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.chat-compose-card .field span { font-size: 12px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.chat-compose-card select,
.chat-compose-card textarea {
  background: rgba(255,255,255,0.05); color: inherit;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; outline: none; font-family: inherit;
}
.chat-compose-card select:focus,
.chat-compose-card textarea:focus { border-color: var(--brand-bright); }

/* ─── Phase 12 — Announcements ──────────────────────────────── */
.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-row {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 14px 16px;
}
.ann-row-focus { border-color: var(--brand-bright, #4A6EE0); box-shadow: 0 0 0 1px var(--brand-bright, #4A6EE0); }
.ann-row-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.ann-title-wrap { flex: 1; min-width: 0; }
.ann-title { margin: 0 0 6px 0; font-size: 15px; font-weight: 600; }
.ann-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ann-pills .pill {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.06); display: inline-flex; align-items: center; gap: 4px;
}
.pill-club      { background: rgba(var(--brand-rgb),0.15);  color: #4ade80; }
.pill-team      { background: rgba(59,130,246,0.15); color: #60a5fa; }
.pill-parent    { background: rgba(168,85,247,0.15); color: #c084fc; }
.pill-role      { background: rgba(245,158,11,0.15); color: #fbbf24; }
.pill-sent      { background: rgba(var(--brand-rgb),0.15);  color: #4ade80; }
.pill-scheduled { background: rgba(245,158,11,0.15); color: #fbbf24; }
.pill-draft     { background: rgba(156,163,175,0.18);color: #d1d5db; }

.ann-actions { display: flex; gap: 6px; }
.ann-body   { margin: 6px 0 8px; color: #cbd5e1; line-height: 1.4; font-size: 14px; white-space: pre-wrap; }
.ann-meta   { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ann-meta a { color: #60a5fa; text-decoration: none; }
.ann-meta a:hover { text-decoration: underline; }

.field-check { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.field-check input[type="checkbox"] { width: 16px; height: 16px; }

/* Phase 13 — Private Session Requests */
.psr-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.psr-admin-list, .psr-list { display: flex; flex-direction: column; gap: 10px; }
.psr-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 14px;
}
.psr-row-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.psr-row-meta { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.psr-row-meta i { margin-right: 4px; opacity: 0.7; }
.psr-notes {
  margin: 6px 0; padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(96,165,250,0.4);
  border-radius: 4px;
  font-size: 13px; color: #cbd5e1; white-space: pre-wrap;
}
.psr-review { margin-top: 6px; }
.psr-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.psr-form {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  padding: 4px 2px;
}
.psr-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.psr-form .field span { color: #94a3b8; font-size: 12px; }
.psr-form input, .psr-form select, .psr-form textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 8px 10px; color: #e5e7eb; font-size: 14px;
}
.psr-form-actions {
  display: flex; align-items: center; gap: 12px;
  padding-top: 4px;
}
@media (max-width: 640px) {
  .psr-form { grid-template-columns: 1fr; }
}

/* ============================================================
   Phase 76 — PRIVATE SESSIONS (admin)
   Violet accent throughout, matching the parent-side schedule card, so
   the same feature reads the same way on both sides of the app.
   ============================================================ */
.ps-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ps-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--bg-2, #141414); border: 1px solid var(--border-1, #262626);
  color: var(--text-2, #a3a3a3); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.ps-tab:hover { background: var(--bg-3, #1c1c1c); color: var(--text-1, #fafafa); }
.ps-tab.is-active {
  background: rgba(167,139,250,0.14); border-color: rgba(167,139,250,0.4);
  color: #c4b5fd;
}
.ps-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 800;
}

/* ── Session rows ─────────────────────────────────────────── */
.ps-session-list { display: flex; flex-direction: column; gap: 10px; }
.ps-session {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: 12px;
  background: linear-gradient(120deg, rgba(167,139,250,0.07), transparent 55%), var(--bg-2, #141414);
  border: 1px solid rgba(167,139,250,0.20);
}
.ps-session.is-cancelled { opacity: .6; border-color: var(--border-1, #262626); background: var(--bg-2, #141414); }
.ps-session.is-pending   { border-style: dashed; }

.ps-session-date {
  width: 58px; flex-shrink: 0; text-align: center;
  padding: 8px 0; border-radius: 10px;
  background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.26);
}
.ps-session-dow { font-size: 10px; font-weight: 700; color: #c4b5fd; text-transform: uppercase; letter-spacing: .08em; }
.ps-session-day { font-size: 21px; font-weight: 800; line-height: 1.1; }
.ps-session-mon { font-size: 10px; color: var(--text-3, #737373); text-transform: uppercase; }

.ps-session-main { flex: 1; min-width: 0; }
.ps-session-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ps-session-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--text-3, #737373); margin-top: 5px;
}
.ps-session-meta i { margin-inline-end: 5px; color: #c4b5fd; opacity: .9; }
.ps-session-meta-aux { margin-top: 3px; }
.ps-session-meta-aux .is-full    { color: #f59e0b; }
.ps-session-meta-aux .is-waiting { color: #60a5fa; }
.ps-session-note {
  font-size: 12px; color: var(--text-2, #a3a3a3);
  margin-top: 7px; padding: 7px 10px;
  background: var(--bg-3, #1c1c1c); border-radius: 8px;
}
.ps-session-note i { margin-inline-end: 6px; opacity: .7; }
.ps-staff-note { border-inline-start: 2px solid var(--border-2, #333); }

.ps-session-actions {
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0; align-items: stretch;
}
@media (max-width: 820px) {
  .ps-session { flex-wrap: wrap; }
  .ps-session-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
}

.ps-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.ps-chip-series    { background: rgba(167,139,250,0.18); color: #c4b5fd; }
.ps-chip-pending   { background: rgba(245,158,11,0.18);  color: #fbbf24; }
.ps-chip-cancelled { background: rgba(239,68,68,0.16);   color: #fca5a5; }

.ps-foot-note {
  margin-top: 14px; padding: 11px 13px; border-radius: 10px;
  background: var(--bg-3, #1c1c1c); font-size: 12px;
  color: var(--text-3, #737373); line-height: 1.55;
}
.ps-foot-note i { margin-inline-end: 7px; opacity: .7; }

/* ── Create form: picker + recurrence preview ─────────────── */
.ps-picker-controls {
  display: flex; gap: 10px; padding: 0 14px 10px; flex-wrap: wrap;
}
.ps-search {
  position: relative; flex: 1; min-width: 200px;
  display: flex; align-items: center;
}
.ps-search i {
  position: absolute; inset-inline-start: 11px;
  font-size: 12px; color: var(--text-3, #737373); pointer-events: none;
}
.ps-search input {
  width: 100%; padding: 9px 12px 9px 32px;
  background: var(--bg-3, #1c1c1c); border: 1px solid var(--border-1, #262626);
  border-radius: 9px; color: var(--text-1, #fafafa); font-size: 13px;
}
.ps-count { color: #c4b5fd; font-weight: 700; }

.ps-selected-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 12px;
}
.ps-chip-pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px; border-radius: 999px;
  background: rgba(167,139,250,0.16); border: 1px solid rgba(167,139,250,0.3);
  font-size: 12px; color: #ddd6fe;
}
.ps-chip-x {
  background: none; border: none; cursor: pointer;
  color: #c4b5fd; font-size: 11px; padding: 2px 4px; line-height: 1;
}
.ps-chip-x:hover { color: #fca5a5; }

.picker-group-head {
  padding: 8px 14px 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3, #737373);
}
.picker-row.is-picked { background: rgba(167,139,250,0.08); }
.ps-clash {
  font-size: 10px; font-weight: 700; color: #fbbf24;
  background: rgba(245,158,11,0.14); padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
}
.ps-clash-inline { color: #fbbf24; }

.ps-rec-preview {
  padding: 10px 12px; border-radius: 9px;
  background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.22);
  font-size: 12px; color: var(--text-2, #a3a3a3); line-height: 1.5;
}
.ps-rec-preview i { margin-inline-end: 7px; color: #c4b5fd; }
.ps-rec-warn { color: #fca5a5; font-weight: 700; }

/* ── Players / waitlist drawer ────────────────────────────── */
.ps-drawer { position: fixed; inset: 0; z-index: 1200; }
.ps-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.ps-drawer-panel {
  position: absolute; inset-block: 0; inset-inline-end: 0;
  width: min(460px, 100%); display: flex; flex-direction: column;
  background: var(--bg-1, #0b0b0b); border-inline-start: 1px solid var(--border-1, #262626);
  box-shadow: -18px 0 42px rgba(0,0,0,.45);
}
.ps-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-1, #262626);
}
.ps-drawer-title { font-size: 15px; font-weight: 700; }
.ps-drawer-sub   { font-size: 12px; color: var(--text-3, #737373); margin-top: 3px; }
.ps-drawer-body  { flex: 1; overflow-y: auto; padding: 16px; }
.ps-drawer-section { margin-bottom: 22px; }
.ps-drawer-section h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-2, #a3a3a3); margin-bottom: 9px;
}

.ps-player-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ps-player-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  background: var(--bg-2, #141414); border: 1px solid var(--border-1, #262626);
}
.ps-player-list .av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-3, #1c1c1c) center/cover no-repeat;
}
.ps-player-list .who { flex: 1; min-width: 0; }
.ps-player-list .who-name { font-size: 13px; font-weight: 600; }
.ps-player-list .who-pos  { font-size: 11px; color: var(--text-3, #737373); }
.ps-absence { color: #fbbf24; }

.ps-att {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; white-space: nowrap;
}
.ps-att-present { background: rgba(34,197,94,0.16);  color: #86efac; }
.ps-att-late    { background: rgba(245,158,11,0.16); color: #fbbf24; }
.ps-att-absent  { background: rgba(239,68,68,0.16);  color: #fca5a5; }
.ps-att-pending { background: var(--bg-3, #1c1c1c);  color: var(--text-3, #737373); }

.ps-add-results { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.ps-add-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-2, #141414);
}
.ps-add-row .who { flex: 1; min-width: 0; }
.ps-add-row .who-name { font-size: 13px; font-weight: 600; }
.ps-add-row .who-pos  { font-size: 11px; color: var(--text-3, #737373); }

/* ── Modal extras ─────────────────────────────────────────── */
.ps-modal-note {
  font-size: 12px; color: var(--text-2, #a3a3a3);
  background: var(--bg-3, #1c1c1c); padding: 9px 11px;
  border-radius: 8px; line-height: 1.5; margin-bottom: 4px;
}
.ps-modal-note i { margin-inline-end: 7px; color: #fbbf24; }
.ps-modal-sub { font-size: 12px; color: var(--text-3, #737373); margin-bottom: 8px; }
.ps-scope {
  border: 1px solid var(--border-1, #262626); border-radius: 9px;
  padding: 11px; margin-top: 4px;
}
.ps-scope legend {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3, #737373); padding: 0 5px;
}
.ps-radio {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; padding: 5px 0; cursor: pointer;
}
.ps-radio input { margin-top: 3px; flex-shrink: 0; }
.ps-invoice-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border-1, #262626); border-radius: 9px; padding: 9px 11px;
}

/* ── Monthly Sessions: private column ─────────────────────── */
.ms-kpi.is-private { border-color: rgba(167,139,250,0.35); }
.ms-kpi.is-private .ms-kpi-v { color: #c4b5fd; }
.ms-private-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: rgba(167,139,250,0.16); color: #c4b5fd;
  font-weight: 700; font-size: 12px;
}

/* ── Attendance list: private event icon ──────────────────── */
.att-event-type.private {
  background: rgba(167,139,250,0.14); color: #c4b5fd;
}

/* Phase 14 — Reports */
.report-controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.report-range-form {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
.report-range-form .field {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
}
.report-range-form .field span { color: #9ca3af; font-size: 11px; }
.report-range-form input[type="date"] {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 6px 10px; color: #e5e7eb; font-size: 13px;
}

.empty-state-sm {
  text-align: center; padding: 28px 16px; color: #9ca3af;
}
.empty-state-sm i { font-size: 28px; opacity: 0.5; margin-bottom: 8px; display: block; }

.exp-cat-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.exp-cat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: 13px;
}
.exp-cat-label { color: #cbd5e1; }
.exp-cat-val   { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.exp-cat-val strong { color: #e5e7eb; font-size: 14px; }

.top-attenders { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.ta-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.ta-rank {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(var(--brand-rgb),0.18); color: #4ade80;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.ta-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ta-info strong { color: #e5e7eb; font-size: 14px; }
.ta-pct { font-size: 16px; font-weight: 700; color: #4ade80; }

/* ─── Phase 16 — Admin Settings ─── */
.settings-label {
  display: block;
  font-size: 11px; color: var(--text-4); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.settings-input {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--admin-bg-3); border: 1px solid var(--border-1);
  border-radius: 8px; color: var(--text-1); font-size: 13px;
  font-family: inherit;
}
.settings-input:focus { outline: none; border-color: var(--admin-accent, #ef4444); }
.settings-input:disabled { opacity: 0.6; cursor: not-allowed; }
.settings-hint { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.settings-select {
  background: var(--admin-bg-3); border: 1px solid var(--border-1);
  border-radius: 6px; color: var(--text-1);
  padding: 6px 10px; font-size: 12px; font-family: inherit;
}
.settings-toggle { cursor: pointer; }
.settings-toggle input[type="checkbox"] {
  width: 38px; height: 22px; appearance: none;
  background: rgba(255,255,255,0.12); border-radius: 999px;
  position: relative; cursor: pointer; transition: background 0.2s;
}
.settings-toggle input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; transition: transform 0.2s;
}
.settings-toggle input[type="checkbox"]:checked { background: var(--admin-accent, #ef4444); }
.settings-toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }
.settings-actions {
  margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--border-1);
}
.flash {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 10px 14px;
  border-radius: 8px; font-size: 13px;
}
.flash-ok  { background: rgba(var(--brand-rgb),0.10);  color: #4ade80; border: 1px solid rgba(var(--brand-rgb),0.25); }
.flash-err { background: rgba(239,68,68,0.10);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }

/* ─────────────────────────────────────────────────────────────
   PHASE 30 — Coach Note editor modal
───────────────────────────────────────────────────────────── */
.note-editor-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100; padding: 20px;
  -webkit-tap-highlight-color: transparent;
}
.note-editor-overlay[hidden] { display: none; }
.note-editor {
  width: min(520px, 100%);
  max-height: 90vh; overflow: auto;
  background: var(--bg-2, #111114);
  color: var(--text-1, #f3f4f6);
  border: 1px solid var(--border-2, rgba(255,255,255,0.10));
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
}
.note-editor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-1, rgba(255,255,255,0.06));
}
.note-editor-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.note-editor-close {
  background: transparent; border: 0;
  color: var(--text-3, #9ca3af);
  cursor: pointer; padding: 4px 8px; font-size: 16px;
}
.note-editor-close:hover { color: var(--text-1, #fff); }
.note-editor-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.note-editor-body textarea {
  width: 100%; resize: vertical; min-height: 100px;
  background: var(--bg-3, #18181d);
  color: var(--text-1, #f3f4f6);
  border: 1px solid var(--border-1, rgba(255,255,255,0.10));
  border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: 13px; line-height: 1.5;
}
.note-editor-body textarea:focus {
  outline: none; border-color: var(--brand, var(--brand));
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.18);
}
.note-counter {
  text-align: right; font-size: 11px;
  color: var(--text-3, #9ca3af);
}
.note-history {
  border-top: 1px dashed var(--border-1, rgba(255,255,255,0.08));
  padding-top: 10px; display: flex; flex-direction: column; gap: 8px;
}
.note-history-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3, #9ca3af);
}
.note-history-loading, .note-history-empty {
  font-size: 12px; color: var(--text-3, #9ca3af); padding: 8px 0;
}
.note-history-row {
  background: var(--bg-3, #18181d);
  border: 1px solid var(--border-1, rgba(255,255,255,0.06));
  border-radius: 10px; padding: 10px 12px;
}
.note-history-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 12px; margin-bottom: 4px;
}
.note-history-time { color: var(--text-3, #9ca3af); font-size: 11px; }
.note-history-body { font-size: 13px; line-height: 1.5; color: var(--text-2, #d4d4d8); white-space: pre-wrap; }
.note-editor-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-1, rgba(255,255,255,0.06));
}

/* Light theme */
html[data-theme="light"] .note-editor {
  background: #fff; color: var(--text-1, #0f172a);
  border-color: var(--border, #e5e7eb);
  box-shadow: 0 20px 60px rgba(15,23,42,0.18);
}
html[data-theme="light"] .note-editor-head { border-bottom-color: var(--border, #e5e7eb); }
html[data-theme="light"] .note-editor-actions { border-top-color: var(--border, #e5e7eb); }
html[data-theme="light"] .note-editor-body textarea {
  background: #f8fafc; color: var(--text-1, #0f172a);
  border-color: var(--border, #e5e7eb);
}
html[data-theme="light"] .note-history-row {
  background: #f8fafc; border-color: var(--border, #e5e7eb);
}
html[data-theme="light"] .note-history-body { color: var(--text-2, #334155); }

/* ─── Phase 31 — Players tab modals (Performance + Coach Note) ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop .modal {
  background: var(--bg-2, #111114);
  border: 1px solid var(--border-1, #1f1f23);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-1, #1f1f23);
}
html[data-theme="light"] .modal-backdrop .modal {
  background: #fff;
  border-color: var(--border, #e5e7eb);
}
html[data-theme="light"] .modal-foot { border-color: var(--border, #e5e7eb); }

/* Performance editor — player header */
.perf-player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-1, #1f1f23);
  margin-bottom: 4px;
}
.perf-player .av {
  width: 48px; height: 48px;
  border-radius: 50%;
  background-size: cover; background-position: center top;
  background-color: #1a2a1a;
  border: 2px solid var(--brand-bright, var(--brand-bright));
  flex-shrink: 0;
}
.perf-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.perf-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Section heading inside modal */
.perf-section-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.perf-section-h i { color: var(--brand-bright, var(--brand-bright)); }

/* Coach-note recent history */
.note-history-body {
  display: flex; flex-direction: column;
  gap: 8px; max-height: 200px; overflow-y: auto;
  padding: 8px; border-radius: 10px;
  background: var(--bg-3, rgba(255,255,255,0.03));
  border: 1px solid var(--border-1, #1f1f23);
  font-size: 12px;
}
.nh-row { display: flex; gap: 10px; align-items: flex-start; }
.nh-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: #1a2a1a;
  flex-shrink: 0;
}
.nh-meta { flex: 1; min-width: 0; }
.nh-head {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-3); margin-bottom: 2px;
}
.nh-head b { color: var(--text-1); font-weight: 700; }
.nh-date { font-size: 10px; opacity: 0.7; }
.nh-body { font-size: 12px; color: var(--text-2); white-space: pre-wrap; word-wrap: break-word; }

/* ─── Coach-note modal — mobile safety (Batch E) ─────────────
   The note modal is a flex column inside a max-height:90vh box.
   On small viewports (iPhone PWA ~600–700px inner-height), the
   perf-player header + history block + footer eat the available
   space, and because `.modal-body textarea` had no `flex-shrink`
   the textarea would collapse to 0 height as history loaded —
   which looked like "the modal appears then disappears" and
   made the input unclickable. Pin the editor size and cap history
   on mobile so the textarea always has room. */
#noteEditor {
  flex: 0 0 auto;      /* never shrink or grow — hold min-height */
  min-height: 120px;
  box-sizing: border-box;
}
#noteHistoryWrap { flex: 0 1 auto; min-height: 0; }
@media (max-width: 640px) {
  /* Trim history on phones so it can't push the textarea out */
  .note-history-body { max-height: 120px; }
  #noteHistoryWrap    { max-height: 160px; overflow: hidden; }
}

/* Form flash inside modals */
.form-flash {
  padding: 8px 10px; border-radius: 8px;
  font-size: 12px; margin-top: 4px;
}
.form-flash.flash-err {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
}
.form-flash.flash-ok {
  background: rgba(var(--brand-rgb),0.12);
  color: var(--brand-bright, var(--brand-bright));
  border: 1px solid rgba(var(--brand-rgb),0.25);
}

/* ─── Phase 33: Quick-help drawer ────────────────────────────────── */
.help-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
body.help-open .help-backdrop {
  opacity: 1; pointer-events: auto;
}
.help-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--admin-bg-1, #0f0f0f);
  border-left: 1px solid var(--border-1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.45);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
body.help-open .help-drawer {
  transform: translateX(0);
}
.help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-1);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb),0.10), transparent 60%),
    var(--admin-bg-2);
}
.help-eyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-bright);
  font-weight: 700;
  margin-bottom: 2px;
}
.help-eyebrow i { margin-right: 6px; }
.help-head h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.help-card {
  display: flex; gap: 12px;
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  padding: 12px;
  transition: border-color .15s, transform .15s;
}
.help-card:hover { border-color: rgba(var(--brand-rgb),0.30); }
.help-card-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: rgba(var(--brand-rgb),0.12);
  color: var(--brand-bright);
  display: grid; place-items: center;
  font-size: 14px;
}
.help-card-body { flex: 1; min-width: 0; }
.help-card-title {
  font-size: 13.5px; font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.help-card-text {
  font-size: 12.5px; line-height: 1.5;
  color: var(--text-3);
}
.help-card-cta {
  display: inline-flex; align-items: center;
  margin-top: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--brand-bright);
  text-decoration: none;
}
.help-card-cta:hover { text-decoration: underline; }
.help-foot {
  margin-top: 6px;
  padding: 12px;
  background: var(--admin-bg-2);
  border: 1px dashed var(--border-1);
  border-radius: 12px;
}
.help-foot-title {
  font-size: 11.5px; font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
}
.help-foot-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.help-foot-row .btn-icon-sm i { margin-right: 4px; }

/* Stretch to full width on narrow phone frame */
@media (max-width: 480px) {
  .help-drawer { width: 100%; border-left: none; }
}

/* ============================================================
   Phase 33 — User Management hub (/admin/users)
   ============================================================ */

/* Tabs */
.users-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 16px;
}
.users-tab {
  background: transparent; border: none; color: var(--text-2);
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 8px 8px 0 0;
  transition: color .15s, border-color .15s, background .15s;
}
.users-tab:hover { color: var(--text-1); background: rgba(255,255,255,0.03); }
.users-tab.active { color: var(--brand-bright); border-bottom-color: var(--brand-bright); }
.users-tab .cnt {
  background: rgba(var(--brand-rgb),0.15); color: var(--brand-bright);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.users-tab.active .cnt { background: rgba(var(--brand-rgb),0.25); }

/* Panels */
.users-panel { display: none; }
.users-panel.open { display: block; }

/* Card head */
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head-left h3 { font-size: 16px; margin: 0 0 4px; }
.card-head-left .muted { font-size: 12px; color: var(--text-2); margin: 0; max-width: 600px; }

.btn-primary {
  background: var(--brand-bright); color: #001a08; border: none;
  padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--brand); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary i { font-size: 11px; }

/* Toolbar */
.users-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.users-toolbar input,
.users-toolbar select {
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  color: var(--text-1); padding: 8px 10px; border-radius: 9px;
  font-size: 13px; min-height: 36px;
}
.users-toolbar .users-search { flex: 1; min-width: 180px; }

/* User card list */
.users-card-list { display: flex; flex-direction: column; gap: 8px; }
.user-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  border-radius: 12px; padding: 12px;
  transition: border-color .15s, transform .1s;
}
.user-card:hover { border-color: rgba(var(--brand-rgb),0.3); }
.user-card[data-status="pending_approval"] { border-left: 3px solid #f59e0b; }
.user-card[data-status="rejected"]         { border-left: 3px solid #ef4444; opacity: 0.7; }

.user-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  background: rgba(var(--brand-rgb),0.15); color: var(--brand-bright);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.user-main { flex: 1; min-width: 0; }
.user-name {
  font-weight: 700; color: var(--text-1); font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.user-name .jersey {
  background: rgba(255,255,255,0.08); color: var(--text-2);
  padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.user-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  color: var(--text-2); font-size: 12px; margin-top: 4px;
}
.user-meta i { font-size: 10px; margin-right: 3px; }
.user-meta-thin {
  margin-top: 4px; color: var(--text-2); font-size: 11px;
}
.user-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.user-actions { display: flex; gap: 4px; }

/* ────────────────────────────────────────────────────────────────
   Phase 71 — email reachability (admin › Users › Parents)
   Distinguishes the login identity from an address we can actually
   deliver to. A login may be an invented address that is not a real
   mailbox, so "has an email" and "can be emailed" are different
   facts and staff need to see which one they are looking at.
   ──────────────────────────────────────────────────────────────── */
.reach {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reach i { font-size: 10px; margin-right: 0; }
.reach-ok      { color: #4ade80; }
.reach-pending { color: #f59e0b; }
.reach-none    { color: var(--text-3, #71717a); }

.reach-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 12px;
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  border-radius: 10px;
  font-size: 12px; color: var(--text-2);
}
.reach-summary > i { color: var(--brand-bright); font-size: 13px; }
.reach-summary b { color: var(--text-1); }
.reach-summary .reach-pending,
.reach-summary .reach-none {
  padding-left: 10px; border-left: 1px solid var(--border-1);
}

/* Pills */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
}
.pill-green  { background: rgba(var(--brand-rgb),0.15);  color: var(--brand-bright); }
.pill-amber  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.pill-red    { background: rgba(239,68,68,0.15);  color: #ef4444; }
.pill-blue   { background: rgba(59,130,246,0.15); color: #3b82f6; }
.role-admin    { background: rgba(168,85,247,0.15); color: #a855f7; }
.role-head     { background: rgba(var(--brand-rgb),0.15);  color: var(--brand-bright); }
.role-coach    { background: rgba(59,130,246,0.15); color: #3b82f6; }
.role-finance  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.role-parent   { background: rgba(255,255,255,0.08); color: var(--text-2); }

/* Empty state */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-2); font-size: 13px;
  border: 1px dashed var(--border-1); border-radius: 12px;
}
.empty-state i { font-size: 32px; display: block; margin-bottom: 12px; opacity: 0.5; }

/* Age groups grid */
.age-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.age-card {
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  border-radius: 12px; padding: 14px;
  position: relative;
  transition: border-color .15s, transform .1s;
}
.age-card:hover { border-color: rgba(var(--brand-rgb),0.3); transform: translateY(-1px); }
.age-card.dim { opacity: 0.5; }
.age-code {
  font-size: 22px; font-weight: 800; color: var(--brand-bright);
  letter-spacing: 0.5px;
}
.age-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.age-meta {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 10px; color: var(--text-2); font-size: 11.5px;
}
.age-meta i { font-size: 10px; margin-right: 4px; width: 12px; text-align: center; }
.age-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 2px;
}

/* Modal */
.users-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.users-modal[hidden] { display: none; }
.users-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.users-modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; max-height: 90vh;
  background: var(--admin-bg-1); border: 1px solid var(--border-1);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.users-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-1);
}
.users-modal-head h3 { margin: 0; font-size: 15px; }
.users-modal-body {
  padding: 16px; overflow-y: auto; flex: 1;
}
.users-modal-body .form-row { margin-bottom: 12px; }
.users-modal-body label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-2); margin-bottom: 4px;
}
.users-modal-body label .req { color: #ef4444; margin-left: 2px; }
.users-modal-body input,
.users-modal-body select,
.users-modal-body textarea {
  width: 100%; box-sizing: border-box;
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  color: var(--text-1); padding: 9px 11px; border-radius: 9px;
  font-size: 13px; font-family: inherit;
}
.users-modal-body input:focus,
.users-modal-body select:focus,
.users-modal-body textarea:focus {
  outline: none; border-color: var(--brand-bright);
}
.users-modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--border-1);
}
.users-modal-foot .btn-primary { padding: 8px 14px; }
.users-modal-foot .btn-secondary {
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  color: var(--text-1); padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ── Phase 42 — multi-coach picker (New/Edit Team modal) ── */
.coach-pick-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 210px; overflow-y: auto;
  background: var(--admin-bg-2); border: 1px solid var(--border-1);
  border-radius: 9px; padding: 8px;
}
.users-modal-body .coach-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin: 0;
  font-size: 13px; font-weight: 500; color: var(--text-1);
  transition: background .15s, border-color .15s;
}
.users-modal-body .coach-pick:hover { background: rgba(var(--brand-rgb),0.07); }
.users-modal-body .coach-pick.on {
  background: rgba(var(--brand-rgb),0.12);
  border-color: rgba(var(--brand-rgb),0.45);
}
.users-modal-body .coach-pick input[type="checkbox"] {
  width: 16px; height: 16px; flex: 0 0 16px;
  accent-color: var(--brand-bright); cursor: pointer; padding: 0;
}
.coach-pick-name { flex: 1; }
.coach-pick-role {
  font-size: 11px; color: var(--text-3); text-transform: capitalize;
}
.coach-pick-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase;
  background: rgba(var(--brand-rgb),0.2); color: var(--brand-bright);
  border: 1px solid rgba(var(--brand-rgb),0.45);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}

.temp-pw-banner {
  background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.4);
  color: #3b82f6; padding: 12px; border-radius: 10px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.temp-pw-banner code {
  background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 6px;
  font-family: 'SF Mono', Menlo, monospace; font-size: 13px; font-weight: 700;
  color: #fff; user-select: all;
}
.temp-pw-banner button {
  margin-left: auto; background: transparent; border: 1px solid currentColor;
  color: inherit; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  font-size: 11px; font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.temp-pw-banner button:hover { background: rgba(59,130,246,0.15); }
.temp-pw-banner button.copied {
  background: rgba(var(--brand-rgb),0.18); border-color: var(--brand-bright); color: var(--brand-bright);
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .users-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .users-tab { white-space: nowrap; }
  .user-card { flex-wrap: wrap; }
  .user-side, .user-actions { width: 100%; justify-content: flex-end; }
  .age-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Phase 33 — Unified Approvals */
.approval-count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 8px; margin-left: 8px;
  background: rgba(245,158,11,0.18);
  border: 1px solid rgba(245,158,11,0.45);
  color: #fbbf24;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.approval-badge { display: inline-flex; align-items: center; gap: 6px; }
.approval-badge i { font-size: 11px; }
.approval-badge.type-user {
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.4);
  color: #c4b5fd;
}
.approval-badge.type-player {
  background: rgba(14,165,233,0.15);
  border: 1px solid rgba(14,165,233,0.4);
  color: #7dd3fc;
}
.approval-badge.type-event {
  background: rgba(var(--brand-rgb),0.15);
  border: 1px solid rgba(var(--brand-rgb),0.4);
  color: var(--brand-bright, var(--brand-bright));
}
.approval-card.type-user   { border-left: 3px solid rgba(168,85,247,0.55); }
.approval-card.type-player { border-left: 3px solid rgba(14,165,233,0.55); }
.approval-card.type-event  { border-left: 3px solid rgba(var(--brand-rgb),0.55); }
.approval-card.fade-out { opacity: 0; transform: translateX(8px); transition: all .25s ease; }

/* Phase 33 — Documents browser */
.docs-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.docs-summary-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 12px;
}
.docs-summary-card i {
  font-size: 22px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-2);
}
.docs-summary-card.kind-emirates_id i      { color: #fbbf24; background: rgba(245,158,11,0.12); }
.docs-summary-card.kind-insurance i        { color: #34d399; background: rgba(16,185,129,0.12); }
.docs-summary-card.kind-medical_clearance i{ color: #f87171; background: rgba(239,68,68,0.12); }
.docs-summary-card.kind-photo_id i         { color: #60a5fa; background: rgba(59,130,246,0.12); }
.docs-summary-card.kind-birth_certificate i{ color: #c4b5fd; background: rgba(168,85,247,0.12); }
.docs-summary-num   { font-size: 20px; font-weight: 800; color: var(--text-1); line-height: 1; }
.docs-summary-label { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.docs-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.docs-filters .filter-input,
.docs-filters .filter-select {
  height: 34px; padding: 0 10px;
  background: var(--bg-3); border: 1px solid var(--border-1);
  border-radius: 8px; color: var(--text-1); font-size: 13px;
}
.docs-filters .filter-input { min-width: 180px; }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.doc-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.doc-thumb {
  position: relative;
  height: 140px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  overflow: hidden;
}
.doc-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.doc-thumb > i {
  font-size: 48px;
  color: var(--text-3);
}
.doc-thumb > i.fa-file-pdf { color: #f87171; }
.doc-kind-tag {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 600;
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(6px);
}
.doc-kind-tag i { font-size: 9px; }
.doc-kind-tag.kind-emirates_id      { background: rgba(245,158,11,0.85); }
.doc-kind-tag.kind-insurance        { background: rgba(16,185,129,0.85); }
.doc-kind-tag.kind-medical_clearance{ background: rgba(239,68,68,0.85); }
.doc-kind-tag.kind-photo_id         { background: rgba(59,130,246,0.85); }
.doc-kind-tag.kind-birth_certificate{ background: rgba(168,85,247,0.85); }

.doc-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.doc-player {
  font-size: 14px; font-weight: 700; color: var(--text-1);
  display: flex; align-items: center; gap: 6px;
}
.doc-player i { font-size: 11px; opacity: .7; }
.doc-sub {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 11px; color: var(--text-3);
}
.doc-sub i { margin-right: 3px; opacity: .7; font-size: 10px; }
.doc-actions {
  display: flex; gap: 6px; margin-top: 6px;
  border-top: 1px solid var(--border-1); padding-top: 8px;
}
.doc-actions .btn-icon-sm { flex: 1; justify-content: center; }

/* Doc viewer modal (lightbox) */
.doc-viewer {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.doc-viewer[hidden] { display: none; }
.doc-viewer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
}
.doc-viewer-panel {
  position: relative;
  width: min(90vw, 1100px); height: min(90vh, 800px);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.doc-viewer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-1);
}
.doc-viewer-title { font-weight: 700; font-size: 14px; }
.doc-viewer-actions { display: flex; gap: 8px; }
.doc-viewer-body {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  overflow: auto;
}
.doc-viewer-body img,
.doc-viewer-body iframe {
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  border: 0;
}
.doc-viewer-body img { object-fit: contain; }

/* ── Training create — weekday chips ── */
.weekday-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.weekday-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px;
  border:1px solid #2a2a2a; border-radius:999px; cursor:pointer; user-select:none;
  background:#141414; font-size:12.5px; font-weight:600; transition:all .15s; }
.weekday-chip input { accent-color:var(--brand-bright); }
.weekday-chip:has(input:checked) { background:rgba(var(--brand-rgb),.15); border-color:var(--brand-bright); color:#86efac; }
.weekday-row.disabled .weekday-chip { opacity:.45; cursor:not-allowed; }

/* ── Training event tag — pending ── */
.event-tag.pending { background:rgba(251,191,36,.15); color:#fbbf24; border:1px solid rgba(251,191,36,.4); }

/* ── Activity feed page (theme-aware) ──────────────────────── */
.activity-page{padding:0}
.activity-page-head{
  display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:12px;margin-bottom:16px;
}
.activity-page-head h2{
  margin:0;font-size:22px;font-weight:700;
  color:var(--text-1);
}
.activity-subtitle{
  color:var(--text-3);font-size:13px;margin-top:4px;
}

.activity-card{
  background:var(--bg-2);
  border:1px solid var(--border-1);
  border-radius:12px;
  overflow:hidden;
}

.activity-filter-bar{
  display:flex;flex-wrap:wrap;gap:8px;
  padding:12px 16px;
  border-bottom:1px solid var(--border-1);
  background:var(--bg-1);
}
.activity-filter-chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 12px;border-radius:999px;
  background:var(--bg-3);color:var(--text-2);
  font-size:13px;font-weight:500;
  text-decoration:none;
  border:1px solid var(--border-1);
  transition:all .15s;
}
.activity-filter-chip:hover{
  background:var(--bg-4);
  border-color:var(--border-2);
  color:var(--text-1);
}
.activity-filter-chip.active{
  background:#1e40af;color:#fff;
  border-color:#1e3a8a;
}
.activity-filter-chip.active:hover{background:#1d4ed8;color:#fff}
.activity-filter-chip i{font-size:12px}

.activity-list-full{padding:0}
.activity-day-group + .activity-day-group{border-top:1px solid var(--border-1)}
.activity-day-header{
  padding:10px 16px;
  background:var(--bg-1);
  font-size:12px;font-weight:600;
  color:var(--text-3);
  text-transform:uppercase;letter-spacing:.5px;
  border-bottom:1px solid var(--border-1);
}

.activity-list-full .activity-row{
  display:flex;gap:12px;align-items:flex-start;
  padding:14px 16px;
  border-bottom:1px solid var(--border-1);
  transition:background .12s;
}
.activity-list-full .activity-row:hover{background:var(--bg-3)}
.activity-list-full .activity-row:last-child{border-bottom:none}

.activity-list-full .activity-icon{
  width:34px;height:34px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;font-size:14px;
}
/* Coloured tinted backgrounds (work on dark or light) */
.activity-list-full .activity-icon.green{background:rgba(var(--brand-rgb),0.18);color:#4ade80}
.activity-list-full .activity-icon.red  {background:rgba(239,68,68,0.18);color:#f87171}
.activity-list-full .activity-icon.amber{background:rgba(245,158,11,0.18);color:#fbbf24}
.activity-list-full .activity-icon.blue {background:rgba(59,130,246,0.18);color:#60a5fa}
.activity-list-full .activity-icon.gray {background:rgba(148,163,184,0.18);color:#cbd5e1}

.activity-list-full .activity-body{flex:1;min-width:0}
.activity-list-full .activity-text{
  color:var(--text-1);
  font-size:14px;line-height:1.45;
  word-break:break-word;
}
.activity-list-full .activity-link{
  color:var(--text-1);
  text-decoration:none;
}
.activity-list-full .activity-link:hover{
  color:#60a5fa;
  text-decoration:underline;
}
.activity-list-full .activity-time{
  color:var(--text-4);
  font-size:12px;margin-top:3px;
}

.activity-empty{
  padding:48px 16px;text-align:center;
  color:var(--text-3);
}
.activity-empty i{font-size:32px;margin-bottom:12px;color:var(--text-4)}
.activity-empty-title{margin:0;color:var(--text-2);font-size:14px}
.activity-empty-sub{margin:6px 0 0;font-size:13px;color:var(--text-4)}

.activity-pagination{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px 16px;
  border-top:1px solid var(--border-1);
  background:var(--bg-1);
}
.activity-pagination-info{color:var(--text-3);font-size:13px}

/* Light-theme overrides — make sure the page is readable when the user
   switches to the light theme. */
:root[data-theme="light"] .activity-list-full .activity-icon.green{background:#d1fae5;color:#047857}
:root[data-theme="light"] .activity-list-full .activity-icon.red  {background:#fee2e2;color:#b91c1c}
:root[data-theme="light"] .activity-list-full .activity-icon.amber{background:#fef3c7;color:#b45309}
:root[data-theme="light"] .activity-list-full .activity-icon.blue {background:#dbeafe;color:#1d4ed8}
:root[data-theme="light"] .activity-list-full .activity-icon.gray {background:#e5e7eb;color:#4b5563}
:root[data-theme="light"] .activity-list-full .activity-link:hover{color:#1d4ed8}

/* ── Phase 34 — Payment Categories (theme-aware) ──────────── */
.paycat-page{padding:0}
.paycat-head{
  display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:12px;margin-bottom:16px;
}
.paycat-head h2{margin:0;font-size:22px;font-weight:700;color:var(--text-1)}
.paycat-sub{color:var(--text-3);font-size:13px;margin-top:4px;max-width:560px}

.paycat-card{
  background:var(--bg-2);
  border:1px solid var(--border-1);
  border-radius:12px;
  overflow:hidden;
}

.paycat-row{
  display:flex;gap:14px;align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--border-1);
}
.paycat-row:last-child{border-bottom:none}
.paycat-row.inactive{opacity:.55}

.paycat-icon{
  width:40px;height:40px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;font-size:16px;
}
.paycat-icon.green {background:rgba(var(--brand-rgb),0.18); color:#4ade80}
.paycat-icon.red   {background:rgba(239,68,68,0.18); color:#f87171}
.paycat-icon.amber {background:rgba(245,158,11,0.18);color:#fbbf24}
.paycat-icon.blue  {background:rgba(59,130,246,0.18);color:#60a5fa}
.paycat-icon.purple{background:rgba(168,85,247,0.18);color:#c084fc}
.paycat-icon.gray  {background:rgba(148,163,184,0.18);color:#cbd5e1}

.paycat-body{flex:1;min-width:0}
.paycat-name{
  color:var(--text-1);font-size:15px;font-weight:600;
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.paycat-meta{
  color:var(--text-3);font-size:12px;margin-top:4px;
  display:flex;gap:12px;flex-wrap:wrap;
}
.paycat-meta i{margin-right:4px;font-size:11px;opacity:.7}

.paycat-tag{
  display:inline-flex;align-items:center;gap:4px;
  font-size:11px;font-weight:500;
  padding:2px 8px;border-radius:999px;
  background:var(--bg-3);color:var(--text-2);
  border:1px solid var(--border-1);
}
.paycat-tag.mode-auto  {background:rgba(var(--brand-rgb),0.15); color:#4ade80;border-color:rgba(var(--brand-rgb),0.35)}
.paycat-tag.mode-manual{background:rgba(59,130,246,0.15);color:#60a5fa;border-color:rgba(59,130,246,0.35)}
.paycat-tag.inactive-tag{background:rgba(239,68,68,0.15);color:#f87171;border-color:rgba(239,68,68,0.35)}

.paycat-actions{display:flex;gap:6px;flex-shrink:0}
.btn-icon-sm.danger{color:#f87171}
.btn-icon-sm.danger:hover{background:rgba(239,68,68,0.12);color:#fca5a5}

.paycat-empty{
  padding:48px 16px;text-align:center;color:var(--text-3);
}
.paycat-empty i{font-size:32px;margin-bottom:12px;color:var(--text-4)}
.paycat-empty p{margin:0;color:var(--text-2)}

/* Modal form fields */
.users-modal .form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.users-modal .form-field>span{font-size:12px;font-weight:600;color:var(--text-3)}
.users-modal .form-field input[type="text"],
.users-modal .form-field input[type="number"],
.users-modal .form-field select{
  background:var(--bg-1);
  border:1px solid var(--border-1);
  border-radius:8px;
  padding:10px 12px;
  color:var(--text-1);font-size:14px;outline:none;
}
.users-modal .form-field input:focus,
.users-modal .form-field select:focus{
  border-color:rgba(59,130,246,0.5);
}
.users-modal .form-field.checkbox-field{
  flex-direction:row;align-items:center;gap:10px;
}
.users-modal .form-field.checkbox-field>span{font-size:14px;color:var(--text-1);font-weight:500}

.icon-grid{
  display:grid;grid-template-columns:repeat(8,1fr);gap:6px;
}
.icon-swatch{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:8px;
  background:var(--bg-1);border:1px solid var(--border-1);
  color:var(--text-2);cursor:pointer;font-size:14px;
  transition:all .12s;
}
.icon-swatch input{position:absolute;opacity:0;pointer-events:none}
.icon-swatch:hover{background:var(--bg-3);color:var(--text-1)}
.icon-swatch:has(input:checked){
  background:rgba(59,130,246,0.18);
  border-color:rgba(59,130,246,0.6);
  color:#60a5fa;
}

.color-row{display:flex;gap:8px;flex-wrap:wrap}
.color-swatch{
  position:relative;display:inline-flex;
  border-radius:50%;padding:3px;cursor:pointer;
  border:2px solid transparent;transition:all .12s;
}
.color-swatch input{position:absolute;opacity:0;pointer-events:none}
.color-swatch:has(input:checked){border-color:var(--text-1)}

/* Light-mode overrides */
:root[data-theme="light"] .paycat-icon.green {background:#d1fae5;color:#047857}
:root[data-theme="light"] .paycat-icon.red   {background:#fee2e2;color:#b91c1c}
:root[data-theme="light"] .paycat-icon.amber {background:#fef3c7;color:#b45309}
:root[data-theme="light"] .paycat-icon.blue  {background:#dbeafe;color:#1d4ed8}
:root[data-theme="light"] .paycat-icon.purple{background:#ede9fe;color:#6d28d9}
:root[data-theme="light"] .paycat-icon.gray  {background:#e5e7eb;color:#4b5563}

/* ── Phase 34 — Invoice 3-step wizard (theme-aware) ───────── */
.invoice-create-page{padding:0;max-width:920px}
.invoice-create-form{display:flex;flex-direction:column;gap:18px}

.invoice-step{
  background:var(--bg-2);
  border:1px solid var(--border-1);
  border-radius:12px;
  padding:18px 20px;
  transition:opacity .15s;
}
.invoice-step-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.invoice-step-head h3{margin:0;font-size:16px;font-weight:600;color:var(--text-1)}
.invoice-step-num{
  width:28px;height:28px;border-radius:50%;
  background:rgba(59,130,246,0.18);color:#60a5fa;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;flex-shrink:0;
}

/* Step 1 — category cards */
.invoice-cat-grid{
  display:grid;gap:10px;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
}
.invoice-cat-card{
  position:relative;display:flex;gap:12px;align-items:center;
  background:var(--bg-1);
  border:1px solid var(--border-1);
  border-radius:10px;
  padding:12px;cursor:pointer;
  transition:all .12s;
}
.invoice-cat-card input{position:absolute;opacity:0;pointer-events:none}
.invoice-cat-card:hover{background:var(--bg-3);border-color:var(--border-2)}
.invoice-cat-card.selected{
  background:rgba(59,130,246,0.12);
  border-color:rgba(59,130,246,0.6);
  box-shadow:0 0 0 1px rgba(59,130,246,0.4) inset;
}
.invoice-cat-icon{
  width:40px;height:40px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;font-size:16px;
}
.invoice-cat-icon.green {background:rgba(var(--brand-rgb),0.18); color:#4ade80}
.invoice-cat-icon.red   {background:rgba(239,68,68,0.18); color:#f87171}
.invoice-cat-icon.amber {background:rgba(245,158,11,0.18);color:#fbbf24}
.invoice-cat-icon.blue  {background:rgba(59,130,246,0.18);color:#60a5fa}
.invoice-cat-icon.purple{background:rgba(168,85,247,0.18);color:#c084fc}
.invoice-cat-icon.gray  {background:rgba(148,163,184,0.18);color:#cbd5e1}
.invoice-cat-body{flex:1;min-width:0}
.invoice-cat-name{font-size:14px;font-weight:600;color:var(--text-1)}
.invoice-cat-meta{font-size:12px;color:var(--text-3);margin-top:3px;display:flex;gap:10px;flex-wrap:wrap}
.invoice-cat-recur{color:#4ade80}
.invoice-cat-recur i{margin-right:3px;font-size:10px}

/* Step 2 — recipient picker */
.invoice-pick-tabs{display:flex;gap:6px;margin-bottom:12px}
.invoice-tab{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 14px;border-radius:8px;
  background:var(--bg-1);color:var(--text-2);
  border:1px solid var(--border-1);
  font-size:13px;font-weight:500;cursor:pointer;
  transition:all .12s;
}
.invoice-tab:hover{background:var(--bg-3);color:var(--text-1)}
.invoice-tab.active{background:rgba(59,130,246,0.18);color:#60a5fa;border-color:rgba(59,130,246,0.5)}

.invoice-search-bar{
  display:flex;align-items:center;gap:8px;
  background:var(--bg-1);border:1px solid var(--border-1);border-radius:8px;
  padding:8px 12px;margin-bottom:10px;
}
.invoice-search-bar i{color:var(--text-4);font-size:13px}
.invoice-search-bar input{
  flex:1;background:transparent;border:none;outline:none;
  color:var(--text-1);font-size:14px;
}

.invoice-recipient-list{
  max-height:280px;overflow-y:auto;
  border:1px solid var(--border-1);border-radius:8px;
  background:var(--bg-1);
}
.invoice-recipient-row{
  display:flex;gap:10px;align-items:center;
  padding:10px 12px;cursor:pointer;
  border-bottom:1px solid var(--border-1);
}
.invoice-recipient-row:last-child{border-bottom:none}
.invoice-recipient-row:hover{background:var(--bg-3)}
.invoice-recipient-row input{flex-shrink:0}
.invoice-recipient-name{font-size:14px;font-weight:500;color:var(--text-1)}
.invoice-recipient-meta{font-size:12px;color:var(--text-3);margin-top:2px}
.invoice-recipient-meta i{font-size:10px;opacity:.7;margin-right:3px}
.invoice-recipient-summary{
  margin-top:10px;font-size:13px;color:var(--text-3);text-align:right;
}
.invoice-empty{padding:24px;text-align:center;color:var(--text-3)}

/* Step 3 — details */
.invoice-details-grid{
  display:grid;gap:12px;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
}
.invoice-create-form .form-field{display:flex;flex-direction:column;gap:6px}
.invoice-create-form .form-field>span{font-size:12px;font-weight:600;color:var(--text-3)}
.invoice-create-form .form-field input,
.invoice-create-form .form-field select{
  background:var(--bg-1);
  border:1px solid var(--border-1);
  border-radius:8px;
  padding:10px 12px;
  color:var(--text-1);font-size:14px;outline:none;
}
.invoice-create-form .form-field input:focus,
.invoice-create-form .form-field select:focus{border-color:rgba(59,130,246,0.5)}
.invoice-create-form .form-field.checkbox-field{
  flex-direction:row;align-items:center;gap:10px;
}
.invoice-create-form .form-field.checkbox-field>span{font-size:14px;color:var(--text-1);font-weight:500}

.invoice-create-foot{
  display:flex;justify-content:flex-end;gap:10px;margin-top:18px;
}

/* ───────────────────────────────────────────────────────────
   Phase 34 — Compact Finance UI
   Mini KPI strip + chip filters + grouped rows + donut chart.
   Uses theme tokens so it works in dark + light modes.
   ─────────────────────────────────────────────────────────── */

/* Mini KPI strip ------------------------------------------- */
.fin-mini-strip{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}
@media (max-width: 900px){
  .fin-mini-strip{
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:80%;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    padding-bottom:6px;
  }
  .fin-mini{ scroll-snap-align:start; }
}
.fin-mini{
  display:flex;align-items:center;gap:12px;
  background:var(--bg-2);
  border:1px solid var(--border-1);
  border-radius:12px;
  padding:12px 14px;
  min-height:72px;
  transition:border-color .15s ease, transform .15s ease;
}
.fin-mini:hover{ border-color:var(--border-2); }
.fin-mini-icon{
  width:38px;height:38px;flex:none;
  display:flex;align-items:center;justify-content:center;
  border-radius:10px;font-size:16px;
  background:rgba(100,116,139,0.15);
  color:var(--text-2);
}
.fin-mini.collected .fin-mini-icon{ background:rgba(16,185,129,0.18); color:#10b981; }
.fin-mini.pending   .fin-mini-icon{ background:rgba(245,158,11,0.18); color:#f59e0b; }
.fin-mini.overdue   .fin-mini-icon{ background:rgba(239,68,68,0.18);  color:#ef4444; }
.fin-mini.avg       .fin-mini-icon{ background:rgba(59,130,246,0.18); color:#3b82f6; }
.fin-mini-body{ display:flex;flex-direction:column;gap:2px;min-width:0; }
.fin-mini-label{
  font-size:11px;font-weight:600;letter-spacing:.04em;
  text-transform:uppercase;color:var(--text-3);
}
.fin-mini-value{
  font-size:18px;font-weight:700;color:var(--text-1);
  font-family:'Space Grotesk', system-ui, sans-serif;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.fin-mini-sub{ font-size:11px;color:var(--text-4); }

/* Two-column grid: list + donut ---------------------------- */
.fin-grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap:16px;
  align-items:start;
}
@media (max-width: 1100px){
  .fin-grid{ grid-template-columns:1fr; }
}

/* Chip rows ----------------------------------------------- */
.fin-chip-row{
  display:flex;flex-wrap:wrap;gap:6px;
  padding:10px 14px;
  border-bottom:1px solid var(--border-1);
}
.fin-chip-row-cats{ background:var(--bg-1); }
.fin-chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;font-weight:600;
  background:var(--bg-2);
  color:var(--text-3);
  border:1px solid var(--border-1);
  cursor:pointer;
  transition:all .15s ease;
  white-space:nowrap;
}
.fin-chip:hover{
  border-color:var(--border-2);
  color:var(--text-1);
}
.fin-chip i{ font-size:11px; }
.fin-chip.active{
  background:rgba(59,130,246,0.15);
  border-color:rgba(59,130,246,0.5);
  color:#60a5fa;
}
.fin-chip.cat.active.color-green { background:rgba(16,185,129,0.18);  border-color:rgba(16,185,129,0.5);  color:#34d399; }
.fin-chip.cat.active.color-red   { background:rgba(239,68,68,0.18);   border-color:rgba(239,68,68,0.5);   color:#f87171; }
.fin-chip.cat.active.color-amber { background:rgba(245,158,11,0.18);  border-color:rgba(245,158,11,0.5);  color:#fbbf24; }
.fin-chip.cat.active.color-blue  { background:rgba(59,130,246,0.18);  border-color:rgba(59,130,246,0.5);  color:#60a5fa; }
.fin-chip.cat.active.color-purple{ background:rgba(168,85,247,0.18);  border-color:rgba(168,85,247,0.5);  color:#c084fc; }
.fin-chip.cat.active.color-gray  { background:rgba(100,116,139,0.18); border-color:rgba(100,116,139,0.5); color:#cbd5e1; }

/* Invoice rows -------------------------------------------- */
.fin-rows{ padding:6px 0 12px; }
.fin-month-group{ margin-bottom:4px; }
.fin-month-header{
  position:sticky;top:0;z-index:1;
  padding:8px 16px;
  font-size:11px;font-weight:700;
  letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-4);
  background:var(--bg-1);
  border-top:1px solid var(--border-1);
  border-bottom:1px solid var(--border-1);
  /* Phase 59 — room for the per-month count + total on the right */
  display:flex;align-items:baseline;justify-content:space-between;gap:10px;
}
/* Phase 59 — per-month subtotal, so each billing run can be reconciled
   without adding the rows up by eye. */
.fin-month-meta{
  font-size:11px;font-weight:600;
  letter-spacing:0;text-transform:none;
  color:var(--text-3);white-space:nowrap;
}

/* Phase 59 — plain-language caption naming the active date basis. */
.fin-basis-note{
  margin:2px 16px 10px;
  padding:8px 11px;
  font-size:12px;line-height:1.5;
  color:var(--text-3);
  background:var(--admin-bg-3);
  border:1px solid var(--border-1);
  border-radius:8px;
}
.fin-basis-note strong{color:var(--text-1);}
.fin-basis-note .fa-circle-info{color:var(--brand-bright);margin-right:2px;}

/* Phase 59 — "Issued <date>" marker on each row under the issue-date basis. */
.fin-row-issued{
  display:inline-flex;align-items:center;gap:4px;
  color:var(--brand-bright);font-weight:600;
}
.fin-row-issued i{font-size:10px;opacity:.85;}
.fin-row{
  display:grid;
  grid-template-columns: 40px minmax(0,1fr) auto auto;
  align-items:center;gap:12px;
  padding:10px 16px;
  border-bottom:1px solid var(--border-1);
  transition:background .12s ease;
}
.fin-row:hover{ background:var(--bg-2); }
.fin-row-icon{
  width:36px;height:36px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  font-size:14px;
  background:rgba(100,116,139,0.15);
  color:var(--text-2);
}
.fin-row-icon.color-green { background:rgba(16,185,129,0.18);  color:#34d399; }
.fin-row-icon.color-red   { background:rgba(239,68,68,0.18);   color:#f87171; }
.fin-row-icon.color-amber { background:rgba(245,158,11,0.18);  color:#fbbf24; }
.fin-row-icon.color-blue  { background:rgba(59,130,246,0.18);  color:#60a5fa; }
.fin-row-icon.color-purple{ background:rgba(168,85,247,0.18);  color:#c084fc; }
.fin-row-icon.color-gray  { background:rgba(100,116,139,0.18); color:#cbd5e1; }
.fin-row-main{ min-width:0; }
.fin-row-title{
  display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;
  font-size:14px;color:var(--text-1);
}
.fin-row-name{ font-weight:600; }
.fin-row-cat{ color:var(--text-3);font-size:12px; }
.fin-row-sub{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  font-size:12px;color:var(--text-4);margin-top:2px;
}
.fin-row-sub .dot{ opacity:.5; }
.fin-row-rec{
  display:inline-flex;align-items:center;
  color:#60a5fa;font-size:11px;
}
.fin-row-right{
  display:flex;flex-direction:column;align-items:flex-end;gap:4px;
}
.fin-row-amount{
  font-family:'Space Grotesk', system-ui, sans-serif;
  font-weight:700;font-size:14px;color:var(--text-1);
  white-space:nowrap;
}
.fin-row-actions{
  display:flex;gap:4px;
}
.fin-row.status-overdue{
  background:rgba(239,68,68,0.04);
}
.fin-row.status-overdue .fin-row-amount{ color:#f87171; }

@media (max-width: 720px){
  .fin-row{ grid-template-columns: 36px minmax(0,1fr) auto; }
  .fin-row-actions{ grid-column: 2 / -1; justify-content:flex-end; margin-top:4px; }
}

/* Donut chart card ---------------------------------------- */
.fin-donut-card .card-head{
  display:flex;align-items:center;justify-content:space-between;
}
.fin-donut-wrap{
  display:flex;justify-content:center;align-items:center;
  padding:14px 8px 6px;
}
.fin-donut-svg{
  width:180px;height:180px;
}
.fin-donut-total{
  fill:var(--text-3);
  font-size:8px;font-weight:600;letter-spacing:.05em;
}
.fin-donut-amount{
  fill:var(--text-1);
  font-size:11px;font-weight:700;
  font-family:'Space Grotesk', system-ui, sans-serif;
}
.fin-donut-legend{
  list-style:none;margin:0;padding:8px 14px 14px;
  display:flex;flex-direction:column;gap:6px;
}
.fin-donut-legend li{
  display:grid;
  grid-template-columns: 12px 1fr auto auto;
  align-items:center;gap:8px;
  font-size:12px;color:var(--text-2);
}
.fin-donut-legend .dot-color{
  width:10px;height:10px;border-radius:3px;
}
.fin-donut-legend .leg-name{
  color:var(--text-1);font-weight:500;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.fin-donut-legend .leg-amt{
  color:var(--text-3);font-size:11px;
  font-family:'Space Grotesk', system-ui, sans-serif;
}
.fin-donut-legend .leg-pct{
  color:var(--text-4);font-size:11px;
  min-width:32px;text-align:right;
}

/* ───────────────────────────────────────────────────────────
   Phase 35 — Match editing (quick-edit drawer + full edit page)
   ─────────────────────────────────────────────────────────── */

/* Quick-edit drawer — logo block at top of form */

.qe-warn{
  display:flex;align-items:center;gap:8px;
  padding:10px 12px;margin:8px 0 4px;
  background:rgba(245,158,11,0.10);
  border:1px solid rgba(245,158,11,0.35);
  border-radius:8px;
  font-size:12px;color:var(--text-2);
}
.qe-warn i{ color:#f59e0b; }

/* Full edit page — opponent logo section */

.form-hint{
  display:inline-flex;align-items:center;gap:5px;
  font-size:11px;color:var(--text-4);margin-top:4px;
}
.form-hint i{ font-size:10px; }

/* Phase 35 fix — quick-edit modal dark-mode override.
   The base .modal-* rules use --surface-1 with a #fff fallback (designed for the
   light theme). Force dark tokens here so the drawer matches the rest of the app. */
.modal-card {
  background: var(--bg-2, #111114);
  color: var(--text-1, #fff);
  border: 1px solid var(--border-1, rgba(255,255,255,0.06));
}
.modal-head {
  border-bottom-color: var(--border-1, rgba(255,255,255,0.08));
}
.modal-head h3 { color: var(--text-1, #fff); }
.modal-close { color: var(--text-3, #a1a1aa); }
.modal-close:hover { background: var(--bg-3, #18181d); color: var(--text-1, #fff); }
.modal-body label {
  color: var(--text-3, #a1a1aa);
}
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="date"],
.modal-body input[type="time"],
.modal-body input[type="email"],
.modal-body select,
.modal-body textarea {
  background: var(--bg-3, #18181d);
  color: var(--text-1, #fff);
  border: 1px solid var(--border-1, rgba(255,255,255,0.10));
}
.modal-body input::placeholder,
.modal-body textarea::placeholder { color: var(--text-4, #71717a); }
/* Force dark UI for the native time/date pickers */
.modal-body input[type="date"],
.modal-body input[type="time"] { color-scheme: dark; }
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: 2px solid var(--brand, var(--brand));
  outline-offset: -2px;
  border-color: transparent;
  background: var(--bg-3, #18181d);
}
.modal-actions {
  border-top-color: var(--border-1, rgba(255,255,255,0.08));
}

/* Light-mode restore — keep the original Word-like look when user picks light */
html[data-theme="light"] .modal-card {
  background: #ffffff;
  color: #0f172a;
  border-color: #e5e7eb;
}
html[data-theme="light"] .modal-head { border-bottom-color: #e5e7eb; }
html[data-theme="light"] .modal-head h3 { color: #0f172a; }
html[data-theme="light"] .modal-body label { color: #6b7280; }
html[data-theme="light"] .modal-body input[type="text"],
html[data-theme="light"] .modal-body input[type="number"],
html[data-theme="light"] .modal-body input[type="date"],
html[data-theme="light"] .modal-body input[type="time"],
html[data-theme="light"] .modal-body input[type="email"],
html[data-theme="light"] .modal-body select,
html[data-theme="light"] .modal-body textarea {
  background: #ffffff; color: #0f172a;
  border-color: #e5e7eb; color-scheme: light;
}
html[data-theme="light"] .modal-actions { border-top-color: #e5e7eb; }

/* ─── Global admin search dropdown ─────────────────────────── */
.admin-search { position: relative; }
.admin-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--admin-bg-2, var(--bg-2, #111114));
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  z-index: 950;
  padding: 6px 0;
}
.admin-search-results[hidden] { display: none; }
.admin-search-section {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4, #71717a);
}
.admin-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text-2, #d4d4d8);
  text-decoration: none;
  font-size: 13px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.admin-search-item:hover,
.admin-search-item.is-active {
  background: var(--admin-bg-3, var(--bg-3, #18181d));
  color: var(--text-1, #fff);
}
.admin-search-item .ico {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--admin-bg-3, var(--bg-3, #18181d));
  color: var(--text-3, #a1a1aa);
  font-size: 12px;
  flex-shrink: 0;
}
.admin-search-item .body { flex: 1; min-width: 0; }
.admin-search-item .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1, #fff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-search-item .meta {
  font-size: 11px;
  color: var(--text-3, #a1a1aa);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-search-item mark {
  background: rgba(34, 197, 94, 0.22);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
.admin-search-empty,
.admin-search-loading {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--text-4, #71717a);
  text-align: center;
}
html[data-theme="light"] .admin-search-results {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 18px 50px rgba(0,0,0,0.12);
}
html[data-theme="light"] .admin-search-item:hover,
html[data-theme="light"] .admin-search-item.is-active {
  background: #f3f4f6;
}

/* ─── Phase 36 — Avatar frames (player & staff) ───────────── */
/* Shared "AI avatar" framing: dark circular background with subtle
   radial gradient + soft inner ring. Works at every size from the
   32 px table cell up to the 160 px parent-dashboard hero. */
.av-frame {
  position: relative;
  border-radius: 50%;
  background-color: #0e0e10;
  background-image:
    radial-gradient(ellipse at center top, #1a1a1f 0%, #0e0e10 65%, #050507 100%);
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.04),
    inset 0 -8px 16px rgba(0,0,0,0.4);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--text-3, #a1a1aa);
}
.av-frame.has-photo {
  /* When a photo is present we composite over the dark gradient so any
     transparent background-removed PNG still has a clean studio backdrop. */
  background-blend-mode: normal;
}
.av-frame .av-fallback {
  font-size: 50%;
  opacity: 0.55;
}
.av-frame .av-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand, var(--brand-bright));
  color: #0a0a0b;
  border: 2px solid var(--admin-bg-1, #0a0a0b);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  opacity: 1;
  transform: scale(1);
  transition: background .15s, transform .15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  z-index: 2;
}
.av-frame:hover .av-edit { transform: scale(1.1); }
.av-frame .av-edit:hover { background: var(--brand); }
.av-frame.is-processing::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 2px solid transparent;
  border-top-color: var(--brand, var(--brand-bright));
  animation: av-spin 0.8s linear infinite;
}
@keyframes av-spin { to { transform: rotate(360deg); } }

/* Sizing helpers — small in tables, bigger on profile / dashboard */
.av-frame.av-sm   { width: 36px;  height: 36px; }
.av-frame.av-md   { width: 56px;  height: 56px; }
.av-frame.av-lg   { width: 96px;  height: 96px; }
.av-frame.av-xl   { width: 128px; height: 128px; }
.av-frame.av-hero { width: 168px; height: 168px; }

/* In the players table the existing .av sizing wins (32 px). We keep that
   look but let the camera overlay still appear. */
.table .player-cell .av.av-frame {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.08);
}
.table .player-cell .av.av-frame .av-fallback { font-size: 14px; }
.table .player-cell .av.av-frame .av-edit { font-size: 8px; }

/* Coach distinguishing ring */
.av-frame.av-staff {
  box-shadow:
    inset 0 0 0 2px rgba(var(--brand-rgb),0.35),
    inset 0 -8px 16px rgba(0,0,0,0.4);
}

html[data-theme="light"] .av-frame {
  background-color: #f3f4f6;
  background-image:
    radial-gradient(ellipse at center top, #fafafa 0%, #f3f4f6 65%, #e5e7eb 100%);
  border-color: #e5e7eb;
  color: #6b7280;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.03), inset 0 -8px 16px rgba(0,0,0,0.06);
}
html[data-theme="light"] .av-frame .av-edit {
  border-color: #fff;
}

/* ─── Phase 37 — Multi-team dropdown for match create ─── */
.ms-dropdown { position: relative; }
.ms-dropdown-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.ms-dropdown-btn:hover { border-color: rgba(var(--brand-rgb),0.40); }
.ms-dropdown-btn[aria-expanded="true"] { border-color: rgba(var(--brand-rgb),0.55); }
.ms-dropdown-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.ms-dropdown-label.placeholder { color: var(--text-4); }
.ms-dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 50;
  max-height: 280px; overflow-y: auto;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.ms-dropdown-menu[hidden] { display: none; }
.ms-dropdown-empty { padding: 12px; color: var(--text-4); font-size: 12px; text-align: center; }
.ms-dropdown-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.ms-dropdown-opt:hover { background: var(--admin-bg-4); }
.ms-dropdown-opt input[type="checkbox"] { accent-color: var(--brand-bright, var(--brand-bright)); }
.ms-dropdown-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25) inset;
}
.ms-dropdown-text { flex: 1; }
.ms-dropdown-primary-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(var(--brand-rgb),0.18);
  color: var(--brand-bright, var(--brand-bright));
  border: 1px solid rgba(var(--brand-rgb),0.35);
  text-transform: uppercase;
}
.ms-dropdown-opt input[type="checkbox"]:checked ~ .ms-dropdown-text { color: var(--text-1); font-weight: 600; }

/* Picker player rows: team color pill + cross-team badge */
.picker-team-group { margin-top: 12px; }
.picker-team-group:first-of-type { margin-top: 0; }
.picker-team-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 8px;
}
.picker-team-head .team-color-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.picker-team-head .team-count { margin-left: auto; color: var(--text-3); font-weight: 600; }
.picker-row .team-pill {
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase;
  margin-left: 6px;
  white-space: nowrap;
}
.picker-row .double-booked-warn {
  font-size: 10px; color: #fbbf24;
  margin-top: 2px;
}

/* ─── Phase 39 — Birthday widgets ─────────────────────────── */
.bday-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffe9d6 100%);
  border: 1px solid #f4c585;
  border-left: 4px solid #e89a3c;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.bday-banner-head {
  display: flex; align-items: center; gap: 8px;
  color: #b45309; font-size: 14px; margin-bottom: 6px;
}
.bday-banner-head i { font-size: 16px; }
.bday-banner-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 10px 16px;
}
.bday-banner-list li {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.6);
  padding: 6px 12px; border-radius: 6px;
}
.bday-banner-list .bday-name { font-weight: 600; color: #1f2937; font-size: 14px; }
.bday-banner-list .bday-meta { font-size: 12px; color: #6b7280; }

.bday-list { list-style: none; padding: 0; margin: 0; }
.bday-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border-1);
}
.bday-row:last-child { border-bottom: none; }
.bday-row-left { display: flex; align-items: center; gap: 12px; }
.bday-row-left i {
  font-size: 14px; color: #e89a3c;
  background: #fff7ed; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.bday-row-name { font-weight: 600; font-size: 14px; color: var(--text-1); }
.bday-row-meta { font-size: 12px; color: var(--text-3); }
.bday-row-right { text-align: right; }
.bday-row-date { display: block; font-weight: 600; font-size: 13px; color: var(--text-1); }
.bday-row-days { font-size: 11px; color: var(--text-3); }

/* ─── Phase 40 — Status pills ─────────────────────────── */

.pill-success {
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.pill-muted {
  background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500;
  margin-left: 6px;
}

/* ─────────────────────────────────────────────────────────────
   Phase 44 — Finance: invoice kebab actions + date-range filter
   ───────────────────────────────────────────────────────────── */

/* Refunded / Cancelled invoice row states */
.fin-row.status-refunded { background: rgba(168,85,247,0.05); }
.fin-row.status-refunded .fin-row-amount { color: #c084fc; }
.fin-row.status-cancelled { opacity: 0.55; }
.fin-row.status-cancelled .fin-row-title,
.fin-row.status-cancelled .fin-row-amount { text-decoration: line-through; }
.pill.refunded  { background: rgba(168,85,247,0.16); color: #c084fc; border-color: rgba(168,85,247,0.3); }
.pill.cancelled { background: rgba(148,163,184,0.16); color: #94a3b8; border-color: rgba(148,163,184,0.3); }

/* Refunded KPI card */
.fin-mini.refunded .fin-mini-icon { background: rgba(168,85,247,0.18); color: #a855f7; }

/* ── Kebab floating menu ── */
.inv-kebab {
  position: absolute;
  z-index: 9999;
  min-width: 194px;
  padding: 6px;
  background: var(--surface-2, #16181d);
  border: 1px solid var(--border-2, #2a2e37);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: invKebabIn 0.12s ease-out;
}
@keyframes invKebabIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.inv-kebab button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-1, #e6e8ee);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.inv-kebab button i { width: 15px; text-align: center; opacity: 0.85; font-size: 12.5px; }
.inv-kebab button:hover { background: rgba(255,255,255,0.07); }
.inv-kebab button.danger        { color: #f87171; }
.inv-kebab button.danger:hover  { background: rgba(239,68,68,0.13); }
.inv-kebab button.warn          { color: #fbbf24; }
.inv-kebab button.warn:hover    { background: rgba(245,158,11,0.13); }
.inv-kebab button.good          { color: #34d399; }
.inv-kebab button.good:hover    { background: rgba(16,185,129,0.13); }
.inv-kebab-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-1, #22252c);
}
.inv-kebab-empty {
  padding: 10px 12px;
  color: var(--text-3, #8b90a0);
  font-size: 12.5px;
}

/* Checkbox line inside invoice-action modals */
.inv-chk {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-1, #22252c);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.inv-chk input[type="checkbox"] {
  width: 16px; height: 16px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent, #d4a129);
  cursor: pointer;
}
.inv-chk span { display: block; }
.inv-chk small {
  display: block;
  margin-top: 2px;
  color: var(--text-3, #8b90a0);
  font-weight: 400;
}
.inv-hint {
  margin: 0;
  padding: 9px 11px;
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 9px;
  color: #fbbf24;
  font-size: 12.5px;
  line-height: 1.45;
}

/* ── Date-range picker ── */
.fin-range-bar { margin: 0 0 14px; }
.range-picker { width: 100%; }
.range-picker-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 10px 12px;
  background: var(--surface-1, #12141a);
  border: 1px solid var(--border-1, #22252c);
  border-radius: 14px;
}
.range-picker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  flex: 0 0 auto;
  background: rgba(212,161,41,0.14);
  border-radius: 9px;
  color: var(--accent, #d4a129);
  font-size: 12.5px;
}
.range-preset {
  min-width: 168px;
  padding: 8px 11px;
  background: var(--surface-2, #16181d);
  border: 1px solid var(--border-2, #2a2e37);
  border-radius: 9px;
  color: var(--text-1, #e6e8ee);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.range-preset:focus { outline: none; border-color: var(--accent, #d4a129); }
.range-custom {
  display: flex;
  align-items: center;
  gap: 7px;
}
.range-custom.hidden { display: none; }
.range-custom input[type="date"] {
  padding: 8px 10px;
  background: var(--surface-2, #16181d);
  border: 1px solid var(--border-2, #2a2e37);
  border-radius: 9px;
  color: var(--text-1, #e6e8ee);
  font-size: 13px;
  color-scheme: dark;
}
.range-custom input[type="date"]:focus { outline: none; border-color: var(--accent, #d4a129); }
.range-dash { color: var(--text-3, #8b90a0); font-size: 13px; }
.range-apply {
  padding: 8px 15px;
  background: var(--accent, #d4a129);
  border: 0;
  border-radius: 9px;
  color: #12141a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.range-apply:hover { filter: brightness(1.07); }
.range-active {
  margin-left: auto;
  padding: 5px 11px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  color: var(--text-2, #b7bcca);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .range-picker-main { gap: 8px; }
  .range-preset { flex: 1 1 100%; min-width: 0; }
  .range-custom { flex: 1 1 100%; }
  .range-custom input[type="date"] { flex: 1 1 0; min-width: 0; }
  .range-active { margin-left: 0; flex: 1 1 100%; text-align: center; }
  .inv-kebab { min-width: 176px; }
}

/* ============================================================
   PHASE 45 — TRAINING EDIT / CANCEL (admin)
   ============================================================ */

/* Row of edit / cancel / restore buttons on each session card */
.session-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.session-actions .btn-icon-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-icon-sm.danger {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.30);
  color: #f87171;
}
.btn-icon-sm.danger:hover { background: rgba(239,68,68,0.20); }
.btn-icon-sm.good {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.30);
  color: #4ade80;
}
.btn-icon-sm.good:hover { background: rgba(34,197,94,0.20); }

/* Cancelled session card — dimmed with a red edge */
.event-card.is-cancelled {
  opacity: .72;
  border-color: rgba(239,68,68,0.32) !important;
  background: rgba(239,68,68,0.04);
}
.event-card.is-cancelled .event-title { text-decoration: line-through; text-decoration-color: rgba(239,68,68,.6); }
.event-tag.cancelled {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.40);
}
.session-cancel-reason {
  margin-top: 6px;
  font-size: 12px;
  color: #f87171;
  display: flex; align-items: flex-start; gap: 6px;
}
.session-cancel-reason i { margin-top: 2px; font-size: 11px; }

/* Edit / cancel modal internals */
.sess-ctx {
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.sess-ctx strong { color: var(--text-1); }
.sess-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  display: flex; align-items: flex-start; gap: 7px;
  line-height: 1.5;
}
.sess-hint i { margin-top: 2px; color: var(--brand-bright); font-size: 11px; }
.sess-hint.warn {
  padding: 9px 11px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.22);
  border-radius: 9px;
  color: #fca5a5;
}
.sess-hint.warn i { color: #f87171; }

@media (max-width: 560px) {
  .session-actions { width: 100%; }
  .session-actions .btn-icon-sm { flex: 1 1 auto; justify-content: center; }
}

/* Modal close "x" + busy submit state (referenced since Phase 44, styled here) */
.modal-x {
  background: transparent; border: none; cursor: pointer;
  font-size: 16px; color: var(--text-3, #a1a1aa);
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-x:hover { background: var(--admin-bg-3); color: var(--text-1); }
.btn.is-busy, button.is-busy { opacity: .6; cursor: progress; pointer-events: none; }

/* ============================================================
   PHASE 46 — FINANCE: DATE BASIS TOGGLE + EXCEL EXPORT
   ============================================================ */

/* Right-hand tool cluster in the range bar */
.fin-bar-tools {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-left: auto;
}

/* Segmented "By due date | By payment date" control */
.fin-basis {
  display: inline-flex;
  background: var(--admin-bg-3);
  border: 1px solid var(--border-1);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.fin-basis-btn {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px; font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s;
}
.fin-basis-btn:hover { color: var(--text-1); }
.fin-basis-btn.active {
  background: rgba(var(--brand-rgb),0.16);
  color: var(--brand-bright);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb),0.28);
}

/* Excel export button — green to read as a spreadsheet action */
.fin-export-btn {
  background: rgba(34,197,94,0.12) !important;
  border-color: rgba(34,197,94,0.30) !important;
  color: #4ade80 !important;
  text-decoration: none;
}
.fin-export-btn:hover { background: rgba(34,197,94,0.20) !important; }

/* Resolved dates under the active-range label */
.range-active { display: inline-flex; flex-direction: column; line-height: 1.3; }
.range-active-dates {
  font-size: 10.5px;
  color: var(--text-4, var(--text-3));
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .fin-bar-tools { margin-left: 0; width: 100%; }
  .fin-basis { flex: 1 1 auto; }
  .fin-basis-btn { flex: 1 1 0; text-align: center; }
  .fin-export-btn { flex: 1 1 100%; justify-content: center; }
}

/* ─── Phase 51 — reminder timing page ───────────────────────────── */
.rem-wrap { display: flex; flex-direction: column; gap: 14px; }
.rem-sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 0 2px; }
@media (max-width: 640px) { .rem-sum-grid { grid-template-columns: 1fr; } }
.rem-sum-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  border: 1px solid var(--admin-border, rgba(255,255,255,.10)); border-radius: 12px; }
.rem-sum-label { font-size: 12px; opacity: .72; display: flex; align-items: center; gap: 7px; }
.rem-sum-item strong { font-size: 14px; line-height: 1.35; }
.rem-note { font-size: 12px; opacity: .66; line-height: 1.5; margin: 6px 0 0; }
.rem-health p { display: flex; align-items: flex-start; gap: 9px; font-size: 13px;
  line-height: 1.5; margin: 0; }
.rem-health.is-ok   i { color: #35c47a; }
.rem-health.is-warn i { color: #e0a63a; }
.rem-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 2px 4px; }
.rem-status { font-size: 12.5px; opacity: .8; }
.rem-status.is-ok  { color: #35c47a; opacity: 1; }
.rem-status.is-err { color: #e2574c; opacity: 1; }
.rem-wrap .ir-sub { display: block; font-size: 11.5px; opacity: .6; margin-top: 3px;
  font-weight: 400; line-height: 1.4; max-width: 46ch; }
.rem-wrap .info-row select:disabled,
.rem-wrap .info-row input:disabled { opacity: .45; cursor: not-allowed; }

/* ─── Phase 52 — Payments: tabs + by-player balances ─────────────── */
.fin-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.fin-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--admin-text-dim, #a5a5a5);
  border: 1px solid var(--admin-border, rgba(255,255,255,.10)); }
.fin-tab:hover { color: #fff; }
.fin-tab.active { background: rgba(212,175,55,.14); color: #d4af37;
  border-color: rgba(212,175,55,.34); }
.fin-tab-badge { background: #e2574c; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 5px; }

.pb-note { font-size: 12.5px; opacity: .66; margin: 2px 0 12px; line-height: 1.5; }
.pb-search { background: rgba(255,255,255,.04);
  border: 1px solid var(--admin-border, rgba(255,255,255,.12));
  border-radius: 9px; padding: 8px 12px; font-size: 13px; color: inherit; min-width: 210px; }
.pb-table-wrap { overflow-x: auto; }
.pb-table { width: 100%; }
.pb-table th.num, .pb-table td.num { text-align: right; white-space: nowrap; }
.pb-row { cursor: pointer; }
.pb-row:hover { background: rgba(255,255,255,.035); }
.pb-name { font-weight: 600; font-size: 13.5px; }
.pb-sub { font-size: 11.5px; opacity: .6; margin-top: 2px; }
.pb-owe { color: #e0a63a; }
.pb-owe-late { color: #e2574c; }
.pb-empty { text-align: center; padding: 26px 0; opacity: .6; }
.pb-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; white-space: nowrap; }
.pb-badge.ok   { background: rgba(53,196,122,.15); color: #35c47a; }
.pb-badge.due  { background: rgba(224,166,58,.15); color: #e0a63a; }
.pb-badge.late { background: rgba(226,87,76,.16);  color: #e2574c; }
.pb-badge.none { background: rgba(255,255,255,.07); color: #9a9a9a; }

/* Drawer */
.pbd-backdrop { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,.55);
  display: flex; justify-content: flex-end; }
.pbd-backdrop[hidden] { display: none; }
.pbd-panel { width: min(460px, 100%); height: 100%; overflow-y: auto;
  background: var(--admin-card, #121212); border-left: 1px solid rgba(255,255,255,.10);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.pbd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pbd-head h3 { margin: 0; font-size: 17px; }
.pbd-sub { margin: 4px 0 0; font-size: 12px; opacity: .65; }
.pbd-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 9px; }
.pbd-tile { border: 1px solid rgba(255,255,255,.10); border-radius: 11px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px; }
.pbd-tile-label { font-size: 11px; opacity: .62; }
.pbd-tile-value { font-size: 14px; }
.pbd-tile.late .pbd-tile-value { color: #e2574c; }
.pbd-tile.due  .pbd-tile-value { color: #e0a63a; }
.pbd-tile.ok   .pbd-tile-value { color: #35c47a; }
.pbd-actions { display: flex; gap: 8px; }
.pbd-inv-list { list-style: none; margin: 0; padding: 0; display: flex;
  flex-direction: column; gap: 8px; }
.pbd-inv { display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 11px; }
.pbd-inv-main { flex: 1; min-width: 0; }
.pbd-inv-label { font-size: 13px; font-weight: 600; }
.pbd-inv-meta { font-size: 11.5px; opacity: .6; margin-top: 3px; }
.pbd-inv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pbd-inv-amt { font-size: 13px; font-weight: 600; white-space: nowrap; }
body.pbd-open { overflow: hidden; }
@media (max-width: 640px) {
  .pbd-panel { width: 100%; }
  .pb-search { min-width: 0; width: 100%; }
}

/* ─── Phase 56 — training card: coach name + audit line ─────────── */
.event-meta .meta-warn { color: #e0a63a; }
.event-subtle {
  margin-top: 6px;
  font-size: 11px;
  opacity: .5;
}

/* ─── Phase 57 — Stripe card payments panel ──────────────────────── */
.stripe-wrap { display: flex; flex-direction: column; gap: 14px; }

/* Hero: state at a glance */
.stripe-hero { display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; }
.stripe-hero .sh-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stripe-hero h2 { font-size: 17px; margin: 0 0 4px; line-height: 1.25; }
.stripe-hero .sh-sub { font-size: 12.5px; opacity: .72; margin: 0; line-height: 1.5;
  max-width: 56ch; }
.stripe-hero .sh-badge { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; font-size: 19px; }
.stripe-hero.is-live  .sh-badge { background: rgba(53,196,122,.14); color: #35c47a; }
.stripe-hero.is-ready .sh-badge { background: rgba(212,175,55,.14); color: #d4af37; }
.stripe-hero.is-setup .sh-badge { background: rgba(255,255,255,.07); color: #9aa0a6; }
.stripe-hero.is-live  { border-color: rgba(53,196,122,.28); }
.stripe-hero .sh-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.mode-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.mode-chip.test { background: rgba(96,165,250,.14); color: #60a5fa;
  border: 1px solid rgba(96,165,250,.3); }
.mode-chip.live { background: rgba(53,196,122,.14); color: #35c47a;
  border: 1px solid rgba(53,196,122,.32); }

/* The on/off switch */
.stripe-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  user-select: none; }
.stripe-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.stripe-switch .ss-track { width: 50px; height: 28px; border-radius: 999px;
  background: rgba(255,255,255,.14); position: relative; transition: background .18s ease;
  border: 1px solid var(--admin-border, rgba(255,255,255,.12)); }
.stripe-switch .ss-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .18s ease; }
.stripe-switch input:checked + .ss-track { background: #35c47a; border-color: #35c47a; }
.stripe-switch input:checked + .ss-track .ss-thumb { transform: translateX(22px); }
.stripe-switch .ss-text { font-size: 13px; font-weight: 600; opacity: .85; }
.stripe-switch input:disabled + .ss-track { opacity: .38; }
.stripe-switch:has(input:disabled) { cursor: not-allowed; }
.stripe-switch input:focus-visible + .ss-track { outline: 2px solid #d4af37; outline-offset: 2px; }

/* Flash message after toggling */
.stripe-flash { display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px;
  border-radius: 11px; font-size: 13px; line-height: 1.5; }
.stripe-flash.is-ok  { background: rgba(53,196,122,.10); color: #35c47a;
  border: 1px solid rgba(53,196,122,.26); }
.stripe-flash.is-err { background: rgba(226,87,76,.10); color: #e2574c;
  border: 1px solid rgba(226,87,76,.26); }

.stripe-livewarn { border-color: rgba(224,166,58,.34) !important;
  background: rgba(224,166,58,.06) !important; }
.stripe-livewarn p { margin: 0; font-size: 13px; line-height: 1.55; }
.stripe-livewarn i { color: #e0a63a; }

/* Checklist rows */
.stripe-check { display: flex; align-items: flex-start; gap: 12px; padding: 13px 2px;
  border-bottom: 1px solid var(--admin-border, rgba(255,255,255,.08)); }
.stripe-check:last-of-type { border-bottom: 0; }
.stripe-check .sc-icon { font-size: 16px; line-height: 1.35; flex: 0 0 auto; }
.stripe-check.is-ok   .sc-icon { color: #35c47a; }
.stripe-check.is-todo .sc-icon { color: #e0a63a; }
.stripe-check .sc-body { flex: 1 1 auto; min-width: 0; }
.stripe-check .sc-label { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.stripe-check .sc-hint { font-size: 12px; opacity: .68; line-height: 1.6; margin-top: 5px; }
.stripe-check .sc-pill { flex: 0 0 auto; font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }
.stripe-check .sc-pill.ok   { background: rgba(53,196,122,.14); color: #35c47a; }
.stripe-check .sc-pill.todo { background: rgba(224,166,58,.14); color: #e0a63a; }

.stripe-code { display: inline-block; margin-top: 5px; padding: 6px 10px; border-radius: 7px;
  background: rgba(0,0,0,.32); border: 1px solid var(--admin-border, rgba(255,255,255,.10));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px;
  line-height: 1.5; word-break: break-all; user-select: all; }

/* Webhook endpoint box */
.stripe-endpoint { margin-top: 14px; padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--admin-border, rgba(255,255,255,.10)); }
.stripe-endpoint .se-label { font-size: 12px; opacity: .72; display: flex;
  align-items: center; gap: 7px; margin-bottom: 9px; }
.stripe-endpoint .se-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stripe-endpoint code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; word-break: break-all; user-select: all; }
.stripe-endpoint .se-hint { font-size: 12px; opacity: .66; line-height: 1.55; margin: 10px 0 0; }
.stripe-endpoint .se-hint code { font-size: 11.5px; }

/* Outstanding summary */
.stripe-outstanding { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 0 2px; }
@media (max-width: 640px) { .stripe-outstanding { grid-template-columns: 1fr; } }
.stripe-outstanding .so-item { display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--admin-border, rgba(255,255,255,.10)); }
.stripe-outstanding .so-label { font-size: 12px; opacity: .72; }
.stripe-outstanding strong { font-size: 18px; }

.stripe-note { font-size: 12px; opacity: .68; line-height: 1.6; margin: 10px 0 0; }
.stripe-totals { font-size: 11.5px; opacity: .66; }

/* Event log */
.ev-type { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.ev-detail { font-size: 11.5px; opacity: .7; max-width: 30ch; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.ev-status { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em; }
.ev-status.ev-applied  { background: rgba(53,196,122,.14); color: #35c47a; }
.ev-status.ev-received { background: rgba(96,165,250,.14); color: #60a5fa; }
.ev-status.ev-ignored  { background: rgba(255,255,255,.07); color: #9aa0a6; }
.ev-status.ev-error    { background: rgba(226,87,76,.14); color: #e2574c; }

/* Go-live steps */
.stripe-steps { margin: 4px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.75; }
.stripe-steps li { margin-bottom: 6px; }
.stripe-steps code:not(.stripe-code) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.28); }

/* Light theme */
:root[data-theme="light"] .stripe-switch .ss-track { background: #d1d5db; border-color: #d1d5db; }
:root[data-theme="light"] .stripe-code,
:root[data-theme="light"] .stripe-steps code:not(.stripe-code) { background: #f3f4f6;
  border-color: #e5e7eb; color: #374151; }
:root[data-theme="light"] .stripe-endpoint { background: #f9fafb; border-color: #e5e7eb; }
:root[data-theme="light"] .stripe-hero.is-setup .sh-badge { background: #f3f4f6; color: #6b7280; }

/* Phase 57 — test-mode tester allowlist */
.tester-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 10px 0 4px; }
.tester-input { flex: 1 1 320px; min-width: 220px; padding: 9px 12px; border-radius: 9px;
  background: rgba(255,255,255,.04); color: inherit; font-size: 13px;
  border: 1px solid var(--admin-border, rgba(255,255,255,.12)); }
.tester-input:focus { outline: none; border-color: rgba(212,175,55,.5); }
:root[data-theme="light"] .tester-input { background: #fff; border-color: #e5e7eb; }

/* ═══════════════════════════════════════════════════════════════
   PHASE 58 — Shared player photo + lightbox
   Replaces the old coach-david.png fallback with a deterministic
   initials disc, and makes every face tappable for a closer look.
   ═══════════════════════════════════════════════════════════════ */
.pphoto {
  border-radius: 50%;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  background-color: var(--bg-3, #18181d);
  border: 1px solid var(--border-1, rgba(255,255,255,0.08));
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.pphoto-initials {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  user-select: none;
}
.pphoto.is-zoomable { cursor: zoom-in; transition: transform .14s ease, box-shadow .14s ease; }
.pphoto.is-zoomable:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 2; }
.pphoto.is-zoomable:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; }

/* ── Lightbox ─────────────────────────────────────────────── */
.pphoto-lightbox { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; }
.pphoto-lightbox[hidden] { display: none; }
.pphoto-lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(3px);
}
.pphoto-lightbox-panel {
  position: relative;
  background: var(--bg-2, #101014);
  border: 1px solid var(--border-1, rgba(255,255,255,0.1));
  border-radius: 18px;
  padding: 20px;
  width: min(92vw, 380px);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: pphotoIn .16s ease-out;
}
@keyframes pphotoIn { from { opacity: 0; transform: scale(.94) } to { opacity: 1; transform: scale(1) } }
.pphoto-lightbox-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
  background-color: #0e0e10;
  border: 1px solid rgba(255,255,255,.08);
}
/* No photo on file — enlarge the initials disc instead of showing a gap. */
.pphoto-lightbox-img.is-empty {
  display: grid; place-items: center;
  font-size: 88px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.pphoto-lightbox-meta { text-align: center; margin-top: 14px; }
.pphoto-lightbox-name { font-size: 17px; font-weight: 700; color: var(--text-1, #fafafa); }
.pphoto-lightbox-sub  { font-size: 12.5px; color: var(--text-3, #a1a1aa); margin-top: 4px; }
.pphoto-lightbox-x {
  position: absolute; top: -10px; right: -10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3, #18181d); color: var(--text-2, #d4d4d8);
  border: 1px solid var(--border-1, rgba(255,255,255,.12));
  cursor: pointer; display: grid; place-items: center; font-size: 13px;
}
.pphoto-lightbox-x:hover { background: var(--brand-bright); color: #0e0e10; }
html[data-theme="light"] .pphoto-lightbox-panel { background: #fff; border-color: #e5e7eb; }
html[data-theme="light"] .pphoto-lightbox-x { background: #fff; border-color: #e5e7eb; }

/* Players table: keep the camera upload button anchored to the photo now that
   the photo is the shared .pphoto component rather than .av-frame. */
.player-cell-photo { position: relative; flex-shrink: 0; line-height: 0; }
.player-cell-photo .av-edit {
  position: absolute; right: -4px; bottom: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-bright); color: #0e0e10;
  border: 1.5px solid var(--bg-2, #101014);
  display: grid; place-items: center; font-size: 8px;
  cursor: pointer; padding: 0; z-index: 3;
  transition: transform .12s ease;
}
.player-cell-photo:hover .av-edit { transform: scale(1.12); }
.pphoto.is-processing { opacity: .55; }
.pphoto.is-processing::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25); border-top-color: var(--brand-bright);
  animation: pphotoSpin .7s linear infinite;
}
@keyframes pphotoSpin { to { transform: rotate(360deg) } }

/* ═══════════════════════════════════════════════════════════════
   PHASE 58 — Monthly sessions sheet & package editor
   ═══════════════════════════════════════════════════════════════ */
.ms-subhead { font-size: 12px; color: var(--text-3, #a1a1aa); margin-top: 5px; line-height: 1.5; }
.ms-warn { color: #f59e0b; margin-left: 8px; font-weight: 600; }
.ms-muted { color: var(--text-4, #71717a); }
.ms-select, .ms-input {
  padding: 7px 10px; border-radius: 8px; font-size: 12.5px;
  background: rgba(255,255,255,.04); color: inherit;
  border: 1px solid var(--admin-border, rgba(255,255,255,.12));
}
.ms-input { width: 110px; }
.ms-select:focus, .ms-input:focus { outline: none; border-color: rgba(var(--brand-rgb),.55); }
:root[data-theme="light"] .ms-select,
:root[data-theme="light"] .ms-input { background: #fff; border-color: #e5e7eb; }

/* ── KPI strip ────────────────────────────────────────────── */
.ms-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin: 4px 0 16px;
}
.ms-kpi {
  background: rgba(255,255,255,.03); border: 1px solid var(--admin-border, rgba(255,255,255,.1));
  border-radius: 12px; padding: 12px 14px;
}
.ms-kpi.is-alert { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.07); }
.ms-kpi-l { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-4, #71717a); }
.ms-kpi-v { font-size: 24px; font-weight: 800; margin-top: 4px; }
.ms-kpi-s { font-size: 11px; color: var(--text-4, #71717a); margin-top: 2px; }
:root[data-theme="light"] .ms-kpi { background: #fafafa; border-color: #e5e7eb; }

/* ── Banner / footnote ────────────────────────────────────── */
.ms-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.3);
  border-radius: 10px; padding: 11px 13px; margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.55; color: var(--text-2, #d4d4d8);
}
.ms-banner i { color: #3b82f6; margin-top: 2px; }
.ms-banner a { color: var(--brand-bright); }
.ms-foot-note {
  margin-top: 14px; font-size: 11.5px; line-height: 1.6;
  color: var(--text-4, #71717a); border-top: 1px solid var(--admin-border, rgba(255,255,255,.08));
  padding-top: 11px;
}
.ms-foot-note i { margin-right: 5px; }

/* ── Table ────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.ms-table th.num, .ms-table td.num { text-align: right; white-space: nowrap; }
.ms-table tbody tr { cursor: pointer; }
.ms-table tbody tr:hover { background: rgba(255,255,255,.03); }
.ms-row-extra { background: rgba(245,158,11,.06); }
.ms-row-extra:hover { background: rgba(245,158,11,.1); }
.ms-pkg {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: rgba(34,197,94,.12); color: #22c55e; white-space: nowrap;
}
.ms-pkg.is-none { background: rgba(255,255,255,.06); color: var(--text-4, #71717a); }
.ms-extra-pill {
  display: inline-block; font-weight: 800; font-size: 12.5px;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(245,158,11,.18); color: #f59e0b;
}
.ms-ok { color: var(--text-4, #71717a); }
.ms-breakdown { display: block; font-size: 10.5px; color: var(--text-4, #71717a); font-weight: 500; }
.ms-flag {
  display: inline-block; margin-left: 6px; font-size: 10.5px;
  color: #f59e0b; font-weight: 600;
}

/* ── Drawer ───────────────────────────────────────────────── */
.ms-drawer { position: fixed; inset: 0; z-index: 8000; }
.ms-drawer[hidden] { display: none; }
.ms-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.ms-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(92vw, 460px); background: var(--bg-2, #101014);
  border-left: 1px solid var(--admin-border, rgba(255,255,255,.1));
  display: flex; flex-direction: column;
  box-shadow: -14px 0 40px rgba(0,0,0,.5);
  animation: msSlide .18s ease-out;
}
@keyframes msSlide { from { transform: translateX(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.ms-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--admin-border, rgba(255,255,255,.08));
}
.ms-drawer-name { font-size: 16px; font-weight: 700; }
.ms-drawer-sub { font-size: 11.5px; color: var(--text-4, #71717a); margin-top: 3px; }
.ms-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 24px; }
.ms-drawer-loading { padding: 20px 0; font-size: 12.5px; color: var(--text-4, #71717a); text-align: center; }
.ms-log-summary {
  font-size: 13px; padding: 10px 12px; border-radius: 9px; margin-bottom: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--admin-border, rgba(255,255,255,.08));
}
.ms-log-sec {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-4, #71717a); margin: 18px 0 8px; font-weight: 700;
}
.ms-log-list { display: flex; flex-direction: column; gap: 6px; }
.ms-log-row {
  display: grid; grid-template-columns: 82px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 11px; border-radius: 9px;
  background: rgba(255,255,255,.02); border: 1px solid var(--admin-border, rgba(255,255,255,.07));
}
.ms-log-row.is-counted { border-left: 2px solid #22c55e; }
.ms-log-date { font-size: 11.5px; font-weight: 600; }
.ms-log-time { display: block; font-size: 10px; color: var(--text-4, #71717a); font-weight: 500; }
.ms-log-title { font-size: 12.5px; }
.ms-log-comment, .ms-log-note { font-size: 10.5px; color: var(--text-4, #71717a); margin-top: 3px; }
.ms-s { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.ms-s-present { background: rgba(34,197,94,.15);  color: #22c55e; }
.ms-s-late    { background: rgba(245,158,11,.15); color: #f59e0b; }
.ms-s-absent  { background: rgba(239,68,68,.15);  color: #ef4444; }
.ms-s-none    { background: rgba(255,255,255,.06); color: var(--text-4, #71717a); }
:root[data-theme="light"] .ms-drawer-panel { background: #fff; border-color: #e5e7eb; }
:root[data-theme="light"] .ms-log-row,
:root[data-theme="light"] .ms-log-summary { background: #fafafa; border-color: #e5e7eb; }

/* ── Package editor ───────────────────────────────────────── */
.pkg-table td { vertical-align: middle; }
.pkg-hist-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--brand-bright); text-decoration: underline;
}
tr.pkg-saved { animation: pkgFlash 1.4s ease-out; }
@keyframes pkgFlash {
  0%   { background: rgba(34,197,94,.22) }
  100% { background: transparent }
}

@media (max-width: 720px) {
  .ms-log-row { grid-template-columns: 70px 1fr; }
  .ms-log-status { grid-column: 2; justify-self: start; }
}

/* Phase 68 — inline explanatory hint under a form control. Used where a
   field's behaviour is not self-evident (e.g. the reminder channel, which
   only supports in-app + push). */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
  font-weight: 400;
}

/* ────────────────────────────────────────────────────────────────
   Phase 73 — self-registration review (/admin/registrations)
   ──────────────────────────────────────────────────────────────── */
.reg-invite-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reg-invite-form .users-search { flex: 1; min-width: 200px; }

.reg-invite-out {
  margin-top: 14px; padding: 14px;
  background: rgba(var(--brand-rgb),0.06);
  border: 1px solid rgba(var(--brand-rgb),0.30);
  border-radius: 12px;
}
.reg-invite-label {
  font-size: 12px; font-weight: 700; color: var(--brand-bright);
  display: flex; align-items: center; gap: 7px;
}
.reg-invite-url {
  margin-top: 10px; padding: 11px 12px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(var(--brand-rgb),0.22);
  border-radius: 9px;
  font: 500 11.5px/1.6 ui-monospace, Menlo, Consolas, monospace;
  color: var(--brand-bright); word-break: break-all;
}
.reg-invite-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.btn-wa {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; text-decoration: none;
  background: rgba(37,211,102,0.12);
  border: 1px solid rgba(37,211,102,0.35);
  color: #25D366; font-size: 13px; font-weight: 600;
}
.btn-wa:hover { background: rgba(37,211,102,0.20); }

/* One staged submission awaiting review. */
.reg-sub {
  margin-top: 12px; padding: 15px;
  background: var(--admin-bg-2);
  border: 1px solid var(--border-1);
  border-radius: 13px;
}
.reg-sub-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.reg-sub-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.reg-sub-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 5px; font-size: 11.5px; color: var(--text-3);
}
.reg-sub-meta i { font-size: 10px; margin-right: 3px; }

/* Duplicate-phone warning. Amber, not red: it is advisory. */
.reg-dup {
  display: flex; gap: 10px; margin-top: 12px; padding: 11px 13px;
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.30);
  border-radius: 10px;
  font-size: 12px; line-height: 1.55; color: #fcd34d;
}
.reg-dup i { font-size: 13px; margin-top: 1px; }
.reg-dup b { color: #fff; }

.reg-kids { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.reg-kid {
  display: flex; gap: 11px; align-items: center;
  padding: 11px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-1);
  border-radius: 11px;
}
.reg-kid-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  background: rgba(var(--brand-rgb),0.13); color: var(--brand-bright);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.reg-kid-body { flex: 1; min-width: 0; }
.reg-kid-name { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.reg-kid-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 3px; font-size: 11px; color: var(--text-3);
}
.reg-kid-meta i { font-size: 10px; margin-right: 3px; }
.reg-kid-ok { color: #4ade80; }
.reg-kid-no { color: var(--text-4); }

.reg-sub-actions {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
  padding-top: 13px; border-top: 1px solid var(--border-1);
  align-items: center;
}
.reg-sub-actions form { display: flex; gap: 6px; align-items: center; }
.reg-reject-reason { min-width: 170px; }

/* ────────────────────────────────────────────────────────────────
   Phase 75 — player status badges (admin › Players)
   Active is the norm and carries no badge; only the exceptions are
   labelled, so the list stays scannable.
   ──────────────────────────────────────────────────────────────── */
.pstatus {
  display: inline-flex; align-items: center; gap: 4px;
  margin-inline-start: 8px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  vertical-align: middle; white-space: nowrap;
}
.pstatus i { font-size: 9px; }
/* Suspended — temporary. Amber: still on the roster. */
.pstatus-susp  { background: rgba(245,158,11,0.14); color: #f59e0b; }
/* Inactive — left the academy. Grey, not red: it is not an error. */
.pstatus-inact { background: rgba(148,163,184,0.14); color: #94a3b8; }

/* Dim the whole row for a player who is no longer with the academy. */
tr:has(.pstatus-inact) .meta .name { color: var(--text-3); }
tr:has(.pstatus-inact) .av-wrap { opacity: .55; }

/* Phase 75 — destructive icon button + neutral status pill.
   Red only on hover: the button sits beside everyday actions, so a
   permanently-red icon would read as an error state on the row. */
.btn-icon-danger { color: #fca5a5; }
.btn-icon-danger:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.35);
  color: #fecaca;
}
.pill-grey { background: rgba(148,163,184,0.14); color: #94a3b8; }
