/* Base reset for every signed-in page. Lives here because the pages no
   longer load Tailwind, whose Preflight used to supply it. */
* { box-sizing:border-box; }
body { margin:0; font-family:Inter,system-ui,sans-serif; background:var(--bg); color:var(--card-active); -webkit-font-smoothing:antialiased; }
[hidden] { display:none !important; }
a { color:var(--gold); text-decoration:none; }
button { font:inherit; }
a:focus-visible,button:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
button:disabled { opacity:.4; cursor:not-allowed; }
h1,h2,h3,p { margin:0; }

/* Uses each signed-in page's canonical token block. */
#cbSidebar { width:256px; background:var(--bg); color:var(--card); border-right:1px solid var(--nav-line); position:fixed; inset:0 auto 0 0; height:100dvh; overflow-y:auto; flex-direction:column; z-index:30; font-family:Inter,system-ui,sans-serif; }
#cbSidebar a { text-decoration:none; }
#cbSidebar .cb-brand { display:flex; align-items:center; height:81px; min-height:81px; padding:0 24px; border-bottom:1px solid var(--nav-line); color:var(--gold); font-size:24px; font-weight:800; letter-spacing:-.8px; }
#cbSidebar .cb-logo { display:block; width:auto; height:40px; }
.cb-brand-short { display:none; width:auto; height:40px; }
#cbSidebar strong { display:block; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
#cbSidebar small { display:block; font-size:12px; color: var(--a11y-muted-dark); margin-top:4px; }
#cbSidebar nav { flex:1; padding:16px; }
#cbSidebar nav > .cb-nav-item { display:flex; align-items:center; gap:12px; min-height:44px; padding:12px 16px; margin:0 0 4px; border:0; border-radius:8px; font-size:14px; color:var(--card); }
#cbSidebar .cb-nav-item i { width:20px; text-align:center; font-size:14px; flex-shrink:0; }
#cbSidebar nav > a[aria-current] { background:var(--gold); color:var(--bg); font-weight:600; }
#cbSidebar nav > a:hover { background:var(--nav); }
#cbSidebar nav > a[aria-current]:hover { background:var(--gold); }
#cbSidebar .nav-off { opacity:.42; cursor:not-allowed; }
.cb-user { display:flex; align-items:center; gap:12px; margin:0; padding:24px 24px 8px; border-top:1px solid var(--nav-line); }
.cb-initials { display:flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:50%; border:1px solid var(--dash); flex-shrink:0; font-size:12px; }
#cbSidebar .cb-collapse { display:flex; align-items:center; gap:12px; background:transparent; border:0; color:var(--card); margin:8px 16px 16px; padding:12px 16px; cursor:pointer; font:inherit; font-size:14px; }
#cbSidebar :is(a,button):focus-visible,.cb-mobile-nav a:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
.cb-mobile-nav { display:none; }
/* The sidebar shows from 768px, so a half-screen window keeps every item.
   From 1024px it is full width or the icon rail, as the coach chose; at
   768-1023px (shell.js) it is the rail, and its toggle opens the full
   sidebar over the page instead of pushing the page across. */
@media(min-width:768px) {
  #cbSidebar { display:flex; }
  #cbMain { margin-left:256px; }
  .cb-rail #cbSidebar { width:72px; }
  .cb-rail #cbMain { margin-left:72px; }
  .cb-rail #cbSidebar .cb-label { display:none; }
  .cb-rail #cbSidebar .cb-brand { padding:0; justify-content:center; }
  .cb-rail .cb-brand-short { display:block; }
  .cb-rail #cbSidebar nav { padding:14px 10px; }
  .cb-rail #cbSidebar nav > .cb-nav-item { margin:0 0 3px; padding:12px 0; justify-content:center; gap:0; }
  .cb-rail .cb-user { margin:0 8px; padding:16px 0; justify-content:center; }
  .cb-rail #cbSidebar .cb-collapse { margin:8px; justify-content:center; }
  .cb-rail .cb-collapse i { transform:rotate(180deg); }
}
@media(min-width:768px) and (max-width:1023px) {
  #cbMain, .cb-rail #cbMain { margin-left:72px; }
  #cbSidebar { box-shadow:12px 0 32px rgba(0,0,0,.45); }
  .cb-rail #cbSidebar { box-shadow:none; }
}
@media(max-width:767px) {
  #cbSidebar { display:none; }
  #cbMain { margin-left:0; }
  /* One row of equal cells, so no destination wraps onto a line of its own. */
  .cb-mobile-nav { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:4px; padding:8px 12px; border-bottom:1px solid var(--nav-line); background:var(--bg); }
  .cb-mobile-nav a { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:6px 4px; border-radius:8px; color:var(--card); font-size:13px; text-decoration:none; white-space:nowrap; }
  .cb-mobile-nav a:hover { background:var(--nav); }
  .cb-mobile-nav a[aria-current] { color:var(--gold); background:color-mix(in srgb,var(--gold) 8%,transparent); font-weight:600; }
}
/* Phones: icon over label, like a tab bar. Each item is as wide as its
   label, spread across the row, so seven fit at 375px; if they still don't
   fit (320px), the bar scrolls sideways rather than labels overlapping. */
@media(max-width:639px) {
  .cb-mobile-nav { grid-auto-columns:auto; justify-content:space-between; gap:2px; padding:8px; overflow-x:auto; scrollbar-width:thin; }
  .cb-mobile-nav a { flex-direction:column; gap:4px; min-height:52px; padding:6px 3px; font-size:12px; }
  .cb-mobile-nav a i { font-size:15px; }
}

/* Topbar. Shell furniture, so it lives here rather than in any one
   page's stylesheet; every signed-in page renders the same markup. */
.club-topbar { height:56px; border-bottom:1px solid var(--nav-line); display:flex; align-items:center; gap:16px; padding:0 24px; background:var(--bg); position:sticky; top:0; z-index:20; }
.club-topbar button { cursor:pointer; }
.club-topbar #cbCollapse { background:transparent; border:0; padding:0; color:var(--text-muted); font-size:16px; }
.topbar-right { margin-left:auto; display:flex; align-items:center; gap:16px; }
.club-topbar .nav-off { opacity:.45; color:var(--text-muted); font-size:14px; }
#cdPill,.mobile-profile { display:flex; align-items:center; gap:8px; min-height:44px; border:1px solid var(--nav-line); border-radius:8px; padding:4px 10px 4px 6px; background:var(--preview); color:var(--card-active); white-space:nowrap; text-decoration:none; }
#cdPill:hover,.mobile-profile:hover { border-color:var(--dash); }
#cdPillCrest { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:6px; overflow:hidden; background:var(--nav); color:var(--dash); font-size:12px; flex-shrink:0; }
#cdPillCrest img { width:100%; height:100%; object-fit:cover; }
#cdPillName { font-size:13px; font-weight:600; max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Phone/tablet only. Scoped to the topbar so accessibility.css's generic
   inline-flex for .mobile-profile cannot show it beside the desktop pill. */
.mobile-profile { font-size:13px; font-weight:600; padding:6px 12px; }
.club-topbar .mobile-profile { display:none; }
/* Brand on the left of the bar once the sidebar (and its brand) is hidden.
   shell.js inserts it. */
.cb-topbar-brand { display:none; align-items:center; min-height:44px; text-decoration:none; }
.cb-topbar-brand img { display:block; width:auto; height:30px; }
@media(max-width:767px) {
  .club-topbar #cbCollapse { display:none; }
  .club-topbar .mobile-profile { display:flex; }
  .cb-topbar-brand { display:inline-flex; }
  /* The Profile link covers the same destination; one is enough here. */
  .club-topbar #cdPill { display:none; }
}
@media(max-width:600px) { .club-topbar { padding:0 16px; } .topbar-right { gap:12px; } }

/* ---------- loading ----------
   A signed-in page starts with data-loading on <main>; its script removes
   it once the real data is drawn (js/shell.js also clears it if loading
   fails). Until then names and counts marked .ld show as placeholder bars,
   and empty states ("No activity yet") stay hidden, so a refresh never
   flashes zeros or a brand-new club's dashboard. */
main[data-loading] .ld { width:fit-content; color:transparent !important; border-radius:6px; background:var(--nav-line); animation:ld-pulse 1.2s ease-in-out infinite; }
main[data-loading] .ld * { visibility:hidden; }
main[data-loading] :is(.empty[id], .ld-hide) { visibility:hidden; }
/* A "Loading…" line that only shows while loading. */
main:not([data-loading]) .ld-show { display:none; }
.ld-show { margin:16px 0 0; font-size:14px; color:var(--text-muted); }
@keyframes ld-pulse { 50% { opacity:.45; } }
