/* Professional Design System for Grassroots Team Manager */
/* Colors dynamically generated from team logo */

/* Font Stack & Dynamic Color Variables */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --primary-color: #f7c500;
  --primary-hover: #ac8900;
  --primary-light: #fadc66;
  --primary-lighter: #fcedb2;
  --secondary-color: #dbd6d6;
  --secondary-hover: #999595;
  --secondary-light: #e9e6e6;
  --accent-color: #d61c1f;
  --accent-hover: #951315;
  --accent-light: #e67678;
  --neutral-white: #ffffff;
  --neutral-light-gray: #f9fafb;
  --neutral-medium-gray: #6b7280;
  --neutral-dark-gray: #374151;
  --neutral-black: #111827;
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;
  --status-info: #3b82f6;
  --border-color: var(--neutral-light-gray);
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

html, body {
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-dark-gray);
}

/* Contain decorative ::before pseudo-elements that use negative insets */
.p-shell, .fd-shell, .we-shell, .feed-shell {
  overflow: hidden;
}

/* Professional Card System */
.card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  background: white;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-header {
  background: var(--neutral-light-gray);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0 !important;
  padding: 1rem 1.5rem;
  font-weight: 600;
}

/* Section Titles */
.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--neutral-black);
  margin-bottom: 1rem;
}

.subsection-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-dark-gray);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Professional Buttons */
.btn {
  font-weight: 500;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  border-color: var(--secondary-hover);
  color: white;
}

/* Match Plan Specific Styles */
.match-header {
  background: linear-gradient(135deg, var(--neutral-light-gray) 0%, var(--primary-lighter) 100%);
  border-bottom: 2px solid var(--primary-color);
  padding: 2rem;
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  border-radius: 8px 8px 0 0;
}

.match-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--neutral-black);
  margin-bottom: 0.5rem;
}

.match-header .subtitle {
  font-size: 1.125rem;
  color: var(--neutral-medium-gray);
  margin-bottom: 0.25rem;
}

.match-header .meta {
  font-size: 0.875rem;
  color: var(--neutral-medium-gray);
}

/* Training Blocks */
.training-blocks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.training-block {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.training-block:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.training-block.highlighted {
  background-color: var(--accent-light);
  border-color: var(--accent-color);
  border-width: 2px;
}

.training-block .block-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neutral-medium-gray);
  margin-bottom: 0.25rem;
}

.training-block .block-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-black);
  line-height: 1.3;
}

/* Rotation Grid */
.rotation-grid {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.rotation-grid table {
  margin: 0;
  border-collapse: collapse;
  width: 100%;
}

.rotation-grid th {
  background: var(--neutral-light-gray);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-medium-gray);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: center;
}

.rotation-grid th:first-child {
  text-align: left;
  padding-left: 1rem;
}

.rotation-grid td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--neutral-light-gray);
  vertical-align: middle;
}

.rotation-grid td:first-child {
  padding-left: 1rem;
  font-weight: 500;
  color: var(--neutral-dark-gray);
}

.rotation-grid .quarter-cell {
  text-align: center;
  width: 60px;
}

.rotation-grid .checkbox-large {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Evaluation Dots */
.evaluation-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot:hover {
  border-color: var(--primary-color);
}

.dot.filled {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Theme Observations */
.observation-row {
  display: grid;
  grid-template-columns: 2fr 60px 60px 60px 60px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--neutral-light-gray);
}

.observation-row:last-child {
  border-bottom: none;
}

.observation-theme {
  font-weight: 500;
  color: var(--neutral-dark-gray);
}

.observation-quarter {
  text-align: center;
}

/* Form Controls */
.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(247, 197, 0, 0.15);
}

/* Status Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.badge-home {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.badge-away {
  background-color: var(--secondary-light);
  color: var(--secondary-color);
}

.badge-scheduled {
  background-color: var(--status-info);
  color: white;
}

.badge-played {
  background-color: var(--status-success);
  color: white;
}

/* Dashboard Cards */
.dashboard-card {
  border: none;
  border-radius: 16px;
  padding: 1.5rem;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.fixture-card {
  border-left: 4px solid var(--primary-color);
  background: linear-gradient(135deg, #ffffff 0%, #fefce8 100%);
}

.quick-action-card {
  text-align: center;
  padding: 1.5rem 1rem;
  text-decoration: none !important;
  color: inherit;
  display: block;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid transparent;
}

.quick-action-card:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: inherit;
}

.quick-action-card .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Navbar Styling */
.navbar {
  padding: 0.75rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.navbar .navbar-brand {
  flex-shrink: 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s ease;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-brand img {
  height: 32px;
  width: auto;
}

.navbar .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.navbar .nav-link.active,
.navbar .nav-item.active .nav-link {
  background: rgba(255, 255, 255, 0.15);
}

.navbar .dropdown-menu {
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.navbar .dropdown-item {
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.navbar .dropdown-item:hover {
  background: var(--primary-lighter);
  transform: translateX(4px);
}

.navbar .dropdown-item i {
  width: 20px;
  margin-right: 8px;
  opacity: 0.7;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .page-break {
    page-break-after: always;
  }
  
  body {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .match-header {
    background: white !important;
    border-bottom: 2px solid #000 !important;
  }
  
  .training-block.highlighted {
    background-color: var(--accent-light) !important;
    border: 2px solid #000 !important;
  }
  
  .rotation-grid {
    page-break-inside: avoid;
  }
  
  .rotation-grid table {
    border: 1px solid #000;
  }
  
  .rotation-grid th,
  .rotation-grid td {
    border: 1px solid #000;
  }
  
  .dot.filled {
    background-color: #000 !important;
    border-color: #000 !important;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .training-blocks {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .observation-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .observation-quarter {
    text-align: left;
  }
  
  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 576px) {
  .training-blocks {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .match-header {
    padding: 1rem;
    margin: -1rem -1rem 1rem -1rem;
  }
  
  .match-header h1 {
    font-size: 1.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   My Club — DESIGN SYSTEM TOKENS (global layer)
   All pp-* classes reference these. Never override these in templates.
═══════════════════════════════════════════════════════════════════ */
:root {
  /* Brand — default: navy/gold/red (clubs) */
  --pp-navy:         #0b1220;
  --pp-navy-mid:     #111a33;
  --pp-navy-deep:    #0a2550;
  --pp-gold:         #f7c500;
  --pp-gold-hover:   #d4a800;
  --pp-red:          #d61c1f;
  --pp-red-hover:    #b01618;

  /* Accent — the "team colour" that themes can override */
  --pp-accent:       #f7c500;
  --pp-accent-hover: #d4a800;
  --pp-accent-on:    #0b1220;   /* text colour on top of accent */

  /* Navbar gradient — themes can override */
  --pp-nav-bg:       linear-gradient(135deg, #0b1220 0%, #111a33 50%, #0a2550 100%);

  /* Neutrals */
  --pp-ink:          #0f172a;
  --pp-muted:        #64748b;
  --pp-light:        #94a3b8;
  --pp-surface:      #fafbfc;
  --pp-surface-2:    #f3f5f7;
  --pp-surface-3:    #edf0f3;
  --pp-bg:           #e8ecf0;
  --pp-stroke:       rgba(15,23,42,0.08);

  /* Status */
  --pp-success:      #16a34a;
  --pp-warning:      #f59e0b;
  --pp-danger:       #ef4444;
  --pp-info:         #2563eb;

  /* Section accents */
  --pp-accent-blue:    #2563eb;
  --pp-accent-teal:    #0891b2;
  --pp-accent-green:   #16a34a;
  --pp-accent-amber:   #d97706;
  --pp-accent-orange:  #ea580c;
  --pp-accent-purple:  #7c3aed;
  --pp-accent-indigo:  #4f46e5;

  /* Shadows */
  --pp-shadow-sm:  0 2px 8px rgba(15,23,42,0.07), 0 0 0 1px rgba(15,23,42,0.06);
  --pp-shadow-md:  0 8px 24px rgba(15,23,42,0.12);
  --pp-shadow-lg:  0 18px 48px rgba(15,23,42,0.16);

  /* Radii */
  --pp-r-sm:   8px;
  --pp-r-md:   12px;
  --pp-r-lg:   16px;
  --pp-r-xl:   22px;
  --pp-r-pill: 999px;

  --pp-ease: cubic-bezier(.2,.8,.2,1);
}

/* ───────────────────────────────────────────────────────────────
   COLOUR THEMES — applied as body class e.g. body.theme-blue
   Each theme overrides: accent, accent-hover, accent-on, nav-bg
─────────────────────────────────────────────────────────────── */

/* Gold/Navy — default clubs, same as :root, no class needed */

html.theme-red {
  --pp-accent:       #dc2626;
  --pp-accent-hover: #b91c1c;
  --pp-accent-on:    #ffffff;
  --pp-nav-bg:       linear-gradient(135deg, #1c0505 0%, #3b0a0a 50%, #5c1010 100%);
}

html.theme-blue {
  --pp-accent:       #2563eb;
  --pp-accent-hover: #1d4ed8;
  --pp-accent-on:    #ffffff;
  --pp-nav-bg:       linear-gradient(135deg, #0c1a3a 0%, #1e3a8a 50%, #1e40af 100%);
}

html.theme-green {
  --pp-accent:       #16a34a;
  --pp-accent-hover: #15803d;
  --pp-accent-on:    #ffffff;
  --pp-nav-bg:       linear-gradient(135deg, #052e16 0%, #14532d 50%, #166534 100%);
}

html.theme-purple {
  --pp-accent:       #7c3aed;
  --pp-accent-hover: #6d28d9;
  --pp-accent-on:    #ffffff;
  --pp-nav-bg:       linear-gradient(135deg, #1e0050 0%, #3b0764 50%, #4c1d95 100%);
}

html.theme-orange {
  --pp-accent:       #ea580c;
  --pp-accent-hover: #c2410c;
  --pp-accent-on:    #ffffff;
  --pp-nav-bg:       linear-gradient(135deg, #1c0800 0%, #431407 50%, #7c2d12 100%);
}

html.theme-teal {
  --pp-accent:       #0891b2;
  --pp-accent-hover: #0e7490;
  --pp-accent-on:    #ffffff;
  --pp-nav-bg:       linear-gradient(135deg, #042c3b 0%, #0c4a6e 50%, #075985 100%);
}

/* Apply nav-bg to the actual navbar when a theme is active */
html[class*="theme-"] .navbar,
html.theme-red .navbar,
html.theme-blue .navbar,
html.theme-green .navbar,
html.theme-purple .navbar,
html.theme-orange .navbar,
html.theme-teal .navbar {
  background: var(--pp-nav-bg) !important;
}

/* Accent bar at bottom of navbar follows theme accent */
html[class*="theme-"] .pp-navbar-accent,
html.theme-red .pp-navbar-accent,
html.theme-blue .pp-navbar-accent,
html.theme-green .pp-navbar-accent,
html.theme-purple .pp-navbar-accent,
html.theme-orange .pp-navbar-accent,
html.theme-teal .pp-navbar-accent {
  background: linear-gradient(90deg, var(--pp-accent) 0%, var(--pp-accent-hover) 50%, var(--pp-accent) 100%) !important;
}

/* ───────────────────────────────────────────────────────────────
   DARK MODE — applied as body.dark-mode
   Only overrides surfaces, backgrounds, text — never brand colours.
   Bespoke pages (match companion, feed, etc.) have dark-compatible
   own styles and will not be affected.
─────────────────────────────────────────────────────────────── */
html.dark-mode {
  --pp-ink:      #f1f5f9;
  --pp-muted:    #94a3b8;
  --pp-light:    #64748b;
  --pp-surface:  #1e2433;
  --pp-surface-2:#252d3d;
  --pp-surface-3:#2d3748;
  --pp-bg:       #141922;
  --pp-stroke:   rgba(255,255,255,0.08);

  /* Bootstrap overrides */
  --bs-body-bg:   #141922;
  --bs-body-color:#f1f5f9;
  color-scheme: dark;
}

html.dark-mode body {
  background-color: var(--pp-bg) !important;
  color: var(--pp-ink);
}

/* Cards */
html.dark-mode .card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink);
}
html.dark-mode .card-header:not([class*='bg-']):not([style*='background']) {
  background: var(--pp-surface-2);
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink);
}

/* pp-cards */
html.dark-mode .pp-card,
html.dark-mode .pp-filter-card,
html.dark-mode .pp-shell-body {
  background: var(--pp-surface) !important;
  color: var(--pp-ink);
}
html.dark-mode .pp-card-header {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pp-card-footer {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pp-kpi {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pp-table {
  background: var(--pp-surface) !important;
  color: var(--pp-ink);
}
html.dark-mode .pp-table thead th {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted);
}
html.dark-mode .pp-table tbody td {
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink);
}
html.dark-mode .pp-table tbody tr:hover td {
  background: var(--pp-surface-2) !important;
}
html.dark-mode .pp-result-row:hover {
  background: var(--pp-surface-2) !important;
}
html.dark-mode .pp-ql-btn {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink);
}
html.dark-mode .pp-input {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink);
}

/* Bootstrap form controls */
html.dark-mode .form-control,
html.dark-mode .form-select {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}

/* Bootstrap utility overrides */
html.dark-mode .bg-light,
html.dark-mode .bg-white {
  background-color: var(--pp-surface) !important;
}
html.dark-mode .bg-light-subtle {
  background-color: var(--pp-surface-2) !important;
}
html.dark-mode .text-dark { color: var(--pp-ink) !important; }
html.dark-mode .text-muted { color: var(--pp-muted) !important; }
html.dark-mode .border,
html.dark-mode .border-bottom,
html.dark-mode .border-top { border-color: var(--pp-stroke) !important; }

/* Dropdowns */
html.dark-mode .dropdown-menu {
  background-color: var(--pp-surface) !important;
  border: 1px solid var(--pp-stroke) !important;
  color: var(--pp-ink);
}
html.dark-mode .dropdown-item {
  color: var(--pp-ink) !important;
}
html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
  background-color: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .dropdown-divider {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .dropdown-header {
  color: var(--pp-muted) !important;
}

/* Alerts */
html.dark-mode .alert {
  border-color: var(--pp-stroke);
}

/* Footer */
html.dark-mode footer.bg-dark {
  background-color: #0a0d12 !important;
}
html.dark-mode .pp-navbar-accent {
  opacity: 0.7;
}

/* Theme picker panel in dropdown */
.pp-theme-picker {
  padding: 0.6rem 0.85rem;
}
.pp-theme-picker-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bs-secondary-color, #6c757d);
  margin-bottom: 0.45rem;
  display: block;
}
.pp-theme-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.pp-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.pp-swatch:hover { transform: scale(1.2); }
.pp-swatch.active {
  border-color: var(--pp-ink, #0f172a);
  transform: scale(1.15);
}
.pp-swatch.active::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.7);
}
.pp-dark-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: inherit;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  transition: background 0.15s;
  border-radius: 6px;
}
.pp-dark-toggle:hover {
  background: var(--bs-tertiary-bg, #f8f9fa);
}
.pp-dark-toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.pp-dark-toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
html.dark-mode .pp-dark-toggle-track {
  background: var(--pp-accent, #f7c500);
}
html.dark-mode .pp-dark-toggle-thumb {
  transform: translateX(14px);
}
html.dark-mode .pp-dark-toggle:hover {
  background: var(--pp-surface-2) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PP COMPONENT LIBRARY — centralised definitions
   These replace all per-template <style> blocks.
   Use pp-* classes in any template; styling comes from here.
═══════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────── */
/* -- Page shell ----------------------------------------------------------- */
.pp-page-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 2rem;
}
.pp-page-shell-wide {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 0 2rem;
}
.pp-page-inner {
  padding: 0 0.5rem;
}
@media (min-width: 576px) {
  .pp-page-inner { padding: 0; }
}

.pp-hero {
  background: linear-gradient(135deg, var(--pp-navy) 0%, var(--pp-navy-mid) 60%, var(--pp-navy-deep) 100%);
  border-radius: var(--pp-r-lg);
  padding: 0.75rem 1.25rem;
  color: #fff;
  margin-bottom: 0.75rem;
}
.pp-hero-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.pp-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.pp-hero-subtitle {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 0.1rem;
}
.pp-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--pp-r-pill);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}

/* ── Card ───────────────────────────────────────────────────────── */
.pp-card {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  box-shadow: var(--pp-shadow-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}
.pp-card-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--pp-stroke);
  background: var(--pp-surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pp-card-header-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
}
.pp-card-body {
  padding: 1.1rem 1.25rem;
}
.pp-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--pp-stroke);
  background: var(--pp-surface-2);
}

/* ── Filter card ────────────────────────────────────────────────── */
.pp-filter-card {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--pp-shadow-sm);
}

/* ── Form section (used in incident form etc.) ──────────────────── */
.pp-form-section {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  box-shadow: var(--pp-shadow-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}
.pp-form-section-header {
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--pp-stroke);
  background: var(--pp-surface-2);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pp-muted);
}
.pp-form-section-body {
  padding: 1rem 1.1rem;
}

/* ── KPI grid ───────────────────────────────────────────────────── */
.pp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 576px) {
  .pp-kpi-grid { grid-template-columns: 1fr; }
}
.pp-kpi-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 768px) {
  .pp-kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
.pp-kpi {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--pp-shadow-sm);
}
.pp-kpi-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pp-muted);
  margin-bottom: 0.2rem;
}
.pp-kpi-value {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--pp-ink);
}
.pp-kpi-sub {
  font-size: 0.75rem;
  color: var(--pp-muted);
  margin-top: 0.1rem;
}

/* ── Table ──────────────────────────────────────────────────────── */
.pp-table {
  width: 100%;
  border-collapse: collapse;
}
.pp-table thead th {
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pp-muted);
  background: var(--pp-surface-2);
  border-bottom: 1px solid var(--pp-stroke);
  white-space: nowrap;
}
.pp-table tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--pp-stroke);
  vertical-align: middle;
  color: var(--pp-ink);
}
.pp-table tbody tr:last-child td {
  border-bottom: none;
}
.pp-table tbody tr:hover td {
  background: var(--pp-surface-2);
}

/* ── Badges ─────────────────────────────────────────────────────── */
.pp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--pp-r-pill);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.pp-badge-success  { background: #dcfce7; color: #15803d; }
.pp-badge-danger   { background: #fee2e2; color: #b91c1c; }
.pp-badge-warning  { background: #fef9c3; color: #a16207; }
.pp-badge-info     { background: #dbeafe; color: #1d4ed8; }
.pp-badge-neutral  { background: var(--pp-surface-3); color: var(--pp-muted); }
.pp-badge-urgent   { background: #dc2626; color: #fff; }
.pp-badge-high     { background: #ea580c; color: #fff; }
.pp-badge-medium   { background: #d97706; color: #fff; }
.pp-badge-low      { background: var(--pp-surface-3); color: var(--pp-muted); }

/* ── Buttons ────────────────────────────────────────────────────── */
.pp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--pp-r-pill);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s var(--pp-ease);
  white-space: nowrap;
}
.pp-btn:focus-visible { outline: 2px solid var(--pp-accent); outline-offset: 2px; }

.pp-btn-primary { background: var(--pp-accent); color: var(--pp-accent-on); }
.pp-btn-primary:hover { background: var(--pp-accent-hover); color: var(--pp-accent-on); text-decoration: none; }

.pp-btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.pp-btn-ghost:hover { background: rgba(255,255,255,0.25); color: #fff; text-decoration: none; }

.pp-btn-outline { background: var(--pp-surface); color: var(--pp-ink); border-color: var(--pp-stroke); }
.pp-btn-outline:hover { background: var(--pp-surface-2); text-decoration: none; color: var(--pp-ink); }

.pp-btn-secondary { background: var(--pp-surface-2); color: var(--pp-ink); border-color: var(--pp-stroke); }
.pp-btn-secondary:hover { background: var(--pp-surface-3, var(--pp-stroke)); color: var(--pp-ink); text-decoration: none; }

.pp-btn-success { background: #dcfce7; color: #15803d; border-color: #86efac; }
.pp-btn-success:hover { background: #bbf7d0; color: #15803d; text-decoration: none; }

.pp-btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.pp-btn-danger:hover { background: #fecaca; color: #991b1b; text-decoration: none; }

.pp-btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
.pp-btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }

/* ── Labels / section typography ───────────────────────────────── */
.pp-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
  display: block;
  margin-bottom: 0.3rem;
}
.pp-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pp-muted);
  margin: 1.1rem 0 0.6rem;
}
.pp-section-label:first-child { margin-top: 0; }
.pp-section-value {
  font-size: 0.9rem;
  color: var(--pp-ink);
  white-space: pre-wrap;
  line-height: 1.6;
}
.pp-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pp-muted);
  margin-bottom: 0.2rem;
}
.pp-field-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--pp-ink);
}

/* ── Input ──────────────────────────────────────────────────────── */
.pp-input {
  display: block;
  width: 100%;
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-sm);
  background: var(--pp-surface-2);
  color: var(--pp-ink);
  transition: border-color 0.15s;
}
.pp-input:focus {
  outline: none;
  border-color: var(--pp-accent);
  box-shadow: 0 0 0 3px rgba(247,197,0,0.15);
}

/* ── Divider ────────────────────────────────────────────────────── */
.pp-divider {
  border: none;
  border-top: 1px solid var(--pp-stroke);
  margin: 1.25rem 0;
}

/* ── Info / referee box ─────────────────────────────────────────── */
.pp-info-box {
  background: var(--pp-surface-2);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--pp-muted);
  margin-top: 0.5rem;
}
.pp-referee-box {
  background: var(--pp-surface-2);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}
.pp-referee-box-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
  margin-bottom: 0.75rem;
}

/* ── Summary bar ────────────────────────────────────────────────── */
.pp-summary {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
}

/* ── Stat (used in division cards etc.) ─────────────────────────── */
.pp-stat { text-align: center; }
.pp-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
}
.pp-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--pp-ink);
}

/* ── Division card (club pages) ─────────────────────────────────── */
.pp-division-card {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  box-shadow: var(--pp-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pp-division-card-header {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--pp-stroke);
  background: var(--pp-surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pp-division-card-body {
  padding: 0.75rem 1rem;
  flex: 1;
}
.pp-division-card-footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--pp-stroke);
  background: var(--pp-surface-2);
  display: flex;
  gap: 0.5rem;
}

/* ── Budget progress bar ────────────────────────────────────────── */
.pp-budget-item {
  background: var(--pp-surface);
  border: 1px solid var(--pp-stroke);
  border-radius: var(--pp-r-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.pp-budget-item:last-child { margin-bottom: 0; }
.pp-progress-track {
  height: 10px;
  background: var(--pp-surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.4rem 0;
}
.pp-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.pp-progress-ok     { background: #16a34a; }
.pp-progress-warn   { background: #d97706; }
.pp-progress-danger { background: #dc2626; }

/* ── Session link ───────────────────────────────────────────────── */
.pp-session-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pp-stroke);
  font-size: 0.875rem;
  color: var(--pp-ink);
  text-decoration: none;
}
.pp-session-link:last-child { border-bottom: none; }
.pp-session-link:hover { color: var(--pp-accent); text-decoration: none; }

/* ── Dark mode overrides for new components ─────────────────────── */
html.dark-mode .pp-form-section,
html.dark-mode .pp-referee-box,
html.dark-mode .pp-info-box,
html.dark-mode .pp-budget-item,
html.dark-mode .pp-division-card,
html.dark-mode .pp-summary {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pp-form-section-header,
html.dark-mode .pp-division-card-header,
html.dark-mode .pp-division-card-footer,
html.dark-mode .pp-referee-box-title {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .pp-form-section-body {
  color: var(--pp-ink);
}
html.dark-mode .pp-progress-track {
  background: var(--pp-surface-3) !important;
}
html.dark-mode .pp-btn-outline {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .pp-btn-outline:hover {
  background: var(--pp-surface-3) !important;
}
html.dark-mode .pp-badge-success { background: #14532d; color: #86efac; }
html.dark-mode .pp-badge-danger  { background: #7f1d1d; color: #fca5a5; }
html.dark-mode .pp-badge-warning { background: #78350f; color: #fcd34d; }
html.dark-mode .pp-badge-info    { background: #1e3a8a; color: #93c5fd; }
html.dark-mode .pp-badge-neutral { background: var(--pp-surface-3); color: var(--pp-muted); }
/* .pp-hero needs no dark-mode override — uses --pp-navy vars which are dark */
html.dark-mode .pp-input {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .pp-session-link { color: var(--pp-ink); }
html.dark-mode .pp-session-link:hover { color: var(--pp-accent); }

/* ===============================================================
   DARK MODE - EXTENDED COVERAGE
   Feed page local vars, Bootstrap components, utilities.
   =============================================================== */

/* Feed page local CSS variables override for dark mode */
html.dark-mode {
  --panel:        rgba(30, 36, 51, 0.97);
  --panel-strong: rgba(37, 45, 61, 0.99);
  --stroke:       rgba(255, 255, 255, 0.09);
  --stroke-2:     rgba(255, 255, 255, 0.15);
  --text:         #f1f5f9;
  --muted:        #94a3b8;
}

/* Bootstrap: Tables */
html.dark-mode table,
html.dark-mode .table {
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,0.03) !important;
}
html.dark-mode .table-hover > tbody > tr:hover > * {
  background-color: var(--pp-surface-2) !important;
}
html.dark-mode thead th,
html.dark-mode thead td {
  background-color: var(--pp-surface-2) !important;
  color: var(--pp-muted) !important;
  border-color: var(--pp-stroke) !important;
}

/* Bootstrap: Modal */
html.dark-mode .modal-content {
  background-color: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .modal-header {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .modal-footer {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .modal-body { color: var(--pp-ink); }
html.dark-mode .btn-close { filter: invert(1) grayscale(1); }

/* Bootstrap: List Group */
html.dark-mode .list-group-item {
  background-color: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .list-group-item-action:hover,
html.dark-mode .list-group-item-action:focus {
  background-color: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .list-group-item.active {
  background-color: var(--pp-accent) !important;
  border-color: var(--pp-accent) !important;
  color: var(--pp-accent-on) !important;
}

/* Bootstrap: Nav Tabs and Pills */
html.dark-mode .nav-tabs { border-color: var(--pp-stroke) !important; }
html.dark-mode .nav-tabs .nav-link { color: var(--pp-muted) !important; }
html.dark-mode .nav-tabs .nav-link:hover {
  border-color: var(--pp-stroke) var(--pp-stroke) transparent !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .nav-tabs .nav-link.active {
  background-color: var(--pp-surface) !important;
  border-color: var(--pp-stroke) var(--pp-stroke) var(--pp-surface) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .nav-pills .nav-link { color: var(--pp-muted) !important; }
html.dark-mode .nav-pills .nav-link.active {
  background-color: var(--pp-accent) !important;
  color: var(--pp-accent-on) !important;
}

/* Bootstrap: Input Group */
html.dark-mode .input-group-text {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}

/* Bootstrap: Breadcrumb */
html.dark-mode .breadcrumb-item,
html.dark-mode .breadcrumb-item a { color: var(--pp-muted) !important; }
html.dark-mode .breadcrumb-item.active { color: var(--pp-ink) !important; }
html.dark-mode .breadcrumb-item + .breadcrumb-item::before { color: var(--pp-light) !important; }

/* Bootstrap: Pagination */
html.dark-mode .page-item .page-link {
  background-color: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .page-item .page-link:hover {
  background-color: var(--pp-surface-2) !important;
  color: var(--pp-accent) !important;
}
html.dark-mode .page-item.active .page-link {
  background-color: var(--pp-accent) !important;
  border-color: var(--pp-accent) !important;
  color: var(--pp-accent-on) !important;
}
html.dark-mode .page-item.disabled .page-link {
  background-color: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-light) !important;
}

/* Bootstrap: Accordion */
html.dark-mode .accordion-item {
  background-color: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .accordion-button {
  background-color: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
  box-shadow: none !important;
}
html.dark-mode .accordion-button:not(.collapsed) {
  background-color: var(--pp-surface-3) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .accordion-button::after { filter: invert(1); }
html.dark-mode .accordion-body {
  background-color: var(--pp-surface) !important;
  color: var(--pp-ink);
}

/* Bootstrap: Alerts */
html.dark-mode .alert-success {
  background-color: #14532d !important; border-color: #166534 !important; color: #86efac !important;
}
html.dark-mode .alert-danger {
  background-color: #7f1d1d !important; border-color: #991b1b !important; color: #fca5a5 !important;
}
html.dark-mode .alert-warning {
  background-color: #78350f !important; border-color: #92400e !important; color: #fcd34d !important;
}
html.dark-mode .alert-info {
  background-color: #1e3a8a !important; border-color: #1d4ed8 !important; color: #93c5fd !important;
}
html.dark-mode .alert-light {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .alert-secondary {
  background-color: var(--pp-surface-3) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}

/* Bootstrap: Badges */
html.dark-mode .badge.bg-light,
html.dark-mode .badge.text-bg-light {
  background-color: var(--pp-surface-3) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .badge.bg-secondary,
html.dark-mode .badge.text-bg-secondary {
  background-color: var(--pp-surface-3) !important;
  color: var(--pp-muted) !important;
}

/* Bootstrap: Progress */
html.dark-mode .progress { background-color: var(--pp-surface-3) !important; }

/* Bootstrap: Offcanvas */
html.dark-mode .offcanvas {
  background-color: var(--pp-surface) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .offcanvas-header { border-color: var(--pp-stroke) !important; }

/* Notification panel hover */
html.dark-mode .notification-item:hover {
  background-color: var(--pp-surface-2) !important;
}

/* Feed: composer card */
html.dark-mode .composer-card {
  background: var(--panel) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .composer-body-area {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.10) !important;
}
html.dark-mode .composer-body-area:focus-within {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(59,130,246,0.5) !important;
}
html.dark-mode .composer-body-area textarea,
html.dark-mode .composer-title-input {
  color: var(--pp-ink) !important;
}
html.dark-mode .composer-body-area textarea::placeholder,
html.dark-mode .composer-title-input::placeholder {
  color: var(--pp-light) !important;
}
html.dark-mode .composer-link-preview {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .composer-settings .form-select,
html.dark-mode .composer-settings select {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .reactors-chip {
  background: rgba(255,255,255,0.08) !important;
}
html.dark-mode .reactors-chip:hover {
  background: rgba(255,255,255,0.14) !important;
}

/* Feed: comment input */
html.dark-mode .ajax-comment-form textarea,
html.dark-mode .ajax-comment-form input[type="text"] {
  background-color: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}

/* Text colour utilities */
html.dark-mode .text-body      { color: var(--pp-ink) !important; }
html.dark-mode .text-secondary { color: var(--pp-muted) !important; }
html.dark-mode .text-black     { color: var(--pp-ink) !important; }

/* Headings */
html.dark-mode h1, html.dark-mode h2, html.dark-mode h3,
html.dark-mode h4, html.dark-mode h5, html.dark-mode h6 {
  color: var(--pp-ink);
}

/* HR and code */
html.dark-mode hr { border-color: var(--pp-stroke) !important; opacity: 1; }
html.dark-mode code { background: var(--pp-surface-3) !important; color: #f472b6 !important; }
html.dark-mode pre {
  background: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}

/* Feed: hardcoded colour overrides */
html.dark-mode .feed-engagement {
  color: var(--pp-muted) !important;
}
html.dark-mode .feed-engagement .small {
  color: var(--pp-muted) !important;
}
html.dark-mode .badge-visibility {
  background: rgba(14,165,233,0.22) !important;
  color: #7dd3fc !important;
}
html.dark-mode .badge-teams {
  background: rgba(16,185,129,0.22) !important;
  color: #6ee7b7 !important;
}
html.dark-mode .attachment-chip {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .comment-block {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .comment-bubble {
  background: rgba(255,255,255,0.07) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .comment-reaction-chips {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .comment-reaction-chips .cr-count {
  color: var(--pp-muted) !important;
}
html.dark-mode .cmt-react-picker {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .source-card {
  background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(37,99,235,0.12)) !important;
  border-color: rgba(37,99,235,0.25) !important;
}
html.dark-mode .source-card .source-subtitle {
  color: var(--pp-muted) !important;
}
html.dark-mode .source-card .meta-item {
  background: rgba(255,255,255,0.07) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .source-card .meta-item span {
  color: var(--pp-muted) !important;
}
html.dark-mode .source-card .source-pill {
  background: rgba(255,255,255,0.10) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .source-card .status-chip {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .spotlight-card {
  background: linear-gradient(120deg, rgba(120,53,15,0.55), rgba(120,53,15,0.35) 45%, rgba(49,46,129,0.35)) !important;
  border-color: rgba(249,115,22,0.30) !important;
}
html.dark-mode .spotlight-pill {
  background: rgba(255,255,255,0.10) !important;
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .bc-strip {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .bc-strip-btn {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .bc-strip-btn:hover {
  background: rgba(255,255,255,0.12) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .bc-chip {
  background: rgba(255,255,255,0.07) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .bc-chip:hover {
  background: rgba(255,255,255,0.11) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .link-preview {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .mention-suggestions {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .mention-suggestions button {
  color: var(--pp-ink) !important;
}
html.dark-mode .giphy-modal {
  background: var(--pp-surface) !important;
}
html.dark-mode .giphy-modal-header {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .giphy-modal-header input {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .giphy-modal-close {
  color: var(--pp-muted) !important;
}
html.dark-mode .giphy-modal-close:hover {
  background: var(--pp-surface-2) !important;
}
html.dark-mode .giphy-modal-footer {
  border-color: var(--pp-stroke) !important;
}

/* Feed: additional hardcoded colour overrides */
html.dark-mode .comment-box {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .emoji-picker-panel {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .reaction-bar {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .reaction-count {
  color: var(--pp-muted) !important;
}
html.dark-mode .poll-option {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .feed-overflow-menu {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .feed-overflow-item {
  color: var(--pp-ink) !important;
}
html.dark-mode .feed-overflow-item:hover {
  background: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .feed-actions {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pdf-preview-card {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pdf-preview-card .fw-semibold {
  color: var(--pp-ink) !important;
}
html.dark-mode .text-muted {
  color: var(--pp-muted) !important;
}



/* Squad dashboard local vars */
html.dark-mode {
  --db-surface:  #1e2433;
  --db-bg:       #141922;
  --db-stroke:   rgba(255,255,255,0.08);
  --db-text:     #f1f5f9;
  --db-muted:    #94a3b8;
}
html.dark-mode main.container-fluid {
  background: var(--db-bg) !important;
}
html.dark-mode .db-card {
  background: var(--db-surface) !important;
  border-color: var(--db-stroke) !important;
}
html.dark-mode .db-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
}
html.dark-mode .db-header {
  background: var(--db-surface) !important;
  border-color: var(--db-stroke) !important;
}
html.dark-mode .db-body {
  background: var(--db-surface) !important;
}
html.dark-mode .db-header-title {
  color: var(--db-text) !important;
}
html.dark-mode .db-header-meta {
  color: var(--db-muted) !important;
}

/* Dashboard: event cards (fixture/training grids) */
html.dark-mode .event-card {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .event-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
}
html.dark-mode .event-card .card-body {
  color: var(--db-text);
}
html.dark-mode .event-card h6.card-title {
  color: var(--db-text) !important;
}
html.dark-mode .event-card p {
  color: var(--db-muted) !important;
}

/* Dashboard: header icon pastel backgrounds  darken for dark mode */
html.dark-mode .db-fixtures .db-header-icon    { background: rgba(37,99,235,0.18) !important; }
html.dark-mode .db-feed .db-header-icon        { background: rgba(8,145,178,0.18) !important; }
html.dark-mode .db-broadcasts .db-header-icon  { background: rgba(217,119,6,0.18) !important; }
html.dark-mode .db-tournaments .db-header-icon { background: rgba(180,83,9,0.18) !important; }
html.dark-mode .db-training .db-header-icon    { background: rgba(22,163,74,0.18) !important; }
html.dark-mode .db-results .db-header-icon     { background: rgba(234,88,12,0.18) !important; }
html.dark-mode .db-quicklinks .db-header-icon  { background: rgba(255,255,255,0.08) !important; }
html.dark-mode .db-whosgoin .db-header-icon    { background: rgba(15,52,96,0.35) !important; }
html.dark-mode .db-fundraisers .db-header-icon { background: rgba(124,58,237,0.18) !important; }
html.dark-mode .db-wrapped .db-header-icon     { background: rgba(79,70,229,0.18) !important; }

/* Dashboard: recent results */
html.dark-mode .recent-result-row {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .recent-result-row:hover {
  background: var(--pp-surface-2) !important;
}
html.dark-mode .match-teams {
  color: var(--db-text);
}
html.dark-mode .match-teams .team-name.win {
  color: #86efac !important;
}
html.dark-mode .score-display {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}
html.dark-mode .match-meta .pill {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--db-muted) !important;
}
html.dark-mode .goal-scorers .chip {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--db-text) !important;
}

/* Dashboard: Who's Going panels */
html.dark-mode .whosgoin-panel {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .whosgoin-panel.fixture-panel {
  background: rgba(37,99,235,0.10) !important;
}
html.dark-mode .whosgoin-panel.training-panel {
  background: rgba(22,163,74,0.10) !important;
}
html.dark-mode .whosgoin-panel .fw-bold[style*="color:#0f3460"],
html.dark-mode .whosgoin-panel .fw-bold[style*="color:#14532d"] {
  color: var(--db-text) !important;
}

/* Dashboard: attendance badges (inline styles need specificity) */
html.dark-mode .whosgoin-panel .badge[style*="background:#d1fae5"] {
  background: rgba(22,163,74,0.25) !important;
  color: #86efac !important;
}
html.dark-mode .whosgoin-panel .badge[style*="background:#fef9c3"] {
  background: rgba(234,179,8,0.25) !important;
  color: #fcd34d !important;
}
html.dark-mode .whosgoin-panel .badge[style*="background:#fee2e2"] {
  background: rgba(239,68,68,0.25) !important;
  color: #fca5a5 !important;
}

/* Dashboard: Quick Links */
html.dark-mode .ql-btn {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--db-text) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
}
html.dark-mode .ql-btn:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.3) !important;
  color: var(--db-text) !important;
}
html.dark-mode .ql-catalogue-item {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--db-text) !important;
}
html.dark-mode .ql-catalogue-item.selected {
  background: rgba(15,52,96,0.4) !important;
  border-color: rgba(59,130,246,0.5) !important;
  color: #93c5fd !important;
}
html.dark-mode .ql-catalogue-item.selected::after {
  color: #93c5fd !important;
}

/* Dashboard: Fundraiser cards (override inline styles) */
html.dark-mode .db-fundraisers .border.rounded-3[style*="background:#faf5ff"] {
  background: rgba(124,58,237,0.12) !important;
  border-color: rgba(124,58,237,0.25) !important;
}
html.dark-mode .db-fundraisers .fw-bold[style*="color:#4f46e5"] {
  color: #a78bfa !important;
}
html.dark-mode .db-fundraisers .progress[style*="background:#e9d5ff"] {
  background: rgba(124,58,237,0.20) !important;
}
html.dark-mode .db-fundraisers .fw-bold[style*="color:#4f46e5;"] {
  color: #a78bfa !important;
}

/* Dashboard: btn-outline-secondary in dark */
html.dark-mode .db-card .btn-outline-secondary {
  color: var(--db-muted) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .db-card .btn-outline-secondary:hover {
  background: rgba(255,255,255,0.08) !important;
  color: var(--db-text) !important;
}
html.dark-mode .db-card .btn-outline-dark {
  color: var(--db-text) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .db-card .btn-outline-dark:hover {
  background: rgba(255,255,255,0.08) !important;
}

/* Dashboard: trend pills (in results header) */
html.dark-mode .trend-pills {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.10) !important;
}

/* 
   TRAINING DASHBOARD dark mode
    */
html.dark-mode {
  --tm-bg:        rgba(30, 36, 51, 0.97);
  --tm-bg-strong: rgba(37, 45, 61, 0.99);
  --tm-stroke:    rgba(255,255,255,0.09);
  --tm-text:      #f1f5f9;
  --tm-muted:     #94a3b8;
}
html.dark-mode .tm-card {
  background: var(--tm-bg) !important;
  border-color: var(--tm-stroke) !important;
  color: var(--tm-text);
}
html.dark-mode .tm-card .card-header {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--tm-stroke) !important;
  color: var(--tm-text);
}
html.dark-mode .tm-card .card-header h5,
html.dark-mode .tm-card .card-body {
  color: var(--tm-text);
}
html.dark-mode .tm-table {
  background: var(--tm-bg) !important;
  border-color: var(--tm-stroke) !important;
}
html.dark-mode .tm-table thead th {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--tm-stroke) !important;
  color: var(--tm-muted) !important;
}
html.dark-mode .tm-table tbody td {
  border-color: var(--tm-stroke) !important;
  color: var(--tm-text);
}
html.dark-mode .tm-table tbody tr:hover {
  background: rgba(255,255,255,0.04) !important;
}
html.dark-mode .tm-table tbody tr.table-warning {
  background: linear-gradient(90deg, rgba(245,158,11,0.12), transparent 65%) !important;
}
html.dark-mode .tm-alert {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(245,158,11,0.25) !important;
  color: var(--tm-text);
}
html.dark-mode .tm-alert h5 { color: #fde68a; }
html.dark-mode .modal-body { background: var(--pp-surface) !important; color: var(--pp-ink); }

/* 
   PITCHES pages dark mode  all share --panel/--text/--muted
   already overridden globally; add component-specific overrides
    */

/* Shared p-btn and p-title/p-subtitle */
html.dark-mode .p-title    { color: var(--pp-ink) !important; }
html.dark-mode .p-subtitle { color: var(--pp-muted) !important; }
html.dark-mode .p-btn {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .p-btn:hover { color: var(--pp-ink) !important; }
html.dark-mode .p-empty {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}

/* Pitch list */
html.dark-mode .pitch-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pitch-card-header {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .pitch-card-name  { color: var(--pp-ink) !important; }
html.dark-mode .pitch-card-loc   { color: var(--pp-muted) !important; }
html.dark-mode .pitch-pill {
  background: var(--pp-surface-3) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .pitch-card-img-placeholder { color: rgba(255,255,255,0.10) !important; }

/* Weather dashboard */
html.dark-mode .wx-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .wx-card-head  { border-color: var(--pp-stroke) !important; }
html.dark-mode .wx-card-name  { color: var(--pp-ink) !important; }
html.dark-mode .wx-card-loc   { color: var(--pp-muted) !important; }
html.dark-mode .wx-card-foot  { border-color: var(--pp-stroke) !important; }
html.dark-mode .wx-cell {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .wx-cell .wx-t,
html.dark-mode .wx-cell .wx-temp { color: var(--pp-ink) !important; }
html.dark-mode .wx-cell .wx-rain,
html.dark-mode .wx-cell .wx-wind { color: var(--pp-muted) !important; }
html.dark-mode .wx-cell--danger { background: rgba(239,68,68,0.12) !important; border-color: rgba(239,68,68,0.20) !important; }
html.dark-mode .wx-cell--warn   { background: rgba(251,191,36,0.10) !important; border-color: rgba(251,191,36,0.20) !important; }
html.dark-mode .wx-cell--frost  { background: rgba(147,197,253,0.08) !important; border-color: rgba(147,197,253,0.18) !important; }
html.dark-mode .wx-suitability--ok  { background: rgba(16,185,129,0.08) !important; }
html.dark-mode .wx-suitability--bad { background: rgba(239,68,68,0.08) !important; }
html.dark-mode .wx-empty {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .alert-banner {
  background: rgba(251,191,36,0.06) !important;
  border-color: rgba(251,191,36,0.18) !important;
}
html.dark-mode .alert-banner-text { color: var(--pp-ink) !important; }

/* Threshold list */
html.dark-mode .thr-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .thr-card-head  { border-color: var(--pp-stroke) !important; }
html.dark-mode .thr-team       { color: var(--pp-ink) !important; }
html.dark-mode .thr-row        { border-color: var(--pp-stroke) !important; }
html.dark-mode .thr-label      { color: var(--pp-muted) !important; }
html.dark-mode .thr-val        { color: var(--pp-ink) !important; }
html.dark-mode .thr-card-foot  { border-color: var(--pp-stroke) !important; }
html.dark-mode .thr-edit {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}

/* Alert list */
html.dark-mode .alert-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .alert-headline { color: var(--pp-ink) !important; }
html.dark-mode .alert-meta     { color: var(--pp-muted) !important; }

/* Clash report */
html.dark-mode .clash-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  border-left-color: #ef4444 !important;
}
html.dark-mode .clash-pitch         { color: var(--pp-ink) !important; }
html.dark-mode .clash-booking {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .clash-booking-title { color: var(--pp-ink) !important; }
html.dark-mode .clash-booking-time  { color: var(--pp-muted) !important; }
html.dark-mode .clash-vs            { color: var(--pp-muted) !important; }

/* Pitch calendar  FullCalendar overrides */
html.dark-mode .cal-wrap {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .cal-filters select {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .fc .fc-toolbar-title       { color: var(--pp-ink) !important; }
html.dark-mode .fc .fc-col-header-cell     { color: var(--pp-muted) !important; }
html.dark-mode .fc .fc-button {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .fc td, html.dark-mode .fc th { border-color: var(--pp-stroke) !important; }
html.dark-mode .fc .fc-scrollgrid          { border-color: var(--pp-stroke) !important; }
html.dark-mode .fc .fc-daygrid-day         { background: transparent; }
html.dark-mode .fc .fc-daygrid-day-number  { color: var(--pp-ink); }
html.dark-mode .fc .fc-timegrid-axis,
html.dark-mode .fc .fc-timegrid-slot-label { color: var(--pp-muted); }
html.dark-mode .fc .fc-list-day-text,
html.dark-mode .fc .fc-list-day-side-text  { color: var(--pp-ink); }
html.dark-mode .fc .fc-list-event-title    { color: var(--pp-ink); }
html.dark-mode .fc-theme-standard .fc-scrollgrid { border-color: var(--pp-stroke) !important; }
html.dark-mode .fc-theme-standard td,
html.dark-mode .fc-theme-standard th      { border-color: var(--pp-stroke) !important; }

/* 
   QUALIFICATION DASHBOARD + FORM dark mode
    */
html.dark-mode {
  --ink:    #f1f5f9;
  --card:   #1e2433;
  --bg:     #141922;
  --border: rgba(255,255,255,0.09);
}
html.dark-mode .metric {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--ink);
}
html.dark-mode .metric .value { color: var(--ink) !important; }
html.dark-mode .metric .icon  { background: var(--pp-surface-2) !important; border-color: var(--border) !important; }
html.dark-mode .soft-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
html.dark-mode .soft-card .card-header {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--border) !important;
}
html.dark-mode .soft-card .card-header h5,
html.dark-mode .soft-card .card-header h6 { color: var(--ink) !important; }
html.dark-mode .soft-card .card-body      { color: var(--ink); }
html.dark-mode .alert-block {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(245,158,11,0.22) !important;
}
html.dark-mode .alert-block h6 { color: #fde68a !important; }
html.dark-mode .alert-row {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--border) !important;
}
html.dark-mode .table thead th { background: var(--pp-surface-2) !important; border-color: var(--border) !important; }
html.dark-mode .badge-expired  { background: rgba(100,116,139,.18) !important; color: #94a3b8 !important; }

/* 
   MATCHPLANS pages dark mode
    */

/* matchplan_list.html  --sx-* vars */
html.dark-mode {
  --sx-text:   #f1f5f9;
  --sx-muted:  #94a3b8;
  --sx-stroke: rgba(255,255,255,0.09);
  --sx-bg:     rgba(30,36,51,0.97);
}
html.dark-mode .section-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .section-card .card-header {
  background: rgba(255,255,255,0.04) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .mp-row-title { color: var(--pp-ink) !important; }
html.dark-mode .mp-sub       { color: var(--pp-muted) !important; }
html.dark-mode .mp-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}

/* matchplan_detail.html  --card-border / --card-bg / --header-bg */
html.dark-mode {
  --card-border: rgba(255,255,255,0.09);
  --card-bg:     #1e2433;
  --header-bg:   rgba(255,255,255,0.04);
}
html.dark-mode .avail-bar {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .section-header {
  background: var(--header-bg) !important;
  border-color: var(--card-border) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .section-body   { color: var(--pp-ink); }
html.dark-mode .player-avail-card.unknown {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #94a3b8 !important;
}
html.dark-mode .player-avail-card.present {
  background: rgba(22,163,74,0.10) !important;
  border-color: rgba(22,163,74,0.22) !important;
}
html.dark-mode .player-avail-card.absent {
  background: rgba(220,38,38,0.08) !important;
  border-color: rgba(220,38,38,0.18) !important;
}
html.dark-mode .player-avail-card.late {
  background: rgba(217,119,6,0.10) !important;
  border-color: rgba(217,119,6,0.22) !important;
}
html.dark-mode .rot-table th { color: var(--pp-muted) !important; border-color: var(--pp-stroke) !important; }
html.dark-mode .rot-table td { border-color: var(--pp-stroke) !important; }
html.dark-mode .rot-table tr.absent-row { background: rgba(255,255,255,0.02) !important; }
html.dark-mode .q-off { background: rgba(255,255,255,0.10) !important; color: #64748b !important; }
html.dark-mode .post-match-zone {
  background: rgba(240,253,244,0.04) !important;
  border-color: rgba(191,219,254,0.15) !important;
}
html.dark-mode .post-match-zone h6 { color: #93c5fd !important; }
html.dark-mode .sh-badge { background: rgba(3,105,161,0.18) !important; color: #7dd3fc !important; }

/* match_analysis.html  reuses --ink/--card/--border already set; add analysis-specific */
html.dark-mode .rating-tile {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .rating-label { color: var(--pp-muted) !important; }
html.dark-mode .player-row {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}

/* 
   CLUB CALENDAR (club_calendar.html)  full dark mode overrides
   All colours in this template are hardcoded, so every component
   needs an explicit override.
    */

/*  Layout shells  */
html.dark-mode .cal-topbar {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .cal-topbar h1 { color: var(--pp-ink) !important; }
html.dark-mode .cal-filters {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}

/*  Buttons  */
html.dark-mode .btn-cal-outline {
  background: var(--pp-surface) !important;
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .btn-cal-outline:hover { background: var(--pp-surface-2) !important; }
html.dark-mode .btn-cal-today {
  background: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}

/*  View toggle  */
html.dark-mode .view-toggle {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .view-toggle button {
  background: var(--pp-surface) !important;
  color: var(--pp-muted) !important;
  border-color: transparent !important;
}
html.dark-mode .view-toggle button.active {
  background: #1e40af !important;
  color: #fff !important;
}

/*  Filter chips  */
html.dark-mode .filter-chip {
  background: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .filter-chip.active {
  background: #1e40af !important;
  color: #fff !important;
  border-color: #1e40af !important;
}

/*  Period nav  */
html.dark-mode .period-nav button {
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
  background: transparent !important;
}
html.dark-mode .period-nav button:hover { background: var(--pp-surface-2) !important; }
html.dark-mode .period-label { color: var(--pp-ink) !important; }

/*  Action queue  */
html.dark-mode .action-queue {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(253,230,138,0.15) !important;
}
html.dark-mode .action-chip.rsvp {
  background: rgba(254,243,199,0.08) !important;
  color: #fbbf24 !important;
  border-color: rgba(253,230,138,0.2) !important;
}
html.dark-mode .action-chip.payment {
  background: rgba(254,226,226,0.08) !important;
  color: #fca5a5 !important;
  border-color: rgba(252,165,165,0.2) !important;
}
html.dark-mode .action-chip.volunteer {
  background: rgba(219,234,254,0.08) !important;
  color: #93c5fd !important;
  border-color: rgba(147,197,253,0.2) !important;
}

/*  Month grid  */
html.dark-mode .month-grid { background: var(--pp-stroke) !important; }
html.dark-mode .month-header-row {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .month-header-cell { color: var(--pp-muted) !important; }
html.dark-mode .month-cell {
  background: var(--pp-surface) !important;
}
html.dark-mode .month-cell.other-month { background: var(--pp-surface-2) !important; }
html.dark-mode .month-cell.today { background: rgba(30,64,175,0.12) !important; }
html.dark-mode .month-cell-date { color: var(--pp-ink) !important; }
html.dark-mode .more-events { color: var(--pp-muted) !important; }
html.dark-mode .more-events:hover { color: #60a5fa !important; }

/*  Week view  */
html.dark-mode .week-header {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .week-header-cell .wh-day { color: var(--pp-muted) !important; }
html.dark-mode .week-header-cell .wh-date { color: var(--pp-ink) !important; }
html.dark-mode .time-slot-label { color: var(--pp-muted) !important; }
html.dark-mode .week-col { border-color: var(--pp-stroke) !important; }
html.dark-mode .week-hour-line { border-color: var(--pp-stroke) !important; }

/*  Agenda view  */
html.dark-mode .agenda-date-header {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .agenda-date-header.today {
  background: rgba(30,64,175,0.12) !important;
  color: #60a5fa !important;
}
html.dark-mode .cal-main,
html.dark-mode .cal-body,
html.dark-mode .cal-page,
html.dark-mode .agenda-group,
html.dark-mode #calMain { background: var(--pp-bg) !important; }
html.dark-mode .agenda-event {
  background: var(--pp-bg) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .agenda-event:hover { background: var(--pp-surface-2) !important; }
html.dark-mode .agenda-event .ae-time { color: var(--pp-ink) !important; }
html.dark-mode .agenda-event .ae-title { color: var(--pp-ink) !important; }
html.dark-mode .agenda-event .ae-meta { color: var(--pp-muted) !important; }
html.dark-mode .badge-action {
  background: rgba(254,243,199,0.1) !important;
  color: #fbbf24 !important;
}
html.dark-mode .badge-cancelled {
  background: rgba(254,226,226,0.1) !important;
  color: #fca5a5 !important;
}
html.dark-mode .badge-volunteer {
  background: rgba(219,234,254,0.1) !important;
  color: #93c5fd !important;
}

/*  Event drawer  */
html.dark-mode .event-drawer {
  background: var(--pp-surface) !important;
  box-shadow: -4px 0 24px rgba(0,0,0,0.4) !important;
}
html.dark-mode .drawer-header {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .drawer-title { color: var(--pp-ink) !important; }
html.dark-mode .drawer-meta { color: var(--pp-muted) !important; }
html.dark-mode .drawer-close { color: var(--pp-muted) !important; }
html.dark-mode .drawer-close:hover {
  background: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .drawer-section-title { color: var(--pp-muted) !important; }

/*  RSVP buttons in drawer  */
html.dark-mode .rsvp-btn {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .rsvp-row .child-name { color: var(--pp-ink) !important; }
html.dark-mode .att-chip.no-resp {
  background: var(--pp-surface-2) !important;
  color: var(--pp-muted) !important;
}

/*  Volunteer / audit in drawer  */
html.dark-mode .volunteer-role {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .vol-role-name { color: var(--pp-ink) !important; }
html.dark-mode .vol-slots { color: var(--pp-muted) !important; }
html.dark-mode .vol-progress { background: var(--pp-surface-2) !important; }
html.dark-mode .audit-entry {
  border-color: var(--pp-stroke) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .audit-entry strong { color: var(--pp-ink) !important; }

/*  Create/edit modal  */
html.dark-mode .modal-box {
  background: var(--pp-surface) !important;
}
html.dark-mode .modal-header {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .modal-header h3 { color: var(--pp-ink) !important; }
html.dark-mode .modal-footer {
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .form-group label { color: var(--pp-ink) !important; }
html.dark-mode .modal-box .form-control {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}

/*  Search input in topbar  */
html.dark-mode .cal-topbar .form-control {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .cal-topbar .form-control::placeholder { color: var(--pp-muted) !important; }

/*  Type filter select  */
html.dark-mode #typeFilter {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}

/*  Personal event badge  */
html.dark-mode .personal-badge {
  background: var(--pp-surface-2) !important;
  color: var(--pp-muted) !important;
}

/*  Divider lines in filters bar  */
html.dark-mode .cal-filters span[style*="background:#e5e7eb"] {
  background: var(--pp-stroke) !important;
}

/* ===============================================================
   DARK MODE  PARENT PORTAL
   Covers parent_dashboard.html, parent_children.html and other
   parent-facing pages that still carry hardcoded colours.
   =============================================================== */

/* Page wrappers */
html.dark-mode .children-page,
html.dark-mode .parent-portal-shell {
  background: var(--pp-bg) !important;
}

/* Section / event / stat cards */
html.dark-mode .section-card,
html.dark-mode .event-card,
html.dark-mode .stat-card {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .section-card .card-header,
html.dark-mode .event-card .card-header {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .section-card .card-body,
html.dark-mode .event-card .card-body,
html.dark-mode .stat-card .card-body {
  background: var(--pp-surface) !important;
  color: var(--pp-ink) !important;
}

/* Onboarding shell body */
html.dark-mode .onboarding-body {
  background: var(--pp-surface) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .onboarding-shell {
  box-shadow: 0 18px 45px rgba(0,0,0,0.45) !important;
}

/* Timeline steps */
html.dark-mode .timeline-step {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .timeline-step.completed {
  background: rgba(16,185,129,0.10) !important;
  border-color: rgba(16,185,129,0.3) !important;
}
html.dark-mode .timeline-step p,
html.dark-mode .timeline-step h4 {
  color: var(--pp-ink) !important;
}

/* Support cards */
html.dark-mode .support-card {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .support-card h5 { color: var(--pp-ink) !important; }
html.dark-mode .support-card p { color: var(--pp-muted) !important; }

/* Attendance rows */
html.dark-mode .attendance-row {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .attendance-row .child-name { color: var(--pp-ink) !important; }

/* Attendance pills  keep status colours, just adjust neutral */
html.dark-mode .attendance-pill.pending {
  background: rgba(100,116,139,0.18) !important;
  color: var(--pp-muted) !important;
}
html.dark-mode .attendance-link.secondary {
  background: var(--pp-surface-3) !important;
  color: var(--pp-muted) !important;
}

/* Footer links */
html.dark-mode .footer-link {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}
html.dark-mode .footer-link:hover {
  background: var(--pp-surface-3) !important;
}
html.dark-mode .footer-link.danger {
  background: rgba(185,28,28,0.12) !important;
  border-color: rgba(220,38,38,0.25) !important;
  color: #fca5a5 !important;
}
html.dark-mode .footer-links {
  border-color: var(--pp-stroke) !important;
}

/* Profile prompt */
html.dark-mode .profile-prompt {
  background: var(--pp-surface-2) !important;
  border-color: rgba(37,99,235,0.35) !important;
}

/* KPI tiles */
html.dark-mode .kpi-tile {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .kpi-tile .kpi-value { color: var(--pp-ink) !important; }
html.dark-mode .kpi-tile .kpi-label { color: var(--pp-muted) !important; }
html.dark-mode .kpi-tile .kpi-sub { color: var(--pp-muted) !important; }

/* Performance rows (children page) */
html.dark-mode .perf-row-parent {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}

/* Soft/recent boxes (children page) */
html.dark-mode .soft-box {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .recent-box {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}

/* Children page card headers */
html.dark-mode .children-page .card {
  background: var(--pp-surface) !important;
}
html.dark-mode .children-page .card-footer {
  background: var(--pp-surface) !important;
  border-color: var(--pp-stroke) !important;
}
html.dark-mode .children-page .card-header.bg-light {
  background: var(--pp-surface-2) !important;
  color: var(--pp-ink) !important;
}

/* Form inputs inside children page */
html.dark-mode .children-page input[type="text"],
html.dark-mode .children-page input[type="email"],
html.dark-mode .children-page input[type="tel"],
html.dark-mode .children-page input[type="number"],
html.dark-mode .children-page input[type="date"],
html.dark-mode .children-page select,
html.dark-mode .children-page textarea {
  background: var(--pp-surface-2) !important;
  border-color: var(--pp-stroke) !important;
  color: var(--pp-ink) !important;
}

/* Progress bars background */
html.dark-mode .children-page .progress {
  background: var(--pp-surface-3) !important;
}

/* Quick action buttons */
html.dark-mode .quick-action-btn {
  border-color: var(--pp-stroke) !important;
  background: var(--pp-surface) !important;
  color: var(--pp-ink) !important;
}

/* Champion row in league table */
html.dark-mode .table tbody tr.champion-row {
  background: linear-gradient(90deg, rgba(245,158,11,0.12), rgba(245,158,11,0.04)) !important;
}

/* Inline bg-white / bg-light fixes on parent portal cards */
html.dark-mode [style*="background: #fff"],
html.dark-mode [style*="background:#fff"],
html.dark-mode [style*="background: white"],
html.dark-mode [style*="background:white"] {
  background: var(--pp-surface) !important;
}
html.dark-mode [style*="background: #f8fafc"],
html.dark-mode [style*="background:#f8fafc"] {
  background: var(--pp-surface-2) !important;
}
html.dark-mode [style*="color: #0f172a"],
html.dark-mode [style*="color:#0f172a"],
html.dark-mode [style*="color: #1e293b"],
html.dark-mode [style*="color:#1e293b"] {
  color: var(--pp-ink) !important;
}
html.dark-mode [style*="color: #64748b"],
html.dark-mode [style*="color:#64748b"],
html.dark-mode [style*="color: #475569"],
html.dark-mode [style*="color:#475569"] {
  color: var(--pp-muted) !important;
}
html.dark-mode [style*="border-color: rgba(2,6,23"],
html.dark-mode [style*="border-color:rgba(2,6,23"],
html.dark-mode [style*="border: 1px solid rgba(2,6,23"],
html.dark-mode [style*="border:1px solid rgba(2,6,23"] {
  border-color: var(--pp-stroke) !important;
}

/* PP Header - always dark so no dark mode override needed */
html.dark-mode .pp-header {
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
html.dark-mode .pp-header-sub {
  color: rgba(255,255,255,0.6);
}
