:root {
  --ink: #102033;
  --muted: #697a8e;
  --soft: #eef5f8;
  --panel: #ffffff;
  --line: #dce7ec;
  --aqua: #08a6c9;
  --aqua-strong: #007e9d;
  --coral: #ef6f61;
  --gold: #e3a82c;
  --green: #1f9d69;
  --navy: #14263b;
  --shadow: 0 18px 48px rgba(20, 38, 59, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: #f5f8fa;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.boot-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: white;
  background-image:
    linear-gradient(135deg, rgba(8, 22, 39, 0.88), rgba(0, 126, 157, 0.48)),
    url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center;
}

.boot-card {
  width: min(310px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  border-radius: 8px;
  background: rgba(7, 24, 39, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 26px 70px rgba(4, 19, 32, 0.35);
  backdrop-filter: blur(16px);
}

.boot-card img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  padding: 7px;
  border-radius: 8px;
  background: white;
}

.boot-card strong {
  font-size: 1.35rem;
}

.boot-card span {
  color: rgba(255, 255, 255, 0.76);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background-image:
    linear-gradient(135deg, rgba(6, 18, 34, 0.78), rgba(8, 85, 110, 0.45)),
    url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center;
}

.login-panel {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(4, 19, 32, 0.34);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--aqua-strong);
  border-radius: 8px;
}

.brand-icon.logo-icon {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px;
}

.brand-icon.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-card h2 {
  margin: 0 0 18px;
  font-size: 1.65rem;
}

.login-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.45;
}

.setup-card {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.setup-card .brand-mark {
  margin-bottom: 12px;
}

.setup-card h2 {
  margin-bottom: 8px;
}

.setup-card > p {
  margin-bottom: 14px;
}

.login-hero {
  display: none;
}

.hero-copy {
  max-width: 560px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 700;
  font-size: 0.86rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(8, 166, 201, 0.14);
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.error {
  color: #b42318;
  min-height: 20px;
  font-size: 0.9rem;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.logout-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  color: white;
  background: var(--aqua-strong);
  box-shadow: 0 12px 24px rgba(0, 126, 157, 0.2);
}

.secondary-btn {
  color: var(--ink);
  background: #e8f4f7;
  border: 1px solid #cae5ec;
}

.ghost-btn {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.danger-btn {
  color: white;
  background: #c43b32;
}

.logout-btn {
  width: 100%;
  color: white;
  background: #d6453d;
  box-shadow: 0 12px 24px rgba(214, 69, 61, 0.22);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.logout-btn:hover {
  transform: translateY(-1px);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.mobile-appbar {
  display: none;
}

.swimmer-shell {
  display: block;
  min-height: 100dvh;
}

.swimmer-shell .sidebar {
  display: none;
}

.swimmer-shell .mobile-appbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  color: white;
  background: rgba(16, 32, 51, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.swimmer-shell .mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.swimmer-shell .mobile-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 3px;
  border-radius: 8px;
  background: white;
}

.swimmer-shell .mobile-brand div {
  display: grid;
  gap: 2px;
}

.swimmer-shell .mobile-brand span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
}

.swimmer-shell .mobile-logout {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 8px;
  color: white;
  background: #c43b32;
  font-weight: 800;
}

.swimmer-shell .content {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100dvh - 70px);
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: #102033;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar .brand-subtitle,
.sidebar .muted {
  color: rgba(255, 255, 255, 0.65);
}

.nav {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
}

.nav button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 750;
}

.nav button.active,
.nav button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.session-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.messages-highlight .item-card > p,
.technical-card > p {
  white-space: pre-line;
}

.technical-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.technical-preview-grid .item-card {
  height: 100%;
}

.payment-report-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.payment-report-filter label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.payment-report-filter select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 0.82rem;
}

.attendance-priority {
  margin-top: 4px;
  border: 2px solid rgba(0, 126, 157, 0.22);
  box-shadow: 0 12px 30px rgba(16, 32, 51, 0.09);
}

/* ── Payment module ── */
.payment-summary {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.payment-stat {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 10px 6px;
  border-radius: 8px;
  background: #f4f8fa;
}
.payment-stat strong { display: block; font-size: 1.5rem; }
.payment-stat strong.green { color: #1f9d69; }
.payment-stat strong.coral { color: #ef6f61; }
.payment-stat strong.aqua { color: #007e9d; }
.payment-stat span { font-size: 0.72rem; color: #697a8e; text-transform: uppercase; letter-spacing: 0.04em; }

.payment-month-list { padding: 0 16px 14px; }
.payment-month-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.payment-month-row.paid { background: #eaf8f2; }
.payment-month-row.pending { background: #fff8ed; }
.payment-month-row strong { font-size: 0.82rem; }
.payment-month-row .hint { font-size: 0.7rem; }

.payment-swimmer-section { margin-top: 14px; }
.payment-swimmer-status {
  padding: 12px 16px;
  text-align: center;
}
.payment-swimmer-status.paid {
  background: #eaf8f2;
  border-radius: 0 0 8px 8px;
}
.payment-swimmer-status.pending {
  background: #fff8ed;
  border-radius: 0 0 8px 8px;
}

.attendance-main-btn {
  min-width: 210px;
}

.attendance-success {
  margin: 12px 0 0;
  padding: 11px 13px;
  border-left: 4px solid #25966f;
  background: #eaf8f2;
  color: #176c50;
  font-weight: 750;
}

.swimmer-dashboard {
  display: grid;
  gap: 18px;
  padding: 24px;
  padding-bottom: 104px;
}

.swimmer-hero {
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border-radius: 8px;
  color: white;
  background-image:
    linear-gradient(135deg, rgba(8, 22, 39, 0.84), rgba(0, 126, 157, 0.42)),
    url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 24px 58px rgba(16, 32, 51, 0.18);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--aqua-strong);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swimmer-hero .eyebrow {
  color: #aee8f2;
}

.swimmer-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.birthday-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fef6e0, #fdebc3);
  border: 1.5px solid #f5d68a;
  color: #7a5800;
  font-size: 0.9rem;
  animation: birthdayPulse 2s ease-in-out infinite;
}
.birthday-banner .birthday-icon {
  font-size: 2rem;
  line-height: 1;
}
.birthday-banner strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
  color: #5a3f00;
}
.birthday-banner p {
  margin: 0;
  font-size: 0.82rem;
  color: #8a6a20;
}
@keyframes birthdayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 214, 138, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(245, 214, 138, 0); }
}

@keyframes champAlertFadeIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.champ-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.champ-alert-modal {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  animation: champAlertFadeIn 0.35s ease;
}
.champ-alert-header {
  text-align: center;
  margin-bottom: 22px;
}
.champ-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e3a82c, #c48a1a);
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.champ-alert-header h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}
.champ-alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.champ-alert-item {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.champ-alert-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.champ-alert-item-top strong {
  font-size: 0.95rem;
}
.champ-alert-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.champ-alert-item .hint {
  margin-top: 6px;
  font-size: 0.8rem;
}
.champ-alert-close {
  width: 100%;
  justify-content: center;
}

.swimmer-edit-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 14px 16px;
  margin: 10px 14px;
  border-radius: 8px;
  background: #f4f8fa;
  border: 1px solid #dce7ec;
}
.swimmer-edit-summary .field-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.swimmer-edit-summary .field-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #697a8e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.swimmer-edit-summary .field-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #102033;
}

.swimmer-hero p {
  max-width: 720px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
}

.level-chip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 0.78rem;
  font-weight: 850;
}

.level-chip.green {
  background: rgba(31, 157, 105, 0.86);
}

.level-chip.coral {
  background: rgba(239, 111, 97, 0.9);
}

.attendance-focus {
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 126, 157, 0.16);
  box-shadow: 0 18px 44px rgba(16, 32, 51, 0.11);
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.45rem;
}

.section-title strong {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: #0b6580;
  background: #e6f7fa;
  font-size: 0.86rem;
}

.training-stack {
  display: grid;
  gap: 12px;
}

.attendance-training-card {
  border: 1px solid rgba(0, 126, 157, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfd 100%);
}

.attendance-training-card .actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.attendance-training-card .attendance-main-btn {
  min-height: 54px;
  font-size: 1rem;
}

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

.swimmer-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.swimmer-dashboard .insight-grid {
  margin-top: 0 !important;
}

.swimmer-dashboard .messages-highlight {
  margin-top: 0;
}

.swimmer-floating-menu {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(520px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 55px rgba(16, 32, 51, 0.34);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.swimmer-floating-menu button {
  min-height: 48px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 1px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-size: 0.58rem;
  font-weight: 850;
}

.swimmer-floating-menu button span {
  line-height: 1.1;
  white-space: nowrap;
}

.swimmer-floating-menu button.active {
  color: white;
  background: var(--aqua-strong);
}

.swimmer-floating-menu svg {
  width: 18px;
  height: 18px;
}

.swimmer-times-section {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.times-section-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(135deg, rgba(16, 32, 51, 0.94), rgba(0, 126, 157, 0.72)),
    url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center;
}

.times-section-hero .eyebrow {
  color: #aee8f2;
}

.times-section-hero h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1;
}

.times-section-hero p {
  max-width: 620px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 650;
}

.time-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.time-filter-row::-webkit-scrollbar {
  display: none;
}

.time-filter-chip {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  color: #526674;
  background: #edf5f8;
  border: 1px solid #dce7ec;
  font-size: 0.8rem;
  font-weight: 850;
}

.time-filter-chip.active {
  color: white;
  background: var(--aqua-strong);
  border-color: var(--aqua-strong);
}

.time-style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.time-style-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fcfd;
  border: 1px solid rgba(0, 126, 157, 0.14);
}

.time-style-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334957;
}

.time-style-top span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: white;
  background: var(--aqua-strong);
}

.time-style-top svg {
  width: 17px;
  height: 17px;
}

.time-style-card strong {
  overflow-wrap: anywhere;
}

.time-style-metric {
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 850;
}

.time-style-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.time-style-card dl {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
}

.time-style-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.time-style-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.time-style-card dd {
  margin: 0;
  font-weight: 850;
  text-align: right;
}

.times-chart-card {
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.times-style-chart {
  width: 100%;
  min-height: 210px;
  margin-top: 6px;
}

.times-style-chart .axis {
  fill: none;
  stroke: var(--muted);
  stroke-width: 3;
}

.times-style-chart polyline {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.times-style-chart circle {
  fill: #ffffff;
  stroke: var(--series-color);
  stroke-width: 3;
}

.times-style-chart text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.time-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.time-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #526674;
  font-size: 0.78rem;
  font-weight: 850;
}

.time-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--series-color);
}

.time-list-header {
  margin-bottom: 0;
}

.time-record-grid {
  display: grid;
  gap: 8px;
}

.time-record-head,
.time-record-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 110px 96px;
  align-items: center;
  gap: 12px;
}

.time-record-head {
  padding: 0 14px 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.time-record-row {
  padding: 13px 14px;
  border-radius: 8px;
  background: #f8fcfd;
  border: 1px solid rgba(220, 231, 236, 0.9);
}

.time-record-row strong,
.time-record-row small {
  display: block;
}

.time-record-row strong {
  overflow-wrap: anywhere;
}

.time-record-row span,
.time-record-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.time-record-row b {
  color: var(--ink);
  font-size: 1.05rem;
}

.time-record-row em,
.time-style-card dd.good,
.time-style-card dd.watch,
.time-style-card dd.neutral {
  font-style: normal;
}

.time-record-row em,
.time-style-card dd.good,
.time-style-card dd.watch,
.time-style-card dd.neutral {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.time-record-row em.good,
.time-style-card dd.good {
  color: #176c50;
  background: #eaf8f2;
}

.time-record-row em.watch,
.time-style-card dd.watch {
  color: #9a3b32;
  background: #fff0ee;
}

.time-record-row em.neutral,
.time-style-card dd.neutral {
  color: #526674;
  background: #edf5f8;
}

.app-toast {
  position: fixed;
  z-index: 1000;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(420px, calc(100% - 28px));
  padding: 14px 18px;
  border-radius: 8px;
  color: #ffffff;
  background: #176c50;
  box-shadow: 0 16px 40px rgba(16, 32, 51, 0.24);
  font-weight: 750;
  text-align: center;
  transform: translate(-50%, -18px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.session-card strong {
  display: block;
  margin-bottom: 4px;
}

.content {
  min-width: 0;
  padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at top right, rgba(8, 166, 201, 0.12), transparent 34%),
    linear-gradient(180deg, #f7fbfc 0%, #eef4f7 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.dashboard-hero {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.55fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 22px;
  padding: 28px;
  overflow: hidden;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(110deg, rgba(16, 32, 51, 0.94), rgba(0, 126, 157, 0.78)),
    url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.dashboard-hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.96;
}

.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.5;
}

.dashboard-hero-compact {
  min-height: 128px;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 20px 24px;
}

.dashboard-hero-compact .hero-metric {
  display: none;
}

.dashboard-hero-compact h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.05;
}

.hero-metric {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
}

.hero-metric span,
.hero-metric small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
}

.hero-metric strong {
  display: block;
  margin: 8px 0;
  font-size: 1.8rem;
}

.two-col {
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}

.three-col {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.panel,
.stat-card,
.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 32, 51, 0.06);
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.panel h2,
.panel h3 {
  margin: 0;
}

.stat-card {
  padding: 18px;
  min-height: 116px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(8, 166, 201, 0.12);
}

.stat-card span {
  color: var(--muted);
  font-weight: 750;
  font-size: 0.86rem;
}

.stat-card strong {
  font-size: 2.15rem;
  letter-spacing: 0;
}

.stat-card small {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 10px;
}

.item-card {
  padding: 14px;
  overflow: hidden;
}

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

.item-card h3,
.item-card h4 {
  margin: 0 0 6px;
}

.item-card p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--aqua-strong);
  background: #dff5fa;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge.coral {
  color: #a9342b;
  background: #fde5e2;
}

.badge.gold {
  color: #815b08;
  background: #fff1c9;
}

.badge.green {
  color: #0e6842;
  background: #dff7eb;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.compact-form {
  margin-bottom: 14px;
}

.compact-form .field {
  margin-bottom: 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.check-item input {
  width: 18px;
  height: 18px;
}

.check-item span {
  display: grid;
  gap: 2px;
  font-weight: 750;
}

.check-item small {
  color: var(--muted);
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search {
  max-width: 340px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.swimmer-mobile-list {
  display: none;
}

.swimmer-mobile-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 32, 51, 0.06);
}

.swimmer-mobile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.swimmer-mobile-heading > div {
  min-width: 0;
}

.swimmer-mobile-heading h3 {
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.swimmer-mobile-heading p {
  margin: 0;
  color: var(--muted);
}

.swimmer-code {
  color: var(--aqua-strong);
  font-size: 0.75rem;
  font-weight: 850;
}

.swimmer-mobile-data {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.swimmer-mobile-data > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 6px;
  background: #f3f7f9;
}

.swimmer-mobile-data dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.swimmer-mobile-data dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.mobile-record-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 8px;
}

.mobile-record-actions > * {
  width: 100%;
  min-width: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--aqua-strong);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--aqua-soft);
}

.icon-btn.danger {
  color: var(--coral);
}

.icon-btn.danger:hover {
  background: #fff0f0;
  border-color: var(--coral);
}

.swimmer-row-actions {
  display: flex;
  gap: 6px;
}

.swimmer-mobile-actions {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 10px;
  grid-template-columns: none;
}

.swimmer-mobile-actions > * {
  width: auto;
}

@media (prefers-color-scheme: dark) {
  .icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
  }
  .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.12);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: white;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f7fafb;
}

tr:last-child td {
  border-bottom: 0;
}

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

.actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.mobile-menu {
  display: none;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.file-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--aqua-strong);
  font-weight: 750;
  text-decoration: none;
}

.training-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  margin: -14px -14px 14px;
  width: calc(100% + 28px);
  border-bottom: 1px solid var(--line);
}

.training-notes {
  margin: 16px 0;
  padding: 14px;
  border-left: 4px solid var(--aqua-strong);
  border-radius: 0 6px 6px 0;
  background: #f3f8fa;
  color: var(--ink);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.world-events-page,
.world-event-detail {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.world-events-hero {
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  color: #fff;
  background-image: linear-gradient(rgba(4, 36, 52, 0.3), rgba(4, 36, 52, 0.82)), url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center 42%;
  border-radius: 8px 8px 0 0;
}

.world-events-hero span {
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.world-events-hero h1 {
  margin: 5px 0;
  font-size: 2.4rem;
  line-height: 1.05;
}

.world-events-hero p {
  max-width: 580px;
  margin: 0;
  line-height: 1.5;
}

.world-events-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.world-events-tabs > * {
  min-height: 56px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-weight: 800;
}

.world-events-tabs .active {
  color: var(--aqua-strong);
  box-shadow: inset 0 -4px var(--aqua-strong);
}

.world-admin-toolbar,
.world-event-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.world-admin-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.world-admin-toolbar span {
  color: var(--muted);
  font-size: 0.78rem;
}

.world-event-form {
  margin-top: 14px;
}

.world-event-filters {
  justify-content: flex-start;
}

.world-event-filters label {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--aqua-strong);
  border-radius: 8px;
  color: var(--aqua-strong);
  background: #fff;
}

.world-event-filters select {
  width: 100%;
  min-height: 46px;
  border: 0;
  color: var(--ink);
  background: transparent;
  outline: none;
  font-weight: 750;
}

.world-events-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.world-event-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.06);
}

.world-event-card.is-hidden {
  opacity: 0.62;
}

.world-event-date {
  min-height: 94px;
  display: grid;
  align-content: center;
  justify-items: center;
  border-right: 1px solid var(--line);
  text-transform: uppercase;
}

.world-event-date strong {
  color: var(--aqua-strong);
  font-size: 1.65rem;
}

.world-event-date span {
  color: var(--aqua-strong);
  font-weight: 850;
}

.world-event-date small,
.world-event-main small {
  color: var(--muted);
}

.world-event-main {
  min-width: 0;
}

.world-event-main h3 {
  margin: 8px 0;
  font-size: 1.22rem;
  overflow-wrap: anywhere;
}

.world-event-main p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--muted);
}

.world-event-main p svg {
  flex: 0 0 auto;
  color: var(--aqua-strong);
}

.world-event-course {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--aqua-strong);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.world-event-actions {
  display: grid;
  gap: 7px;
  min-width: 135px;
}

.world-events-list.compact .world-event-card {
  grid-template-columns: 90px minmax(0, 1fr) auto;
  padding: 15px;
}

.world-events-list.compact .world-event-date {
  min-height: 74px;
}

.world-events-source,
.world-event-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.world-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
}

.world-detail-title > span {
  color: var(--aqua-strong);
}

.world-detail-title h1 {
  margin: 0;
  font-size: 2rem;
}

.world-detail-photo {
  aspect-ratio: 16 / 6;
  border-radius: 8px;
  background-image: linear-gradient(rgba(7, 48, 66, 0.08), rgba(7, 48, 66, 0.25)), url("assets/login-swimmer.png");
  background-size: cover;
  background-position: center 45%;
}

.world-detail-data {
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.world-detail-data > div {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1.3fr;
  gap: 18px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}

.world-detail-data dt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.world-detail-data dt svg {
  color: var(--aqua-strong);
}

.world-detail-data dd {
  margin: 0;
}

.world-event-notes {
  padding: 14px;
  border-left: 4px solid var(--aqua-strong);
  background: var(--soft);
  white-space: pre-wrap;
}

.watch-panel {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--aqua);
  border-radius: 8px;
  background: #f5fbfc;
}

.watch-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--aqua-strong);
}

.watch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calendar-cta {
  width: 100%;
  color: #fff;
  background: var(--coral);
  text-decoration: none;
}

.world-back {
  margin: 4px 0 12px;
}

.attendance-chart {
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(12, minmax(38px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px 4px 2px;
}

.insight-grid .full-span {
  grid-column: 1 / -1;
}

.timer-display {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--ink);
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.timer-workspace {
  display: grid;
  gap: 16px;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f8fa;
}

.view-tabs button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.view-tabs button.active {
  color: #fff;
  background: var(--aqua-strong);
  box-shadow: 0 8px 18px rgba(0, 126, 157, 0.18);
}

.time-tab-panel {
  display: none;
}

.time-tab-panel.active {
  display: block;
}

/* ============================================================
   CHAMPIONSHIP TABS
   ============================================================ */
.championship-panel {
  display: grid;
  gap: 18px;
}

.championship-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.championship-tab-panel {
  display: none;
}

.championship-tab-panel.active {
  display: block;
}

.championship-my-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.registration-event-list {
  display: grid;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.registration-event-list h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.registration-event-row {
  display: grid;
  grid-template-columns: auto 1fr 120px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.registration-event-row .check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / 3;
  cursor: pointer;
}

.registration-event-row .check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.registration-event-row .check-item div strong {
  display: block;
  font-size: 0.95rem;
}

.registration-event-row .check-item div small {
  color: var(--muted);
  font-size: 0.8rem;
}

.time-input {
  font-family: monospace;
  text-align: center;
  font-size: 0.95rem;
  padding: 6px 8px;
  min-width: 100px;
  grid-column: 3;
}

@media (max-width: 640px) {
  .championship-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .registration-event-row {
    grid-template-columns: auto 1fr;
  }
  .registration-event-row .check-item {
    grid-column: 1 / 3;
  }
  .registration-event-row .time-input {
    grid-column: 1 / 3;
  }
}

@media (prefers-color-scheme: dark) {
  .registration-event-row {
    background: rgba(255, 255, 255, 0.03);
  }
}

.lane-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.lane-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.lane-card span,
.lane-card .lane-result {
  color: var(--muted);
}

.mini-bars {
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding: 12px 8px 0;
}

.mini-bar {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.mini-bar-track {
  width: min(58px, 100%);
  height: 125px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf3f6;
}

.mini-bar-track span {
  width: 100%;
  min-height: 4px;
  display: block;
  border-radius: 8px 8px 0 0;
}

.mini-bar-track .green {
  background: var(--green);
}

.mini-bar-track .coral {
  background: var(--coral);
}

.mini-bar-track .gold {
  background: var(--gold);
}

.mini-bar small {
  color: var(--muted);
}

.inline-tool {
  width: fit-content;
  margin-top: 8px;
}

.chart-month {
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.chart-bar-track {
  width: 100%;
  max-width: 34px;
  height: 150px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background: #edf3f6;
  border: 1px solid var(--line);
}

.chart-bar {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, var(--aqua), var(--green));
  border-radius: 8px 8px 0 0;
}

.chart-month strong {
  font-size: 0.78rem;
}

.chart-month span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: capitalize;
}

@media (max-width: 980px) {
  .login-page,
  .app-shell,
  .two-col,
  .dashboard-grid,
  .three-col,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 42vh;
    order: -1;
  }

  .sidebar {
    position: static;
    height: auto;
    padding-bottom: 14px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .nav button {
    min-width: max-content;
    scroll-snap-align: start;
  }

  .attendance-chart {
    overflow-x: auto;
    grid-template-columns: repeat(12, 46px);
  }
}

@media (max-width: 640px) {
  .login-hero,
  .content,
  .sidebar {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }

  .content {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .login-card {
    padding: 22px;
  }

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

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

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

  .stat-card strong {
    font-size: 1.9rem;
  }

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

  .actions > * {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 760px) {
  body {
    background: #eef4f7;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .mobile-appbar {
    position: sticky;
    z-index: 40;
    top: 0;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(9px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left));
    color: white;
    background: rgba(16, 32, 51, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
  }

  .mobile-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-brand img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    padding: 3px;
    border-radius: 8px;
    background: white;
  }

  .mobile-brand div {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .mobile-brand strong {
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-brand span {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.76rem;
  }

  .mobile-logout {
    min-width: 62px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    color: white;
    background: #c43b32;
    font-size: 0.82rem;
    font-weight: 800;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    width: 100%;
    height: auto;
    display: block;
    padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(16, 32, 51, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -12px 32px rgba(16, 32, 51, 0.2);
    backdrop-filter: blur(18px);
  }

  .sidebar > .brand-mark,
  .sidebar > .session-card,
  .sidebar > .logout-btn {
    display: none;
  }

  .nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    width: auto;
    min-width: 78px;
    min-height: 56px;
    flex: 1 0 78px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 7px;
    text-align: center;
    scroll-snap-align: center;
  }

  .nav button svg {
    width: 20px;
    height: 20px;
  }

  .nav button span {
    max-width: 100%;
    font-size: 0.68rem;
    line-height: 1.05;
    white-space: normal;
  }

  .coach-shell .nav {
    overflow-x: auto;
  }

  .coach-shell .nav button {
    min-width: 76px;
    flex: 0 0 76px;
    padding-inline: 5px;
  }

  .coach-shell .nav button span {
    font-size: 0.65rem;
    overflow-wrap: anywhere;
  }

  .swimmer-shell .nav button {
    max-width: none;
    flex-basis: 100%;
  }

  .content {
    min-height: calc(100dvh - 66px);
    padding: 16px max(14px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: linear-gradient(180deg, #f7fbfc 0%, #eef4f7 100%);
  }

  .swimmer-shell .content {
    padding: 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .swimmer-dashboard {
    gap: 14px;
    padding: 14px max(14px, env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .swimmer-hero {
    min-height: 190px;
    align-items: flex-end;
    padding: 20px;
    flex-direction: column;
    justify-content: flex-end;
    background-position: center top;
  }

  .swimmer-hero h1 {
    font-size: 2rem;
  }

  .swimmer-hero p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .level-chip {
    align-self: flex-start;
    order: -1;
  }

  .attendance-focus {
    padding: 14px;
  }

  .section-title {
    display: grid;
    gap: 8px;
  }

  .section-title h2 {
    font-size: 1.28rem;
  }

  .section-title strong {
    width: max-content;
    font-size: 0.8rem;
  }

  .attendance-training-card .actions {
    grid-template-columns: 1fr;
  }

  .attendance-training-card .attendance-main-btn {
    min-height: 58px;
    font-size: 1.02rem;
  }

  .swimmer-kpis,
  .swimmer-section-grid {
    grid-template-columns: 1fr;
  }

  .swimmer-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .swimmer-floating-menu {
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(420px, calc(100% - 16px));
    gap: 3px;
    padding: 5px;
  }

  .swimmer-floating-menu button {
    min-height: 44px;
    gap: 2px;
    font-size: 0.58rem;
  }

  .swimmer-floating-menu svg {
    width: 16px;
    height: 17px;
  }

  .times-section-hero {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  .times-section-hero h2 {
    font-size: 2rem;
  }

  .time-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .time-style-card {
    padding: 13px;
  }

  .time-style-metric {
    font-size: 1.85rem;
  }

  .times-chart-card {
    padding: 12px;
  }

  .times-style-chart {
    min-height: 190px;
  }

  .time-record-head {
    display: none;
  }

  .time-record-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .time-record-row b,
  .time-record-row em {
    justify-self: start;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: 1.55rem;
    line-height: 1.12;
  }

  .topbar p {
    margin-top: 5px;
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar > * {
    width: 100%;
  }

  .dashboard-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
    padding: 20px;
  }

  .dashboard-hero h1 {
    font-size: 2rem;
    line-height: 1.05;
  }

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

  .grid,
  .two-col,
  .three-col,
  .insight-grid {
    gap: 12px;
  }

  .two-col,
  .three-col,
  .insight-grid,
  .technical-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    min-width: 0;
    padding: 14px;
  }

  .swimmer-desktop-list {
    display: none;
  }

  .swimmer-mobile-list {
    display: grid;
    gap: 12px;
  }

  .panel-header {
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 13px;
  }

  .panel h2 {
    font-size: 1.08rem;
    line-height: 1.25;
  }

  .stat-card {
    min-height: 102px;
    padding: 14px;
  }

  .stat-card strong {
    font-size: 1.65rem;
  }

  .stat-card span,
  .stat-card small {
    font-size: 0.75rem;
    line-height: 1.25;
  }

  .item-card {
    padding: 13px;
  }

  .item-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .item-top > div:first-child {
    min-width: 0;
    flex: 1 1 220px;
  }

  .item-card h3,
  .item-card h4 {
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .item-card p {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
  }

  .form-grid,
  .check-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .field {
    gap: 6px;
    margin-bottom: 12px;
  }

  .field label {
    font-size: 0.84rem;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 48px;
    padding: 11px 12px;
    font-size: 16px;
  }

  .field textarea {
    min-height: 112px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn,
  .logout-btn {
    min-height: 46px;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .actions > * {
    width: 100%;
    min-width: 0;
    padding: 9px 8px;
    font-size: 0.83rem;
    text-align: center;
  }

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

  table {
    min-width: 680px;
    font-size: 0.86rem;
  }

  th,
  td {
    padding: 10px;
  }

  .attendance-chart {
    min-height: 220px;
    grid-template-columns: repeat(12, 42px);
    gap: 7px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .timer-display {
    font-size: 2.25rem;
  }

  .login-page {
    align-items: center;
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background-position: 58% center;
  }

  .login-card {
    padding: 20px 18px;
    background: rgba(255, 255, 255, 0.96);
  }

  .login-card h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 370px) {
  .dashboard-grid,
  .actions,
  .mobile-record-actions {
    grid-template-columns: 1fr;
  }

  .mobile-logout span {
    display: none;
  }

  .mobile-logout {
    min-width: 44px;
  }
}

@media (max-width: 760px) {
  .world-events-page,
  .world-event-detail {
    width: 100%;
  }

  .world-events-hero {
    min-height: 168px;
    padding: 20px 16px;
    margin-inline: -14px;
    border-radius: 0;
  }

  .world-events-hero h1 {
    font-size: 2rem;
  }

  .world-events-tabs {
    margin-inline: -14px;
  }

  .world-admin-toolbar,
  .world-event-filters,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .world-admin-toolbar .actions,
  .world-event-filters label {
    width: 100%;
    min-width: 0;
  }

  .world-event-card,
  .world-events-list.compact .world-event-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .world-event-date,
  .world-events-list.compact .world-event-date {
    min-height: 82px;
  }

  .world-event-date strong {
    font-size: 1.35rem;
  }

  .world-event-main h3 {
    font-size: 1.03rem;
  }

  .world-event-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    width: 100%;
  }

  .world-detail-title h1 {
    font-size: 1.45rem;
  }

  .world-detail-photo {
    aspect-ratio: 16 / 8;
  }

  .world-detail-data > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .watch-actions {
    grid-template-columns: 1fr;
  }
}

@media (display-mode: standalone) {
  body {
    overscroll-behavior-y: contain;
  }
}

/* ============================================================
   SKELETON SCREENS (Point 6)
   ============================================================ */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  background: linear-gradient(90deg, var(--soft) 25%, #dce7ec 50%, var(--soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.tiny { width: 35%; height: 10px; }
.skeleton-title { height: 22px; width: 70%; margin-bottom: 12px; }
.skeleton-card { height: 120px; width: 100%; }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 8px; flex: 0 0 44px; }
.skeleton-chip { width: 60px; height: 26px; border-radius: 999px; }

.boot-screen .boot-card {
  animation: pulse 2s ease-in-out infinite;
}

.boot-screen .boot-card img {
  animation: shimmer 2s ease-in-out infinite;
  background-size: 200% 100%;
}

.boot-dots::after {
  content: "";
  display: inline-block;
  animation: bootDots 1.5s steps(4, end) infinite;
  width: 1.2em;
  text-align: left;
}

@keyframes bootDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* Loading overlay for view transitions */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: rgba(245, 248, 250, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--aqua-strong);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   MICRO-INTERACTIONS (Point 8)
   ============================================================ */
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.logout-btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  will-change: transform;
}

.primary-btn:active:not(:disabled),
.secondary-btn:active:not(:disabled),
.ghost-btn:active:not(:disabled),
.danger-btn:active:not(:disabled),
.logout-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.primary-btn:active:not(:disabled) {
  box-shadow: 0 6px 14px rgba(0, 126, 157, 0.3);
}

.item-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(16, 32, 51, 0.1);
}

.item-card:active {
  transform: translateY(0);
}

.stat-card,
.world-event-card,
.attendance-focus {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(16, 32, 51, 0.12);
}

.app-toast {
  transition: opacity 200ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.nav button,
.swimmer-floating-menu button {
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nav button:active:not(.active),
.swimmer-floating-menu button:active:not(.active) {
  transform: scale(0.94);
}

/* Smooth tab transitions */
.time-tab-panel {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Swipe hint indicator */
.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  opacity: 0.6;
}

.swipe-hint svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   MODAL OVERLAY (for editing times)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 19, 32, 0.55);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}

.modal-box {
  width: min(480px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(4, 19, 32, 0.34);
}

.modal-box h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.modal-box > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions > * {
  flex: 1;
}

@media (prefers-color-scheme: dark) {
  .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
  }
  .modal-box {
    background: var(--panel);
    border-color: var(--line);
  }
}

/* ============================================================
   TIMES VIEW SPACING (Point 4 fix)
   ============================================================ */
.time-style-grid {
  gap: 12px;
}

.time-record-grid {
  gap: 8px;
}

.time-record-row {
  padding: 14px 16px;
  gap: 10px;
}

.time-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

@media (max-width: 480px) {
  .time-style-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .time-record-row {
    padding: 12px 14px;
  }

  .time-record-row > div strong {
    font-size: 0.95rem;
  }

  .time-record-row b {
    font-size: 1rem;
  }
}

/* ============================================================
   DARK MODE (Point 7) — comprehensive overrides
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0f6fa;
    --muted: #94aabc;
    --soft: #1a2c3c;
    --panel: #1f3345;
    --line: #2a4055;
    --navy: #0d1a26;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
    --coral: #ff7a6b;
    --gold: #f0b830;
    --green: #28b87a;
  }

  body {
    background: #0f1e2c;
  }

  /* ---- Content area backgrounds ---- */
  .content {
    background: #0f1e2c;
  }

  .swimmer-dashboard {
    background: transparent;
  }

  .topbar h1 {
    color: var(--ink);
  }

  .topbar p {
    color: var(--muted);
  }

  /* ---- Hero sections (keep dark overlays, fix text) ---- */
  .boot-screen {
    background-image:
      linear-gradient(135deg, rgba(8, 22, 39, 0.94), rgba(0, 80, 100, 0.6)),
      url("assets/login-swimmer.png");
  }

  .login-page {
    background-image:
      linear-gradient(135deg, rgba(6, 18, 34, 0.88), rgba(8, 85, 110, 0.55)),
      url("assets/login-swimmer.png");
  }

  /* ---- Panels & cards ---- */
  .login-card,
  .panel,
  .stat-card,
  .item-card,
  .attendance-focus,
  .times-chart-card,
  .swimmer-mobile-card,
  .world-event-card,
  .world-admin-toolbar,
  .world-event-filters,
  .table-wrap,
  .view-tabs,
  .timer-display,
  .lane-card,
  .time-record-row,
  .time-style-card,
  .boot-card,
  .watch-panel,
  .attendance-training-card,
  .attendance-row-card {
    background: var(--panel);
    border-color: var(--line);
  }

  .login-card {
    background: rgba(31, 51, 69, 0.96);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .login-card input,
  .login-card select {
    background: #1a2c3c;
    border-color: var(--line);
    color: var(--ink);
  }

  .field input,
  .field select,
  .field textarea {
    background: #162736;
    border-color: var(--line);
    color: var(--ink);
  }

  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    border-color: var(--aqua);
    box-shadow: 0 0 0 3px rgba(8, 166, 201, 0.2);
  }

  .stat-card::after {
    background: rgba(8, 166, 201, 0.08);
  }

  .check-item {
    background: #1a2c3c;
    border-color: var(--line);
  }

  .secondary-btn {
    background: #1a2c3c;
    border-color: var(--line);
    color: var(--ink);
  }

  .ghost-btn {
    border-color: var(--line);
    color: var(--ink);
  }

  .danger-btn {
    color: #fff;
    background: #c43b32;
  }

  .session-card {
    background: rgba(255, 255, 255, 0.08);
  }

  .swimmer-mobile-data > div {
    background: #162736;
  }

  .training-notes {
    background: #162736;
    border-left-color: var(--aqua-strong);
  }

  .attendance-success {
    background: #0a2e1e;
    color: #4cdb9a;
  }

  .badge {
    background: rgba(8, 166, 201, 0.15);
    color: var(--aqua);
  }

  .badge.green {
    background: rgba(40, 184, 122, 0.15);
    color: var(--green);
  }

  .badge.coral {
    background: rgba(255, 122, 107, 0.15);
    color: var(--coral);
  }

  .badge.gold {
    background: rgba(240, 184, 48, 0.15);
    color: var(--gold);
  }

  .time-filter-chip {
    background: #1a2c3c;
    border-color: var(--line);
    color: var(--muted);
  }

  .time-filter-chip.active {
    background: var(--aqua-strong);
    border-color: var(--aqua-strong);
    color: #fff;
  }

  .hero-metric {
    backdrop-filter: blur(14px);
  }

  .attendance-training-card {
    background: linear-gradient(180deg, var(--panel) 0%, #1a2c3c 100%);
  }

  .world-event-date {
    border-right-color: var(--line);
  }

  .world-detail-data {
    border-top-color: var(--line);
  }

  .world-detail-data > div {
    border-bottom-color: var(--line);
  }

  .attendance-chart .chart-bar-track {
    background: #1a2c3c;
    border-color: var(--line);
  }

  .mini-bar-track {
    background: #1a2c3c;
    border-color: var(--line);
  }

  .view-tabs button {
    color: var(--muted);
  }

  .view-tabs button.active {
    color: #fff;
  }

  .time-record-row,
  .swimmer-mobile-card {
    background: var(--panel);
    border-color: var(--line);
  }

  .empty {
    border-color: var(--line);
    color: var(--muted);
  }

  .swimmer-shell .mobile-appbar {
    background: rgba(10, 20, 30, 0.98);
  }

  .sidebar {
    background: #0a1622;
  }

  table {
    background: var(--panel);
  }

  th {
    background: #162736;
    color: var(--muted);
  }

  th,
  td {
    border-bottom-color: var(--line);
  }

  .loading-overlay {
    background: rgba(15, 30, 44, 0.75);
  }

  .skeleton {
    background: linear-gradient(90deg, #1a2c3c 25%, #2a4055 50%, #1a2c3c 75%);
    background-size: 200% 100%;
  }

  .world-event-notes {
    background: #162736;
  }

  .world-events-tabs,
  .world-event-card {
    background: var(--panel);
  }

  .world-event-filters label {
    border-color: var(--aqua-strong);
  }

  .world-event-filters select {
    background: transparent;
    color: var(--ink);
  }

  .world-back {
    color: var(--aqua);
  }

  /* ---- Chart improvements ---- */
  .times-style-chart text {
    fill: var(--muted) !important;
  }

  .times-style-chart line {
    stroke: var(--line) !important;
  }

  .times-style-chart .axis {
    stroke: var(--muted) !important;
  }

  .time-chart-legend span {
    color: var(--ink) !important;
  }

  .time-record-row small {
    color: var(--muted);
  }

  .time-record-row span {
    color: var(--muted);
  }

  /* ---- Section title badges ---- */
  .section-title strong {
    background: #1a2c3c;
    color: var(--aqua);
  }

  .section-title h2 {
    color: var(--ink);
  }

  /* ---- Times view headers ---- */
  .times-section-hero {
    color: #fff;
  }

  .times-section-hero .eyebrow {
    color: #aee8f2;
  }

  .times-section-hero h2 {
    color: #fff;
  }

  .times-section-hero p {
    color: rgba(255, 255, 255, 0.78);
  }

  /* ---- Swimmer hero ---- */
  .swimmer-hero h1,
  .swimmer-hero p {
    color: #fff;
  }

  .swimmer-hero .eyebrow {
    color: #aee8f2;
  }

  /* ---- Dashboard hero ---- */
  .dashboard-hero h1,
  .dashboard-hero p {
    color: #fff;
  }

  .hero-metric span,
  .hero-metric small {
    color: rgba(255, 255, 255, 0.78);
  }

  .hero-metric strong {
    color: #fff;
  }

  /* ---- World events hero ---- */
  .world-events-hero {
    color: #fff;
  }

  .world-events-hero span,
  .world-events-hero h1,
  .world-events-hero p {
    color: #fff;
  }

  /* ---- Detail title ---- */
  .world-detail-title h1 {
    color: var(--ink);
  }

  .world-detail-title > span {
    color: var(--aqua);
  }

  /* ---- Level chip ---- */
  .level-chip {
    color: #fff;
  }

  .level-chip.green {
    background: rgba(40, 184, 122, 0.86);
  }

  .level-chip.coral {
    background: rgba(255, 122, 107, 0.9);
  }

  /* ---- File preview links ---- */
  .file-preview {
    color: var(--aqua);
  }

  /* ---- Attendance priority card ---- */
  .attendance-priority {
    border-color: rgba(8, 166, 201, 0.3);
  }

  /* ---- Technical card links ---- */
  .technical-card a.secondary-btn {
    color: var(--ink);
  }

  /* ---- Birthday banner ---- */
  .birthday-banner {
    background: linear-gradient(135deg, #2a2200, #3d2f00);
    border-color: #8a7020;
    color: #f0d060;
  }
  .birthday-banner strong { color: #ffeb80; }
  .birthday-banner p { color: #d4b84a; }

  /* ---- Swimmer edit summary ---- */
  .swimmer-edit-summary {
    background: #162736;
    border-color: var(--line);
  }
  .swimmer-edit-summary .field-value {
    color: var(--ink);
  }

  /* ── Time history grouped by date ── */
  .time-history-group { margin-bottom: 18px; }
  .time-history-group-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 12px; margin-bottom: 8px;
    background: linear-gradient(135deg, #eef6fb, #e0eef6);
    border: 1px solid #b3dceb; border-radius: 10px;
  }
  .time-history-date { font-size: 0.9rem; font-weight: 700; color: #0a6b9a; }
  .time-history-count {
    font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 12px;
    background: rgba(8, 145, 178, 0.12); color: #0891b2; border: 1px solid rgba(8, 145, 178, 0.2);
  }
  .time-history-list { gap: 8px; }
  .time-history-list .item-card { padding: 10px 12px; }

  /* ── Payment module dark ── */
  .payment-stat { background: #162736; }
  .payment-month-row.paid { background: #103020; }
  .payment-month-row.pending { background: #2a2200; }
  .payment-swimmer-status.paid { background: #103020; }
  .payment-swimmer-status.pending { background: #2a2200; }

  /* ── Champ alert dark ── */
  .champ-alert-modal { background: #0f1f2b; }
  .champ-alert-item { background: #162736; border-color: #1e3550; }
}

/* ── Swimmer attendance row list ── */
.attendance-row-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.attendance-row-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.attendance-row-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attendance-row-info h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.attendance-row-date {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.attendance-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.attendance-row-badges .badge {
  flex: 0 0 auto;
  width: auto;
  display: inline-flex;
}

.attendance-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.attendance-row-actions button,
.attendance-row-actions a {
  justify-content: center;
  text-align: center;
  min-height: 38px;
  font-size: 0.85rem;
  padding: 6px 12px;
}

.attendance-row-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .attendance-row-main {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .attendance-row-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: auto;
  }
  .attendance-row-actions button,
  .attendance-row-actions a {
    flex: 1 1 auto;
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  .attendance-row-actions {
    flex-direction: column;
  }
  .attendance-row-actions button,
  .attendance-row-actions a {
    width: 100%;
  }
}

/* ── Detalle expandible del entrenamiento del nadador ── */
.training-details {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(0, 126, 157, 0.06);
  border-left: 4px solid var(--aqua-strong);
}

.training-details[hidden] {
  display: none !important;
}

.training-details .training-notes {
  margin-top: 0;
}

.training-details .secondary-btn {
  margin-top: 10px;
}

.attendance-training-card .item-top {
  align-items: flex-start;
}

@media (max-width: 760px) {
  .attendance-training-actions {
    grid-template-columns: 1fr;
  }
}
