/* workspaces.css
   Scoped workspaces: shared panel chrome, health, recruiting.

   Part of the dashboard stylesheet, split by concern. index.html links these
   in source order; keep that order, the cascade depends on it. */

/* ── Picker workspace (health | offense | defense) ─────────────────────
   One layout for every scope that works context-by-context: pick a practice
   or a game, then edit what that scope owns. Each scope supplies its own
   accent through --ws (the same colour SCOPES gives it), which stands in for
   the program accent throughout, so a workspace reads as its own place
   rather than a stripped-down dashboard. Red / amber / green stay reserved
   for status and grades, never for chrome. */
.ws {
  --ws:       #0d9488;                        /* health, and the fallback */
  --ws-light: rgba(13, 148, 136, 0.11);
  position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 26px 22px 60px;
}
.ws--offense { --ws: #C79200; --ws-light: rgba(199, 146, 0, 0.13); }
.ws--defense { --ws: #2f6fdd; --ws-light: rgba(47, 111, 221, 0.12); }
.ws--specialTeams { --ws: #64748b; --ws-light: rgba(100, 116, 139, 0.13); }
.ws--penalties { --ws: #c96f1f; --ws-light: rgba(201, 111, 31, 0.13); }
/* Entrance plays once on mount, like the full dashboard — the in-place
   repaints after an edit rebuild these nodes and must not replay it. */
body.booting .ws-greet { animation: fadeUp 0.4s  cubic-bezier(0.16,1,0.3,1) both; }
body.booting .ws-stats { animation: fadeUp 0.4s  cubic-bezier(0.16,1,0.3,1) 0.04s both; }
body.booting .ws-hero  { animation: fadeUp 0.42s cubic-bezier(0.16,1,0.3,1) 0.08s both; }
body.booting .ws-panel { animation: fadeUp 0.42s cubic-bezier(0.16,1,0.3,1) 0.12s both; }

.ws-greet { margin-bottom: 20px; }
.ws-greet h1 { font-size: 25px; font-weight: 780; letter-spacing: -0.025em; }
.ws-greet p  { font-size: 14px; color: var(--label-2); margin-top: 3px; }

/* Three tiles summarising the scope at a glance — squad availability for
   health, the season's tally of lights for offense / defense. */
.ws-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }

/* Says which context the tiles below are describing — without it the numbers
   read as a season total, which is the one thing they are not. */
.ws-caption {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin: 0 2px 9px; font-size: 12.5px; line-height: 1.4;
}
.ws-caption-key {
  font-size: 10.5px; font-weight: 750; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ws);
}
.ws-caption-val  { font-weight: 620; color: var(--label); }
.ws-caption-note {
  font-size: 11px; font-weight: 650; color: var(--label-3);
  background: var(--surface-2); border-radius: var(--r-full); padding: 1px 8px;
}
/* The trend glyphs carry the meaning, so let them read a touch larger. */
.ws-stats .stat-ic svg { width: 17px; height: 17px; }

/* Up next — the context this scope almost certainly wants: today's, else the
   next one on the calendar. One tap straight into it. */
.ws-hero {
  display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 17px 19px; margin-bottom: 20px;
  cursor: pointer; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.ws-hero:hover  { border-color: color-mix(in srgb, var(--ws) 42%, transparent); box-shadow: var(--shadow-md); }
.ws-hero:active { transform: scale(0.995); }
.ws-hero--idle  { cursor: default; }
.ws-hero--idle:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.ws-hero-ic {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  /* Reads as the scope's own colour without needing a gradient per scope:
     a lighter tint above, a darker one below, both derived from --ws. */
  background: linear-gradient(150deg,
      color-mix(in srgb, var(--ws) 72%, #fff) 0%,
      var(--ws) 55%,
      color-mix(in srgb, var(--ws) 68%, #000) 100%);
}
.ws-hero-ic svg { width: 21px; height: 21px; position: relative; z-index: 1; }
.ws-hero-ic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(175deg, rgba(255,255,255,0.26), transparent 46%); }
.ws-hero-main  { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ws-kind       { font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ws); }
.ws-hero-title { font-size: 18px; font-weight: 720; letter-spacing: -0.02em; line-height: 1.2; }
.ws-hero-sub   { font-size: 12.5px; color: var(--label-2); }
.ws-hero-chev  { color: var(--label-3); display: inline-flex; flex-shrink: 0; }
.ws-hero-chev svg { width: 18px; height: 18px; }

/* Status chips — one per non-empty bucket: player availability for health,
   green / yellow / red marks for offense and defense. */
.ws-chips { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ws-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-full); font-size: 11.5px; font-weight: 750;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ws-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ws-chip--out   { background: var(--red-light);    color: var(--red);   }
.ws-chip--lim   { background: var(--amber-light);  color: var(--amber); }
.ws-chip--prob  { background: var(--green-light);  color: var(--green); }
.ws-chip--other { background: var(--slate-light);  color: var(--slate); }
.ws-chip--clear { background: var(--surface-2);    color: var(--label-3); font-weight: 650; }
.ws-chip--clear::before { display: none; }

/* ── Workspace panel chrome ───────────────────────────────────────────
   Shared by the scoped workspaces (the health / offense / defense picker,
   recruiting's board and roster panels) so they read as one family. Anything specific to
   a workspace lives under its own prefix below. */
.ws-panel, .rc-panel {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.ws-panel-head, .rc-panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 14px; border-bottom: 1px solid var(--border-2);
}
.ws-panel-meta, .rc-panel-meta { margin-left: auto; font-size: 12px; color: var(--label-2); font-weight: 500; }
.ws-list, .rc-list { padding: 8px 10px 12px; overflow-y: auto; }
.ws-list::-webkit-scrollbar, .rc-list::-webkit-scrollbar { width: 8px; }
.ws-list::-webkit-scrollbar-thumb, .rc-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* The picker itself — a tabbed list of every practice and game. */
.ws-tabs .tab.active { color: var(--ws); }
.ws-list { max-height: 470px; }
.ws-row { cursor: pointer; }
.ws-row .game-mon { color: var(--ws); }
.ws-row.is-next { background: var(--ws-light); }
.ws-row.is-past { opacity: 0.6; }
.ws-row.is-past:hover { opacity: 1; }
.ws-row-chev { color: var(--label-3); display: inline-flex; flex-shrink: 0; }
.ws-row-chev svg { width: 16px; height: 16px; }

/* The optional second action on a hero / row (see rowAction in picker.js).
   It says what it opens rather than hinting at it with a glyph: this is the
   context's other panel, not an affordance of the row, and it has to read as
   its own destination beside a row that already opens one. Filled in the
   workspace's own colour once that context has something filed under it. */
.ws-act {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 30px; padding: 0 11px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--label-2); font-size: 12px; font-weight: 700; white-space: nowrap;
  cursor: pointer;
  transition: color 0.14s, background 0.14s, border-color 0.14s, transform 0.08s;
}
.ws-act-ic { display: inline-flex; }
.ws-act-ic svg { width: 15px; height: 15px; }
.ws-act:hover, .ws-act:focus-visible {
  color: var(--ws); background: var(--ws-light);
  border-color: color-mix(in srgb, var(--ws) 42%, transparent); outline: none;
}
.ws-act:active { transform: scale(0.96); }
.ws-act.is-set {
  color: var(--ws); background: var(--ws-light);
  border-color: color-mix(in srgb, var(--ws) 30%, transparent);
}
/* The hero has room to spell it out and is the one a coach reaches for first. */
.ws-act--hero { height: 36px; padding: 0 15px; font-size: 13px; }
.ws-act--hero .ws-act-ic svg { width: 16px; height: 16px; }
/* The next context's row is already tinted --ws-light, so its button needs a
   plain surface of its own to stay legible against it. */
.ws-row.is-next .ws-act { background: var(--surface); }
.ws-row.is-next .ws-act:hover, .ws-row.is-next .ws-act.is-set { background: var(--ws-light); }
.ws-muted { color: var(--label-3); font-weight: 600; }
/* Section header — the game a block of game-week practices belongs to. */
.ws-group {
  font-size: 11px; font-weight: 700; color: var(--label-3);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 15px 10px 4px;
}
.ws-group:first-child { padding-top: 4px; }
.ws-foot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--label-3); }

@media (max-width: 620px) {
  .ws-stats { grid-template-columns: 1fr; }
  /* The chevron goes, the action does not — it is the row's second panel, and
     the row itself is still tappable without it. In a row the chips give up
     width first so the button keeps its words; on the hero there isn't width to
     give, so the button takes a line of its own, full width, below the title. */
  .ws-hero-chev, .ws-row-chev { display: none; }
  .ws-chips { flex-wrap: wrap; justify-content: flex-end; max-width: 96px; gap: 4px; }
  .ws-row .ws-chips { max-width: 62px; }
  .ws-act { height: 34px; padding: 0 10px; margin-left: 2px; }
  .ws-hero { flex-wrap: wrap; }
  .ws-act--hero {
    flex: 1 0 100%; width: 100%; justify-content: center;
    height: 38px; margin: 13px 0 0; font-size: 13px;
  }
  .ws-panel-head { gap: 8px; }
  .ws-panel-meta { margin-left: 0; width: 100%; }
}

/* ── Recruiting workspace (dashboardAccess: 'recruiting') ─────────────
   Two pipelines and the roster they feed. Violet is the recruiting scope's
   colour (see SCOPES) and stands in for the program accent inside .rc —
   including the roster bars, which are red on the full dashboard. */
.rc {
  --rc:       #8b5cf6;
  --rc-light: rgba(139, 92, 246, 0.11);
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 26px 22px 60px;
}
body.booting .rc-greet { animation: fadeUp 0.4s  cubic-bezier(0.16,1,0.3,1) both; }
body.booting .rc-stats { animation: fadeUp 0.4s  cubic-bezier(0.16,1,0.3,1) 0.04s both; }
body.booting .rc-panel { animation: fadeUp 0.42s cubic-bezier(0.16,1,0.3,1) 0.08s both; }

.rc-greet { margin-bottom: 20px; }
.rc-greet h1 { font-size: 25px; font-weight: 780; letter-spacing: -0.025em; }
.rc-greet p  { font-size: 14px; color: var(--label-2); margin-top: 3px; }
.rc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }

/* Board on the left, roster on the right — the board is where the work is. */
.rc-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Primary switch between the two pipelines. Deliberately heavier than the
   bucket .tabs underneath it, so the hierarchy reads at a glance. */
.rc-seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-md); padding: 4px; gap: 3px; }
.rc-seg-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
  border: none; background: none; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 650; color: var(--label-2); cursor: pointer;
  white-space: nowrap; transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.rc-seg-btn svg { width: 15px; height: 15px; }
.rc-seg-btn:hover { color: var(--label); }
.rc-seg-btn.active { background: var(--surface); color: var(--rc); box-shadow: var(--shadow-sm); }
.rc-add { margin-left: auto; background: var(--rc-light); color: var(--rc); }
.rc-add:hover { background: var(--rc); color: #fff; }
/* Bucket row sits under the head, on the panel's own tint. */
.rc-buckets { display: flex; align-items: center; gap: 10px; padding: 11px 14px 0; }
.rc-tabs .tab.active { color: var(--rc); }
/* min-height keeps the panel from collapsing when a bucket is empty, so
   switching tabs doesn't make the roster beside it jump. */
.rc-list { max-height: 520px; min-height: 220px; padding-top: 6px; }

.rc-row { cursor: pointer; align-items: center; }
.rc .avatar-sm { background: var(--rc-light); color: var(--rc); }
.rc-row-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; }
/* Per-player notes tint to the workspace's purple instead of the generic accent. */
.rc .row-note-dot { background: var(--rc-light); color: var(--rc); }
.rc .row-actions .icon-btn:not(.danger):hover { background: var(--rc-light); color: var(--rc); }

/* Roster & NIL — same body as the dashboard card (see rosterBodyHTML), in
   the workspace's colour. */
.rc-side { display: flex; flex-direction: column; gap: 16px; }
.rc-roster-body { padding: 14px 12px 16px; }
.rc .rm-year-bar > div { background: var(--rc); }
.rc .rm-bar-fill { background: linear-gradient(90deg, #b49bfa, var(--rc)); }
.rc .rm-bar-fill.over { background: var(--red); }
.rc-edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto; width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--rc-light); color: var(--rc); border: none; cursor: pointer;
  transition: background 0.14s, color 0.14s, transform 0.08s;
}
.rc-edit-btn:hover  { background: var(--rc); color: #fff; }
.rc-edit-btn:active { transform: scale(0.92); }
.rc-edit-btn svg { width: 15px; height: 15px; }
.rc-panel-title { font-size: 14.5px; font-weight: 680; letter-spacing: -0.01em; }

/* Notes footer — the same dated threads the staff reads on the cards. This is
   the primary action for a recruiting-scoped account, not a quiet aside, so it
   reads as a filled CTA rather than a plain text row. */
.rc-foot { padding: 10px 12px 12px; border-top: 1px solid var(--border-2); }
.rc-notes-btn {
  display: inline-flex; align-items: center; gap: 9px; width: 100%;
  padding: 11px 14px; border-radius: var(--r-md); border: none;
  background: linear-gradient(135deg, var(--rc), #8a6ae8);
  color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
  cursor: pointer; box-shadow: 0 2px 10px -3px rgba(124, 90, 232, 0.55);
  transition: transform 0.14s, box-shadow 0.14s, filter 0.14s;
}
.rc-notes-btn:hover { filter: brightness(1.06); box-shadow: 0 4px 14px -3px rgba(124, 90, 232, 0.65); }
.rc-notes-btn:active { transform: scale(0.985); }
.rc-notes-btn-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0; border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.22);
}
.rc-notes-btn svg { width: 13px; height: 13px; }
.rc-notes-btn-ic svg { width: 12px; height: 12px; }
.rc-notes-count {
  margin-left: auto; font-size: 11px; font-weight: 750; color: #fff;
  background: rgba(255, 255, 255, 0.28); border-radius: var(--r-full); padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.rc-foot-note { margin-top: 16px; text-align: center; font-size: 12px; color: var(--label-3); }

@media (max-width: 940px) {
  .rc-grid { grid-template-columns: 1fr; }
  .rc-list { max-height: 440px; }
}
@media (max-width: 680px) {
  .rc-stats { grid-template-columns: repeat(2, 1fr); }
  .rc-panel-head { gap: 8px; }
  .rc-seg { width: 100%; }
  .rc-seg-btn { flex: 1; justify-content: center; padding: 7px 10px; }
}
