/* TrainFit - Professional grey/black/white theme */
:root {
  --bg: #1a1a1a;
  --bg-card: #242424;
  --bg-hover: #2e2e2e;
  --accent: #737373;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --border: #3a3a3a;
  --success: #22c55e;
  --danger: #ef4444;
}

/* Light mode foundation — fixes hardcoded dark-theme colors across the app */
body.theme-light {
  --bg-hover: #e8e8e8;
  --text-muted: color-mix(in srgb, var(--text) 62%, transparent);
  --border: rgba(0, 0, 0, 0.12);
}

body.theme-light .topbar {
  background: color-mix(in srgb, var(--bg-card) 12%, #ffffff);
  border-bottom-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

body.theme-light .card,
body.theme-light .stat-card {
  background: color-mix(in srgb, var(--bg-card) 10%, #ffffff);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

body.theme-light .card h2,
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light p,
body.theme-light label,
body.theme-light th,
body.theme-light td,
body.theme-light .dashboard-title,
body.theme-light .stat-card .label,
body.theme-light .accounting-section h4 {
  color: var(--text);
}

body.theme-light th {
  color: var(--text-muted);
}

body.theme-light .form-group input,
body.theme-light .form-group select,
body.theme-light .form-group textarea {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1a1a1a;
}

body.theme-light .form-group input::placeholder,
body.theme-light .form-group textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .home-search-hero-inner {
  background: rgba(255, 255, 255, 0.96);
}

body.theme-light .home-search-hero-placeholder {
  color: rgba(0, 0, 0, 0.45);
}

body.theme-light .home-search-hero-kbd {
  color: #333;
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .quick-btn {
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .trainee-btn {
  background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
  color: var(--text);
}

body.theme-light .modal {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

body.theme-light .modal-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .accounting-total {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

body.theme-light .badge {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

body.theme-light .settings-tab:hover,
body.theme-light .settings-tab.active {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-light .settings-reset-form {
  background: rgba(239, 68, 68, 0.06);
}

body.theme-light .dropdown-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
}

body.theme-light .btn-outline {
  border-color: rgba(0, 0, 0, 0.18);
  color: var(--text);
}

body.theme-light .trainee-payments-table th,
body.theme-light .trainee-payments-table td,
body.theme-light .attendance-list-table th,
body.theme-light .attendance-list-table td,
body.theme-light .ranks-trainees-table th,
body.theme-light .ranks-trainees-table td,
body.theme-light .exams-table th,
body.theme-light .exams-table td {
  color: var(--text);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .trainee-trend-chart-container {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .trainee-trend-click-hint {
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .attendee-chip.chip-more {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
}

body.theme-light .week-day-card {
  background: color-mix(in srgb, var(--bg-card) 8%, #ffffff);
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .toolbar-actions .btn-sm {
  color: var(--text);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #111;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 500;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.topbar-banner {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 1.5rem 1.5rem 1.75rem;
  position: relative;
  overflow: visible;
}

.topbar-menu-float {
  position: absolute;
  top: 0.85rem;
  right: 1.25rem;
  z-index: 520;
}

.nav-dropdown {
  position: relative;
  z-index: 520;
}

.school-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem 0;
  z-index: 1;
  overflow: visible;
  width: 100%;
}

.school-banner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3.5rem 0 1.5rem;
}

.school-banner-row--no-logo {
  padding: 0 3rem;
}

.school-banner-text {
  flex: 1;
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.school-banner-logo-wrap {
  flex-shrink: 0;
  padding: 10px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--accent) 30%, transparent),
    0 4px 16px rgba(0, 0, 0, 0.25);
  animation: schoolLogoGlow 5s ease-in-out infinite;
}

.theme-light .school-banner-logo-wrap {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.1);
}

@keyframes schoolLogoGlow {
  0%, 70%, 100% {
    box-shadow:
      0 0 18px color-mix(in srgb, var(--accent) 35%, transparent),
      0 4px 14px rgba(0, 0, 0, 0.2);
    filter: brightness(1);
    transform: scale(1);
  }
  78%, 88% {
    box-shadow:
      0 0 12px #fff,
      0 0 28px color-mix(in srgb, var(--accent) 85%, transparent),
      0 0 56px color-mix(in srgb, var(--accent) 55%, transparent),
      0 6px 20px rgba(0, 0, 0, 0.25);
    filter: brightness(1.15);
    transform: scale(1.04);
  }
}

.school-banner-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 640px);
  height: 120px;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 70%);
  pointer-events: none;
  animation: bannerGlowPulse 5s ease-in-out infinite;
}

@keyframes bannerGlowPulse {
  0%, 70%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  80%, 88% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.school-banner-logo {
  display: block;
  height: clamp(72px, 10vw, 96px);
  width: clamp(72px, 10vw, 96px);
  object-fit: contain;
  border-radius: 12px;
  margin: 0;
}

.school-banner-title {
  font-size: clamp(2.1rem, 6vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 900px;
  text-wrap: balance;
}

.school-banner-line {
  width: min(200px, 40%);
  height: 3px;
  margin-top: 0.85rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: bannerLineGlow 5s ease-in-out infinite;
}

@keyframes bannerLineGlow {
  0%, 70%, 100% { opacity: 0.6; width: min(160px, 35%); }
  80%, 88% { opacity: 1; width: min(240px, 50%); }
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-brand img {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.topbar-brand h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.school-name-glow {
  color: #fff;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 24px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 48px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: schoolNameGlow 5s ease-in-out infinite;
}

.theme-light .school-name-glow {
  color: #111827;
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 24px color-mix(in srgb, var(--accent) 40%, transparent);
}

@keyframes schoolNameGlow {
  0%, 70%, 100% {
    text-shadow:
      0 0 18px color-mix(in srgb, var(--accent) 30%, transparent),
      0 0 36px color-mix(in srgb, var(--accent) 15%, transparent);
    filter: brightness(1);
    transform: scale(1);
  }
  78%, 88% {
    text-shadow:
      0 0 8px #fff,
      0 0 20px color-mix(in srgb, var(--accent) 90%, transparent),
      0 0 45px color-mix(in srgb, var(--accent) 75%, transparent),
      0 0 80px color-mix(in srgb, var(--accent) 50%, transparent),
      0 0 120px color-mix(in srgb, var(--accent) 30%, transparent);
    filter: brightness(1.2);
    transform: scale(1.02);
  }
}

.topbar-brand small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown { position: relative; }

.dropdown-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ── Management nav dropdown (hover) ── */
.nav-dropdown .menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-dropdown .menu-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.18) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theme-light .nav-dropdown .menu-trigger {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(0, 0, 0, 0.12);
}

.nav-dropdown:hover .menu-trigger,
.nav-dropdown:focus-within .menu-trigger {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--accent) 30%, transparent),
    0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.nav-dropdown:hover .menu-trigger::before,
.nav-dropdown:focus-within .menu-trigger::before {
  opacity: 1;
}

.menu-trigger-icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .menu-trigger-icon,
.nav-dropdown:focus-within .menu-trigger-icon {
  transform: scale(1.1);
}

.menu-trigger-chevron {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.nav-dropdown:hover .menu-trigger-chevron,
.nav-dropdown:focus-within .menu-trigger-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown .menu-panel {
  display: block;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  padding: 0.45rem;
  border-radius: 14px;
  background: rgba(20, 20, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.97);
  transform-origin: top right;
  transition:
    opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
    visibility 0.25s;
  pointer-events: none;
}

.theme-light .nav-dropdown .menu-panel {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.nav-dropdown .menu-panel::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown:hover .menu-panel,
.nav-dropdown:focus-within .menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nav-dropdown .menu-panel .menu-link,
.nav-dropdown .menu-panel .menu-divider {
  opacity: 0;
  transform: translateX(-12px);
}

.nav-dropdown:not(:hover):not(:focus-within) .menu-panel .menu-link,
.nav-dropdown:not(:hover):not(:focus-within) .menu-panel .menu-divider {
  animation: none;
}

.nav-dropdown:hover .menu-panel .menu-link,
.nav-dropdown:focus-within .menu-panel .menu-link,
.nav-dropdown:hover .menu-panel .menu-divider,
.nav-dropdown:focus-within .menu-panel .menu-divider {
  animation: menuItemIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.05s + var(--menu-stagger, 0) * 0.038s);
}

.nav-dropdown .menu-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-dropdown .menu-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.nav-dropdown .menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transform: translateX(4px) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 15%, transparent);
}

.nav-dropdown .menu-link:hover::before {
  opacity: 1;
}

.theme-light .nav-dropdown .menu-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-dropdown .menu-icon {
  font-size: 1rem;
  width: 1.35rem;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.nav-dropdown .menu-link:hover .menu-icon {
  transform: scale(1.15);
}

.nav-dropdown .menu-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.35rem 0.25rem;
  transform-origin: left center;
}

.nav-dropdown:hover .menu-panel .menu-divider,
.nav-dropdown:focus-within .menu-panel .menu-divider {
  animation-name: menuDividerIn;
}

@keyframes menuDividerIn {
  from {
    opacity: 0;
    transform: scaleX(0.35);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.theme-light .nav-dropdown .menu-divider {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.nav-dropdown .menu-link-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.15);
}

.theme-light .nav-dropdown .menu-link-logout:hover {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
}

/* Stagger menu items on open — delay driven by --menu-stagger on each row */

@keyframes menuItemIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
}

.dropdown-menu a:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

.nav-quick {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: #141414;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.quick-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.quick-btn:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.card.glass,
.stat-card.glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.theme-light .card.glass,
.theme-light .stat-card.glass {
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.glass-modal {
  background: rgba(30, 30, 36, 0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-light .glass-modal {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(0, 0, 0, 0.08);
}

.dashboard-title {
  margin-bottom: 0;
  font-size: 1.5rem;
  color: var(--text);
}

.dashboard-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.home-clock-wrap {
  text-align: right;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  min-width: 200px;
}

.home-clock {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 0 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.home-clock-date {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.2rem;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-refresh-btn {
  white-space: nowrap;
}

/* Home trainee search hero & cinematic control panel */
.home-search-hero {
  margin-bottom: 1.25rem;
  cursor: pointer;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 80%, #c9a227),
    color-mix(in srgb, var(--accent) 45%, #70542a)
  );
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.home-search-hero:hover,
.home-search-hero:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  outline: none;
}

.home-search-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(20, 20, 24, 0.92);
}

.home-search-hero-placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.home-search-hero-kbd {
  font-size: 0.72rem;
  opacity: 0.45;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .app-shell {
  filter: blur(2px);
  transform: scale(0.995);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.trainee-cinema-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2500;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  background: transparent;
  opacity: 0;
  transition: opacity 0.32s ease;
}

.trainee-cinema-overlay.open {
  display: flex;
  opacity: 1;
}

.trainee-cinema-overlay.is-closing {
  opacity: 0;
}

.trainee-cinema-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.82) 55%, rgba(0, 0, 0, 0.92) 100%),
    var(--cinema-bg, radial-gradient(ellipse at 30% 20%, #3d2e14 0%, #141414 45%, #050505 100%));
  background-size: cover;
  background-position: center top;
  filter: grayscale(0.35) contrast(1.08);
  transform: scale(1.03);
}

.trainee-cinema-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(112, 84, 42, 0.18) 0%, transparent 28%);
}

.trainee-cinema-stage {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 2rem));
  margin: auto;
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  cursor: default;
  animation: traineeCinemaIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.trainee-cinema-stage--search .trainee-cinema-topbar {
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.trainee-cinema-stage--dashboard {
  width: min(960px, calc(100% - 2rem));
  max-height: min(92vh, 900px);
}

.trainee-cinema-overlay.is-closing .trainee-cinema-stage {
  animation: traineeCinemaOut 0.3s ease forwards;
}

.trainee-cinema-topbar {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 72px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.35rem;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 92%, #8a6428) 0%,
    color-mix(in srgb, var(--accent) 72%, #5c3f18) 100%
  );
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.trainee-cinema-topbar--compact {
  min-height: 58px;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.trainee-cinema-topbar-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16) 0%, transparent 42%);
  pointer-events: none;
}

.trainee-cinema-logo {
  position: relative;
  z-index: 1;
  max-height: 56px;
  max-width: min(220px, 55vw);
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.trainee-cinema-topbar--compact .trainee-cinema-logo {
  max-height: 44px;
}

.trainee-cinema-school {
  position: relative;
  z-index: 1;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.trainee-cinema-heading {
  margin: 0 0 1rem;
  padding: 0 0.15rem;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.trainee-cinema-heading--inline {
  flex: 1;
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trainee-control-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #343434 0%, #2b2b2b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.trainee-control-card--dashboard {
  padding: 1rem;
  max-height: min(68vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.trainee-search-field {
  margin-bottom: 0.65rem;
}

.trainee-search-input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  border: 2px solid color-mix(in srgb, var(--accent) 75%, #c9a227);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.trainee-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.trainee-search-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 90%, #e8c547);
  background: rgba(0, 0, 0, 0.55);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.trainee-count-line {
  margin: 0 0 0.55rem;
  padding: 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.trainee-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 100px;
  max-height: min(46vh, 420px);
}

.trainee-picker-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.65rem;
  margin-bottom: 0.2rem;
  border-radius: 10px;
  cursor: pointer;
  opacity: 1;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  animation: traineeItemIn 0.35s ease both;
  animation-delay: var(--item-delay, 0s);
}

.trainee-picker-item:hover {
  background: rgba(112, 84, 42, 0.42);
  transform: translateX(3px);
}

.trainee-picker-item.is-active {
  background: linear-gradient(90deg, rgba(112, 84, 42, 0.62), rgba(112, 84, 42, 0.38));
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.trainee-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 55%, #70542a), #2a2114);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.trainee-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.trainee-item-info strong {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trainee-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.trainee-art-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.48rem;
  border-radius: 4px;
  color: #fff;
  background: color-mix(in srgb, var(--pill-color, #22c55e) 28%, rgba(0, 0, 0, 0.35));
  border: 1px solid color-mix(in srgb, var(--pill-border, #16a34a) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.trainee-art-pill-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.trainee-art-pill--boxing,
.trainee-art-pill--kickboxing {
  background: color-mix(in srgb, var(--pill-color, #eab308) 32%, rgba(0, 0, 0, 0.35));
}

.trainee-add-athlete-btn {
  display: block;
  margin-top: 0.9rem;
  width: 100%;
  padding: 0.82rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #24d366 0%, #1db954 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(29, 185, 84, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.trainee-add-athlete-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(29, 185, 84, 0.45);
  filter: brightness(1.05);
  color: #fff;
}

.trainee-cinema-dismiss {
  position: absolute;
  top: 0.35rem;
  right: 0;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.trainee-cinema-dismiss:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.04);
}

.trainee-cinema-dismiss--inline {
  position: static;
  flex-shrink: 0;
}

.trainee-dashboard-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.trainee-back-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.trainee-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.trainee-list-empty {
  padding: 1.75rem 0.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.trainee-dashboard-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.2rem;
}

.trainee-card--dark {
  padding: 1rem 1.05rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes traineeCinemaIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes traineeCinemaOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}

@keyframes traineeItemIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.trainee-profile-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 0.5rem 0.25rem 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trainee-avatar {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, #333), #1a1a1a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.trainee-name {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: #fff;
}

.trainee-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.82);
}

.trainee-art-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.trainee-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #fca5a5;
}

.trainee-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.trainee-card {
  padding: 1rem 1.1rem;
}

.trainee-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.trainee-card-head h3 {
  font-size: 0.95rem;
  margin: 0;
}

.trainee-rank-row {
  padding: 0.5rem 0;
}

.trainee-rank-art {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.trainee-rank-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.trainee-rank-since {
  font-size: 0.72rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trainee-billing-box {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.trainee-billing-amount {
  font-size: 1.35rem;
  font-weight: 700;
}

.trainee-billing-amount small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
}

.trainee-billing-meta {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.2rem;
}

.trainee-billing-status {
  margin-top: 0.5rem;
}

.trainee-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.trainee-stat-row:last-child {
  border-bottom: none;
}

.trainee-trend-wrap {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.trainee-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.trainee-trend-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.62);
}

.trainee-trend-tabs {
  padding: 0.15rem;
}

.trainee-trend-tabs .trend-tab {
  font-size: 0.68rem;
  padding: 0.32rem 0.55rem;
}

.trainee-trend-chart-container {
  margin-top: 0.35rem;
  padding: 0.5rem 0.45rem 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.trainee-trend-chart-container:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.2));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.trainee-trend-click-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.48);
  font-style: italic;
}

/* Centered foreground popup (month attendance) */
.trainee-foreground-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2700;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.trainee-foreground-overlay.open {
  display: flex;
  opacity: 1;
}

.trainee-foreground-overlay.is-closing {
  opacity: 0;
}

.trainee-foreground-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  padding: 1.25rem 1.1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #383838 0%, #2b2b2b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  cursor: default;
  animation: traineeCinemaIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.trainee-foreground-overlay.is-closing .trainee-foreground-panel {
  animation: traineeCinemaOut 0.28s ease forwards;
}

.trainee-foreground-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.trainee-foreground-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.trainee-foreground-title {
  margin: 0 2rem 0.35rem 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.trainee-foreground-meta {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.trainee-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.trainee-month-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 52px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
}

.trainee-month-day.is-attended {
  background: color-mix(in srgb, #22c55e 28%, rgba(0, 0, 0, 0.25));
  border-color: color-mix(in srgb, #22c55e 55%, transparent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.2);
}

.trainee-month-day.is-today {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, #c9a227);
}

.trainee-month-day.is-future {
  opacity: 0.35;
}

.trainee-month-weekday {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.trainee-month-num {
  font-size: 0.95rem;
  font-weight: 800;
}

.trainee-month-list-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.85rem;
}

.trainee-month-list-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.trainee-month-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
}

.trainee-month-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
}

.trainee-month-list li:last-child {
  border-bottom: none;
}

.unpaid-panel {
  width: min(560px, 100%);
}

.unpaid-count-line {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.unpaid-list-scroll {
  max-height: min(50vh, 380px);
  overflow-y: auto;
  margin-bottom: 0.85rem;
}

.unpaid-goto-btn {
  margin-top: 0;
}

.unpaid-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.unpaid-list-table th,
.unpaid-list-table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.unpaid-list-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.theme-light .unpaid-list-table th,
.theme-light .unpaid-list-table td {
  border-bottom-color: var(--border);
}

.trainee-trend-line {
  stroke: color-mix(in srgb, var(--accent) 70%, #22c55e);
}

.trainee-trend-area {
  fill: color-mix(in srgb, var(--accent) 55%, #22c55e);
  opacity: 0.18;
}

.trainee-trend-dot {
  fill: color-mix(in srgb, var(--accent) 65%, #4ade80);
}

.trainee-mini-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.85rem;
}

.trainee-mini-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.trainee-notes-card {
  margin-bottom: 1rem;
}

.trainee-notes-body {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.trainee-payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.trainee-payments-table th,
.trainee-payments-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.trainee-payments-table th:last-child,
.trainee-payments-table td:last-child {
  text-align: right;
}

@media (max-width: 900px) {
  .trainee-cards-grid {
    grid-template-columns: 1fr;
  }

  .trainee-cinema-stage,
  .trainee-cinema-stage--dashboard {
    width: calc(100% - 1rem);
  }

  .trainee-control-card--dashboard {
    max-height: 72vh;
  }

  .home-search-hero-kbd {
    display: none;
  }

  .trainee-cinema-heading--inline {
    font-size: 1rem;
  }
}

.week-attendance-card {
  margin-bottom: 1rem;
}

.week-attendance-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.week-range {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.week-click-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.week-attendance-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.week-day-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 130px;
  padding: 0.55rem 0.45rem;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  font-family: inherit;
}

.week-day-box.glass {
  background: color-mix(in srgb, var(--bg-card) 78%, rgba(255, 255, 255, 0.05));
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
}

.theme-light .week-day-box.glass {
  background: color-mix(in srgb, #ffffff 85%, var(--bg-card));
  border-color: rgba(0, 0, 0, 0.1);
}

.week-day-box:not(:disabled):hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent);
}

.week-day-box.is-today {
  outline: 2px solid color-mix(in srgb, #22c55e 55%, transparent);
  outline-offset: 2px;
}

.week-day-box.is-future {
  opacity: 0.4;
  cursor: not-allowed;
}

.week-day-box.is-empty:not(.is-future) {
  opacity: 0.65;
}

.week-day-name {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  align-self: center;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-light .week-day-name {
  color: #111827;
  background: rgba(255, 255, 255, 0.92);
  text-shadow: none;
  border-color: rgba(0, 0, 0, 0.12);
}

.week-day-num {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.25rem 0 0.1rem;
  color: color-mix(in srgb, var(--text) calc(var(--text-opacity, 100) * 1%), var(--text));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.theme-light .week-day-num {
  color: #111827;
  text-shadow: none;
}

.week-day-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 0.35rem;
}

.week-day-box.is-empty .week-day-count {
  color: var(--text-muted);
}

.week-day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* Attendance trend chart */
.trend-card {
  margin-bottom: 1rem;
}

.trend-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.trend-card-header h2 {
  margin-bottom: 0.15rem;
}

.trend-subtitle {
  font-size: 0.8rem;
  opacity: 0.65;
}

.trend-header-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  min-width: min(100%, 280px);
}

.attendance-athlete-search {
  position: relative;
}

.attendance-search-input {
  width: 100%;
  min-width: 220px;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
}

.theme-light .attendance-search-input {
  background: rgba(255, 255, 255, 0.85);
}

.attendance-search-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.attendance-search-input[readonly] {
  cursor: default;
  opacity: 0.92;
}

.attendance-search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.attendance-search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
}

.attendance-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.attendance-search-results li {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.attendance-search-results li:hover,
.attendance-search-results li:focus {
  background: rgba(255, 255, 255, 0.08);
}

.attendance-search-empty {
  cursor: default;
  color: var(--text-muted);
}

.attendance-search-empty:hover {
  background: transparent;
}

.trend-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-light .trend-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.trend-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.trend-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.trend-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-light .trend-tab.active {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.trend-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.75rem 0 0.5rem;
}

.trend-legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 80%, #93c5fd);
}

.trend-chart-container {
  position: relative;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.theme-light .trend-chart-container {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

.trend-chart {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
}

.trend-grid {
  stroke: color-mix(in srgb, var(--text) 14%, transparent);
  stroke-width: 1;
}

.trend-grid-v {
  stroke: color-mix(in srgb, var(--text) 7%, transparent);
  stroke-width: 1;
}

.trend-axis-y,
.trend-axis-x {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.trend-line {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 75%, #60a5fa);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-area {
  fill: var(--accent);
  opacity: 0.12;
}

.trend-dot {
  fill: color-mix(in srgb, var(--accent) 80%, #93c5fd);
  stroke: color-mix(in srgb, var(--bg) 55%, transparent);
  stroke-width: 2;
  pointer-events: none;
}

.trend-tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(30, 30, 36, 0.92);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-light .trend-tooltip {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.trend-tooltip strong {
  display: block;
  font-size: 0.7rem;
  opacity: 0.9;
  margin-bottom: 0.15rem;
}

@media (max-width: 600px) {
  .trend-card-header {
    flex-direction: column;
  }
  .trend-header-actions {
    width: 100%;
    min-width: 0;
  }
  .trend-tabs {
    width: 100%;
  }
  .trend-tab {
    flex: 1;
    text-align: center;
  }
}

.attendee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--chip-border, #16a34a) 55%, transparent);
  background: color-mix(in srgb, var(--chip-color, #22c55e) 35%, rgba(0,0,0,0.4));
  color: #fff;
  max-width: 100%;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.theme-light .attendee-chip {
  background: color-mix(in srgb, var(--chip-color, #22c55e) 32%, #fff);
  color: #111827;
  text-shadow: none;
}

.attendee-chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 3.5rem;
}

.attendee-chip.chip-more {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .topbar-banner {
    padding: 2.5rem 1rem 1.25rem;
  }
  .school-banner {
    padding: 0.25rem 0.5rem 0;
  }
  .school-banner-row {
    flex-direction: column;
    padding: 0 0.5rem;
    gap: 0.75rem;
  }
  .school-banner-logo-wrap {
    padding: 8px;
  }
  .school-banner-title {
    font-size: clamp(1.65rem, 7.5vw, 2.4rem);
  }
  .topbar-menu-float {
    top: 0.5rem;
    right: 0.5rem;
  }
}

@media (max-width: 900px) {
  .week-attendance-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 520px) {
  .week-attendance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-clock {
    font-size: 1.4rem;
  }
}

.stats-grid-home {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card-present {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-card-athletes .value {
  color: #f5f5f5 !important;
  text-shadow:
    0 0 22px color-mix(in srgb, var(--accent) 70%, #fff),
    0 0 40px color-mix(in srgb, var(--accent) 40%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.45);
}

.theme-light .stat-card-athletes .value {
  color: #111827 !important;
  text-shadow: 0 0 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.stat-card-athletes .label {
  color: var(--text);
  font-weight: 600;
}

.stat-card-present .value {
  color: #22c55e !important;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
}

.stat-card-present .label {
  color: var(--text);
  font-weight: 600;
}

.stat-action-btn {
  margin-top: 0.85rem;
  color: var(--text) !important;
  border-color: color-mix(in srgb, var(--text) 30%, transparent) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.stat-action-btn:hover {
  border-color: #22c55e !important;
  color: #22c55e !important;
  background: rgba(34, 197, 94, 0.1) !important;
}

.home-welcome {
  margin-top: 1rem;
  opacity: 0.85;
  color: var(--text);
}

.card-kiosk {
  text-align: center;
}

.btn-kiosk-open {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.85rem 1.75rem !important;
  font-size: 1rem;
  text-decoration: none !important;
  border-radius: 10px;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}

.attendance-list-table {
  width: 100%;
  border-collapse: collapse;
}

.attendance-list-table th,
.attendance-list-table td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.attendance-list-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--text) 95%, transparent);
}

.stat-card.glass .value {
  color: color-mix(in srgb, var(--text) calc(var(--text-opacity, 100) * 1%), var(--text));
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.stat-card.glass .label {
  color: var(--text);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  color-scheme: dark;
}

body:not(.theme-light) .form-group select option,
body:not(.theme-light) select option {
  background-color: #1a1a1a;
  color: #f5f5f5;
}

body.theme-light .form-group select,
body.theme-light select {
  color-scheme: light;
}

body.theme-light .form-group select option,
body.theme-light select option {
  background-color: #ffffff;
  color: #1a1a1a;
}

.form-group textarea { min-height: 80px; resize: vertical; }

/* Settings page */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.settings-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.settings-tab:hover,
.settings-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.theme-light .settings-tab {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(0, 0, 0, 0.08);
}

.settings-panel {
  display: none;
  margin-bottom: 1rem;
}

.settings-panel.active {
  display: block;
}

.settings-panel h2 {
  margin-bottom: 0.75rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.settings-grid .full {
  grid-column: 1 / -1;
}

.settings-muted {
  font-size: 0.82rem;
  opacity: 0.65;
  margin-bottom: 0.75rem;
}

.settings-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.settings-check-item,
.settings-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.settings-tag {
  font-size: 0.7rem;
  opacity: 0.5;
}

.settings-media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.settings-media-block {
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-preview-img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  margin: 0.5rem 0;
  border-radius: 8px;
}

.settings-preview-bg {
  max-width: 160px;
  max-height: 90px;
  object-fit: cover;
  opacity: 0.6;
  filter: grayscale(100%);
}

.settings-color-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.settings-color-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: end;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-opacity-group input[type="range"] {
  width: 100%;
  margin-top: 0.35rem;
  accent-color: var(--accent, #737373);
}

.settings-opacity-group span {
  font-weight: 700;
  color: var(--text);
}

.settings-theme-preview {
  margin: 1.25rem 0;
}

.settings-preview-shell {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.5rem;
}

.settings-preview-topbar {
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.settings-preview-body {
  padding: 1rem;
  min-height: 120px;
}

.settings-preview-body p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.settings-preview-btn {
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
  cursor: default;
}

.settings-preview-card {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.78rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .settings-color-row {
    grid-template-columns: 1fr;
  }
}

.custom-art-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}

.custom-art-add-row .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.custom-art-lookup {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lookup-meta {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.lookup-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.lookup-ranks li {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-arts-list {
  margin-top: 1.25rem;
}

.custom-arts-list ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.custom-arts-list li {
  padding: 0.35rem 0;
  font-size: 0.88rem;
}

.custom-art-status {
  margin-top: 0.75rem;
}

.settings-actions {
  margin: 1rem 0 1.5rem;
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--bg) 88%, transparent) 35%,
    color-mix(in srgb, var(--bg) 96%, transparent) 100%
  );
}

.settings-system-reset {
  margin-top: -0.5rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.settings-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.25rem 0;
}

.settings-reset-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.settings-reset-card {
  display: block;
  padding: 1rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-reset-card strong {
  display: block;
  margin-bottom: 0.35rem;
}

.settings-reset-card p {
  font-size: 0.8rem;
  opacity: 0.7;
}

.settings-reset-danger {
  border-color: color-mix(in srgb, #ef4444 35%, transparent);
}

.settings-reset-form {
  padding: 1rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid color-mix(in srgb, #ef4444 25%, transparent);
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Attendance buttons */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.rank-na {
  color: var(--text-muted);
  opacity: 0.5;
}

.rank-field-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rank-display-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.belt-swatch {
  display: inline-block;
  width: 2.5rem;
  height: 0.65rem;
  border-radius: 3px;
  border: 2px solid #737373;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.belt-picker {
  position: relative;
  min-width: 9rem;
}

.belt-picker-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
}

.belt-picker-toggle:hover {
  border-color: var(--accent);
}

.belt-picker-current {
  flex: 1;
  min-width: 0;
}

.belt-picker-chevron {
  opacity: 0.6;
  font-size: 0.75rem;
}

.belt-picker-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 100%;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.belt-picker.open .belt-picker-menu {
  display: block;
  z-index: 10050;
}

.belt-picker-menu--portaled.belt-picker-menu--open {
  display: block;
}

#athletesTable .cell-rank,
#athletesTable .athlete-edit-rank-field,
.athletes-table-wrap {
  overflow: visible;
}

#athletesTable .belt-picker.open {
  z-index: 10051;
}

.belt-picker-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
}

.belt-picker-option:hover,
.belt-picker-option--selected {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}

.belt-picker-label {
  white-space: nowrap;
}

.stripe-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stripe-field-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.stripe-input {
  width: 3.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
}

#addBeltGroup .belt-picker--form {
  width: 100%;
}

#addBeltGroup .belt-picker--form .belt-picker-toggle {
  width: 100%;
  min-height: 2.65rem;
  box-sizing: border-box;
}

#addStripesGroup input[type="number"] {
  width: 100%;
  min-height: 2.65rem;
  box-sizing: border-box;
}

#addBeltGroup.rank-disabled .belt-picker-toggle,
#addStripesGroup.rank-disabled input {
  opacity: 0.55;
  cursor: not-allowed;
}

#addRankGroup .rank-field-row--add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  gap: 1rem;
  align-items: end;
}

#addRankGroup .rank-field-row--add-form .belt-picker {
  min-width: 0;
  width: 100%;
}

#addRankGroup .rank-field-row--add-form .belt-picker-toggle {
  width: 100%;
  min-height: 2.65rem;
  box-sizing: border-box;
}

#addRankGroup .stripe-field--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#addRankGroup .stripe-field--stacked .stripe-input {
  width: 100%;
  min-height: 2.65rem;
  box-sizing: border-box;
}

#addRankGroup .rank-field-row:not(.rank-field-row--add-form) .belt-picker {
  width: 100%;
}

.athlete-add-card {
  position: relative;
  z-index: 20;
  overflow: visible;
}

.athletes-list-card {
  position: relative;
  z-index: 1;
}

#addBeltGroup .belt-picker.open,
#addBeltField .belt-picker.open,
#addRankGroup .belt-picker.open {
  position: relative;
  z-index: 10100;
}

#addBeltGroup .belt-picker.open .belt-picker-menu,
#addBeltField .belt-picker.open .belt-picker-menu,
#addRankGroup .belt-picker.open .belt-picker-menu {
  z-index: 10101;
}

.rank-field-row--add-form .stripe-field-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#athletesTable .rank-field-row {
  min-width: 11rem;
}

#athletesTable .belt-picker {
  min-width: 7.5rem;
}

.rank-select-swatch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-select-preview {
  flex-shrink: 0;
}

.rank-select-preview .belt-swatch {
  width: 2.25rem;
}

.settings-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.belt-picker-current--swatch-only {
  display: none;
}

.belt-picker-option .belt-swatch {
  width: 2.25rem;
}

.rank-disabled label,
.rank-disabled input {
  color: var(--text-muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.rank-disabled input {
  background: var(--bg-card);
  border-color: var(--border);
}

.trainee-btn {
  padding: 1rem 0.75rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: linear-gradient(145deg, var(--bg-card) 0%, #1a1a1a 100%);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.trainee-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.trainee-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(255,255,255,0.08), 0 0 20px rgba(255,255,255,0.05);
}

.trainee-btn:hover::before {
  opacity: 1;
}

.trainee-btn:active {
  transform: translateY(0) scale(0.98);
}

.trainee-btn.present {
  background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
  border-color: #4ade80;
  color: #fff;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.55), 0 4px 16px rgba(34, 197, 94, 0.3);
}

.trainee-btn.present:hover {
  box-shadow: 0 0 32px rgba(34, 197, 94, 0.7), 0 8px 24px rgba(34, 197, 94, 0.4);
  transform: translateY(-3px) scale(1.03);
}

.trainee-btn.present.has-checkin-warning-unpaid,
.trainee-btn.present.has-checkin-warning {
  background: linear-gradient(145deg, #ef4444 0%, #b91c1c 100%) !important;
  border-color: #f87171 !important;
  color: #fff !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.55), 0 4px 16px rgba(239, 68, 68, 0.3) !important;
}

.trainee-btn.present.has-checkin-warning-unpaid:hover,
.trainee-btn.present.has-checkin-warning:hover {
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.7), 0 8px 24px rgba(239, 68, 68, 0.4) !important;
}

.trainee-btn.present.has-checkin-warning-cert {
  background: linear-gradient(145deg, #eab308 0%, #ca8a04 100%) !important;
  border-color: #fde047 !important;
  color: #1a1a1a !important;
  box-shadow: 0 0 24px rgba(234, 179, 8, 0.55), 0 4px 16px rgba(234, 179, 8, 0.3) !important;
}

.trainee-btn.present.has-checkin-warning-cert:hover {
  box-shadow: 0 0 32px rgba(234, 179, 8, 0.7), 0 8px 24px rgba(234, 179, 8, 0.4) !important;
}

.attendance-mgmt-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.attendance-mgmt-toolbar .btn.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
}

.attendance-grid .trainee-btn[hidden],
.attendance-grid .trainee-btn.warnings-filter-hidden {
  display: none !important;
}

.trainee-btn .rank {
  font-size: 0.7rem;
  opacity: 0.8;
}

.attendance-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.attendance-toolbar label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.attendance-toolbar input,
.attendance-toolbar select {
  padding: 0.5rem;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

/* Setup wizard */
.setup-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.setup-header {
  text-align: center;
  margin-bottom: 2rem;
}

.setup-header h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }

.setup-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.setup-section h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #111;
  border-radius: 6px;
  font-size: 0.85rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.flash.success { background: #14532d; color: #bbf7d0; }
.flash.error { background: #7f1d1d; color: #fecaca; }

/* Page transitions (box in / box out) */
.page-stage {
  transform-origin: center top;
  will-change: transform, opacity, filter;
}

.page-stage.page-enter-active {
  animation: pageBoxIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-stage.page-exit-active {
  animation: pageBoxOut 0.34s cubic-bezier(0.55, 0, 0.9, 0.4) both;
}

body.page-is-leaving {
  overflow: hidden;
}

@keyframes pageBoxIn {
  from {
    opacity: 0;
    transform: perspective(900px) translateY(28px) scale(0.9) rotateX(4deg);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: perspective(900px) translateY(0) scale(1) rotateX(0);
    filter: blur(0);
  }
}

@keyframes pageBoxOut {
  from {
    opacity: 1;
    transform: perspective(900px) translateY(0) scale(1) rotateX(0);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: perspective(900px) translateY(-18px) scale(0.94) rotateX(-3deg);
    filter: blur(5px);
  }
}

.page-box-in-target.page-box-in-active {
  animation: pageBoxIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Login welcome splash */
.login-page {
  min-height: 100vh;
  background: color-mix(in srgb, var(--bg, #111) 92%, #000);
  color: var(--text, #f5f5f5);
  position: relative;
  overflow: hidden;
}

.login-welcome-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--accent, #c9a227) 22%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, #0a0a0c 0%, #121218 50%, #08080a 100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.login-welcome-splash.is-exiting {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.login-welcome-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
}

.login-welcome-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, #e8c547) 80%, #fff);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, #e8c547) 60%, transparent);
  left: calc(10% + (var(--p-i) * 7.5%));
  top: calc(20% + (var(--p-i) * 5%));
  animation: loginParticleFloat 3.2s ease-in-out infinite;
  animation-delay: calc(var(--p-i) * 0.18s);
  opacity: 0;
}

.login-welcome-speedlines {
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(
    105deg,
    transparent 0,
    transparent 40px,
    rgba(255, 255, 255, 0.02) 40px,
    rgba(255, 255, 255, 0.02) 42px
  );
  animation: loginSpeedlines 1.2s linear infinite;
  pointer-events: none;
  opacity: 0.35;
}

.login-welcome-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem;
  animation: loginWelcomeIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-welcome-logo-wrap {
  position: relative;
  display: inline-block;
  --welcome-logo-size: min(168px, 42vw);
  width: var(--welcome-logo-size);
  height: var(--welcome-logo-size);
  margin: 0 auto 1.5rem;
  animation: loginLogoPop 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.login-welcome-logo-circle {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14%;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, var(--accent, #e8c547) 55%, transparent);
  box-shadow:
    0 0 40px color-mix(in srgb, var(--accent, #e8c547) 25%, transparent),
    inset 0 0 24px rgba(0, 0, 0, 0.35);
  background: radial-gradient(
    circle at 50% 42%,
    color-mix(in srgb, var(--accent, #e8c547) 8%, rgba(255, 255, 255, 0.04)) 0%,
    rgba(8, 8, 12, 0.55) 72%
  );
  animation: loginRingPulse 2s ease-in-out infinite;
}

.login-welcome-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5));
}

.login-welcome-logo-ring {
  display: none;
}

.login-welcome-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
  animation: loginTextSlide 0.9s ease 0.35s both;
}

.login-welcome-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 30px color-mix(in srgb, var(--accent, #e8c547) 35%, transparent),
    0 4px 20px rgba(0, 0, 0, 0.6);
  animation: loginTitleReveal 1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.login-welcome-line {
  width: 0;
  height: 3px;
  margin: 1rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, #e8c547), transparent);
  animation: loginLineGrow 1.2s ease 0.9s forwards;
}

.login-form-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-container.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@keyframes loginWelcomeIn {
  from { opacity: 0; transform: translateY(40px) scale(0.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginLogoPop {
  0% { opacity: 0; transform: scale(0.2) rotate(-12deg); }
  60% { transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes loginRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes loginTextSlide {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 0.75; transform: translateX(0); }
}

@keyframes loginTitleReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.9); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes loginLineGrow {
  to { width: min(280px, 70vw); }
}

@keyframes loginParticleFloat {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  30% { opacity: 1; }
  70% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

@keyframes loginSpeedlines {
  from { transform: translateX(0); }
  to { transform: translateX(48px); }
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-card {
  background: color-mix(in srgb, var(--bg-card, #2b2b2b) 88%, rgba(0, 0, 0, 0.4));
  border: 1px solid color-mix(in srgb, var(--accent, #c9a227) 35%, var(--border, #333));
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-card p {
  text-align: center;
  color: var(--text-muted, rgba(255,255,255,0.6));
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-submit-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* Neutral login form (shown after welcome splash) */
.login-form-neutral-wrap {
  background: #e8e8e8;
  color: #1a1a1a;
}

.login-form-neutral-wrap.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.login-page-neutral {
  --bg: #f0f0f0;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #d4d4d4;
  background: #e8e8e8;
  color: #1a1a1a;
}

.login-page-neutral::before {
  display: none !important;
}

.login-card-neutral {
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}

.login-card-neutral h1 {
  color: #1a1a1a;
  font-size: 1.35rem;
  font-weight: 600;
}

.login-card-neutral p {
  color: #666666;
}

.login-trial-banner {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

.login-trial-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #ffffff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.login-trial-topbar--expired {
  background: linear-gradient(90deg, #991b1b, #dc2626);
}

.login-welcome-trial {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(147, 197, 253, 0.5);
  color: #dbeafe;
  font-size: 0.95rem;
  font-weight: 600;
}

.mgmt-trial-banner {
  background: linear-gradient(90deg, #1e3a5f, #2563eb);
  color: #eff6ff;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.gym-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  background: linear-gradient(90deg, #0b1f4d, #1d4ed8);
  color: #eff6ff;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.gym-welcome strong {
  flex-basis: 100%;
}

.gym-link-code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.95rem;
  word-break: break-all;
}

.gym-link-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gym-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.5rem;
}

.gym-welcome-close {
  margin-left: auto;
}

.login-card-neutral .form-group label {
  color: #444444;
  font-size: 0.85rem;
}

.login-neutral-input,
.login-card-neutral input {
  background: #fafafa;
  border: 1px solid #cccccc;
  color: #1a1a1a;
  border-radius: 6px;
}

.login-neutral-input:focus,
.login-card-neutral input:focus {
  border-color: #888888;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.btn-neutral {
  background: #333333;
  color: #ffffff;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-neutral:hover {
  background: #1a1a1a;
}

.login-reset-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.login-reset-toggle {
  background: none;
  border: none;
  color: #555555;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.login-reset-toggle:hover {
  color: #1a1a1a;
}

.login-reset-form {
  margin-top: 0.75rem;
}

.login-reset-hint {
  font-size: 0.8rem;
  margin: 0.35rem 0 0.75rem;
  color: #777777;
}

.login-forced-notice {
  color: #444444;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.login-neutral-link {
  color: #555555;
  text-decoration: underline;
  font-size: 0.9rem;
}

.login-neutral-link:hover {
  color: #1a1a1a;
}

.acct-bar-clickable {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.acct-bar-clickable:hover {
  opacity: 0.85;
}

.acct-month-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Attendance LAN page - lighter for tablets */
.attendance-lan {
  background: #f5f5f5;
  color: #111;
  min-height: 100vh;
}

.attendance-lan .topbar-lan {
  background: #111;
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attendance-lan .topbar-lan img { height: 48px; }

.attendance-lan .main-content { max-width: 1200px; }

.attendance-lan .attendance-toolbar {
  background: #fff;
  border-color: #ddd;
}

.attendance-lan .trainee-btn {
  background: linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
  border-color: rgba(255,255,255,0.2);
  color: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.attendance-kiosk .trainee-btn.kiosk-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.attendance-lan .trainee-btn:hover {
  border-color: color-mix(in srgb, var(--kiosk-accent, #22c55e) 50%, transparent);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2), 0 0 20px color-mix(in srgb, var(--kiosk-accent, #22c55e) 15%, transparent);
}

.attendance-lan .trainee-btn.present {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--bg-hover);
}

/* Athletes table actions */
.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover { background: #b91c1c; }

.btn-warning {
  background: #ca8a04;
  color: #fff;
}

.btn-info {
  background: #2563eb;
  color: #fff;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

tr.editing {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--accent);
}

tr.editing > td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  max-width: none;
  overflow: visible;
  white-space: normal;
}

tr.editing .athlete-edit-panel,
tr.editing .athlete-edit-rank-field,
tr.editing .belt-picker {
  overflow: visible;
}

#athletesTable tr.editing .belt-picker-menu {
  z-index: 120;
}

.athletes-list-card {
  overflow: hidden;
}

.athletes-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sub-search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.sub-search-card {
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--bg-card) 92%, var(--accent) 8%) 0%,
    color-mix(in srgb, var(--bg-card) 98%, transparent) 100%
  );
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.subscriptions-page .sub-toolbar .form-group > label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sub-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.sub-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent) !important;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-card) 84%, #ffffff 16%) 0%,
    color-mix(in srgb, var(--bg-card) 68%, transparent) 100%
  );
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 4px 0 color-mix(in srgb, var(--text) 8%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, filter 0.16s ease;
}

.sub-filter-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 5px 0 color-mix(in srgb, var(--accent) 18%, transparent),
    0 14px 28px rgba(0, 0, 0, 0.2);
}

.sub-filter-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 2px 0 color-mix(in srgb, var(--text) 10%, transparent),
    0 6px 14px rgba(0, 0, 0, 0.14);
}

.sub-filter-btn-unpaid.is-active {
  border-color: color-mix(in srgb, #f59e0b 75%, transparent) !important;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #1f1300;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 4px 0 #92400e,
    0 12px 24px rgba(245, 158, 11, 0.35);
}

.sub-filter-btn-search {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent) !important;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 95%, #ffffff 10%) 0%,
    color-mix(in srgb, var(--accent) 72%, #000000 8%) 100%
  );
  color: #fff;
  min-width: 7rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 4px 0 color-mix(in srgb, var(--accent) 55%, #000000 20%),
    0 12px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.sub-filter-btn-search:hover:not(:disabled) {
  filter: brightness(1.08);
}

.theme-light .sub-search-card {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.theme-light .sub-filter-btn {
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  box-shadow:
    0 1px 0 #ffffff inset,
    0 3px 0 #d1d5db,
    0 8px 18px rgba(15, 23, 42, 0.08);
}

.theme-light .sub-filter-btn-unpaid.is-active {
  color: #78350f;
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 3px 0 #d97706,
    0 10px 20px rgba(245, 158, 11, 0.25);
}

.theme-light .sub-filter-btn-search {
  color: #fff;
}

.sub-search-input {
  flex: 1 1 14rem;
}

.athletes-search-bar,
.sub-search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.athletes-search-bar input,
.sub-search-row input {
  min-width: 14rem;
}

.athletes-table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem 0.25rem;
}

#athletesTable {
  width: 100%;
  min-width: 0;
  table-layout: auto;
  border-collapse: collapse;
}

#athletesTable th,
#athletesTable td {
  padding: 0.45rem 0.4rem;
  vertical-align: middle;
}

#athletesTable th:not(.athletes-actions-col),
#athletesTable td:not(.athletes-actions-col) {
  white-space: nowrap;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

#athletesTable .cell-name {
  max-width: 10rem;
  white-space: normal;
}

#athletesTable .cell-barcode code {
  font-size: 0.78rem;
}

#athletesTable .athletes-actions-col {
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  white-space: normal;
  position: sticky;
  right: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  box-shadow: -6px 0 10px rgba(0, 0, 0, 0.18);
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.theme-light #athletesTable .athletes-actions-col {
  background: color-mix(in srgb, #ffffff 92%, transparent);
  box-shadow: -6px 0 10px rgba(0, 0, 0, 0.08);
}

#athletesTable thead .athletes-actions-col {
  z-index: 3;
}

#athletesTable .action-btns-compact {
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  min-width: 0;
}

#athletesTable .action-btns-compact .btn {
  padding: 0.2rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.15;
  min-height: 0;
}

#athletesTable .action-btns-compact .btn-accounting {
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
}

#athletesTable th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

#athletesTable .cell-name strong {
  white-space: normal;
}

.athlete-edit-panel {
  padding: 1rem 1.1rem 1.1rem;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.athlete-edit-panel-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.athlete-edit-panel-head strong {
  font-size: 1.05rem;
}

.athlete-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem 1rem;
}

.athlete-edit-grid .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.athlete-edit-grid .form-group input,
.athlete-edit-grid .form-group select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.athlete-edit-rank-group {
  grid-column: span 2;
}

.athlete-edit-rank-field .rank-field-row {
  width: 100%;
}

.athlete-edit-readonly .athlete-edit-readonly-value {
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--border);
}

.athlete-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.athlete-edit-subscription {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.athlete-edit-subscription-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.athlete-sub-package-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0;
}

.athlete-sub-package-tab {
  flex: 1 1 5.5rem;
  min-width: 5.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.25;
}

.athlete-sub-package-tab small {
  display: block;
  margin-top: 0.15rem;
  opacity: 0.85;
}

.athlete-sub-package-tab.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

.athlete-sub-selected-amount {
  margin: 0.35rem 0 0.65rem;
  font-size: 1.1rem;
}

.athlete-sub-pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.theme-light .athlete-edit-panel {
  background: color-mix(in srgb, #ffffff 90%, var(--bg-card));
}

.theme-light tr.editing {
  background: rgba(0, 0, 0, 0.03);
}

tr.editing td input,
tr.editing td select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  color-scheme: dark;
}

body:not(.theme-light) tr.editing td select option {
  background-color: #1a1a1a;
  color: #f5f5f5;
}

.theme-light tr.editing td input,
.theme-light tr.editing td select,
.theme-light .athlete-edit-grid .form-group input,
.theme-light .athlete-edit-grid .form-group select {
  background: #ffffff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}

.action-btns {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Modal — rendered outside .app-shell so it stacks above the banner */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  padding-top: var(--modal-top-offset, clamp(8rem, 20vh, 11.5rem));
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: min(85vh, calc(100vh - var(--modal-top-offset, clamp(8rem, 20vh, 11.5rem)) - 2rem));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.1rem; }

.modal-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.accounting-section {
  margin-bottom: 1.25rem;
}

.accounting-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.accounting-total {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.modal-wide {
  max-width: 900px;
}

.activities-table tbody tr.activity-row {
  cursor: pointer;
}

.activities-table tbody tr.activity-row:hover {
  background: rgba(255,255,255,0.04);
}

.activity-summary {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.activity-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.activity-summary-grid .hint {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.participants-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.mgmt-athlete-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 260px;
  max-width: min(100%, 480px);
}

.mgmt-athlete-search .attendance-search-input {
  flex: 1;
  min-width: 0;
}

.mgmt-athlete-search-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.exam-athlete-search-bar {
  margin-bottom: 1rem;
}

.exam-search-results {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.exam-add-athlete-search {
  margin-bottom: 0.75rem;
}

.participant-row.is-search-hit {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.exams-table tr.is-search-hit td {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.participant-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

.participant-row.is-active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.participant-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.participant-payment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payment-quick {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.payment-input input {
  max-width: 140px;
}

.remaining-display {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.badge-warning {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.badge-muted {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.badge-membership-basic {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.family-code-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cell-membership {
  min-width: 9rem;
}

.membership-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.membership-select {
  min-width: 6.5rem;
  font-size: 0.85rem;
}

.equipment-select {
  min-width: 9rem;
  max-width: 12rem;
  font-size: 0.8rem;
}

.athlete-edit-equipment .equipment-select {
  min-width: 100%;
  max-width: 100%;
}

.equip-toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 14rem;
}

.equip-toggle-list .equip-toggle-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  white-space: normal;
  text-align: left;
  line-height: 1.2;
}

.sub-equip-toggles {
  max-width: 11rem;
}

.sub-equip-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 11rem;
}

.sub-equip-cell .btn-sub-equip-pay.hidden {
  display: none;
}

.sub-member-cell {
  min-width: 14rem;
}

#subTableCard {
  position: relative;
  z-index: 2;
  margin-bottom: 1rem;
}

.sub-members-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.btn-sort-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)) !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 90%, var(--accent) 10%) 0%, var(--bg-card) 100%);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.btn-sort-name:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border)) !important;
}

.sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}

.sub-actions .sub-action-btn-equip {
  grid-column: 1 / -1;
}

.sub-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 2.35rem;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid transparent !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 3px 0 rgba(0, 0, 0, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.sub-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.sub-action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.sub-action-btn-edit {
  background: linear-gradient(180deg, color-mix(in srgb, #3b82f6 88%, #ffffff 12%) 0%, #2563eb 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 3px 0 #1d4ed8,
    0 8px 16px rgba(37, 99, 235, 0.28);
}

.sub-action-btn-renew {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #1a1a1a;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 3px 0 #b45309,
    0 8px 16px rgba(217, 119, 6, 0.28);
}

.sub-action-btn-renew-expired {
  border-color: color-mix(in srgb, #ef4444 55%, var(--border)) !important;
  background: color-mix(in srgb, #f59e0b 35%, var(--bg-card)) !important;
  color: #fef3c7 !important;
}

.sub-action-btn-void {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 3px 0 #991b1b,
    0 8px 16px rgba(220, 38, 38, 0.28);
}

.sub-action-btn-void:disabled,
.sub-action-btn-edit:disabled {
  opacity: 0.38;
  filter: grayscale(0.35);
  cursor: not-allowed;
  box-shadow: none;
}

.sub-action-btn-equip {
  width: 100%;
  margin-top: 0;
  min-height: 2.4rem;
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 3px 0 #047857,
    0 8px 16px rgba(5, 150, 105, 0.28);
}

.pay-equip-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.pay-equip-price-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pay-equip-price-label .exam-date-input {
  max-width: 8rem;
}

.sub-member-card .btn-sub-summary {
  width: 100%;
  max-width: none;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)) !important;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--bg-card) 88%, var(--accent) 12%) 0%,
    color-mix(in srgb, var(--bg-card) 96%, transparent) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 6px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.sub-member-card .btn-sub-summary:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border)) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 10px 22px rgba(0, 0, 0, 0.16);
}

.theme-light .sub-member-card .btn-sub-summary {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.theme-light .sub-action-btn-edit,
.theme-light .sub-action-btn-void,
.theme-light .sub-action-btn-equip {
  color: #fff;
}

.sub-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.sub-member-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--bg-card);
  min-width: 0;
  overflow: hidden;
}

.sub-card-equipment .sub-equip-cell {
  width: 100%;
}

.sub-card-equipment .equipment-select {
  width: 100%;
  max-width: none;
}

.sub-family-hint {
  margin: 0;
  font-size: 0.75rem;
}

.sub-member-card.sub-row-paid {
  border-color: color-mix(in srgb, #22c55e 55%, var(--border));
  background: color-mix(in srgb, #22c55e 12%, var(--bg-card));
  box-shadow: 0 0 0 1px color-mix(in srgb, #22c55e 20%, transparent);
}

.sub-member-card.sub-row-paid .btn-sub-summary {
  border-color: color-mix(in srgb, #22c55e 45%, var(--border));
  background: color-mix(in srgb, #22c55e 18%, var(--bg-card));
}

.sub-member-card.sub-row-paid .sub-summary-status {
  color: #16a34a;
  font-weight: 700;
}

.sub-member-card.sub-row-paid .sub-summary-days {
  color: color-mix(in srgb, #16a34a 85%, var(--text-muted));
}

.sub-member-card.sub-row-partial {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border));
  background: color-mix(in srgb, #f59e0b 10%, var(--bg-card));
}

.sub-member-card.sub-row-expired {
  border-color: color-mix(in srgb, #ef4444 55%, var(--border));
  background: color-mix(in srgb, #ef4444 12%, var(--bg-card));
  box-shadow: 0 0 0 1px color-mix(in srgb, #ef4444 20%, transparent);
}

.sub-member-card.sub-row-expired .btn-sub-summary,
.btn-sub-summary.btn-sub-summary-expired {
  border-color: color-mix(in srgb, #ef4444 45%, var(--border));
  background: color-mix(in srgb, #ef4444 18%, var(--bg-card));
}

.sub-member-card.sub-row-expired .sub-summary-days-expired,
.sub-summary-days.sub-summary-days-expired {
  color: #ef4444;
  font-weight: 700;
}

.sub-action-btn-edit-expired,
.sub-action-btn-equip-expired {
  border-color: color-mix(in srgb, #ef4444 55%, var(--border)) !important;
  background: color-mix(in srgb, #ef4444 22%, var(--bg-card)) !important;
  color: #fecaca !important;
}

.sub-action-btn-edit-expired:hover:not(:disabled),
.sub-action-btn-equip-expired:hover:not(:disabled) {
  background: color-mix(in srgb, #ef4444 35%, var(--bg-card)) !important;
}

.theme-light .sub-member-card.sub-row-expired .btn-sub-summary,
.theme-light .btn-sub-summary.btn-sub-summary-expired {
  color: #991b1b;
}

.theme-light .sub-action-btn-edit-expired,
.theme-light .sub-action-btn-equip-expired {
  color: #991b1b !important;
}

.sub-search-card .sub-search-field {
  flex: 1 1 100%;
  min-width: 14rem;
}

.personal-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.personal-form-span {
  grid-column: 1 / -1;
}

.personal-form-actions {
  grid-column: 1 / -1;
}

.personal-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.personal-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--bg-card);
}

.personal-row.is-paid {
  border-color: color-mix(in srgb, #22c55e 45%, var(--border));
  background: color-mix(in srgb, #22c55e 10%, var(--bg-card));
}

.personal-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.personal-row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sub-member-card.sub-row-family-muted {
  opacity: 0.7;
}

.sub-member-card.sub-row-family-kid-paid {
  opacity: 1;
  border-color: color-mix(in srgb, #3b82f6 55%, var(--border));
  background: color-mix(in srgb, #3b82f6 12%, var(--bg-card));
  box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 20%, transparent);
}

.sub-member-card.sub-row-family-kid-paid .btn-sub-summary,
.btn-sub-summary.btn-sub-summary-family-kid-paid {
  border-color: color-mix(in srgb, #3b82f6 45%, var(--border));
  background: color-mix(in srgb, #3b82f6 18%, var(--bg-card));
}

.sub-member-card.sub-row-family-muted .btn-sub-summary {
  opacity: 1;
}

.sub-member-card.sub-row-family-muted .sub-summary-line,
.sub-member-card.sub-row-family-muted .sub-summary-date {
  color: var(--text-muted);
}

.sub-member-card.sub-row-family-kid-paid .sub-summary-status,
.sub-member-card.sub-row-family-kid-paid .sub-summary-kid-badge {
  color: #3b82f6;
  font-weight: 700;
}

.theme-light .sub-member-card.sub-row-family-kid-paid .sub-summary-status,
.theme-light .sub-member-card.sub-row-family-kid-paid .sub-summary-kid-badge {
  color: #2563eb;
}

.pay-equip-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.pay-equip-list li {
  margin-bottom: 0.35rem;
}

.pay-modal-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
  flex-wrap: wrap;
}

.pay-modal-tab {
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: inherit;
  border-radius: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.pay-modal-tab.is-active {
  background: var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
  color: #fff;
}

.pay-equip-list {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.1rem;
}

.pay-equip-list li {
  margin-bottom: 0.25rem;
}

.acct-txn-row {
  cursor: pointer;
}

.acct-txn-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.acct-txn-detail {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
}

.acct-txn-detail dt {
  color: var(--text-muted, #9ca3af);
  margin: 0;
}

.acct-txn-detail dd {
  margin: 0;
}

.acct-linked-invoices {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.invoice-view-frame-wrap {
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: 0.5rem;
  overflow: hidden;
  min-height: 18rem;
  background: #fff;
}

.invoice-view-frame {
  width: 100%;
  min-height: 18rem;
  border: 0;
  background: #fff;
}

.family-modal-package-option {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.family-modal-members {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.5rem 0;
}

.family-member-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
}

.family-member-option.is-disabled {
  opacity: 0.45;
}

.family-member-option input {
  margin: 0;
}

.family-session-primary {
  margin-top: 0.75rem;
}

.family-session-row,
.family-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
}

.family-session-row-primary {
  background: rgba(196, 30, 58, 0.12);
  border: 1px solid rgba(196, 30, 58, 0.25);
}

.family-member-row.is-disabled {
  opacity: 0.45;
}

.family-session-ticks {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-tick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.session-tick input {
  margin: 0;
}

.sub-summary-amount {
  color: #fbbf24;
  font-weight: 600;
}

@media (max-width: 700px) {
  .participant-row {
    grid-template-columns: 1fr;
  }
}

/* Ranks page */
.ranks-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ranks-toolbar h2 {
  font-size: 1.5rem;
  margin: 0;
}

.ranks-report-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.report-art-select {
  min-width: 220px;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: #1c1c1c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23f5f5f5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  color: #f5f5f5;
  font-size: 0.95rem;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.report-art-select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, white);
  outline-offset: 2px;
}

.report-art-select option {
  background: #1c1c1c;
  color: #f5f5f5;
  font-weight: 500;
  padding: 0.5rem;
}

.theme-light .report-art-select {
  background-color: #ffffff;
  color: #111111;
  border-color: rgba(0, 0, 0, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23111' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

.theme-light .report-art-select option {
  background: #ffffff;
  color: #111111;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rank-art-card[hidden] {
  display: none !important;
}

.ranks-by-art {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rank-art-title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.ranks-table-wrap {
  overflow-x: auto;
}

.ranks-trainees-table {
  width: 100%;
  border-collapse: collapse;
}

.ranks-trainees-table th,
.ranks-trainees-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.ranks-trainees-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.rank-name-cell {
  width: 28%;
  min-width: 120px;
  white-space: nowrap;
}

.trainee-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.trainee-list li {
  font-size: 0.95rem;
}

.rank-unassigned-row .rank-name-cell {
  color: var(--text-muted);
}

.ranks-no-rank-art h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.report-card h3 {
  margin-bottom: 0.35rem;
}

.report-desc {
  margin-bottom: 1rem;
}

.report-toolbar {
  margin-bottom: 1.25rem;
}

.report-field-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.report-preview {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.report-preview-title {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.report-preview-table {
  margin-top: 0.25rem;
}

/* Exams page */
.exam-filters-card {
  margin-bottom: 1rem;
}

.exam-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }
}

.exam-list-header,
.exam-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.exam-list-header h3,
.exam-detail-header h3 {
  margin: 0;
}

.exam-list-header-actions,
.exam-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.exam-list-wrap {
  max-height: 70vh;
  overflow: auto;
}

.exam-list-row {
  cursor: pointer;
}

.exam-list-row:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.exam-list-row.is-selected {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.daily-digest-tab.is-active {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.daily-digest-panel {
  max-width: min(920px, 96vw);
  pointer-events: auto;
}

.daily-digest-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.daily-digest-tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
}

.daily-digest-tab-label {
  pointer-events: none;
}

.daily-digest-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  pointer-events: none;
}

.daily-digest-body {
  max-height: 50vh;
}

.daily-digest-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.exam-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
}

.exam-date-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: #1c1c1c;
  color: #f5f5f5;
  font-size: 0.95rem;
}

.theme-light .exam-date-input {
  background-color: #fff;
  color: #111;
  border-color: rgba(0, 0, 0, 0.2);
}

.exams-table {
  width: 100%;
  border-collapse: collapse;
}

.exams-table th,
.exams-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.exams-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.exam-fee-input {
  width: 100px;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.exam-paid-btn {
  min-width: 72px;
}

.exam-paid-btn.btn-paid,
.exam-paid-btn.btn-success {
  background: #22c55e !important;
  border-color: #16a34a !important;
  color: #fff !important;
}

.badge-expense {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Accounting page */
.acct-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.acct-toolbar h2 {
  font-size: 1.5rem;
  margin: 0;
}

.acct-year-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.acct-year-select label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.acct-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.acct-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
}

.acct-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.acct-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.acct-stat-income .acct-stat-value { color: #4ade80; }
.acct-stat-expense .acct-stat-value { color: #f87171; }
.acct-stat-net .acct-stat-value { color: #60a5fa; }
.acct-stat-loss .acct-stat-value { color: #f87171; }

.acct-stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.acct-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.acct-section-header .ui-section-title {
  margin: 0;
}

.acct-section-hint {
  margin: 0;
}

.acct-list-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.acct-list-search .exam-date-input {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.settings-exam-art-block {
  margin-top: 1rem;
}

.settings-exam-art-block h3 {
  margin-bottom: 0.5rem;
}

.settings-exam-price-input {
  width: 7rem;
  text-align: right;
}

.acct-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.acct-category-tables-row {
  align-items: start;
}

.acct-category-group-row td {
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.acct-month-category-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.acct-month-category-card {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.acct-month-category-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.acct-month-category-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.2rem 0;
  font-size: 0.9rem;
}

.acct-chart-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.acct-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.acct-legend-income { color: #4ade80; }
.acct-legend-expense { color: #f87171; }

.acct-bar-chart {
  width: 100%;
  height: auto;
  min-height: 200px;
}

.acct-pie-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.acct-pie {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acct-pie-hole {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 0.25rem;
}

.acct-pie-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.acct-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  flex: 1;
  min-width: 160px;
}

.acct-pie-legend li {
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.acct-pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.report-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.report-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}

.report-cat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.report-cat-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.report-cat-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.report-panels {
  position: relative;
}

.report-panel {
  display: none;
}

.report-panel.is-active {
  display: block;
}

.report-global-smtp {
  margin-top: 0.75rem;
}

.sub-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  white-space: nowrap;
}

.btn-sub-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  max-width: 14rem;
  padding: 0.65rem 0.8rem;
  text-align: left;
  line-height: 1.3;
  white-space: normal;
}

.sub-summary-line {
  font-size: 0.8rem;
}

.sub-summary-status {
  color: var(--text-muted);
}

.athletes-view-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.athletes-view-tab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.athletes-view-tab.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 99, 102, 241), 0.12);
}

.athletes-list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.athletes-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.athletes-count-title {
  margin: 0;
}

.equipment-select {
  min-width: 9rem;
  max-width: 12rem;
  font-size: 0.8rem;
}

.sub-row-paid {
  opacity: 0.85;
}

.sub-row-family-muted {
  opacity: 0.45;
}

.sub-row-family-muted td {
  color: var(--text-muted);
}

.sub-row-family-muted .btn,
.sub-row-family-muted input,
.sub-row-family-muted select {
  pointer-events: none;
}

.sub-pay-amount {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.75rem 0 1rem;
}

.sub-payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.sub-payment-methods .sub-pay-method.is-selected,
.sub-payment-methods .sub-pay-method.btn-primary {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.sub-pricing-hint p {
  margin: 0;
  line-height: 1.4;
}

.report-preview-html {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  color: var(--text);
}

.report-preview-html table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-preview-html th,
.report-preview-html td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.report-preview-html th {
  background: rgba(255, 255, 255, 0.06);
}

.report-mode-tabs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.report-smtp-hint {
  color: #f59e0b;
}

.acct-bottom-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.acct-print-sheet h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.acct-print-sheet ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

/* Accounting landscape report — screen preview on Reports page */
.report-preview-html .acct-report {
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 12px;
}

.report-preview-html .acct-report-panel,
.report-preview-html .acct-stat-card {
  background: #fff;
}

@media print {
  .acct-print-landscape {
    width: 100%;
  }

  .print-report-area .acct-print-landscape,
  .print-report-area .acct-print-landscape .acct-report {
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.exams-table .report-art-select {
  min-width: 160px;
  width: 100%;
}

/* Certificate print */
.cert-print-sheet {
  text-align: center;
  padding: 2rem 1.5rem;
  font-family: Georgia, 'Times New Roman', serif;
  color: #111;
}

.cert-print-logo {
  max-height: 90px;
  max-width: 200px;
  margin: 0 auto 1rem;
  display: block;
}

.cert-print-school {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
  letter-spacing: 0.02em;
}

.cert-print-subtitle {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #555;
  margin-bottom: 2rem;
}

.cert-print-body {
  margin: 2rem auto;
  max-width: 480px;
}

.cert-print-body p {
  margin: 0.35rem 0;
  font-size: 1rem;
}

.cert-print-name {
  font-size: 1.75rem;
  font-weight: bold;
  margin: 0.5rem 0 1rem !important;
}

.cert-print-rank {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
  margin: 0.5rem 0 1rem !important;
}

.cert-print-date {
  margin-top: 2rem;
  font-size: 0.95rem;
}

.cert-print-number {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

.cert-print-sign {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cert-print-address {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #666;
}

.cert-exam-table {
  margin-top: 1rem;
}

.print-report-area {
  display: none;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .print-report-area,
  .print-report-area * {
    visibility: visible !important;
  }

  .print-report-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 1.5rem;
    background: #fff !important;
    color: #111 !important;
  }

  .print-report-sheet h1 {
    font-size: 1.4rem;
    margin: 0 0 0.25rem;
  }

  .print-report-sheet h2 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    font-weight: 600;
  }

  .print-meta {
    margin-bottom: 1rem;
    font-size: 0.95rem;
  }

  .print-ranks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
  }

  .print-ranks-table th,
  .print-ranks-table td {
    border: 1px solid #ccc;
    padding: 0.5rem 0.65rem;
    text-align: left;
    vertical-align: top;
  }

  .print-ranks-table th {
    background: #f0f0f0;
  }
}

@media (max-width: 600px) {
  .attendance-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  .trainee-btn { min-height: 70px; font-size: 0.8rem; }
}

/* ── Attendance Kiosk (port 4001) ── */
.attendance-kiosk {
  min-height: 100vh;
  background: var(--kiosk-bg, #0f0f12);
  color: var(--kiosk-fg, #f5f5f5);
  position: relative;
  overflow-x: hidden;
}

.attendance-kiosk::before {
  content: '';
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) blur(2px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.kiosk-ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, color-mix(in srgb, var(--kiosk-accent, #22c55e) 25%, transparent), transparent),
    radial-gradient(ellipse 60% 40% at 90% 100%, color-mix(in srgb, var(--kiosk-accent, #22c55e) 15%, transparent), transparent);
  pointer-events: none;
  z-index: 0;
  animation: kioskAmbient 12s ease-in-out infinite alternate;
}

@keyframes kioskAmbient {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

.kiosk-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(20,20,28,0.92) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
}

.kiosk-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.kiosk-window-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kiosk-win-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--kiosk-fg, #f5f5f5) 22%, transparent);
  background: color-mix(in srgb, var(--kiosk-fg, #f5f5f5) 8%, transparent);
  color: color-mix(in srgb, var(--kiosk-fg, #f5f5f5) 92%, transparent);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.kiosk-win-btn:hover {
  background: color-mix(in srgb, var(--kiosk-accent, #22c55e) 18%, transparent);
  border-color: color-mix(in srgb, var(--kiosk-accent, #22c55e) 45%, transparent);
}

.kiosk-light .kiosk-win-btn {
  color: #111827;
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.kiosk-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kiosk-logo-wrap {
  padding: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--kiosk-accent, #22c55e), transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--kiosk-accent, #22c55e) 40%, transparent);
}

.kiosk-logo {
  height: 52px;
  width: 52px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.kiosk-school-name {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff 0%, color-mix(in srgb, var(--kiosk-accent, #22c55e) 30%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kiosk-subtitle {
  display: block;
  font-size: 0.8rem;
  opacity: 0.65;
  margin-top: 0.15rem;
}

.kiosk-live-date {
  font-size: 0.85rem;
  opacity: 0.75;
  text-align: right;
  max-width: 220px;
  line-height: 1.35;
}

.kiosk-main {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.kiosk-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.kiosk-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.kiosk-stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kiosk-stat-value.bump {
  transform: scale(1.2);
  color: var(--kiosk-accent, #22c55e);
}

.present-stat .kiosk-stat-value {
  color: color-mix(in srgb, var(--kiosk-fg, #f5f5f5) 85%, var(--kiosk-accent, #22c55e) 15%);
  text-shadow: 0 0 20px color-mix(in srgb, var(--kiosk-fg, #f5f5f5) 40%, transparent);
}

.kiosk-light .present-stat .kiosk-stat-value {
  color: color-mix(in srgb, var(--kiosk-fg, #111827) 90%, var(--kiosk-accent, #16a34a) 10%);
  text-shadow: none;
}

.kiosk-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-top: 0.25rem;
}

.kiosk-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}

.kiosk-date-pill {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kiosk-date-pill label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.kiosk-date-pill input {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.35);
  color: inherit;
  font-size: 0.95rem;
}

.kiosk-search-btn {
  margin-left: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.25);
  color: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.kiosk-search-btn:hover,
.kiosk-search-btn.active {
  border-color: color-mix(in srgb, var(--kiosk-accent, #22c55e) 55%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--kiosk-accent, #22c55e) 20%, transparent);
}

.kiosk-search-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
}

.kiosk-search-panel[hidden] {
  display: none !important;
}

.kiosk-search-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: inherit;
  font-size: 1.05rem;
}

.kiosk-search-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.kiosk-search-close {
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.trainee-btn.kiosk-search-hidden {
  display: none !important;
}

.kiosk-search-empty {
  margin: 1rem 0 0;
  text-align: center;
  color: color-mix(in srgb, var(--kiosk-fg, #f5f5f5) 72%, transparent);
  font-size: 1rem;
}

.kiosk-grid {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1rem;
}

.kiosk-card {
  min-height: 108px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: kioskCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes kioskCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.attendance-kiosk .kiosk-card:hover {
  border-color: color-mix(in srgb, var(--kiosk-accent, #22c55e) 45%, transparent);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,0.22), 0 0 24px color-mix(in srgb, var(--kiosk-accent, #22c55e) 18%, transparent);
}

.attendance-kiosk .kiosk-card.present {
  animation: kioskCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.kiosk-card.just-checked {
  animation: checkPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.kiosk-card.present {
  animation: presentPulse 2.5s ease-in-out infinite;
}

@keyframes presentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}

.present-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(4px);
  color: #111;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  animation: badgeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeIn {
  from { transform: scale(0) rotate(-90deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.trainee-name {
  font-size: 0.95rem;
  line-height: 1.2;
}

.attended-art {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.2);
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

.attended-art-icon {
  font-size: 0.85rem;
}

.default-art {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

.default-art-icon {
  font-size: 0.85rem;
}

.kiosk-card .tap-hint {
  font-size: 0.68rem;
  opacity: 0.55;
}

.kiosk-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  opacity: 0.55;
  font-size: 1rem;
}

/* Art picker modal */
.art-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.art-picker-overlay.open {
  opacity: 1;
  visibility: visible;
}

.art-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
}

.art-picker-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 1.75rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(30,30,38,0.98) 0%, rgba(18,18,24,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.05) inset;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.art-picker-overlay.open .art-picker-panel {
  transform: translateY(0) scale(1);
}

.art-picker-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 120px;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--kiosk-accent, #22c55e) 35%, transparent), transparent);
  pointer-events: none;
}

.art-picker-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.art-picker-athlete {
  text-align: center;
  font-size: 1.05rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.art-pick-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.art-pick-default:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.05);
}

.art-pick-default-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.art-pick-default-hint {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.art-picker-or {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

.art-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.art-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  color: #111827;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.art-pick-btn .art-pick-label {
  color: #111827;
  font-weight: 700;
}

.art-pick-btn.is-default {
  outline: 2px solid var(--kiosk-accent, #22c55e);
  outline-offset: 2px;
}

.art-pick-btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.art-pick-btn:active {
  transform: scale(0.97);
}

.art-pick-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.art-picker-cancel {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s, background 0.2s;
}

.art-picker-cancel:hover {
  opacity: 1;
  background: rgba(255,255,255,0.06);
}

@media (max-width: 600px) {
  .kiosk-header { flex-direction: column; align-items: flex-start; }
  .kiosk-live-date { text-align: left; max-width: none; }
  .kiosk-stats { justify-content: center; }
  .kiosk-date-pill { margin-left: 0; width: 100%; }
  .kiosk-search-btn { margin-left: 0; width: 100%; }
  .kiosk-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

.kiosk-light .kiosk-stats {
  background: rgba(255,255,255,0.75);
  border-color: rgba(0,0,0,0.08);
  color: #111;
}

.kiosk-light .kiosk-card {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.55);
  color: #111;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

.kiosk-light .kiosk-card:hover {
  background: rgba(255, 255, 255, 0.55);
}

.kiosk-light .kiosk-school-name {
  background: linear-gradient(90deg, #111 0%, var(--kiosk-accent, #22c55e) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kiosk-light .kiosk-date-pill input {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: #111;
}

.trainee-health-cert-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.trainee-health-cert-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.trainee-health-cert-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
}

.trainee-health-cert-input {
  width: 100%;
  max-width: 220px;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 2px solid color-mix(in srgb, var(--accent) 65%, #c9a227);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  pointer-events: auto;
}

.trainee-health-cert-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 90%, #e8c547);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.trainee-health-cert-feedback.is-success {
  color: #86efac;
}

.trainee-health-cert-feedback.is-error {
  color: #fca5a5;
  font-weight: 600;
}

.trainee-health-cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.trainee-barcode-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.trainee-barcode-code {
  display: inline-block;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
}

.trainee-barcode-qr-wrap {
  margin: 0.5rem 0;
}

.trainee-barcode-qr {
  width: 160px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem;
}

.member-card-preview {
  display: block;
  width: min(100%, 430px);
  margin: 0 auto 0.75rem;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.barcode-print-card {
  text-align: center;
}

.barcode-print-name {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.barcode-print-linear,
.barcode-print-qr {
  width: 220px;
  max-width: 100%;
  height: auto;
  background: #fff;
  padding: 0.35rem;
  border-radius: 8px;
}

.barcode-print-code {
  display: inline-block;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  margin: 0.75rem 0 0.35rem;
}

.cell-barcode {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.kiosk-scan-panel {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.12);
}

.kiosk-scan-label {
  display: block;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.kiosk-scan-input {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: inherit;
}

.kiosk-scan-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

.kiosk-scan-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.kiosk-welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(58vh, 520px);
  margin: 1rem auto 2rem;
  padding: 2.5rem 1.5rem;
  max-width: 640px;
  border-radius: 24px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}

.kiosk-welcome-logo-wrap {
  width: min(220px, 52vw);
  height: min(220px, 52vw);
  margin-bottom: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.kiosk-welcome-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.kiosk-welcome-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.kiosk-welcome-school {
  margin: 0 0 1.25rem;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  opacity: 0.88;
}

.kiosk-welcome-scan {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 600;
  line-height: 1.45;
  color: color-mix(in srgb, var(--kiosk-accent, #22c55e) 82%, var(--kiosk-fg, #f5f5f5));
}

.kiosk-light .kiosk-welcome-hero {
  background: rgba(255,255,255,0.78);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 20px 50px rgba(15,23,42,0.08);
}

.kiosk-light .kiosk-welcome-logo-wrap {
  background: rgba(255,255,255,0.9);
}

.kiosk-light .kiosk-welcome-scan {
  color: color-mix(in srgb, var(--kiosk-accent, #16a34a) 70%, #111827);
}

.kiosk-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}

.kiosk-gate-overlay[hidden] {
  display: none !important;
}

.kiosk-gate-panel {
  max-width: 420px;
  width: 100%;
  padding: 1.5rem;
  border-radius: 16px;
  background: #1a1a22;
  border: 1px solid rgba(239,68,68,0.45);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  text-align: center;
}

.kiosk-gate-panel h2 {
  margin: 0 0 0.75rem;
  color: #fca5a5;
  font-size: 1.25rem;
}

.kiosk-gate-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.kiosk-gate-message {
  margin: 0 0 1rem;
  opacity: 0.9;
  line-height: 1.45;
}

.kiosk-gate-close {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  background: var(--kiosk-accent, #22c55e);
  color: #111;
  font-weight: 600;
}

.kiosk-gate-overlay--ok {
  background: rgba(0,0,0,0.35);
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1001;
}

.kiosk-gate-panel--ok {
  border-color: rgba(34,197,94,0.5);
  background: rgba(20,30,24,0.95);
  max-width: 420px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.kiosk-gate-panel--ok .kiosk-gate-message {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #bbf7d0;
}

.kiosk-gate-overlay--warn {
  background: rgba(0,0,0,0.55);
  z-index: 1002;
}

.mgmt-checkin-warning-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}

.mgmt-checkin-warning-overlay.is-open {
  display: flex;
}

.mgmt-checkin-warning-panel {
  max-width: 460px;
  width: 100%;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(40,32,12,0.97);
  border: 1px solid rgba(234,179,8,0.55);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  text-align: center;
}

.mgmt-checkin-warning-panel h2 {
  margin: 0 0 0.75rem;
  color: #fde68a;
  font-size: 1.25rem;
}

.mgmt-checkin-warning-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.mgmt-checkin-warning-message {
  margin: 0 0 1.25rem;
  opacity: 0.95;
  line-height: 1.45;
  color: #fef3c7;
}

.mgmt-checkin-warning-close {
  min-width: 7rem;
}

.mgmt-checkin-warning-overlay.is-success .mgmt-checkin-warning-panel {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(12, 40, 28, 0.97);
}

.mgmt-checkin-warning-overlay.is-success .mgmt-checkin-warning-panel h2 {
  color: #86efac;
}

.mgmt-checkin-warning-overlay.is-success .mgmt-checkin-warning-message {
  color: #dcfce7;
}

.kiosk-gate-panel--warn {
  border-color: rgba(234,179,8,0.55);
  background: rgba(40,32,12,0.97);
  max-width: 460px;
}

.kiosk-gate-panel--warn h2 {
  color: #fde68a;
}

.kiosk-gate-panel--warn .kiosk-gate-message {
  color: #fef3c7;
}

.kiosk-scan-status {
  margin: 0.65rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.kiosk-scan-status[hidden] {
  display: none !important;
}

.kiosk-scan-status.is-ok {
  background: color-mix(in srgb, #22c55e 22%, transparent);
  border: 1px solid color-mix(in srgb, #22c55e 55%, transparent);
  color: #bbf7d0;
}

.kiosk-scan-status.is-error {
  background: color-mix(in srgb, #ef4444 22%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 55%, transparent);
  color: #fecaca;
}

.kiosk-scan-status.is-warn {
  background: color-mix(in srgb, #eab308 22%, transparent);
  border: 1px solid color-mix(in srgb, #eab308 55%, transparent);
  color: #fde68a;
}

.kiosk-light .kiosk-scan-status.is-ok {
  color: #166534;
}

.kiosk-light .kiosk-scan-status.is-error {
  color: #991b1b;
}

.kiosk-light .kiosk-scan-panel {
  background: rgba(255,255,255,0.65);
  border-color: rgba(0,0,0,0.08);
}

.kiosk-light .kiosk-scan-input {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: #111;
}

/* Equipment catalog page */
.equipment-page {
  max-width: 920px;
}

.equipment-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.equipment-page-lead {
  margin: 0.35rem 0 0;
  max-width: 52rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.equipment-catalog-card {
  padding: 0;
  overflow: hidden;
}

.equipment-catalog-head {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 180px) minmax(90px, 120px) minmax(88px, 110px);
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.theme-light .equipment-catalog-head {
  background: rgba(255, 255, 255, 0.35);
}

.equipment-catalog-body {
  max-height: min(62vh, 560px);
  overflow-y: auto;
}

.equipment-row {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 180px) minmax(90px, 120px) minmax(88px, 110px);
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.equipment-row:last-child {
  border-bottom: none;
}

.equipment-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.theme-light .equipment-row:hover {
  background: rgba(255, 255, 255, 0.55);
}

.low-stock-list {
  margin: 0.75rem 0 0;
}

.low-stock-line {
  margin: 0.35rem 0;
}

.low-stock-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.equipment-field {
  min-width: 0;
}

.equipment-input {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.equipment-input:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.equipment-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  background: rgba(255, 255, 255, 0.09);
}

.theme-light .equipment-input {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(0, 0, 0, 0.1);
  color: #111;
}

.theme-light .equipment-input:focus {
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 50%, #999);
}

.equipment-price-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.equipment-euro-prefix {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-left: 0.15rem;
}

.equipment-input-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.equipment-empty,
.equipment-loading {
  padding: 2rem 1.25rem;
  text-align: center;
}

.equipment-add-card {
  margin-top: 1rem;
}

.equipment-add-title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.equipment-add-form {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 200px);
  gap: 1rem 1.25rem;
  align-items: end;
}

.equipment-add-form .form-group {
  margin-bottom: 0;
}

.equipment-add-form .form-group input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.theme-light .equipment-add-form .form-group input {
  background: rgba(255, 255, 255, 0.82);
  color: #111;
}

.equipment-add-actions {
  grid-column: 1 / -1;
  padding-top: 0.25rem;
}

.equipment-catalog-head-actions {
  text-align: end;
}

.equipment-field-actions {
  display: flex;
  justify-content: flex-end;
}

#saveEquipmentBtn.equipment-save-ok {
  background: #22c55e !important;
  border-color: #16a34a !important;
}

@media (max-width: 640px) {
  .equipment-catalog-head,
  .equipment-row,
  .equipment-add-form {
    grid-template-columns: 1fr;
  }

  .equipment-catalog-head span:last-child {
    display: none;
  }

  .equipment-field-price::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
  }
}

/* =============================================================================
   Phase 1 — shared design system (headers, surfaces, tables, toasts)
   ============================================================================= */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.page-header-main {
  flex: 1 1 16rem;
  min-width: 0;
}

.page-title,
.page-header .dashboard-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-lead {
  margin: 0.4rem 0 0;
  max-width: 46rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ui-card {
  margin-bottom: 1rem;
}

.ui-card > h2,
.ui-card > h3,
.ui-section-title {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ui-surface .form-group input,
.ui-surface .form-group select,
.ui-surface .form-group textarea,
.ui-surface .exam-date-input,
.ui-surface .report-art-select {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ui-surface .form-group input:hover,
.ui-surface .form-group select:hover,
.ui-surface .form-group textarea:hover,
.ui-surface .exam-date-input:hover,
.ui-surface .report-art-select:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.ui-surface .form-group input:focus,
.ui-surface .form-group select:focus,
.ui-surface .form-group textarea:focus,
.ui-surface .exam-date-input:focus,
.ui-surface .report-art-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  background: rgba(255, 255, 255, 0.09);
}

.theme-light .ui-surface .form-group input,
.theme-light .ui-surface .form-group select,
.theme-light .ui-surface .form-group textarea,
.theme-light .ui-surface .exam-date-input,
.theme-light .ui-surface .report-art-select {
  background: rgba(255, 255, 255, 0.88);
  color: #111;
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .ui-surface .form-group input:focus,
.theme-light .ui-surface .form-group select:focus,
.theme-light .ui-surface .form-group textarea:focus,
.theme-light .ui-surface .exam-date-input:focus,
.theme-light .ui-surface .report-art-select:focus {
  background: #fff;
}

.data-table-wrap {
  overflow-x: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem 0.25rem;
}

.data-table,
table.exams-table,
table.unpaid-list-table,
#athletesTable {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td,
table.exams-table th,
table.exams-table td,
table.unpaid-list-table th,
table.unpaid-list-table td,
#athletesTable th,
#athletesTable td {
  padding: 0.7rem 0.75rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.data-table th,
table.exams-table th,
table.unpaid-list-table th,
#athletesTable th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.theme-light .data-table th,
.theme-light table.exams-table th,
.theme-light table.unpaid-list-table th,
.theme-light #athletesTable th {
  background: rgba(255, 255, 255, 0.45);
}

.data-table tbody tr:hover,
table.exams-table tbody tr:hover,
table.unpaid-list-table tbody tr:hover,
#athletesTable tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.theme-light .data-table tbody tr:hover,
.theme-light table.exams-table tbody tr:hover,
.theme-light table.unpaid-list-table tbody tr:hover,
.theme-light #athletesTable tbody tr:hover {
  background: rgba(255, 255, 255, 0.55);
}

.empty-state {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.empty-state-icon {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  opacity: 0.65;
}

.btn {
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 10rem;
}

.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: min(92vw, 360px);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: rgba(30, 30, 36, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(145deg, rgba(22, 101, 52, 0.95), rgba(21, 128, 61, 0.92));
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(145deg, rgba(127, 29, 29, 0.95), rgba(153, 27, 27, 0.92));
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.96), rgba(146, 64, 14, 0.94));
  color: #fff;
}

.toast-info {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(145deg, rgba(40, 40, 48, 0.96), rgba(55, 55, 65, 0.94));
}

.settings-page-header {
  margin-bottom: 1rem;
}

.settings-save-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.acct-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.acct-toolbar h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.acct-stat.card.glass {
  border-radius: 12px;
}

/* =============================================================================
   Phase 3 — dashboard polish
   ============================================================================= */

.dashboard-page-header {
  margin-bottom: 1.25rem;
}

.dashboard-greeting {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.home-search-hero {
  margin-bottom: 1.5rem;
}

.stats-grid-home {
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card.glass.dashboard-stat {
  border-radius: 14px;
  padding: 1.35rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card.glass.dashboard-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 80%, transparent), transparent);
  opacity: 0.7;
}

.stat-card-present.dashboard-stat::before {
  background: linear-gradient(90deg, #22c55e, transparent);
}

.stat-card.glass.dashboard-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.stat-card.glass.dashboard-stat .value {
  font-size: 2.35rem;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-info-card p {
  margin: 0.35rem 0;
  line-height: 1.5;
}

.dashboard-info-card h2 {
  margin-bottom: 0.65rem;
}

.card-kiosk.dashboard-kiosk-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-kiosk.dashboard-kiosk-card .btn-kiosk-open {
  margin-top: 0.25rem;
}

.week-attendance-card.dashboard-week-card {
  margin-bottom: 1.25rem;
}

/* Home: today's attendees without a paid subscription */
.home-unpaid-today-card {
  margin-bottom: 1.25rem;
  border: 1px solid rgba(239, 68, 68, 0.55);
  box-shadow: inset 4px 0 0 #ef4444;
}
.home-unpaid-today-card.is-clear {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: inset 4px 0 0 #22c55e;
}
.home-unpaid-today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.home-unpaid-today-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.home-unpaid-today-card.is-clear .home-unpaid-today-header h2 > span[aria-hidden] {
  display: none;
}
.home-unpaid-today-count {
  min-width: 1.75rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}
.home-unpaid-today-card.is-clear .home-unpaid-today-count {
  background: #16a34a;
}
.home-unpaid-today-hint {
  margin: 0.35rem 0 0.75rem;
}
.home-unpaid-today-none {
  margin: 0;
  font-weight: 600;
  color: #22c55e;
}
.home-unpaid-today-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.home-unpaid-today-list:empty {
  display: none;
}
.home-unpaid-today-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.14);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.home-unpaid-today-item:hover,
.home-unpaid-today-item:focus-visible {
  background: rgba(239, 68, 68, 0.28);
  outline: none;
}
.home-unpaid-today-amount {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.activities-table.data-table {
  width: 100%;
}

.report-card.ui-card {
  margin-bottom: 0;
}

.report-page-header {
  margin-bottom: 1rem;
}

.notif-status-badge {
  align-self: center;
}

.notif-setup-card {
  margin-bottom: 1rem;
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.08);
}

.theme-light .notif-setup-card {
  background: rgba(234, 179, 8, 0.12);
}

/* Home quick-ask AI bar */
.home-quick-ask-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
}

.home-quick-ask-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.35rem 1rem 0;
}

.home-quick-ask-examples-label {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-right: 0.25rem;
}

.home-quick-ask-bar {
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0));
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.home-quick-ask-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.home-quick-ask-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.home-quick-ask-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: inherit;
}

.home-quick-ask-modal {
  max-width: 640px;
  width: calc(100% - 2rem);
}

.home-quick-ask-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.home-quick-ask-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.home-quick-ask-amount {
  margin-left: auto;
  font-weight: 600;
}

.home-quick-ask-chip {
  display: inline-block;
  margin: 0.25rem 0.35rem 0 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
}

.home-quick-ask-voice.is-listening {
  animation: voice-pulse 1s ease-in-out infinite;
  border-color: #ef4444;
}

@keyframes voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.home-quick-ask-item--clickable {
  width: 100%;
  text-align: left;
  border: none;
  background: color-mix(in srgb, var(--bg-card) 60%, transparent);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.home-quick-ask-item--clickable:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.home-quick-ask-open-hint {
  width: 100%;
  font-size: 0.8rem;
  opacity: 0.7;
}

.home-quick-ask-suggestions-wrap {
  margin-top: 0.75rem;
}

.home-quick-ask-suggestions-label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 0.35rem;
}

.home-quick-ask-source {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #6366f1;
  color: #fff;
  margin-bottom: 0.5rem;
}

.assistant-layout {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  margin-bottom: 5rem;
}

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 280px;
}

.assistant-msg {
  max-width: 85%;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  line-height: 1.45;
}

.assistant-msg--user {
  margin-left: auto;
  background: color-mix(in srgb, #6366f1 25%, transparent);
}

.assistant-msg--assistant {
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
  border: 1px solid var(--border);
}

.assistant-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.assistant-compose textarea {
  flex: 1;
  resize: vertical;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
}

.assistant-notice {
  margin-bottom: 1rem;
  padding: 1rem;
}

.assistant-examples {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.assistant-example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.assistant-structured {
  margin-top: 0.65rem;
}

.assistant-result-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.assistant-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.assistant-result-item {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.assistant-result-item--clickable {
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.assistant-result-item--clickable:hover {
  background: color-mix(in srgb, #6366f1 15%, transparent);
}

.assistant-result-meta {
  opacity: 0.75;
  font-size: 0.85rem;
}

.assistant-suggestions {
  margin-top: 0.65rem;
}

.assistant-suggestions-label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 0.35rem;
}

.assistant-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.assistant-pending {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

body:has(.home-quick-ask-wrap) .main-content {
  padding-bottom: 7.5rem;
}

body.has-quick-ask-bar .app-main {
  padding-bottom: 4.5rem;
}

.athletes-list-card .athletes-table-wrap {
  max-height: min(70vh, 760px);
  overflow: auto;
}

.subscriptions-page .sub-members-grid {
  max-height: min(65vh, 720px);
  overflow: auto;
  padding-right: 0.25rem;
}

.list-pagination-host {
  margin-top: 0.75rem;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.list-pagination-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.list-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.list-pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.list-pagination-per-page {
  min-width: 4.5rem;
}

.settings-alerts-table th,
.settings-alerts-table td {
  vertical-align: middle;
}

.settings-alerts-table td .hint {
  margin-left: 0.35rem;
}

.athlete-details-body {
  max-height: min(70vh, 32rem);
  overflow-y: auto;
}

.athlete-details-section {
  margin-bottom: 1.25rem;
}

.athlete-details-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.athlete-details-dl {
  margin: 0;
  display: grid;
  gap: 0.35rem 1rem;
}

.athlete-details-row {
  display: grid;
  grid-template-columns: minmax(8rem, 38%) 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.athlete-details-row dt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.65));
}

.athlete-details-row dd {
  margin: 0;
  word-break: break-word;
}

.athlete-edit-details-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.athlete-edit-details-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

#dojoEditableContextMenu {
  position: fixed;
  z-index: 100000;
  min-width: 9rem;
  padding: 0.35rem 0;
  border-radius: 8px;
  border: 1px solid var(--border, #3a3a3a);
  background: var(--bg-card, #242424);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

#dojoEditableContextMenu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text, #f5f5f5);
  font: inherit;
  cursor: pointer;
}

#dojoEditableContextMenu button:hover {
  background: var(--bg-hover, #2e2e2e);
}


/* Phones: keep the gym name clear of the floating menu button. */
@media (max-width: 640px) {
  .school-banner { padding-top: 3.1rem; }
  .school-banner-title { font-size: clamp(1.5rem, 7vw, 2.2rem); }
}

/* Installed app (PWA): leave room for the phone's status bar / notch. */
html.pwa-standalone .topbar { padding-top: env(safe-area-inset-top); }
html.pwa-standalone .topbar-menu-float { top: calc(env(safe-area-inset-top) + 12px); }
html.pwa-standalone body { padding-bottom: env(safe-area-inset-bottom); }
