/* ============================================================================
   hub.css — Latida instructor home (v4). Restrained dark dashboard; the workout
   profile chart is the hero. Effort colors (STANDARD ramp — cyan/green/yellow/orange/red,
   Family A canonical) are DATA-VIZ ONLY (chart, block chips/refs). Status colors are
   CHROME ONLY. Condensed uppercase is limited to nav / card titles / stat labels /
   eyebrows; all numbers + table data render in the normal-width face with tabular-nums.
   Scoped under body.hub-v2. The effort ramp is defined ONCE in dashboard.html's RAMP
   array (queued for deck/TV/builder migration; applied to hub only for now).
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow+Condensed:wght@400;500;600;700&family=Barlow:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #1b1b1b; --border: #262626;
  --accent: #00DAFF; --text: #f0f0f0; --muted: #7c7c7c;
  /* Effort ramp is NOT declared here — it lives as a SINGLE definition (color +
     label + breakpoint) in the RAMP array in dashboard.html, which is what fills
     the chart. Duplicating the hexes as CSS tokens is what let them drift; one
     source only. 5-stop @ 60/80/90/95, Easy/Moderate/Hard/Very Hard/Max. */
  /* status (chrome only) */
  --live: #24BC29; --pending: #F5A623; --error: #ff6b6b;
  --up: #24BC29; --down: #ff6b6b;
}

body.hub-v2 { background: var(--bg); color: var(--text); font-family: 'Barlow', sans-serif;
  min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
.hub-v2 * { box-sizing: border-box; }
.hub-v2 a { text-decoration: none; color: var(--accent); }
.hub-v2 ::-webkit-scrollbar { width: 4px; height: 4px; } .hub-v2 ::-webkit-scrollbar-thumb { background: var(--border); }
.hub-v2 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* condensed-uppercase helper (nav / titles / labels / eyebrows ONLY) */
.hub-v2 .cd { font-family: 'Barlow Condensed', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; }

/* header / nav */
.hub-v2 .hub-nav { display: flex; align-items: center; gap: 4px; height: 64px; padding: 0 40px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 100; }
.hub-v2 .hub-nav .brand { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 4px; color: var(--text); margin-right: 26px; }
.hub-v2 .hub-nav a { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); padding: 8px 12px; transition: color .15s; }
.hub-v2 .hub-nav a:hover { color: var(--text); } .hub-v2 .hub-nav a.active { color: var(--accent); }
.hub-v2 .hub-nav .spacer { flex: 1; }
.hub-v2 .hub-nav #whoami, .hub-v2 .hub-nav #logout { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.hub-v2 .hub-nav #logout:hover { color: var(--error); }
/* "More" dropdown — hub-v2 restyle of the base structural styles */
.hub-v2 .hub-nav .more-btn { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 8px 12px; }
.hub-v2 .hub-nav .more-btn:hover { color: var(--text); }
.hub-v2 .hub-nav .more-menu { background: var(--surface); border-color: var(--border); }
.hub-v2 .hub-nav .more-menu a { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 10px 16px; }
.hub-v2 .hub-nav .more-menu a:hover { color: var(--text); background: var(--surface-2); }

.hub-v2 .hub-main { max-width: 1180px; margin: 0 auto; padding: 36px 40px 64px; }

/* greeting row — greeting left, actions right, aligned */
.hub-v2 .top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.hub-v2 .greet { font-family: 'Bebas Neue', sans-serif; font-size: 30px; letter-spacing: 1px; }
.hub-v2 .greet .accent { color: var(--accent); }
.hub-v2 .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hub-v2 .btn { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 10px 18px; border: 1px solid var(--border); color: var(--text); background: transparent;
  cursor: pointer; transition: border-color .15s; }
.hub-v2 .btn:hover { border-color: var(--muted); }
.hub-v2 .btn.primary { background: var(--accent); color: #06222a; border-color: var(--accent); font-weight: 700; }

/* card */
.hub-v2 .card { background: var(--surface); border: 1px solid var(--border); padding: 28px; }
.hub-v2 .col-label { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }

/* LEAD */
.hub-v2 .lead { margin-bottom: 16px; }
.hub-v2 .lead .lc-head { display: inline-block; font-family: 'Barlow Condensed', sans-serif; font-size: 14px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.hub-v2 .lead a.lc-head:hover { color: var(--text); }
.hub-v2 .lead .lc-title { font-family: 'Bebas Neue', sans-serif; font-size: 40px; letter-spacing: 1px; line-height: 1; }
/* title row with prev/next chevrons (reusable class card) */
.hub-v2 .lc-titlerow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hub-v2 .lc-titlerow .lc-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-v2 .lc-chev { flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.hub-v2 .lc-chev:hover:not(:disabled) { border-color: var(--muted); color: var(--accent); }
.hub-v2 .lc-chev:disabled { opacity: .28; cursor: default; }

/* profile chart (SVG hero) */
.hub-v2 .chart-wrap { width: 100%; }
.hub-v2 .chart-wrap svg { width: 100%; height: 260px; display: block; }
.hub-v2 .chart-wrap .blk { cursor: pointer; } .hub-v2 .chart-wrap .blk:hover { filter: brightness(1.25); }
.hub-v2 .chart-wrap .blk.hl { filter: brightness(1.7); stroke: #ffffff; stroke-width: 2; }
.hub-v2 .row[data-bi] { cursor: pointer; } .hub-v2 .row.held { background: var(--surface-2); }
.hub-v2 .chart-grid { stroke: var(--border); stroke-width: 1; }
.hub-v2 .chart-glabel, .hub-v2 .chart-xlabel { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; letter-spacing: 1px; fill: var(--muted); text-transform: uppercase; }
.hub-v2 .chart-top { fill: none; stroke: #eafcff; stroke-width: 2; stroke-linejoin: round; }
.hub-v2 .chart-cap { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.hub-v2 .chart-cap .tip { color: var(--text); }

/* stat tiles — subordinate; big value, small muted label; VALUE in normal face tabular-nums */
.hub-v2 .tiles { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.hub-v2 .tile .v { font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.hub-v2 .tile .l { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* smaller cards — equal heights via grid stretch */
.hub-v2 .cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.hub-v2 .cards > .card { display: flex; flex-direction: column; }

/* rider rows — names in NORMAL face, up a notch; data in normal face tabular-nums */
.hub-v2 .rows { flex: 1; }
/* PR list can be long (every PR in the week) — bound it and scroll inside the card so
   it doesn't stretch its grid row; the card title stays fixed above. */
.hub-v2 #prs { max-height: 380px; overflow-y: auto; }
.hub-v2 .row { display: flex; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.hub-v2 .row:last-child { border-bottom: none; }
.hub-v2 .row .who { font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 18px; }
.hub-v2 .row .what { font-family: 'Barlow', sans-serif; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-v2 .row .ref { margin-left: auto; font-family: 'Barlow Condensed', sans-serif; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.hub-v2 .row .ref.muted { opacity: .65; font-style: italic; }

/* attendance */
.hub-v2 .att { display: flex; align-items: baseline; gap: 14px; }
.hub-v2 .att .v { font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 48px; line-height: .9; font-variant-numeric: tabular-nums; }
.hub-v2 .att .d { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.hub-v2 .att .d.up { color: var(--up); } .hub-v2 .att .d.down { color: var(--down); } .hub-v2 .att .d.flat { color: var(--muted); }
.hub-v2 .att .sub { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.hub-v2 .att-line { font-family: 'Barlow', sans-serif; font-size: 14px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* Approaching sub-line (recently-cleared, under the prospective rows) */
.hub-v2 .ms-sub { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); line-height: 1.5; }

/* sparkline (reusable — recurring-slot attendance trend) */
.hub-v2 .spark { margin-top: 18px; }
.hub-v2 .spark svg { width: 100%; height: 44px; display: block; overflow: visible; }
.hub-v2 .spark-line { fill: none; stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-linecap: round; }
.hub-v2 .spark-dot { fill: var(--muted); opacity: .45; }
.hub-v2 .spark-dot.cur { fill: var(--accent); opacity: 1; }

/* recent table — no grid lines, hover only; DATA in normal face tabular-nums */
.hub-v2 table { border-collapse: collapse; width: 100%; }
.hub-v2 thead th { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 14px 12px; border-bottom: 1px solid var(--border); }
.hub-v2 tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 15px; font-family: 'Barlow', sans-serif; }
.hub-v2 tbody tr:last-child td { border-bottom: none; } .hub-v2 tbody tr:hover td { background: var(--surface-2); }
.hub-v2 td.num, .hub-v2 th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* empty / error / skeleton */
.hub-v2 .empty { font-family: 'Barlow Condensed', sans-serif; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; color: var(--muted); line-height: 1.7; }
/* no-chart state: hold the space the chart would occupy so the card reads as intentional
   (eyebrow + title + tiles still present), not broken. */
.hub-v2 .chart-empty { padding: 40px 0 30px; max-width: 620px; }
.hub-v2 .empty.recede { opacity: .45; }
.hub-v2 .empty .btn { margin-top: 14px; }
.hub-v2 .errbox { border: 1px solid var(--error); color: var(--error); padding: 20px; font-family: 'Barlow Condensed', sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.hub-v2 .sk { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: hub-sh 1.4s ease infinite; }
.hub-v2 .sk-line { height: 14px; margin: 10px 0; } .hub-v2 .sk-chart { height: 260px; }
@keyframes hub-sh { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ===== WORKOUTS — card grid (browse for ideas; the mini-viz is the point) ===== */
.hub-v2 .wk-controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.hub-v2 .wk-search, .hub-v2 .wk-sel { font-family: 'Barlow', sans-serif; font-size: 14px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.hub-v2 .wk-search { flex: 1; min-width: 200px; } .hub-v2 .wk-sel { cursor: pointer; }
.hub-v2 .wk-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hub-v2 .chip { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; padding: 7px 14px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.hub-v2 .chip:hover { color: var(--text); border-color: var(--muted); }
.hub-v2 .chip.active { color: #06222a; background: var(--accent); border-color: var(--accent); }
.hub-v2 .chip-star.active { color: #2a2000; background: #e8c000; border-color: #e8c000; }
.hub-v2 .wk-count { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.hub-v2 .wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.hub-v2 .wk-card { background: var(--surface); border: 1px solid var(--border); padding: 18px; display: flex; flex-direction: column; }
.hub-v2 .wk-card.starred { border-color: #6a5a00; }
.hub-v2 .wk-top { display: flex; align-items: center; justify-content: space-between; }
.hub-v2 .wk-num { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; color: var(--muted); }
.hub-v2 .wk-star { background: none; border: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.hub-v2 .wk-star:hover, .hub-v2 .wk-card.starred .wk-star { color: #e8c000; }
.hub-v2 .wk-type { align-self: flex-start; font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; }
.hub-v2 a.wk-title { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: .5px; line-height: 1.05; color: var(--text); }
.hub-v2 a.wk-title:hover { color: var(--accent); }
.hub-v2 .wk-sp { color: #1DB954; font-size: 14px; }
.hub-v2 .wk-sub { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; letter-spacing: .5px; color: var(--muted); margin-top: 3px; }
.hub-v2 .wk-meta { font-family: 'Barlow', sans-serif; font-size: 12px; color: var(--muted); margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.hub-v2 .wk-mini { display: flex; align-items: flex-end; height: 44px; margin-bottom: 14px; }
.hub-v2 .wk-seg { display: block; align-self: flex-end; }
.hub-v2 .wk-actions { display: flex; gap: 8px; margin-top: auto; }
.hub-v2 .wk-actions .btn { flex: 1; text-align: center; font-size: 12px; padding: 8px 10px; }
.hub-v2 .wk-deck { background: var(--accent); color: #06222a; border-color: var(--accent); font-weight: 700; }
.hub-v2 .wk-pager { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.hub-v2 .wk-pageinfo { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* ===== CLASSES — session-history list (rows link into /classes/<id>/) ===== */
.hub-v2 #cl-list table { width: 100%; }
.hub-v2 tr[data-href] { cursor: pointer; }
.hub-v2 tr.cls-running td { background: rgba(36,188,41,0.06); }
.hub-v2 a.cl-title { color: var(--text); font-weight: 600; }
.hub-v2 a.cl-title:hover { color: var(--accent); }
/* per-row effort-profile thumbnail (reuses HubRamp.bar → same single-definition ramp) */
.hub-v2 td.cl-mini { width: 150px; min-width: 130px; }
.hub-v2 td.cl-mini .wk-mini { margin: 0; }

/* riders directory — name emphasis (no link; /riders/<id>/ detail doesn't exist yet) */
.hub-v2 td.rd-name { font-weight: 600; color: var(--text); }
/* status = CHROME (not the effort ramp): live green, completed/aborted muted */
.hub-v2 .cls-badge { display: inline-block; font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; padding: 2px 9px; border: 1px solid var(--border); color: var(--muted); }
.hub-v2 .cls-badge.live { background: var(--live); border-color: var(--live); color: #06220a; }
.hub-v2 .cls-badge.aband { opacity: .7; }

@media (max-width: 760px) {
  /* nav stays on ONE line — instructor nav is 4 links, which fit at reduced size
     rather than wrapping to four rows (or hiding behind a hamburger). whoami is
     dropped; if a manager's longer nav overflows, the row scrolls horizontally
     (hidden scrollbar) instead of wrapping. */
  .hub-v2 .hub-nav { height: 52px; padding: 0 14px; flex-wrap: nowrap; gap: 0;
    overflow-x: auto; scrollbar-width: none; }
  .hub-v2 .hub-nav::-webkit-scrollbar { display: none; }
  .hub-v2 .hub-nav .brand { font-size: 20px; letter-spacing: 2px; margin-right: 14px; flex-shrink: 0; }
  .hub-v2 .hub-nav a { padding: 6px 7px; font-size: 12px; letter-spacing: .8px; flex-shrink: 0; }
  .hub-v2 .hub-nav #whoami { display: none; }
  .hub-v2 .hub-nav #logout { flex-shrink: 0; padding-left: 10px; }
  .hub-v2 .hub-main { padding: 22px 14px 40px; }
  .hub-v2 .top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hub-v2 .card { padding: 18px; }
  .hub-v2 .cards { grid-template-columns: 1fr; }
  .hub-v2 .lead .lc-title { font-size: 30px; }
  .hub-v2 .lc-titlerow { gap: 8px; }
  .hub-v2 .lc-chev { width: 34px; height: 34px; font-size: 20px; }
  .hub-v2 .chart-wrap svg { height: 200px; }
  /* stat tiles as a fixed 2-col grid instead of flex-wrap — 4 core stats land as a
     clean 2x2; if room-energy is present it flows to a 5th cell below (never clipped,
     never a horizontal scroll where a number could be missed). */
  .hub-v2 .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .hub-v2 .tile .v { font-size: 26px; }
}
