/* ============================================================================
   MyTrackReady — Apple HIG Design System
   ============================================================================
   Clarity  ·  Deference  ·  Depth  ·  Material  ·  Lightness
   ============================================================================ */

/* -- Light Mode (default) -------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Apple system backgrounds */
  --bg: #f2f2f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8f8fa;
  --bg-quaternary: #e8e8ed;

  /* Typography */
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #aeaeb2;

  /* Accent */
  --accent: #007aff;
  --accent-hover: #0066d6;
  --accent-tint: rgba(0, 122, 255, 0.1);

  /* Semantic colors */
  --green: #34c759;
  --green-tint: rgba(52, 199, 89, 0.12);
  --red: #ff3b30;
  --red-tint: rgba(255, 59, 48, 0.12);
  --orange: #ff9500;
  --orange-tint: rgba(255, 149, 0, 0.12);
  --purple: #af52de;
  --purple-tint: rgba(175, 82, 222, 0.12);

  /* Separators */
  --separator: rgba(0, 0, 0, 0.08);
  --separator-strong: rgba(0, 0, 0, 0.12);

  /* Shadows (Apple uses subtle fill + shadow, not borders) */
  --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --elevated-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

  /* Radii */
  --radius: 12px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Form controls */
  --control-height: 48px;
  --compact-control-height: 42px;

  /* Transitions */
  --transition: 0.2s ease;

  /* Aliases (used by legacy / component-specific CSS) */
  --text-primary: var(--text);
  --text-muted: var(--text-secondary);
  --bg-primary: var(--bg-secondary);
  --card-bg: var(--bg-secondary);
  --border: var(--separator);
  --muted: var(--text-secondary);
  --link-color: var(--accent);
  --warning: var(--orange);
  --accent-subtle: var(--accent-tint);
}

/* -- Dark Mode ------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-quaternary: #3a3a3c;

    --text: #f2f2f7;
    --text-secondary: #98989d;
    --text-tertiary: #636366;

    --separator: rgba(255, 255, 255, 0.08);
    --separator-strong: rgba(255, 255, 255, 0.12);

    --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    --elevated-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Aliases — dark mode overrides */
    --text-primary: var(--text);
    --text-muted: var(--text-secondary);
    --bg-primary: var(--bg-secondary);
    --card-bg: var(--bg-secondary);
    --border: var(--separator);
    --muted: var(--text-secondary);
    --link-color: var(--accent);
    --warning: var(--orange);
    --accent-subtle: var(--accent-tint);
  }
}

/* ============================================================================
   Reset & Base
   ============================================================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    'Helvetica Neue', sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

[hidden] {
  display: none !important;
}

/* ============================================================================
   Typography
   ============================================================================ */

h1 {
  font-size: 34px; /* Apple "Large Title" */
  line-height: 1.12;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 16px;
  letter-spacing: -0.005em;
}

h2 {
  font-size: 22px; /* Apple "Title 1" */
  line-height: 1.18;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 8px;
}

h3 {
  font-size: 20px; /* Apple "Title 2" */
  line-height: 1.2;
  font-weight: 600;
  margin-top: 0;
}

p {
  margin-top: 0;
}

/* Eyebrow / caption labels */
.eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.hero-band .eyebrow {
  color: #ffb26b;
}

.club-registration-identity {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

/* ============================================================================
   App Shell
   ============================================================================ */

.app-shell {
  min-height: 100vh;
}

.redirect-page {
  align-items: center;
  display: grid;
  gap: 18px;
  justify-items: center;
  min-height: 100vh;
  text-align: center;
}

/* -- Topbar (thin translucent material) ------------------------------------ */

.topbar {
  align-items: center;
  background: rgba(242, 242, 247, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--separator);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 10;
}

@media (prefers-color-scheme: dark) {
  .topbar {
    background: rgba(0, 0, 0, 0.8);
  }
}

/* -- Brand ----------------------------------------------------------------- */

.brand {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
  transition: transform var(--transition);
}

.brand:hover .brand-mark {
  transform: scale(1.05);
}

/* Club logo — replaces brand-mark when uploaded */
.club-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Logo preview box in settings */
.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin: 12px 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--separator);
  min-height: 60px;
}

.logo-preview .club-logo {
  width: 80px;
  height: 80px;
}

.logo-preview .logo-fallback {
  width: 80px;
  height: 80px;
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}

/* -- Nav Tabs -------------------------------------------------------------- */

.nav-tabs {
  align-items: center;
  display: flex;
  gap: 6px;
}

.nav-tabs a {
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  padding: 10px 16px;
  text-decoration: none;
  transition: all var(--transition);
}

.nav-tabs a:hover {
  background: var(--accent-tint);
  color: var(--accent);
}

.nav-tabs a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ============================================================================
   Hero Band (Registration Page)
   ============================================================================ */

.hero-band {
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.7),
      rgba(0, 0, 0, 0.3) 48%,
      rgba(0, 0, 0, 0.1)
    ),
    url('assets/training-track.png') center / cover;
  color: #fff;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  min-height: 380px;
  padding: clamp(40px, 7vw, 86px) clamp(16px, 4vw, 48px) 54px;
}

.hero-copy {
  align-self: end;
  max-width: 760px;
}

.hero-copy h1 {
  color: #fff;
  margin-bottom: 12px;
}

.hero-copy p:last-child {
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.55;
  max-width: 620px;
  margin-bottom: 0;
}

.hero-stats {
  align-self: end;
  display: grid;
  gap: 12px;
}

.hero-stats div {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  color: var(--text);
  padding: 16px 20px;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition);
}

.hero-stats div:hover {
  transform: scale(1.03);
}

.hero-stats span {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.hero-stats small {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

/* -- Dark mode: hero stats cards use dark translucent fill ---------------- */
@media (prefers-color-scheme: dark) {
  .hero-stats div {
    background: rgba(28, 28, 30, 0.88); /* Dark system gray with blur */
  }
}

/* ============================================================================
   Workspace (Registration Form Layout)
   ============================================================================ */

.workspace {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  margin: -30px auto 48px;
  max-width: 1240px;
  padding: 0 clamp(16px, 4vw, 32px);
  position: relative;
}

.side-panel,
.content-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.side-panel {
  padding: 24px;
  position: sticky;
  top: 92px;
}

/* -- Step List ------------------------------------------------------------- */

.step-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 20px 0;
  padding: 0;
}

.step-list li {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding-left: 0;
  transition: color var(--transition);
}

.step-list span {
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  color: var(--accent);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.step-list li.active {
  color: var(--text);
}

.step-list li.active span {
  background: var(--accent);
  color: #fff;
}

.step-list li.completed {
  color: var(--green);
}

.step-list li.completed span {
  background: var(--green);
  color: #fff;
}

.admin-note {
  border-top: 1px solid var(--separator);
  color: var(--text-secondary);
  font-size: 15px;
  padding-top: 18px;
}

.admin-note strong {
  color: var(--text);
}

/* -- Content Panel --------------------------------------------------------- */

.content-panel {
  min-width: 0;
  padding: clamp(18px, 3vw, 30px);
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--separator);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
}

.panel-header .button-group {
  align-items: center;
  display: flex;
  gap: 12px;
}

#registerAnotherBtn {
  display: none;
}

#registerAnotherBtn.visible {
  display: inline-flex;
}

/* ============================================================================
   Registration Form
   ============================================================================ */

.registration-form {
  display: grid;
  gap: 24px;
  margin-top: 26px;
}

/* -- Program Picker -------------------------------------------------------- */

.program-picker {
  display: grid;
  gap: 14px;
}

.program-options {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.program-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  color: inherit;
  display: grid;
  gap: 12px;
  min-height: 320px;
  padding: 20px;
  text-align: left;
  transition: all var(--transition);
}

.program-card:hover {
  box-shadow: var(--elevated-shadow);
  transform: translateY(-2px);
}

.program-card.active {
  box-shadow:
    0 0 0 2px var(--accent),
    var(--elevated-shadow);
  transform: translateY(-2px);
}

.program-card > span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.program-card strong {
  font-size: 20px;
  font-weight: 600;
}

.program-card p {
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0;
}

.program-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.program-card dt {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.program-card dd {
  margin: 2px 0 0;
}

.selected-program {
  background: var(--accent-tint);
  border-radius: var(--radius-sm);
  color: var(--accent);
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  font-weight: 600;
}

.selected-program span {
  color: var(--text-secondary);
  font-weight: 400;
}

/* -- Fieldsets (grouped inset sections) ------------------------------------ */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: var(--text-secondary);
  display: grid;
  font-size: 15px;
  font-weight: 500;
  gap: 7px;
}

.wide {
  grid-column: 1 / -1;
}

/* -- Inputs ---------------------------------------------------------------- */

input,
select,
textarea {
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  min-height: 44px;
  padding: 12px 14px;
  width: 100%;
  transition: all var(--transition);
}

input:not([type='checkbox']):not([type='radio']):not([type='file']),
select:not([multiple]) {
  height: var(--control-height);
  min-height: var(--control-height);
}

textarea {
  line-height: 1.4;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background: var(--bg-secondary);
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}

.check-row {
  align-items: start;
  display: flex;
  gap: 10px;
}

.check-row input {
  flex: 0 0 auto;
  min-height: 18px;
  width: 18px;
}

/* -- Form Actions ---------------------------------------------------------- */

.form-actions,
.filter-row,
.card-actions {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* -- Admin Note in Forms --------------------------------------------------- */

.admin-note-section {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-note-existing {
  background: var(--orange-tint);
  border-radius: var(--radius-sm);
  color: var(--orange);
  font-size: 13px;
  padding: 10px 12px;
  font-weight: 600;
}

.admin-note-input {
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
  min-height: 36px;
  transition: all var(--transition);
}

.admin-note-input:focus {
  background: var(--bg-secondary);
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.card-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.filter-button {
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  min-height: 34px;
  padding: 6px 14px;
  transition: all var(--transition);
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.primary-button:active {
  transform: scale(0.98);
}

.secondary-button,
.filter-button {
  background: var(--bg-tertiary);
  color: var(--text);
}

.secondary-button:hover,
.filter-button:hover {
  background: var(--bg-quaternary);
}

.danger-button {
  background: var(--bg-secondary);
  border: 1px solid var(--red);
  border-radius: var(--radius-pill);
  color: var(--red);
  font-weight: 600;
  min-height: 34px;
  padding: 6px 14px;
  transition: all var(--transition);
}

.danger-button:hover {
  background: var(--red);
  color: #fff;
}

.warning-button {
  background: var(--bg-secondary);
  border: 1px solid var(--warning, #e67e22);
  border-radius: var(--radius-pill);
  color: var(--warning, #e67e22);
  font-weight: 600;
  min-height: 34px;
  padding: 6px 14px;
  transition: all var(--transition);
}

.warning-button:hover {
  background: var(--warning, #e67e22);
  color: #fff;
}

.filter-button.active {
  background: var(--text);
  color: var(--bg);
}

/* ============================================================================
   Empty State
   ============================================================================ */

.empty-state {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 24px;
  text-align: center;
}

/* ============================================================================
   Registration List / Cards
   ============================================================================ */

.registration-list {
  display: grid;
  gap: 14px;
}

.registration-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 16px;
  padding: 20px;
  transition: all var(--transition);
}

.registration-card:hover {
  box-shadow: var(--elevated-shadow);
}

.registration-card header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.registration-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
}

.registration-card p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-grid div {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.detail-grid dt {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ============================================================================
   Status Pills
   ============================================================================ */

.status-pill {
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  white-space: nowrap;
}

.status-submitted {
  background: var(--orange-tint);
  color: var(--orange);
}

.status-approved {
  background: var(--green-tint);
  color: var(--green);
}

.status-declined {
  background: var(--red-tint);
  color: var(--red);
}

.status-withdrawn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ============================================================================
   Dialogs
   ============================================================================ */

dialog {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--elevated-shadow);
  max-width: min(92vw, 440px);
  padding: 0;
  background: var(--bg-secondary);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dialog-card {
  padding: 24px;
}

.dialog-card p {
  color: var(--text-secondary);
  line-height: 1.55;
}

#addAthleteDialog,
#householdDialog,
#guardianDialog {
  max-height: min(90vh, 820px);
  max-width: min(92vw, 720px);
  overflow-y: auto;
  width: 100%;
}

/* ============================================================================
   Login / Sign-In
   ============================================================================ */

.admin-body {
  background: var(--bg);
}

.admin-login {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevated-shadow);
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 430px;
  padding: 32px;
  width: 100%;
}

.login-card h1 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
}

.form-error {
  background: var(--red-tint);
  border-radius: var(--radius-sm);
  color: var(--red) !important;
  font-weight: 600;
  padding: 12px 14px;
  font-size: 14px;
}

/* ============================================================================
   Admin Panel
   ============================================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

/* -- Sidebar (clean fill material) ---------------------------------------- */

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

.admin-logo {
  align-items: center;
  background: var(--bg-tertiary);
  color: var(--text);
  display: flex;
  gap: 13px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  padding: 24px;
  text-decoration: none;
}

.admin-logo strong {
  display: block;
  font-weight: 600;
}

.admin-logo span#sidebarClubName {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.admin-logo .brand-mark {
  background: var(--accent);
  color: #fff;
}

.admin-nav {
  display: grid;
  gap: 17px;
  padding: 18px 12px;
}

.admin-nav-group {
  display: grid;
  gap: 3px;
}

.admin-nav-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 12px 5px;
  text-transform: uppercase;
}

.admin-nav a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  font-weight: 500;
  font-size: 15px;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  text-decoration: none;
  transition: all var(--transition);
}

.admin-nav a::before {
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: 7px;
  color: var(--text-secondary);
  content: attr(data-nav-short);
  display: inline-flex;
  flex: 0 0 25px;
  font-size: 11px;
  font-weight: 700;
  height: 25px;
  justify-content: center;
}

.admin-nav a:hover {
  background: var(--accent-tint);
  color: var(--accent);
}

.admin-nav a.active {
  background: var(--accent-tint);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.admin-nav a.active::before {
  background: var(--accent);
  color: #fff;
}

.admin-sidebar-footer {
  border-top: 1px solid var(--separator);
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 16px 16px;
}

.admin-account {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.admin-account > span:last-child {
  min-width: 0;
}

.admin-account strong,
.admin-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-account strong {
  font-size: 13px;
  font-weight: 600;
}

.admin-account small {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
}

.admin-signout {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  padding: 5px 44px;
  text-align: left;
}

.admin-signout:hover {
  color: var(--red);
}

/* -- Topbar (thin translucent) --------------------------------------------- */

.admin-topbar {
  align-items: center;
  background: rgba(242, 242, 247, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--separator);
  color: var(--text);
  display: none;
  justify-content: flex-end;
  min-height: 54px;
  padding: 8px 18px;
}

.admin-topbar-title {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .admin-topbar {
    background: rgba(0, 0, 0, 0.8);
  }
}

.admin-tools {
  align-items: center;
  display: flex;
  gap: 10px;
}

/* Hamburger — hidden on desktop, shown on mobile via media query */
#mobileMenuButton {
  display: none;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 99;
}

.icon-button {
  align-items: center;
  background: var(--bg-tertiary);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
  transition: all var(--transition);
}

.icon-button:hover {
  background: var(--bg-quaternary);
}

/* Keyboard and assistive-technology navigation */
.skip-link {
  background: var(--accent);
  border-radius: 0 0 var(--radius-sm) 0;
  color: #fff;
  font-weight: 700;
  left: 0;
  padding: 10px 14px;
  position: fixed;
  top: 0;
  transform: translateY(-120%);
  transition: transform var(--transition);
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, [tabindex]:not([tabindex='-1'])):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.admin-main,
.admin-main main,
.admin-view {
  min-width: 0;
}

.admin-avatar {
  align-items: center;
  background: var(--green-tint);
  border-radius: var(--radius-pill);
  color: var(--green);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.admin-main {
  min-width: 0;
}

/* -- Admin View ---------------------------------------------------------- */

.admin-view {
  padding-bottom: 48px;
}

/* -- Admin Hero ------------------------------------------------------------ */

.admin-hero {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(0, 87, 112, 0.9), rgba(0, 87, 112, 0.75)),
    url('assets/training-track.png') center / cover;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 180px;
  padding: 36px clamp(24px, 7vw, 92px);
}

.admin-hero h1 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 6px;
  color: #fff;
}

.admin-hero p {
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

/* Constrain text block width for readability on wide screens */
.admin-hero > div:first-child {
  max-width: 760px;
  min-width: 260px;
}

.admin-hero-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.admin-hero-metric {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 110px;
  color: #fff;
  text-decoration: none;
  transition:
    background var(--transition),
    transform var(--transition);
}

.admin-hero-metric:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.admin-hero-metrics span {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.admin-hero-metrics small {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.admin-hero-invoice {
  background: rgba(0, 122, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: #fff;
  min-width: 170px;
  padding: 10px 14px;
  text-decoration: none;
  transition:
    background var(--transition),
    transform var(--transition);
}

.admin-hero-invoice:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.admin-hero-invoice.overdue {
  background: rgba(200, 53, 46, 0.9);
}

.admin-hero-invoice span {
  font-size: 18px;
  margin: 2px 0;
}

.admin-hero-invoice small {
  margin: 0;
}

.admin-hero-invoice strong {
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* -- Admin Sections -------------------------------------------------------- */

.admin-section,
.admin-page-title,
.placeholder-panel {
  margin: 28px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

/* Shared container — all admin cards/sections use this for consistent width */
.admin-container {
  max-width: calc(1180px - 48px);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

/* Settings sections — add bottom padding for trailing space */
#settings-section > .settings-sections {
  margin-bottom: 14px;
}

/* Settings cards need explicit padding (they're grandchild of admin-section, not direct child) */
.settings-sections > .hq-card {
  padding: 24px;
}

/* Extra bottom margin on action row for breathing room before card edge */
.settings-action-row:last-child {
  margin-bottom: 4px;
}

.admin-section-heading h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.admin-section-heading {
  margin-bottom: 16px;
}

.admin-section-heading p,
.admin-page-title p,
.placeholder-panel p {
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* -- HQ Cards -------------------------------------------------------------- */

.hq-card,
.request-card,
.placeholder-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.hq-card {
  padding: 0 24px;
}

/* hq-card inside admin-section — match next-up-card width, add stacking gap */
.admin-section > .hq-card {
  max-width: calc(1180px - 48px);
  margin: 14px auto;
  padding: 24px;
}

/* Profile card — same width treatment as hq-card */
.admin-section > .profile-card {
  max-width: calc(1180px - 48px);
  margin: 14px auto;
  padding: 32px;
}

.card-title-row {
  align-items: center;
  border-bottom: 1px solid var(--separator);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 0 14px;
}

.card-title-row strong {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.card-title-row span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.summary-rows {
  display: grid;
}

.summary-row {
  align-items: center;
  border-bottom: 1px solid var(--separator);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 0;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row strong {
  color: var(--accent);
}

.text-link {
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}

.text-link:hover {
  opacity: 0.7;
}

.summary-row span,
.summary-row small {
  color: var(--text-secondary);
  display: block;
}

.center-link {
  display: block;
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  text-align: center;
  color: var(--accent);
  text-decoration: none;
}

/* -- Request Card (improved registrations) -------------------------------- */

.request-card {
  border-top: 4px solid var(--accent);
  margin-top: 14px;
  padding: 24px;
  text-align: center;
}

.request-card h3 {
  color: var(--accent);
  margin: 0 0 8px;
}

.request-card p {
  color: var(--text-secondary);
}

/* -- Admin Page Title ------------------------------------------------------ */

.admin-page-title {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.admin-page-title h1 {
  font-size: 34px;
}

/* -- Filters --------------------------------------------------------------- */

.admin-filter-row {
  margin: 18px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.admin-view .registration-list {
  margin: 18px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

/* ============================================================================
   Reports / Financials
   ============================================================================ */

.report-tabs {
  margin: 18px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
  align-items: center;
  border-bottom: 1px solid var(--separator-strong);
  display: flex;
  gap: 18px;
}

.report-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 15px;
  padding: 0 0 10px;
  transition: all var(--transition);
}

.report-tabs button:hover {
  color: var(--text);
}

.report-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.finance-report {
  margin: 18px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.section-tabs {
  display: flex;
  gap: 6px;
  margin: 18px auto 0;
  max-width: calc(1180px - 48px);
  overflow-x: auto;
  padding: 0 24px 4px;
  scrollbar-width: thin;
}

.section-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  flex: 0 0 auto;
  font: inherit;
  font-weight: 650;
  min-height: 42px;
  padding: 8px 14px;
}

.section-tab:hover {
  color: var(--text);
}

.section-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.quick-filters {
  align-items: center;
  border-bottom: 1px solid var(--separator);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
}

.finance-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: 250px minmax(0, 1fr);
  padding: 24px 0;
}

.finance-grid strong,
.finance-grid span {
  display: block;
}

.finance-grid > div > span {
  color: var(--text-secondary);
  margin-top: 4px;
}

/* -- Donut Chart ----------------------------------------------------------- */

.donut {
  background: conic-gradient(var(--accent) 0 82%, var(--accent-hover) 82% 100%);
  border-radius: 50%;
  height: 150px;
  margin: 24px auto 18px;
  position: relative;
  width: 150px;
}

.donut::after {
  background: var(--bg-secondary);
  border-radius: 50%;
  content: '';
  inset: 32px;
  position: absolute;
}

.legend {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.legend span {
  background: var(--accent);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.legend.alt span {
  background: var(--accent-hover);
}

/* -- Bar Chart ------------------------------------------------------------- */

.bar-chart {
  align-items: end;
  border-bottom: 1px solid var(--separator);
  border-left: 1px solid var(--separator);
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(12, 1fr);
  min-height: 220px;
  padding: 8px 12px 0;
}

.bar-chart div {
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 6px;
  transition: opacity var(--transition);
}

.bar-chart div:hover {
  opacity: 0.8;
}

/* Bar chart — tighter gap on mobile for more usable bar width */
@media (max-width: 860px) {
  .bar-chart {
    gap: 6px;
    min-height: 160px;
  }
}

/* -- Report Table ---------------------------------------------------------- */

.report-table {
  border-collapse: collapse;
  width: 100%;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll:focus-visible {
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px var(--accent-tint);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.table-scroll .report-table {
  min-width: 760px;
}

/* Tables inside card wrappers — enable horizontal scroll on narrow screens */
.hq-card > .report-table,
.finance-report > .report-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

/* Financials table card — spacing after finance-grid */
.finance-report > .hq-card {
  margin-top: 14px;
  padding: 24px;
}

/* Also handle tables directly in admin-section (not wrapped in hq-card) */
.admin-section > .report-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 8px 0;
  margin: 14px auto;
  max-width: calc(1180px - 48px);
}

.report-table th,
.report-table td {
  border-top: 1px solid var(--separator);
  padding: 11px 14px;
  text-align: left;
}

.report-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.report-table thead th:first-child {
  border-bottom: 2px solid var(--separator);
}

/* -- Shared compact directories ------------------------------------------ */

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.directory-toolbar {
  display: block;
  margin: 18px 0 10px;
}

.directory-search {
  flex: 1 1 360px;
  position: relative;
}

.directory-search > span {
  color: var(--text-secondary);
  font-size: 20px;
  left: 12px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-52%);
}

.directory-search input,
.directory-filter select {
  background: var(--bg-tertiary);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  height: var(--compact-control-height);
  min-height: var(--compact-control-height);
}

.directory-search input {
  padding: 9px 12px 9px 38px;
  width: 100%;
}

.directory-filter select {
  min-width: 170px;
  padding: 9px 34px 9px 12px;
}

.directory-search input:focus,
.directory-filter select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
  outline: none;
}

.directory-summary {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 2px 8px;
}

.directory-table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compact-directory-table {
  min-width: 760px;
}

.compact-directory-table th,
.compact-directory-table td {
  vertical-align: middle;
}

.compact-directory-table tbody tr {
  cursor: pointer;
  transition: background-color var(--transition);
}

.compact-directory-table tbody tr:hover,
.compact-directory-table tbody tr:focus-visible {
  background: var(--accent-tint);
  outline: none;
}

.compact-directory-table td small,
.directory-primary-link + small {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  margin-top: 3px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-primary-link {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.directory-primary-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.directory-badge {
  background: var(--accent-tint);
  border-radius: var(--radius-pill);
  color: var(--accent);
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 8px;
}

.directory-badge.success {
  background: var(--green-tint);
  color: var(--green);
}

.directory-pagination {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-top: 12px;
}

.directory-pagination > div {
  display: flex;
  gap: 5px;
}

.directory-page-button {
  background: var(--bg-secondary);
  border: 1px solid var(--separator-strong);
  border-radius: 7px;
  color: var(--text);
  min-height: 32px;
  min-width: 32px;
  padding: 5px 9px;
}

.directory-page-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.directory-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.profile-detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-left: auto;
}

.profile-detail-grid > .hq-card,
.household-profile-athletes {
  margin: 0;
  max-width: none;
}

.profile-field-list {
  margin: 16px 0 0;
}

.profile-link-list {
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  overflow: hidden;
}

.profile-link-row {
  align-items: center;
  border-bottom: 1px solid var(--separator);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 13px 14px;
  text-decoration: none;
}

.profile-link-row:last-child {
  border-bottom: 0;
}

.profile-link-row:hover {
  background: var(--accent-tint);
}

.profile-link-row small {
  color: var(--text-secondary);
  display: block;
  margin-top: 3px;
}

.guardian-contact-row {
  gap: 16px;
}

.guardian-contact-row:hover {
  background: transparent;
}

.guardian-contact-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.athlete-guardian-list {
  display: grid;
  gap: 14px 24px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.athlete-guardian {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.athlete-guardian small {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.household-profile-athletes {
  margin-top: 16px;
}

.registration-directory-table {
  min-width: 980px;
}

.registration-profile {
  display: grid;
  gap: 16px;
}

.registration-profile > .registration-profile-wide {
  margin: 0;
  max-width: none;
  width: 100%;
}

.registration-response-grid {
  display: grid;
  gap: 0 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registration-subsection {
  border-top: 1px solid var(--separator);
  margin-top: 18px;
  padding-top: 16px;
}

.registration-review-card textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  display: block;
  margin-top: 8px;
  min-height: 88px;
  padding: 11px 12px;
  resize: vertical;
  width: 100%;
}

.registration-review-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
  outline: none;
}

.registration-note-label {
  display: block;
  font-weight: 600;
  margin-top: 18px;
}

.registration-profile-actions {
  margin-top: 16px;
}

/* -- Clubs table (platform overview) — numeric columns centered ------------ */

#overviewClubsTable .report-table th:nth-child(n + 2),
#overviewClubsTable .report-table td:nth-child(n + 2) {
  text-align: center;
}

/* ============================================================================
   Placeholder Panel
   ============================================================================ */

.placeholder-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 28px;
}

.placeholder-panel h1 {
  font-size: 22px;
}

/* ============================================================================
   Program Admin
   ============================================================================ */

.program-admin-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  margin: 24px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.program-editor,
.program-admin-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
}

.program-admin-list {
  display: grid;
  gap: 14px;
}

.program-profile-editor > .program-editor {
  max-width: none;
  width: 100%;
}

.program-admin-card {
  display: grid;
  gap: 14px;
  transition: all var(--transition);
}

.program-admin-card:hover {
  box-shadow: var(--elevated-shadow);
}

.program-admin-card header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.program-admin-card h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.program-admin-card header span:first-child {
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.program-admin-card p {
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.club-counts {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0;
}

.club-counts span::before {
  content: '\00b7';
  margin-right: 16px;
}

.club-counts span:first-child::before {
  content: none;
}

.compact-detail-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.compact-detail-list div {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.compact-detail-list dt {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.compact-detail-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

/* ============================================================================
   Seasons View
   ============================================================================ */

.seasons-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin: 24px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.season-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 14px;
  padding: 20px;
  transition: all var(--transition);
}

.season-card:hover {
  box-shadow: var(--elevated-shadow);
}

.season-card-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.season-card-header h3 {
  margin: 0;
  font-size: 17px;
}

.program-admin-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================================
   Rosters View
   ============================================================================ */

.rosters-list {
  margin: 24px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.rosters-list .report-table {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.rosters-list .report-table th,
.rosters-list .report-table td {
  border-top: 1px solid var(--separator);
  padding: 11px 14px;
}

.rosters-list .report-table thead th {
  border-bottom: 2px solid var(--separator);
}

#programRosterView {
  margin: 24px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

#programRosterList {
  margin-top: 20px;
}

#programRosterList .report-table {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

#programRosterList .report-table th,
#programRosterList .report-table td {
  border-top: 1px solid var(--separator);
  padding: 11px 14px;
}

#programRosterList .report-table thead th {
  border-bottom: 2px solid var(--separator);
}

.family-athlete-group {
  margin-bottom: 20px;
}

.family-athlete-group:last-child {
  margin-bottom: 0;
}

.family-athlete-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

/* ============================================================================
   Profile Card
   ============================================================================ */

a.admin-avatar {
  background: var(--accent-tint);
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

a.admin-avatar:hover {
  background: var(--accent);
  color: #fff;
}

.profile-card {
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 28px;
  margin: 28px auto 0;
  max-width: calc(1180px - 48px);
  padding: 32px;
}

.profile-avatar {
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  height: 72px;
  line-height: 1;
  width: 72px;
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.profile-field {
  display: grid;
  grid-template-columns: minmax(60px, auto) 1fr;
  gap: 8px;
  align-items: baseline;
}

.profile-field dt {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* Profile Edit Form */

#profileEditForm label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

#profileEditForm textarea,
#profileEditForm input[type='date'] {
  margin-top: 4px;
}

#bioCharCount {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  text-transform: none;
  letter-spacing: normal;
}

.profile-field dd {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

/* ============================================================================
   Members (expandable rows)
   ============================================================================ */

.expand-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 2px 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1;
  transition: color var(--transition);
}

.expand-toggle:hover {
  color: var(--accent);
}

.expand-icon {
  display: inline-block;
  transition: transform 0.15s ease;
}

.members-detail td {
  padding: 0 16px 16px !important;
  background: var(--bg-tertiary);
}

/* Members table — card wrapper with scroll on narrow screens */
.members-section > .report-table {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.members-section > .report-table th,
.members-section > .report-table td {
  border-top: 1px solid var(--separator);
}

.members-section > .report-table thead th {
  border-bottom: 2px solid var(--separator);
}

.members-section > .report-table .members-detail td {
  border-top: 1px solid var(--separator);
}

.members-athletes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.member-athlete {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  min-width: 200px;
}

.member-athlete span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Households Tab */

.household-athletes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0;
}

.household-athlete-card {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  min-width: 200px;
}

.household-athlete-card span {
  font-size: 13px;
  color: var(--text-secondary);
}

.athlete-link {
  color: var(--link-color);
  cursor: pointer;
  text-decoration: underline;
}

.athlete-link:hover {
  color: var(--text-primary);
}

.balance-clear {
  color: var(--green);
  font-weight: 600;
}

.balance-overdue {
  color: var(--red);
  font-weight: 600;
}

/* ============================================================================
   Clubs View
   ============================================================================ */

.clubs-list {
  display: grid;
  gap: 14px;
  margin: 24px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

/* Club editor cards — centered like other admin sections */
#clubEditor,
#clubAdminEditor {
  margin: 14px auto 0;
  max-width: calc(1180px - 48px);
  padding: 24px;
}

/* ============================================================================
   Settings Section
   ============================================================================ */

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-nav {
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding: 6px;
}

.settings-nav a {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  text-decoration: none;
}

.settings-nav a:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.settings-nav a.active {
  background: var(--accent-tint);
  color: var(--accent);
}

.settings-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.settings-status {
  color: var(--text-secondary);
  font-size: 15px;
}

.admin-note-inline {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.admin-note-inline code {
  background: var(--bg-quaternary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', menlo, monospace;
  font-size: 12px;
}

/* ============================================================================
   Responsive Breakpoints
   ============================================================================ */

@media (max-width: 860px) {
  .topbar,
  .panel-header,
  .registration-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-band,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: 520px;
  }

  .side-panel {
    position: static;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .program-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .content-panel,
  .side-panel {
    padding: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .nav-tabs a {
    flex: 0 0 auto;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  /* Filter buttons stay compact (used in admin registration page) */
  .filter-button {
    width: auto;
    flex: 0 0 auto;
  }

  .settings-action-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ============================================================================
   Dashboard — Phase J Components
   ============================================================================ */

/* -- Stat Strip (3-column grid) -------------------------------------------- */

.stat-strip {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 28px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.stat {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  transition: all var(--transition);
}

.stat:hover {
  box-shadow: var(--elevated-shadow);
  transform: translateY(-2px);
}

.stat > span {
  display: block;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
}

.stat small {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* -- PR Feed ---------------------------------------------------------------- */

.pr-feed,
.upcoming-meets {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-top: 12px;
}

.pr-entry,
.meet-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--separator);
}

.pr-entry:last-child,
.meet-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pr-entry:first-child,
.meet-entry:first-child {
  padding-top: 0;
}

.pr-entry strong,
.meet-entry strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pr-entry span,
.meet-entry span {
  color: var(--text);
  font-size: 15px;
}

.pr-entry small,
.meet-entry small {
  color: var(--text-secondary);
  font-size: 13px;
}

/* -- Chips ------------------------------------------------------------------ */

.chip {
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  white-space: nowrap;
}

.chip-gold {
  background: var(--orange-tint);
  color: var(--orange);
}

.chip-green {
  background: var(--green-tint);
  color: var(--green);
}

.chip-red {
  background: var(--red-tint);
  color: var(--red);
}

.chip-navy {
  background: var(--accent-tint);
  color: var(--accent);
}

.chip-gray {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* -- Athlete Profile -------------------------------------------------------- */

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.athlete-profile {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Cards inside athlete-profile should stretch to fill the section, not re-constrain */
.athlete-profile > .hq-card {
  max-width: none;
  margin: 14px 0;
  text-align: left;
}

#athleteProfileChips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Bio & Physical display area — add spacing between bio text and fields */
#profileDisplayView {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

#profileDisplayView p {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
}

#athleteHouseholdInfo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

#athleteHouseholdInfo .profile-field {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: block;
  min-width: 0;
  padding: 16px;
}

#athleteHouseholdInfo .profile-field dt {
  margin-bottom: 8px;
}

#athleteHouseholdInfo .profile-field dd {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#athleteHouseholdInfo .household-field-guardians,
#athleteHouseholdInfo .household-field-address {
  grid-column: span 2;
}

@media (max-width: 680px) {
  #athleteHouseholdInfo .household-field-guardians,
  #athleteHouseholdInfo .household-field-address {
    grid-column: 1 / -1;
  }
}

#athletePrTable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#athletePrTable .report-table {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

#athletePrTable .report-table td {
  font-size: 14px;
}

/* Media gallery grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* ============================================================================
   Family Accounts — Phase 2 Components
   ============================================================================ */

/* Hidden nav links (shown only when logged in) */
.hidden-nav {
  display: none;
}

/* Family Dashboard Header */
.family-dashboard-header {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.family-dashboard-header > div:first-child {
  font-size: 1.1rem;
}

.family-stats {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.family-stats > span:nth-child(1) {
  color: var(--text);
  font-weight: 500;
}

/* Athlete Group Header */
.athlete-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 16px;
}

.athlete-group-header .secondary-button {
  font-size: 0.85rem;
  padding: 6px 14px;
}

/* Athlete Empty Prompt */
.athlete-empty-prompt {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

/* Settings Toggle Row */
.settings-toggle {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-toggle .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.settings-toggle .check-row:hover {
  background: var(--bg-quaternary);
}

.settings-toggle .check-row input[type='checkbox'] {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-toggle .check-row span {
  font-size: 0.95rem;
  color: var(--text);
}

/* Readonly Field Styling */
.readonly-field {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  cursor: default;
  opacity: 0.7;
}

/* Responsive adjustments for new components */
@media (max-width: 734px) {
  .family-dashboard-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .athlete-group-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .athlete-group-header .secondary-button {
    width: 100%;
    text-align: center;
  }
}

/* -- Waiver text block in registration form ------------------------------- */

.waiver-text {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
  max-height: 240px;
  overflow-y: auto;
  padding: 16px;
  margin-bottom: 16px;
}

.waiver-text h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.waiver-text p {
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.waiver-text p:last-child {
  margin-bottom: 0;
}

.waiver-text + .check-row {
  margin-top: 4px;
}

.check-row + .check-row {
  margin-top: 10px;
}

/* ============================================================================
   Platform Overview (Super Admin)
   ============================================================================ */

/* HQ card wrapping the clubs table — needs bottom padding */
#overviewClubsTable.hq-card,
.hq-card > #overviewClubsTable {
  padding-bottom: 8px;
}

/* Table container — horizontal scroll on very narrow screens */
#overviewClubsTable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hover highlight on table rows */
#overviewClubsTable .report-table tbody tr:hover {
  background: var(--accent-tint);
}

/* Empty state inside the table container */
#overviewClubsTable .empty-state {
  color: var(--text-secondary);
  font-size: 15px;
  padding: 32px 14px;
  text-align: center;
}

/* ============================================================================
   Messaging — Phase K Components
   ============================================================================ */

/* -- Announcements Section ------------------------------------------------- */

.msg-announcements {
  margin: 28px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.msg-announcements .hq-card {
  padding: 24px;
}

.msg-announcement {
  padding: 16px 0;
  border-bottom: 1px solid var(--separator);
}

.msg-announcement:first-child {
  padding-top: 0;
}

.msg-announcement:last-child {
  border-bottom: none;
}

.msg-announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.msg-announcement-header strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.msg-announcement-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  flex-shrink: 0;
}

.msg-announcement p {
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  font-size: 15px;
}

/* -- Chat Container (flex: group list left, thread right) ----------------- */

.msg-chat-container {
  margin: 28px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.msg-chat-container .hq-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 480px;
}

/* -- Youth Safety Notice --------------------------------------------------- */

.youth-notice {
  background: var(--orange-tint);
  border-radius: var(--radius-sm);
  color: var(--orange);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  text-align: center;
}

/* -- Chat Layout (group list + thread) ------------------------------------ */

.msg-chat-layout {
  display: flex;
  gap: 0;
  min-height: 320px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* -- Group List (left panel) ----------------------------------------------- */

.msg-group-list {
  width: 240px;
  min-width: 200px;
  border-right: 1px solid var(--separator);
  overflow-y: auto;
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
}

.msg-group-list .empty-state {
  padding: 24px 16px;
  font-size: 13px;
}

/* -- Group Item ------------------------------------------------------------ */

.msg-group-item {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--separator);
  color: inherit;
  font: inherit;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
  width: 100%;
}

.msg-group-item:hover {
  background: var(--accent-tint);
}

.msg-group-item:focus-visible {
  background: var(--accent-tint);
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.msg-group-item.active {
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
}

.msg-group-item strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.msg-group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* -- Message Thread (right panel) ------------------------------------------ */

.msg-thread {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-secondary);
}

.msg-thread .empty-state {
  margin: auto;
}

/* -- Message Bubble -------------------------------------------------------- */

.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-bubble-body {
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

.msg-bubble-meta {
  font-size: 11px;
  opacity: 0.7;
}

/* Message bubble — sent by me (aligned right) */
.msg-bubble.me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Message bubble — sent by others (aligned left) */
.msg-bubble.them {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* -- Message Input --------------------------------------------------------- */

.msg-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.msg-input input {
  flex: 1;
  min-height: 40px;
}

.msg-input[hidden] {
  display: none;
}

/* -- Responsive ------------------------------------------------------------ */

@media (max-width: 860px) {
  .msg-chat-layout {
    flex-direction: column;
    min-height: auto;
  }

  .msg-group-list {
    width: 100%;
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--separator);
  }

  .msg-announcement-header {
    flex-direction: column;
    gap: 4px;
  }
}

/* ============================================================================
   Schedule — Phase L Components
   ============================================================================ */

/* -- Schedule Event List --------------------------------------------------- */

.sched-list {
  margin: 24px auto 0;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
  display: grid;
  gap: 14px;
}

.schedule-toolbar,
#scheduleSummary {
  margin-left: auto;
  margin-right: auto;
  max-width: calc(1180px - 48px);
  padding-left: 24px;
  padding-right: 24px;
}

.schedule-advanced-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* -- Schedule Event Card --------------------------------------------------- */

.sched-event {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  overflow: hidden;
  transition: all var(--transition);
}

.sched-event:hover {
  box-shadow: var(--elevated-shadow);
}

/* -- Date Box (left column) ------------------------------------------------ */

.sched-datebox {
  flex: 0 0 58px;
  text-align: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sched-datebox-dow {
  font-family: 'SFMono-Regular', ui-monospace, 'Roboto Mono', Menlo, monospace;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sched-datebox-day {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 22px;
  font-weight: 700;
}

/* -- Event Body (right column) --------------------------------------------- */

.sched-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
}

.sched-header {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sched-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sched-header h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.sched-admin-actions {
  display: flex;
  gap: 8px;
}

/* -- Meta Row -------------------------------------------------------------- */

.sched-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--text-secondary);
  font-size: 15px;
}

.sched-meta span::before {
  content: '\00b7';
  margin-right: 16px;
  color: var(--text-tertiary);
}

.sched-meta span:first-child::before {
  content: none;
  margin-right: 0;
}

/* -- RSVP Row -------------------------------------------------------------- */

.sched-rsvp {
  align-items: center;
  display: flex;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--separator);
}

.sched-rsvp-count {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.sched-rsvp-actions {
  display: flex;
  gap: 8px;
}

.rsvp-button {
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  transition: all var(--transition);
}

.rsvp-button:hover {
  background: var(--bg-quaternary);
}

.rsvp-button.active[data-status='going'] {
  background: var(--green-tint);
  color: var(--green);
}

.rsvp-button.active[data-status='out'] {
  background: var(--red-tint);
  color: var(--red);
}

/* -- Volunteer Section ----------------------------------------------------- */

.sched-vol-list {
  display: grid;
  gap: 10px;
}

.sched-vol {
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  padding: 10px 14px;
}

.sched-vol strong {
  font-size: 15px;
  font-weight: 600;
}

.sched-vol span {
  color: var(--text-secondary);
  font-size: 13px;
  flex: 1;
}

/* -- Schedule Editor Form -------------------------------------------------- */

.sched-editor {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
}

/* -- Responsive ------------------------------------------------------------ */

@media (max-width: 860px) {
  .sched-event {
    grid-template-columns: 1fr;
  }

  .sched-datebox {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .sched-datebox-num {
    font-size: 22px;
  }

  .sched-datebox-day,
  .sched-datebox-month {
    font-size: 12px;
  }

  .sched-body {
    padding: 16px;
  }

  .sched-header {
    flex-direction: column;
    gap: 10px;
  }

  .sched-rsvp {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sched-vol {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 860px) {
  .section-tabs,
  .schedule-toolbar,
  #scheduleSummary {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
  }

  .section-tabs {
    margin-top: 12px;
  }

  .sched-admin-actions,
  .discount-rule-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .schedule-advanced-filters {
    grid-template-columns: 1fr;
  }

  .msg-input {
    align-items: stretch;
    flex-direction: column;
  }

  .msg-input .primary-button {
    min-height: 44px;
  }

  .msg-bubble {
    max-width: 88%;
  }

  .sched-admin-actions,
  .sched-rsvp-actions {
    width: 100%;
  }

  .sched-admin-actions > button,
  .sched-rsvp-actions > button {
    flex: 1 1 0;
  }
}

@media (pointer: coarse) {
  .primary-button,
  .secondary-button,
  .danger-button,
  .warning-button,
  .filter-button,
  .rsvp-button,
  .section-tab,
  .directory-page-button,
  .msg-group-item {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .primary-button,
  .filter-button.active,
  .section-tab.active,
  .rsvp-button.active,
  .msg-group-item.active {
    border: 2px solid ButtonText;
  }
}

/* Billing (Phase M) */

.discount-rule-card {
  padding: 12px 16px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--bg-secondary);
}

.discount-rule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.discount-rule-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.discount-rule-card p {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-muted);
}

.chip-sibling,
.chip-scholarship,
.chip-custom {
  background: var(--accent-subtle);
  color: var(--accent);
}

.chip-due {
  background: var(--orange-tint);
  color: var(--orange);
}

.chip-paid {
  background: var(--green-tint);
  color: var(--green);
}

.chip-overdue {
  background: var(--red-tint);
  color: var(--red);
}

.chip-cancelled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* -- Invoice table actions ------------------------------------------------ */

.report-table td > button + button {
  margin-left: 4px;
}

.muted {
  color: var(--text-muted);
}

/* ============================================================================
   Invoice Summary (Registration Confirmation)
   ============================================================================ */

.invoice-summary {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 16px 0;
}

.invoice-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.9rem;
}

.invoice-summary-row + .invoice-summary-row {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.invoice-summary-row span:first-child {
  color: var(--text-secondary);
}

/* ============================================================================
   Billing Dialog Forms
   ============================================================================ */

dialog .form-grid {
  margin-top: 16px;
}

dialog .form-actions {
  margin-top: 20px;
  margin-bottom: 0;
}

dialog h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

/* ============================================================================
   Discount Rule Cards
   ============================================================================ */

.discount-rule-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.discount-rule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.discount-rule-header strong {
  text-transform: capitalize;
}

.discount-rule-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 12px;
}

.discount-rule-actions {
  display: flex;
  gap: 6px;
}

/* ============================================================================
   Installment Plan Display
   ============================================================================ */

.installment-row {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 4px;
  font-size: 0.85rem;
}

.installment-row .installment-status {
  float: right;
}

/* ============================================================================
   Media Gallery (Phase N)
   ============================================================================ */

.media-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  padding: 12px 0;
}

.media-item {
  position: relative;
  background: var(--bg-tertiary, #f5f5f5);
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  aspect-ratio: 1;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-item .media-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 6px 8px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-item .media-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transition: opacity var(--transition, 0.2s);
}

.media-item:hover .media-delete,
.media-item:focus-within .media-delete {
  opacity: 1;
}

.media-item .media-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  pointer-events: none;
}

.media-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--text-secondary, #888);
  font-size: 14px;
}

/* Upload dialog styling */
#uploadMediaDialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

/* -- Registration Filters (I-9) ------------------------------------------- */

.registration-filters {
  margin: 18px auto 10px;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.directory-search-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.directory-search-row .directory-search {
  flex: 1 1 auto;
}

.directory-filter-toggle {
  flex: 0 0 auto;
  min-height: 42px;
  min-width: 104px;
}

.directory-advanced-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 10px;
}

.directory-advanced-filters[hidden] {
  display: none;
}

.directory-advanced-filters .directory-filter select {
  min-width: 0;
  width: 100%;
}

.registration-advanced-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reg-total {
  margin: 0 auto 8px;
  max-width: calc(1180px - 48px);
  padding: 0 24px;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  margin-top: 16px;
  max-width: calc(1180px - 48px);
  margin-left: auto;
  margin-right: auto;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary, #888);
  font-weight: 500;
}

.pagination-row .secondary-button {
  min-width: 80px;
}

.pagination-row .secondary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================================
   Dashboard & Admin Components (additional)
   ============================================================================
   Supplemental components: next-up card, group filters, youth notice, etc.
   Uses existing Apple HIG design tokens.
   ============================================================================ */

/* -- Flex row utility ------------------------------------------------------ */

.lo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* -- Next-up card (dashboard) ---------------------------------------------- */

.next-up-card {
  margin: 28px auto 0;
  max-width: calc(1180px - 48px);
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.next-up-card > .eyebrow {
  padding-top: 20px;
  padding-bottom: 10px;
}

.next-up-card > hr.section-divider {
  margin: 14px 0;
}

.next-up-card > .lo-row:last-child {
  padding-bottom: 20px;
}

.next-up-card .eyebrow {
  margin-bottom: 10px;
}

.next-up-card .primary-button {
  flex-shrink: 0;
}

/* -- Group filter buttons -------------------------------------------------- */

.group-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fbtn {
  appearance: none;
  border: 1px solid var(--separator);
  background: var(--bg-secondary);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.fbtn:hover {
  background: var(--bg-tertiary);
}

.fbtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* -- Youth safety notice --------------------------------------------------- */

.youth-notice {
  background: rgba(255, 214, 10, 0.15);
  border: 1px solid rgba(255, 214, 10, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* -- Section divider ------------------------------------------------------- */

.section-divider {
  border: 0;
  border-top: 1px solid var(--separator);
  margin: 14px 0;
}

/* ============================================================================
   Admin Mobile Responsive (MUST be after all base rules for cascade)
   ============================================================================
   These rules override base definitions that appear earlier in the file.
   Placed at the end so they win the CSS cascade on narrow viewports.
   ============================================================================ */

@media (max-width: 860px) {
  /* -- Admin shell: single column, full width -------------------------- */

  .admin-shell {
    grid-template-columns: 1fr;
  }

  /* Topbar — hamburger left, tools right */
  .admin-topbar {
    display: flex;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
  }

  /* Hamburger button — only visible on mobile */
  #mobileMenuButton {
    display: inline-flex;
  }

  /* Sidebar — hidden off-screen, slides in as overlay */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    z-index: 100;
    width: 264px;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--separator);
    border-bottom: none;
    transition: left 0.25s ease;
  }

  .admin-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .admin-logo {
    padding: 24px;
    gap: 13px;
    min-height: auto;
  }

  .admin-nav {
    display: grid;
    padding: 18px 12px;
  }

  .admin-nav a {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 15px;
  }

  .admin-nav a.active {
    border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  }

  /* -- Content blocks: full width, no centering gaps -------------------- */

  .admin-hero,
  .card-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  /* Parent container handles all horizontal padding on mobile */
  .admin-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-page-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .profile-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .detail-header-actions {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .admin-page-title .primary-button {
    flex: 0 0 auto;
    width: auto;
  }

  .admin-page-title,
  .admin-section,
  .admin-section > .hq-card,
  .admin-section > .profile-card,
  .admin-section > .report-table,
  .members-section > .report-table,
  .settings-sections > .hq-card,
  .placeholder-panel {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
  }

  .admin-section > .hq-card {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 16px;
  }

  .admin-section > .profile-card {
    margin-top: 8px;
    margin-bottom: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }

  /* Filter buttons: compact on mobile to allow wrapping */
  .filter-row {
    gap: 6px;
  }

  .filter-button {
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 14px;
    font-size: 14px;
    min-height: 36px;
  }

  .admin-hero-metrics {
    justify-content: center;
  }

  .finance-grid {
    grid-template-columns: 1fr;
  }

  .directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .directory-search {
    flex-basis: auto;
  }

  .directory-filter select {
    width: 100%;
  }

  .registration-advanced-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .registration-response-grid {
    grid-template-columns: 1fr;
  }

  .program-admin-layout,
  .compact-detail-list {
    grid-template-columns: 1fr;
  }

  .seasons-grid {
    grid-template-columns: 1fr;
  }

  .season-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .stat-strip,
  .admin-container {
    grid-template-columns: 1fr;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
  }

  .next-up-card {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
  }

  .lo-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .next-up-card .primary-button {
    width: 100%;
    text-align: center;
  }

  .group-filters {
    gap: 6px;
  }

  /* All content containers go full width; parent .admin-view handles padding */
  .admin-filter-row,
  .admin-view .registration-list,
  .report-tabs,
  .finance-report,
  .finance-report > .hq-card,
  .program-admin-layout,
  .seasons-grid,
  .rosters-list,
  #programRosterView,
  .clubs-list,
  #clubAdminEditor,
  .msg-announcements,
  .msg-chat-container,
  .sched-list,
  .pr-feed,
  .upcoming-meets,
  .group-filters,
  .profile-card,
  .registration-filters,
  .reg-total,
  .pagination-row {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  /* Stack profile card vertically on mobile */
  .profile-card {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 16px;
  }

  /* Stack footer vertically on mobile */
  .admin-footer {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

/* -- Tighter spacing on very small screens (must come after 860px) --------- */

@media (max-width: 480px) {
  .registration-advanced-filters {
    grid-template-columns: 1fr;
  }

  /* Tighter padding on parent container */
  .admin-view {
    padding-left: 12px;
    padding-right: 12px;
  }

  .admin-page-title,
  .admin-section,
  .admin-section > .hq-card,
  .admin-section > .profile-card,
  .admin-section > .report-table,
  .members-section > .report-table,
  .settings-sections > .hq-card,
  .msg-announcements,
  .msg-chat-container,
  .finance-report,
  .finance-report > .hq-card,
  .stat-strip,
  .next-up-card,
  .placeholder-panel,
  .admin-filter-row,
  .registration-filters,
  .reg-total,
  .pagination-row,
  #clubEditor,
  .clubs-list {
    padding-left: 0;
    padding-right: 0;
  }

  .admin-section > .hq-card,
  .settings-sections > .hq-card,
  .finance-report > .hq-card,
  .request-card {
    padding: 12px;
    margin-top: 6px;
    margin-bottom: 6px;
  }

  .admin-section > .profile-card {
    padding: 16px;
    margin-top: 6px;
    margin-bottom: 6px;
  }

  .stat {
    padding: 14px 8px;
  }

  .stat > span {
    font-size: 26px;
  }

  .stat small {
    font-size: 10px;
  }

  .next-up-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .group-filters {
    gap: 4px;
  }

  .fbtn {
    padding: 5px 10px;
    font-size: 14px;
  }

  /* Login card (sign-in, onboarding) — tighter padding on small screens */
  .login-card {
    padding: 20px;
  }
}

/* -- Onboarding fieldset styling ------------------------------------------- */

.onboarding-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.onboarding-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 14px;
}

/* -- Onboarding success view ----------------------------------------------- */

.onboarding-success {
  padding: 2rem 0;
  text-align: center;
}

.onboarding-success-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.onboarding-success p {
  color: var(--text-secondary);
  margin-top: 1.5rem;
}

.onboarding-success .primary-button {
  margin-top: 1.5rem;
}

/* -- Consent footer in registration form -- */

.consent-footer {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted, #666);
}

.consent-footer a {
  color: var(--accent, #0066cc);
  text-decoration: none;
}

.consent-footer a:hover {
  text-decoration: underline;
}

/* -- Signature modal -- */

#signatureModal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.signature-dialog {
  max-width: 520px;
  margin: 10% auto;
  padding: 24px;
  background: var(--card-bg, #fff);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signature-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.signature-instructions {
  margin: 0;
  font-size: 14px;
  color: var(--muted, #666);
}

#signatureCanvas {
  width: 100%;
  max-width: 480px;
  height: 200px;
  border: 2px solid var(--border, #ddd);
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
  background: #fafafa;
  margin: 0 auto;
  display: block;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

/* -- Privacy policy page -- */

.privacy-page {
  width: min(100% - 40px, 960px);
  margin: clamp(24px, 5vw, 56px) auto;
}

.privacy-page h1 {
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: 8px;
}

.privacy-page .last-updated {
  color: var(--muted, #666);
  font-size: 14px;
  margin-bottom: 32px;
}

.privacy-page h2 {
  font-size: clamp(21px, 3vw, 26px);
  margin-top: clamp(32px, 6vw, 48px);
  margin-bottom: 12px;
}

.privacy-page p,
.privacy-page ul {
  max-width: 74ch;
  line-height: 1.65;
  margin-bottom: 16px;
}

.privacy-page ul {
  padding-left: 24px;
}

.privacy-page table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 20px 0 32px;
  overflow-wrap: anywhere;
}

.privacy-page th,
.privacy-page td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #eee);
}

.privacy-page th {
  font-weight: 600;
  background: var(--bg-alt, #f8f8f8);
}

.privacy-page th:first-child {
  width: 22%;
}

.privacy-page th:nth-child(2) {
  width: 38%;
}

.privacy-page td:first-child {
  font-weight: 600;
}

.privacy-page a {
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .privacy-page {
    width: min(100% - 28px, 960px);
    margin-block: 24px 40px;
  }

  .privacy-page .last-updated {
    margin-bottom: 24px;
  }

  .privacy-page ul {
    padding-left: 20px;
  }

  .privacy-page table,
  .privacy-page tbody,
  .privacy-page tr,
  .privacy-page td {
    display: block;
    width: 100%;
  }

  .privacy-page table {
    margin-top: 16px;
  }

  .privacy-page thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .privacy-page tbody {
    display: grid;
    gap: 14px;
  }

  .privacy-page tbody tr {
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--separator);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
  }

  .privacy-page td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--separator);
  }

  .privacy-page td:last-child {
    border-bottom: 0;
  }

  .privacy-page td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
  }
}

@media (max-width: 420px) {
  .privacy-page {
    width: min(100% - 20px, 960px);
  }

  .privacy-page h1 {
    font-size: 30px;
  }
}

/* Dark mode support for privacy page */

@media (prefers-color-scheme: dark) {
  .signature-dialog {
    background: var(--card-bg);
  }

  .signature-instructions {
    color: var(--muted);
  }

  #signatureCanvas {
    border-color: var(--border);
    background: var(--bg-tertiary);
  }

  .signature-dialog .signature-canvas-inner {
    filter: invert(1);
  }

  .privacy-page {
    color: var(--text);
  }

  .privacy-page .last-updated {
    color: var(--muted);
  }

  .privacy-page th {
    background: var(--bg-tertiary);
  }

  .privacy-page th,
  .privacy-page td {
    border-color: var(--border);
  }
}

/* Admin footer */

.admin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-top: 20px;
  border-top: 1px solid var(--separator);
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-footer a {
  color: var(--accent, #0066cc);
  text-decoration: none;
}

.admin-footer a:hover {
  text-decoration: underline;
}

/* ============================================================================
   Schedule Generation Dialog
   ============================================================================ */

.schedule-gen-summary {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.schedule-gen-summary strong {
  font-weight: 600;
}

.schedule-gen-summary .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.schedule-gen-summary .summary-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.schedule-gen-summary .schedule-pattern {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent, #0066cc);
}

.schedule-gen-progress {
  margin: 16px 0;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--accent, #0066cc);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

#scheduleGenProgressText {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

#generateScheduleDialog {
  max-width: min(92vw, 520px);
}

.staff-member-card {
  border: 1px solid var(--border, #dfe3e8);
  border-radius: var(--radius, 10px);
  margin: 16px 0;
  padding: 16px;
}

.staff-member-card select[multiple],
#addStaffForm select[multiple] {
  min-height: 96px;
}

.msg-bubble-author {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  opacity: 0.8;
}
