/* Squad swim-set pages (sidebar of sessions + session view) */

/* Old colour names still used by these pages' scripts, mapped onto the theme */
:root {
  --cyan: var(--accent);
  --white: var(--text);
  --dim: var(--muted);
  --yellow: var(--amber);
  --water-deep: var(--bg);
  --water-mid: var(--surface);
  --on-color: #ffffff;           /* text on a solid coloured badge */
  --sidebar-w: 280px;
}
:root[data-theme="dark"] { --on-color: #0a1628; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --on-color: #0a1628; } }

/* ── LAYOUT ── */
.sets-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 140px); }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.sidebar-eyebrow {
  font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.sidebar-title {
  font-family: var(--font-cond); font-size: 20px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; line-height: 1.05; color: var(--text);
}
.sidebar-title br { display: none; }
.sidebar-title span { color: var(--accent); }
.sidebar-title span.club { color: var(--gold-dark); margin-right: .3em; }
:root[data-theme="dark"] .sidebar-title span.club { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar-title span.club { color: var(--gold); } }

.sidebar-nav { padding: 10px 10px 24px; display: flex; flex-direction: column; gap: 3px; flex: 1; }

#rotation-schedule { display: none; }
.today-banner { padding: 10px 6px 4px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.today-label {
  font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 6px;
}
.today-banner .today-item { border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent); background: var(--orange-soft); margin-bottom: 8px; }
.today-banner .today-item:hover { border-color: var(--orange); }
.today-banner .today-item.active { border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }

.nav-group-label {
  font-family: var(--font-cond); font-size: 12px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px;
  display: flex; align-items: center; gap: 8px;
}
.nav-group-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.nav-group-label:first-child { margin-top: 0; }

.nav-item {
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; background: transparent;
  transition: background .15s, border-color .15s;
}
.nav-item:hover { background: var(--row-hover); border-color: var(--border); }
.nav-item.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: inset 3px 0 0 var(--gold); }
.nav-item-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 3px; }
.nav-item.active .nav-item-title { color: var(--text); }
.nav-item-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.nav-item-dist { color: var(--amber); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.nav-item-badges { display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.nav-badge {
  font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 1px 7px; border-radius: 4px; line-height: 1.6;
  display: inline-block; color: var(--on-color);
}
.nav-badge-pool-33 { background: var(--blue); }
.nav-badge-pool-25 { background: var(--green); }
.nav-badge-dur     { background: var(--orange); }

/* ── MAIN ── */
.main { flex: 1; min-width: 0; position: relative; }
.session-view {
  max-width: 680px; margin: 0 auto; padding: 32px 28px 80px;
  display: none; animation: fadeUp .35s ease both;
}
.session-view.visible { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.empty-state {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 12px; min-height: 60vh; opacity: .6;
}
.empty-state-icon { font-size: 48px; }
.empty-state-text {
  font-family: var(--font-cond); font-size: 13px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted);
}

/* session header */
.session-eyebrow {
  font-family: var(--font-cond); font-size: 13px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.session-title {
  font-family: var(--font-cond); font-size: clamp(32px, 6vw, 46px); font-weight: 800;
  line-height: 1.02; text-transform: uppercase; letter-spacing: .01em; color: var(--text);
  margin-bottom: 12px;
}
.header-line { width: 48px; height: 4px; background: var(--gold); border-radius: 2px; margin-bottom: 18px; }
.session-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 20px; }
.pool-badge, .duration-badge {
  display: inline-block; font-family: var(--font-cond); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--on-color);
  background: var(--blue); padding: 3px 10px; border-radius: 4px;
}
.duration-badge { background: var(--orange); }
.session-summary {
  font-size: 15px; line-height: 1.6; color: var(--text-2);
  background: var(--surface); border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 28px;
}

/* sections — each becomes a card */
.section {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 16px;
}
.section > .section-label {
  background: var(--card-head-bg); color: var(--card-head-text);
  border-bottom: 2px solid var(--gold);
  font-family: var(--font-cond); font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: 9px 16px; margin: 0;
}
.section .row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background .15s;
}
.section .row:last-of-type { border-bottom: none; }
.section .row:hover { background: var(--row-hover); }
.drill-name { font-size: 15px; color: var(--text); line-height: 1.4; }
.dist {
  font-size: 15px; font-weight: 700; color: var(--text-2); white-space: nowrap; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.dist::after { content: 'm'; font-size: 11px; margin-left: 1px; color: var(--muted); font-weight: 500; }
.row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.drill-video-link {
  font-size: 11px; color: var(--accent); text-decoration: none;
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent-soft); transition: background .15s, color .15s;
}
.drill-video-link:hover { background: var(--accent); color: var(--surface); }

.subtotal {
  display: flex; justify-content: flex-end; padding: 8px 16px;
  background: var(--surface-2); border-top: 1px solid var(--border);
}
.subtotal-pill {
  font-family: var(--font-cond); font-size: 15px; font-weight: 800; letter-spacing: .04em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.subtotal-pill::before { content: 'Subtotal '; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.subtotal-pill::after { content: 'm'; font-size: 12px; color: var(--muted); margin-left: 1px; }

/* total */
.total-bar {
  margin-top: 20px; background: var(--card-head-bg); border-radius: var(--radius);
  border-bottom: 4px solid var(--gold); box-shadow: var(--shadow);
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
}
.total-label {
  font-family: var(--font-cond); font-size: 15px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--gold);
}
.total-right { display: flex; align-items: baseline; gap: 6px; }
.total-num {
  font-family: var(--font-cond); font-size: 44px; font-weight: 800; line-height: 1;
  color: #ffffff; font-variant-numeric: tabular-nums;
}
.total-unit { font-size: 13px; color: var(--head-muted); letter-spacing: .1em; text-transform: uppercase; }

/* rotation schedule rows (built by script) */
.rotation-row { font-size: 14px; }
.rotation-row > div:nth-child(2) { font-size: 14px !important; }

/* mobile sidebar toggle */
.mob-toggle {
  display: none; position: fixed; bottom: 18px; right: 18px; z-index: 100;
  background: var(--gold); color: var(--on-gold); border: none; border-radius: 50%;
  width: 52px; height: 52px; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(10,22,40,.35);
}

@media (max-width: 760px) {
  .sets-layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; z-index: 50;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  .sidebar.open { transform: translateX(0); }
  .session-view { padding: 24px 16px 96px; }
  #rotation-schedule { padding-left: 16px !important; padding-right: 16px !important; }
  .mob-toggle { display: flex; align-items: center; justify-content: center; }
}
