/* ============================================================
   TIMEFORGE — App shell + component styles
   Sits on top of tokens.css. Layout only lives here — colours,
   spacing scale and structural sizes stay in tokens.css so the
   two themes never need touching in this file.
   ============================================================ */

/* ── LOGIN ───────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--accent-orange);
  flex: 0 0 auto;
}

.login-brand-name {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-card h1 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--text-primary);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--fs-base);
  transition: border-color var(--transition);
}

.field input:focus {
  outline: none;
  border-color: var(--accent-teal);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  border: 1px solid transparent;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: var(--fs-sm); }

/* Same trap as .worker-pause-toggle below: `.btn { display: inline-flex }`
   is an author rule, so it beats the UA stylesheet's `[hidden] { display:
   none }` on source order regardless of specificity — any button toggled
   via the `hidden` attribute would otherwise stay visible. Fixed once here
   rather than per-button so the next page that hides a .btn doesn't
   rediscover it. */
.btn[hidden] { display: none; }

.btn-primary {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #FFFFFF;
}
.btn-primary:hover { background: var(--accent-orange-hover); }

.btn-ghost {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--accent-red-bg);
  border-color: var(--accent-red-border);
  color: var(--accent-red);
}
.btn-danger:hover { background: var(--accent-red-border); }

.login-error {
  margin: 0 0 16px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red-border);
  color: var(--accent-red);
  font-size: var(--fs-sm);
  display: none;
}
.login-error.is-visible { display: block; }

.login-footnote {
  margin: 20px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
}

/* ── SHELL LAYOUT ────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  flex: 0 0 auto;
  width: var(--sidebar-collapsed);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

:root[data-theme="light"] .sidebar {
  background: var(--sidebar-bg-light);
}

.sidebar:hover,
.sidebar:focus-within {
  width: var(--sidebar-expanded);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-height);
  padding: 0 14px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent-orange);
  flex: 0 0 auto;
}

.sidebar-brand-name {
  color: #EDE8E0;
  font-size: var(--fs-md);
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar:hover .sidebar-brand-name,
.sidebar:focus-within .sidebar-brand-name { opacity: 1; }

.sidebar-nav {
  flex: 1 1 auto;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 21px;
  color: rgba(237, 232, 224, 0.72);
  text-decoration: none;
  white-space: nowrap;
  border-left: 2px solid transparent;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #EDE8E0;
}

.nav-item.is-active {
  color: var(--accent-teal);
  border-left-color: var(--accent-teal);
  background: rgba(41, 182, 200, 0.08);
}

button.nav-item {
  background: none;
  border: none;
  border-left: 2px solid transparent;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-item svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.nav-item-label {
  font-size: var(--fs-base);
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar:hover .nav-item-label,
.sidebar:focus-within .nav-item-label { opacity: 1; }

.sidebar-footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 0;
}

/* ── MAIN COLUMN ─────────────────────────────────────────── */
.main-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.icon-btn svg { width: 16px; height: 16px; }

/* tokens.css gives .worker-pause-toggle `display: inline-flex`, which as an
   author rule beats the UA stylesheet's `[hidden] { display: none }` on
   origin alone regardless of specificity — so app.js setting .hidden = true
   would otherwise have no visible effect. Higher-specificity author rule to
   put `[hidden]` back in charge. */
.worker-pause-toggle[hidden] { display: none; }

.view-container {
  flex: 1 1 auto;
  padding: 28px 32px;
}

/* ── ROUTE FALLBACK / DASHBOARD PLACEHOLDER ─────────────────── */
.route-fallback,
.dashboard-placeholder {
  max-width: 520px;
}

.route-fallback p:last-child,
.dashboard-placeholder-body {
  color: var(--text-secondary);
}

.dashboard-placeholder h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 6px 0 14px;
  color: var(--text-primary);
}

/* ── DATA ENTRY PAGES ────────────────────────────────────────
   Shared by tutors/rooms/courses/year — a list with an inline
   add/edit panel, matching V11's interaction model, restyled to
   Planning Hub's tokens.
   ───────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.page-header p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 640px;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.section-toolbar h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.chip-neutral {
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-color: var(--border);
}

/* ── DATA TABLE ──────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-mid);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-primary);
  font-size: var(--fs-base);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .muted { color: var(--text-muted); font-size: var(--fs-sm); }

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ── FORM PANEL ──────────────────────────────────────────── */
.form-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.form-panel h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--text-primary);
}

.form-panel[hidden] { display: none; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px;
  margin-bottom: 18px;
}

.field-grid .field { margin-bottom: 0; }

.form-panel select {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--fs-base);
}

.section-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 22px 0 8px;
}

.field-hint {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

/* ── TOGGLE SWITCH ───────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 6px;
}
.toggle-row label[for] {
  cursor: pointer;
  color: var(--text-primary);
  font-size: var(--fs-base);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-purple-bg);
  border-color: var(--accent-purple);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: var(--accent-purple);
}

/* ── CAMPUS GRID ─────────────────────────────────────────── */
.campus-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 12px;
  align-items: center;
  max-width: 420px;
}
.campus-day-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.campus-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.campus-summary-item {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.campus-summary-item .campus-pill {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-teal-bg);
  border: 1px solid var(--accent-teal-border);
  color: var(--accent-teal);
  font-size: var(--fs-xs);
}

/* ── ADDABLE ROW BUILDER (unavailability, blackouts, etc.) ── */
.block-builder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.block-builder-row select { width: auto; min-width: 110px; }
.block-builder-row input {
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--fs-base);
}
.block-builder-row input[type="text"] { flex: 1; min-width: 160px; }
.block-builder-row .sep {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ── WORKING HOURS GRID (year.js) ────────────────────────── */
.hours-grid {
  display: grid;
  grid-template-columns: 44px 1fr auto 1fr;
  gap: 8px 12px;
  align-items: center;
  max-width: 420px;
}
.hours-day-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
}
.hours-sep {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* Viewer-role read-only state — year.js disables inputs rather than
   swapping to a separate read-only template. */
.field input:disabled,
.form-panel select:disabled,
.block-builder-row input:disabled,
.block-builder-row select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.block-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

/* ── TOASTS ──────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  animation: toast-in 180ms ease-out;
}
.toast.success { border-color: var(--accent-green-border); }
.toast.success .toast-icon { color: var(--accent-green); }
.toast.error { border-color: var(--accent-red-border); }
.toast.error .toast-icon { color: var(--accent-red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── FREE-TAG INPUT ──────────────────────────────────────────
   Room capability tags today; course required-room-tags and
   additional-tutor chips (P1.3) reuse the same pattern.
   ───────────────────────────────────────────────────────────── */
.tag-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.tag-input-row input,
.tag-input-row select {
  flex: 1;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--fs-base);
}
.tag-input-row input:focus,
.tag-input-row select:focus { outline: none; border-color: var(--accent-teal); }

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
}
.tag-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1;
}
.tag-remove:hover { color: var(--accent-red); }

/* ── SOLVE PAGE (solve.js) ───────────────────────────────────
   Options form reuses .form-panel/.field-grid/.toggle-row as-is.
   The live-run card below is new: a status chip + explanatory copy,
   a small stats row once a schedule exists (even a partial one —
   the worker writes best-so-far as it improves), and a streaming
   log. The log gets a monospace stack as a deliberate, narrow
   exception to ADR-008's "no monospace face" rule — CLAUDE.md's
   point there is about metadata LABEL runs; this is verbatim
   solver console output (aligned timing/penalty columns), which is
   what a monospace face is actually for.
   ───────────────────────────────────────────────────────────── */
.run-meta {
  margin: -6px 0 12px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.run-explain {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.run-explain[hidden] { display: none; }
.run-explain.explain-infeasible {
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red-border);
  color: var(--accent-red);
}
.run-explain.explain-timeout {
  background: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber);
}
.run-explain.explain-neutral {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.solve-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.solve-stats[hidden] { display: none; }
.stat-item {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-item .stat-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.stat-item .stat-value {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.solve-log {
  margin: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── BOARD PAGE (board.js) ───────────────────────────────────
   Calendar-style weekly grid: a fixed time-axis column plus one
   column per weekday, sessions absolutely positioned within their
   day's track by minutes-since-axis-start. The track height is set
   from JS via --board-height (depends on density), so this file only
   lays out the columns and the block chrome.
   ───────────────────────────────────────────────────────────── */
.board-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-toolbar-actions[hidden] { display: none; }
.density-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.density-toggle[hidden] { display: none; }
.density-btn {
  padding: 5px 10px;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.density-btn:last-child { border-right: none; }
.density-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.density-btn.is-active { background: var(--accent-teal-bg); color: var(--accent-teal); }

/* Timetable filter: same segmented-tab look as density-toggle for the
   dimension picker (Course/Tutor/Room), same chip-filter-row/-btn look
   the solve-history status filter already uses for the value picker. */
.board-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.board-filter-row[hidden] { display: none; }
.board-filter-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.board-filter-tab-btn {
  padding: 5px 10px;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.board-filter-tab-btn:last-child { border-right: none; }
.board-filter-tab-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.board-filter-tab-btn.is-active { background: var(--accent-teal-bg); color: var(--accent-teal); }

/* Overrides .form-panel select's width:100% — this is an inline toolbar
   control, not a form field, so it stays compact regardless of how many
   tutors/rooms/courses end up in its option list. */
.board-filter-row .board-filter-select {
  width: auto;
  min-width: 170px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--fs-xs);
}

.board-scroll {
  overflow-x: auto;
}

.board-grid {
  display: grid;
  grid-template-columns: 56px repeat(5, minmax(150px, 1fr));
  min-width: 760px;
}

.board-day-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-mid);
}
.board-axis-header { background: transparent; border-bottom-color: transparent; }

.board-axis-track {
  position: relative;
  height: var(--board-height);
  border-right: 1px solid var(--border);
}
.board-axis-tick {
  position: absolute;
  left: 0;
  right: 6px;
  transform: translateY(-50%);
  text-align: right;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.board-axis-tick.is-hour { color: var(--text-secondary); }

.board-day-col { min-width: 0; }
.board-day-track {
  position: relative;
  height: var(--board-height);
  border-right: 1px solid var(--border);
}
.board-day-col:last-child .board-day-track { border-right: none; }

.board-block {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--border-mid);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
}
.board-block.is-pdt { border-left-color: var(--accent-purple); }
.board-block.is-hourly { box-shadow: inset 0 0 0 2px var(--accent-amber); }

.board-block-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 2px;
}
.board-block-meta {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-block-time { color: var(--text-muted); }
.board-block-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.board-block.is-compact .board-block-title {
  font-size: var(--fs-xs);
  margin-bottom: 0;
}
.board-block.is-compact .board-block-meta:not(.board-block-time) { display: none; }
.board-block.is-compact .board-block-chips { display: none; }

/* ── SOLVE HISTORY (board.js) ─────────────────────────────────
   Status filter reuses the existing chip-* classes wrapped in plain
   buttons — dimmed unless selected — rather than a second visual
   language for the same statuses solve.js already renders.
   ───────────────────────────────────────────────────────────── */
.chip-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-filter-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.chip-filter-btn:hover { opacity: 0.8; }
.chip-filter-btn.is-active { opacity: 1; }

/* ── PRINT (board.js) ──────────────────────────────────────────
   Board-only printing: hide everything except the timetable grid
   and force a literal white/black page regardless of the active
   theme — dark ink on a near-black page wastes toner, and most
   printers ignore CSS background-color without "background
   graphics" explicitly turned on in the print dialog, so relying
   on var(--bg) here would print illegible pale-on-white text as
   often as not. This is the one place in the app that hardcodes
   colours instead of using tokens.css, deliberately.
   ───────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .page-header, #history-panel,
  .board-toolbar-actions, .board-filter-row, .toast-stack, #board-meta button {
    display: none !important;
  }
  body, .shell, .main-column, .view-container, #timetable-panel {
    background: #fff !important;
    color: #111 !important;
  }
  #timetable-panel {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .board-scroll { overflow: visible !important; }
  .board-day-header {
    background: #fff !important;
    color: #111 !important;
    border-bottom-color: #999 !important;
  }
  .board-axis-track, .board-day-track { border-right-color: #ccc !important; }
  .board-block {
    border-color: #999 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .board-block-title, .board-block-meta { color: #111 !important; }
  #board-stats, #board-stats .stat-item {
    background: #fff !important;
    border-color: #999 !important;
  }
  #board-stats .stat-label, #board-stats .stat-value {
    color: #111 !important;
  }
}

/* ── HOURS STATISTICS (stats.js) ─────────────────────────────
   Reuses .solve-stats/.stat-item for the per-tutor mini-metrics
   grid (same visual language as the Solve/Board stat rows) — only
   the card wrapper and the progress bar are new.
   ───────────────────────────────────────────────────────────── */
.tutor-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.tutor-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.tutor-stat-name {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tutor-stat-campus {
  font-size: var(--fs-xs);
  letter-spacing: var(--label-tracking);
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.tutor-stat-card .solve-stats {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-bottom: 14px;
}

.hours-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hours-bar-caption {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.hours-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hours-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition);
}
.hours-bar-label {
  font-size: var(--fs-xs);
  font-weight: 600;
}
