/* ============================================================================================================================
   COROS skin, part 2 of 2: the "Training Hub" look. Loads after coros-theme.css; index.html sets data-theme="dark".
   Values were read off t.coros.com (the Hub's own UI): navy ground and cards, near-square corners, sentence-case tabs centred in the
   header with a red underline on the active one, zebra table rows, DIN-COROS Bold for big readouts only.
   The Hub's navy is NOT in the COROS mini guide (which has Carbon Black #101820); VI 2023 lists "COROS Dark #0B0B21". Flagged for marketing.
   ============================================================================================================================ */
:root[data-theme="dark"] {
  --bg: #0f142c; --panel: #161b32; --text: #ffffff; --muted: rgba(255, 255, 255, .62); --line: rgba(255, 255, 255, .09);
  --neutral-bg: #20273c; --chart-grid: rgba(255, 255, 255, .08); --chart-line: rgba(255, 255, 255, .75);
  --accent: #ffffff; --accent-text: #0f142c;
  --over-bg: #3a1a28; --ok-bg: #133229; --warn-bg: #33270f; --info-bg: #14293f; --low-bg: #14293f;
}
body { font-family: "Inter", "Barlow", Arial, sans-serif; }
.topbar { background: #0f142c; border-bottom: 1px solid rgba(255, 255, 255, .08); height: 64px; position: sticky; }
.topbar nav { margin: 0 auto; }   /* centred in the space between the logo group and the account box, so it can never collide with the logo */
nav a { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .72); padding: 0 16px; margin-top: 0; }
nav a:hover { color: #fff; }
nav a.active { color: #fff; font-weight: 500; border-bottom: 3px solid #e52e3a; }
.brand { letter-spacing: .1em; }
.userbox { margin-left: 0; }
main { max-width: 1440px; padding: 24px 24px 72px; }
h1 { font-size: 22px; line-height: 30px; text-transform: none; letter-spacing: 0; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 16px; font-weight: 600; }

/* cards: near-square, flat navy, small sentence-case titles like the Hub's */
.panel, .card, .epg-card, .basis-box { border-radius: 2px; border: 0; background: #161b32; }
.panel .card, .panel .panel, .panel .stat, .panel .basis-box { border-radius: 2px; background: #1b2238; }
.card .label, .stat .k { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .78); }
.card .value, .big { font-family: var(--font-display); font-weight: 700; font-size: 30px; color: #fff; }
th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .72); border-bottom: 1px solid rgba(255, 255, 255, .1); }
th, td { padding: 12px 10px; }
td { border-bottom: 0; }
tbody tr:nth-child(odd) td { background: #1c2339; }
tbody tr:nth-child(even) td { background: #20273c; }
tbody tr:hover td { background: #2a3350; }
table th.frz, table td.frz { background: #1c2339; }
tbody tr:nth-child(even) td.frz { background: #20273c; }
tbody tr:hover td.frz { background: #2a3350; }

/* controls: outlined, square, like Import data / Export data */
button, a.btn, input[type=text], input[type=number], input[type=password], select, textarea { border-radius: 2px; background: #161b32; border: 1px solid rgba(255, 255, 255, .22); }
button:hover:not(:disabled), a.btn:hover { background: #20273c; }
button.primary, a.btn.primary { background: #fff; color: #0f142c; border-color: #fff; }
button.primary:hover:not(:disabled), a.btn.primary:hover { background: #e6e8ee; }
a[href^="/api/export"] { display: inline-block; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 2px; text-decoration: none; background: #161b32; font-weight: 500; }
a[href^="/api/export"]:hover { background: #20273c; }
.seg { border-radius: 2px; } .seg button.on { background: #fff; color: #0f142c; }
.tabs { border-bottom-color: rgba(255, 255, 255, .1); }
.zone, .badge, .chip, .lt-state, .conf, .notice, .modal, .toast, .zonebar { border-radius: 2px; }
.modal { background: #161b32; border-color: rgba(255, 255, 255, .18); }
.notice { background: #1b2238; }
.overlay { background: rgba(5, 8, 20, .7); }
td a[href^="/api/export"] { display: inline; padding: 0; border: 0; background: none; font-weight: inherit; text-decoration: underline; }
td a[href^="/api/export"]:hover { background: none; }
input[type=file]::file-selector-button { background: #20273c; border-color: rgba(255, 255, 255, .22); border-radius: 2px; }

/* ---- header that survives narrow windows and the signed-in account box: tighter spacing as it shrinks, and it scrolls sideways before it would ever clip ---- */
.topbar { gap: 24px; overflow-x: auto; scrollbar-width: none; }
.topbar::-webkit-scrollbar { display: none; }
nav a { padding: 0 11px; }
.userbox { flex: none; white-space: nowrap; }
@media (max-width: 1380px) { nav a { font-size: 14px; padding: 0 9px; } .topbar { gap: 16px; } }
@media (max-width: 1180px) { .brand .beta { display: none; } .brand::before { margin-right: 4px; } }
@media (max-width: 1100px) { nav a { font-size: 13px; padding: 0 7px; } .topbar { gap: 12px; padding: 0 12px; } .brand { font-size: 13px; letter-spacing: .08em; } .brand::before { width: 104px; height: 26px; margin-right: 2px; } }

/* ---- print / save as PDF: print what the screen shows ----
   Browsers drop background colours when printing unless "Background graphics" is ticked, which turned the navy page white and left pale text
   on white paper. print-color-adjust: exact makes every colour print regardless of that checkbox. The rest keeps the layout whole on paper:
   landscape (the dashboards are wide), no sticky header or sticky table columns, cards, charts and rows not split across pages (a big panel may break between them), wide tables allowed to wrap. */
@media print {
  @page { size: landscape; margin: 8mm; }
  html, body { background: var(--bg) !important; }
  *, *::before, *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .topbar, .viewbar { position: static; }
  #toasts, .overlay { display: none !important; }
  main { max-width: none; padding: 12px 0 0; }
  .card, .epg-card, .basis-box, .notice, svg.chart, tr { break-inside: avoid; page-break-inside: avoid; }   /* small things stay whole; big panels may break between them */
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  h2 + p, h2 + .muted { break-after: avoid; page-break-after: avoid; }
  .scroll { break-inside: avoid; page-break-inside: avoid; }   /* a chart or table that fits on a page is not split; one taller than a page still breaks */
  .scroll, .bout-scroll { overflow: visible !important; }
  .cards { overflow: visible; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  table th.frz, table td.frz, table th.frz-group { position: static; }
  th, td { white-space: normal; padding: 5px 6px; font-size: 11px; }
}
