/*
 * dashboard.css — GoFindOne
 * Shared styles for all dashboard and profile pages.
 *
 * Load order (in each dashboard HTML <head>):
 *   1. ../colors_and_type.css   ← design tokens & fonts
 *   2. ../css/global.css        ← site-wide reset, nav, footer, buttons, tags
 *   3. ../css/dashboard.css     ← this file (dashboard chrome, shared patterns)
 *   4. <page-specific inline styles remain for anything unique to that page>
 *
 * Sections:
 *   1.  Light parchment surface
 *   2.  Nav — dark over light override
 *   3.  Page layout
 *   4.  Loading skeleton
 *   5.  Error / auth-guard states
 *   6.  Status tags — light surface variants
 *   7.  Stat strip
 *   8.  Section head (eyebrow + rule + count)
 *   9.  Modal overlay + modal base
 *  10.  Shared form field base — light surface
 *  11.  Animations (fadeSlideIn, spin, shimmer)
 *  12.  Mobile
 */


/* ─────────────────────────────────────────────
   1. LIGHT PARCHMENT SURFACE
   Applied to html/body on all dashboard + profile pages.
───────────────────────────────────────────── */
html, body {
  background: var(--light-bg);
  color: var(--light-fg);
}

body::after {
  opacity: 0.035;
  mix-blend-mode: multiply;
}


/* ─────────────────────────────────────────────
   2. NAV — DARK OVER LIGHT OVERRIDE
   All dashboard pages use the dark nav bar sitting
   over the light parchment body — same override pattern.
───────────────────────────────────────────── */
.nav {
  background: var(--dark-bg);
  border-bottom: 0.5px solid var(--dark-border);
  backdrop-filter: none;
}

.nav-wm { color: var(--dark-fg); }

.nav-section {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dark-fg-muted);
  padding-left: 24px;
  border-left: 0.5px solid var(--dark-border-mid);
}

.nav-section a {
  color: var(--dark-fg-muted);
  text-decoration: none;
  transition: color 180ms ease;
}
.nav-section a:hover { color: var(--dark-fg); }
.nav-section .crumb  { color: var(--dark-fg); }


/* ─────────────────────────────────────────────
   3. PAGE LAYOUT
───────────────────────────────────────────── */
.page {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 48px 48px 140px;
}

/* Breadcrumb meta row */
.meta-row {
  display: flex; align-items: center; gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.10em;
  color: var(--light-fg-dim); text-transform: uppercase;
}
.meta-row a {
  color: inherit; text-decoration: none;
  transition: color 180ms ease;
}
.meta-row a:hover { color: var(--light-fg); }
.meta-sep { color: var(--light-fg-dimmer); }


/* ─────────────────────────────────────────────
   4. LOADING SKELETON
───────────────────────────────────────────── */
.skel,
.skeleton {
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--light-bg-elevated) 25%,
    var(--light-bg-surface)  50%,
    var(--light-bg-elevated) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
}

.loading-state,
.loading-placeholder {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 48px 0;
}


/* ─────────────────────────────────────────────
   5. ERROR / AUTH-GUARD STATES
───────────────────────────────────────────── */
.error-state {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 80px 0 40px;
}
.error-state.visible { display: flex; }

.error-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; letter-spacing: 0.05em;
  color: var(--light-fg);
}

.error-body {
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 15px; color: var(--light-fg-muted);
  line-height: 1.6;
}
.error-body a { color: var(--teal-on-light); text-decoration: none; }

.auth-guard {
  display: none;
  flex-direction: column;
  padding: 80px 48px;
  max-width: 480px; margin: 0 auto;
  gap: 20px;
}
.auth-guard.visible { display: flex; }


/* ─────────────────────────────────────────────
   6. STATUS TAGS — LIGHT SURFACE VARIANTS
   Overrides the dark-surface .tag variants from global.css
   for pages using the light parchment theme.
───────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 3px;
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tag.live {
  color: var(--teal-on-light);
  border: 1px solid rgba(46,163,163,0.4);
  background: rgba(46,163,163,0.08);
}
.tag.draft {
  color: var(--urgent-on-light);
  border: 1px solid rgba(163,90,42,0.4);
  background: rgba(163,90,42,0.07);
}
.tag.under-review {
  color: var(--prize-on-light);
  border: 1px solid rgba(139,111,46,0.35);
  background: rgba(139,111,46,0.08);
}
.tag.closed {
  color: var(--light-fg-dim);
  border: 1px solid var(--light-border-mid);
  background: transparent;
}
.tag.no-award {
  color: var(--urgent-on-light);
  border: 1px solid rgba(163,90,42,0.3);
  background: rgba(163,90,42,0.06);
}
.tag.winner {
  color: var(--prize-on-light);
  border: 1px solid rgba(139,111,46,0.4);
  background: rgba(139,111,46,0.08);
}


/* ─────────────────────────────────────────────
   7. STAT STRIP
   Grid of stat cells — used on sponsor dashboard,
   problem-manage, and submission-review.
───────────────────────────────────────────── */
.stat-strip,
.stat-row {
  display: grid;
  gap: 1px;
  background: var(--light-border-mid);
  border: 0.5px solid var(--light-border-mid);
  border-radius: 3px;
  overflow: hidden;
}

.stat-cell {
  background: var(--light-bg-surface);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 3px;
}

.stat-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px; letter-spacing: -0.01em;
  line-height: 1; color: var(--light-fg);
}
.stat-val.teal   { color: var(--teal-on-light); }
.stat-val.prize  { color: var(--prize-on-light); }
.stat-val.urgent { color: var(--urgent-on-light); }

.stat-label {
  font-family: 'Source Serif 4', serif;
  font-weight: 300; font-size: 11px;
  color: var(--light-fg-muted); line-height: 1.4;
}

.stat-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--light-fg-dim);
  letter-spacing: 0.06em; margin-top: 2px; line-height: 1.5;
}


/* ─────────────────────────────────────────────
   8. SECTION HEAD — eyebrow + rule + count
   Shared heading pattern used across all dashboard pages.
───────────────────────────────────────────── */
.section-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}

.section-eyebrow {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--light-fg-muted);
  white-space: nowrap;
}

.section-rule {
  flex: 1; height: 0.5px;
  background: var(--light-border-mid);
}

.section-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: var(--light-fg-dim);
  white-space: nowrap;
}


/* ─────────────────────────────────────────────
   9. MODAL OVERLAY + MODAL BASE
   Shared across problem-manage, submission-review,
   and file-vault. Page-specific modal content styles
   remain inline in each page.
───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,17,14,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.visible { display: flex; }

.modal {
  background: var(--light-bg-surface);
  border: 0.5px solid var(--light-border-strong);
  border-radius: 4px;
  padding: 36px 40px;
  max-width: 480px; width: 100%;
  animation: fadeSlideIn 280ms ease forwards;
  display: flex; flex-direction: column; gap: 20px;
}

.modal-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--error-on-light);
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem; letter-spacing: 0.05em;
  line-height: 0.95; color: var(--light-fg);
}

.modal-body {
  font-family: 'Source Serif 4', serif;
  font-weight: 300; font-size: 14px;
  color: var(--light-fg-muted); line-height: 1.7;
}
.modal-body strong { font-weight: 500; color: var(--light-fg); }

.modal-actions {
  display: flex; gap: 10px;
  padding-top: 8px;
  border-top: 0.5px solid var(--light-border);
}

.btn-modal-cancel {
  height: 44px; padding: 0 20px;
  background: transparent; color: var(--light-fg-muted);
  font-family: 'Source Serif 4', serif;
  font-weight: 400; font-size: 13px;
  border: 0.5px solid var(--light-border-strong);
  border-radius: 3px; cursor: pointer;
  transition: all 180ms ease;
}
.btn-modal-cancel:hover { color: var(--light-fg); border-color: var(--light-fg-muted); }

/* Spinner — used inside modal confirm buttons and save buttons */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.loading .spinner   { display: block; }
.loading .btn-label { display: none; }


/* ─────────────────────────────────────────────
   10. SHARED FORM FIELD BASE — LIGHT SURFACE
   Input, textarea, select on the light parchment theme.
   Overrides the dark-surface inputs from forms.css
   for dashboard pages.
───────────────────────────────────────────── */
.page input[type="text"],
.page input[type="number"],
.page input[type="date"],
.page textarea,
.page select {
  width: 100%;
  background: var(--light-bg-surface);
  border: 0.5px solid rgba(20,17,14,0.18);
  border-radius: 3px;
  padding: 12px 14px;
  font-family: 'Source Serif 4', serif;
  font-weight: 300; font-size: 15px;
  color: var(--light-fg);
  transition: border-color 220ms ease, box-shadow 220ms ease;
  outline: none;
  -webkit-appearance: none;
}

.page input[type="text"]:focus,
.page input[type="number"]:focus,
.page input[type="date"]:focus,
.page textarea:focus,
.page select:focus {
  border-color: var(--teal-on-light);
  box-shadow: 0 0 0 3px rgba(46,163,163,0.10);
}

.page input::placeholder,
.page textarea::placeholder { color: var(--light-fg-dimmer); }

.page textarea { resize: vertical; line-height: 1.7; }

.page input:disabled,
.page textarea:disabled,
.page select:disabled {
  background: var(--light-bg-elevated);
  color: var(--light-fg-muted);
  cursor: not-allowed;
  opacity: 0.65;
}

.page select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23948e83' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px; cursor: pointer;
}

/* Field label */
.page label {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 13px;
  color: var(--light-fg); letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
}

.page .field-hint {
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 12px; color: var(--light-fg-muted);
  line-height: 1.5;
}

/* Save / action button — light surface primary */
.btn-save {
  height: 44px; padding: 0 28px;
  background: var(--light-fg); color: var(--light-bg);
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 12px;
  letter-spacing: 0.10em; text-transform: uppercase;
  border: none; border-radius: 3px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 220ms ease, transform 150ms ease, opacity 220ms ease;
}
.btn-save:hover:not(:disabled) { background: var(--teal-on-light); transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Save feedback / error inline text */
.save-feedback {
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 13px; color: var(--teal-on-light);
  display: none;
}
.save-feedback.visible { display: block; }

.save-error {
  font-family: 'Source Serif 4', serif;
  font-weight: 300; font-size: 13px;
  color: var(--error-on-light);
  display: none;
}
.save-error.visible { display: block; }

/* Inline notice — teal tinted info box */
.inline-notice {
  padding: 14px 18px;
  background: rgba(46,163,163,0.06);
  border: 0.5px solid rgba(46,163,163,0.25);
  border-radius: 3px; margin-top: 16px;
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 13px; color: var(--teal-on-light);
  display: none;
}
.inline-notice.visible { display: block; }

/* Closed notice — neutral info box */
.closed-notice {
  padding: 16px 20px;
  background: var(--light-bg-elevated);
  border: 0.5px solid var(--light-border-mid);
  border-radius: 3px;
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 14px; color: var(--light-fg-muted);
  display: none;
}
.closed-notice.visible { display: block; }


/* ─────────────────────────────────────────────
   11. ANIMATIONS
───────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}


/* ─────────────────────────────────────────────
   12. MOBILE — max-width: 640px
───────────────────────────────────────────── */
@media (max-width: 640px) {
  .page { padding: 32px 20px 100px; }
  .modal { padding: 28px 24px; }
}


/* ─────────────────────────────────────────────
   13. SECTION CHROME — form-page section pattern
   Used on problem-manage and future form-heavy
   dashboard pages. Distinct from the card section
   head (.section-head) used on sponsor.html.
───────────────────────────────────────────── */

/* Section wrapper */
.section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 0.5px solid var(--light-border-mid);
}
.section:first-of-type { border-top: none; margin-top: 40px; }

/* Two-column section head: left (eyebrow+title+sub) + right (edit toggle) */
.section-head-split {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px;
}
.section-head-left { display: flex; flex-direction: column; gap: 5px; }

/* Section eyebrow with teal leading rule — form-page variant */
.section-eyebrow-rule {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--light-fg-muted);
  display: flex; align-items: center; gap: 12px;
}
.section-eyebrow-rule::before {
  content: ''; width: 16px; height: 1px;
  background: var(--teal-on-light);
}

/* Section display title — Bebas */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  letter-spacing: 0.05em; line-height: 1;
  color: var(--light-fg);
}

/* Section subtitle — italic serif */
.section-sub {
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 13px; color: var(--light-fg-muted);
  line-height: 1.55; margin-top: 4px;
}


/* ─────────────────────────────────────────────
   14. FIELD LAYOUT
   Field wrapper and two-column grid used on
   problem-manage and any future form-heavy pages.
───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.field-row:last-child { margin-bottom: 0; }
.field-row .field { margin-bottom: 0; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}


/* ─────────────────────────────────────────────
   15. EDIT MODE PATTERN
   Toggle button, editing badge, save/cancel row.
   Used on problem-manage; reusable for any
   dashboard page with inline editing.
───────────────────────────────────────────── */

/* Row containing the edit toggle button + "Editing" badge */
.edit-toggle-row {
  display: flex; align-items: center; gap: 12px;
}

/* The "Edit →" / "Cancel" text button */
.btn-edit-toggle {
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-size: 13px;
  color: var(--teal-on-light);
  background: none; border: none; cursor: pointer; padding: 0;
  transition: opacity 200ms ease;
  display: flex; align-items: center; gap: 6px;
}
.btn-edit-toggle:hover { opacity: 0.7; }

/* "Editing" pill badge — shown while a section is in edit mode */
.edit-indicator {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--teal-on-light);
  background: rgba(46,163,163,0.10);
  border: 0.5px solid rgba(46,163,163,0.3);
  padding: 3px 8px; border-radius: 2px;
  display: none;
}
.edit-indicator.visible { display: inline-flex; }

/* Animated save/cancel row — slides in below a section when editing */
.save-row {
  display: none; align-items: center; gap: 14px;
  margin-top: 24px; padding-top: 20px;
  border-top: 0.5px solid var(--light-border);
  animation: fadeSlideIn 280ms ease forwards;
}
.save-row.visible { display: flex; }

/* Cancel text button */
.btn-cancel {
  font-family: 'Source Serif 4', serif;
  font-weight: 400; font-size: 13px;
  color: var(--light-fg-muted);
  background: none; border: none;
  cursor: pointer; padding: 0;
  transition: color 180ms ease;
}
.btn-cancel:hover { color: var(--light-fg); }


/* ─────────────────────────────────────────────
   16. MODAL CONFIRM BUTTON
   The action button inside confirmation modals.
   Styled per-context via modifier classes.
───────────────────────────────────────────── */
.btn-modal-confirm {
  height: 44px; padding: 0 24px;
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 3px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  border: none; transition: all 220ms ease;
}
/* Danger variant — used for close-early */
.btn-modal-confirm.close-early {
  background: var(--error-on-light); color: #fff;
}
.btn-modal-confirm.close-early:hover { opacity: 0.85; }
/* Warning variant — used for no-award */
.btn-modal-confirm.no-award {
  background: var(--urgent-on-light); color: #fff;
}
.btn-modal-confirm.no-award:hover { opacity: 0.85; }
.btn-modal-confirm:disabled { opacity: 0.35; cursor: not-allowed; }


/* ─────────────────────────────────────────────
   17. ACTION ZONE — "Waiting on you"
   The action-first zone at the top of the sponsor
   landing dashboard. Computed from problem state;
   shown when problems exist, hidden on first run.
───────────────────────────────────────────── */

.action-zone {
  margin-bottom: 44px;
}

.action-zone-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}

/* Action rows — one per item that needs attention */
.action-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 0.5px solid var(--light-border-mid);
  border-radius: 4px;
  overflow: hidden;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  background: var(--light-bg-surface);
  border-bottom: 0.5px solid var(--light-border);
  animation: fadeSlideIn 300ms ease forwards;
}
.action-row:last-child { border-bottom: none; }

.action-row-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.action-row-title {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 14px;
  color: var(--light-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 480px;
}

.action-row-desc {
  font-family: 'Source Serif 4', serif;
  font-weight: 300; font-style: italic;
  font-size: 12px; color: var(--light-fg-muted);
  line-height: 1.4;
}

/* Priority: pick-a-winner gets a left accent */
.action-row.pick-winner {
  border-left: 2px solid var(--teal-on-light);
}

/* Button on each action row */
.btn-action-row {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 12px;
  color: var(--teal-on-light);
  border: 1px solid rgba(46,163,163,0.35);
  background: transparent;
  padding: 8px 16px; border-radius: 3px;
  text-decoration: none; letter-spacing: 0.03em;
  white-space: nowrap; flex-shrink: 0;
  transition: background 200ms ease, border-color 200ms ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-action-row:hover {
  background: var(--teal-on-light-soft);
  border-color: var(--teal-on-light);
}

/* All-clear state — nothing waiting */
.action-clear {
  padding: 20px 22px;
  background: var(--light-bg-surface);
  border: 0.5px solid var(--light-border);
  border-radius: 4px;
  display: flex; flex-direction: column; gap: 6px;
}

.action-clear-title {
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 14px;
  color: var(--light-fg);
}

.action-clear-desc {
  font-family: 'Source Serif 4', serif;
  font-weight: 300; font-style: italic;
  font-size: 13px; color: var(--light-fg-muted);
  line-height: 1.5;
}


/* ─────────────────────────────────────────────
   18. CARD ANSWER COUNT + NEW PILL
   Replaces the old "N subs" pattern on sponsor
   dashboard problem cards.
───────────────────────────────────────────── */

.card-answer-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--light-fg-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}

.new-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal-on-light);
  background: rgba(46,163,163,0.10);
  border: 0.5px solid rgba(46,163,163,0.35);
  padding: 2px 7px; border-radius: 2px;
}


/* ─────────────────────────────────────────────
   19. CARD ARROW
   Static affordance glyph on whole-clickable cards.
   Matches the sponsor-profile.js card pattern.
───────────────────────────────────────────── */

.card-arrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px; color: var(--light-fg-dimmer);
  flex-shrink: 0;
  transition: color 200ms ease, transform 200ms ease;
  align-self: center;
}

.problem-card:hover .card-arrow,
.problem-card.card-clickable:hover .card-arrow {
  color: var(--teal-on-light);
  transform: translateX(3px);
}


/* ─────────────────────────────────────────────
   20. ROLE SWITCH
   Posting / Solving toggle in the sidebar account
   block. Shown only when is_sponsor && is_solver.
───────────────────────────────────────────── */

.role-switch {
  display: flex;
  gap: 2px;
  margin-top: 10px;
  padding: 3px;
  background: var(--light-bg-elevated);
  border: 0.5px solid var(--light-border-mid);
  border-radius: 3px;
}

.role-switch-btn {
  flex: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 8px;
  border-radius: 2px;
  border: none; cursor: pointer;
  text-decoration: none;
  color: var(--light-fg-muted);
  background: transparent;
  transition: color 160ms ease, background 160ms ease;
  display: block;
}
.role-switch-btn:hover { color: var(--light-fg); }

.role-switch-btn.active {
  background: var(--light-bg-surface);
  color: var(--teal-on-light);
  box-shadow: 0 1px 3px rgba(20,17,14,0.08);
}


/* ─────────────────────────────────────────────
   21. PROBLEM WORKSPACE — chrome
   The unified surface at problem-manage.html?id=.
   One header (the constant), one tab bar (carries
   signal), three panels (Answers / The problem /
   Files). Answers-specific styles live in the page
   <style>; this section is reusable workspace shell
   only. Replaces the old .status-banner pattern.
───────────────────────────────────────────── */

/* ── The constant header ──
   Title + prize/clock on the left, status tag and
   "see it on the board" on the right. Persists above
   the tabs no matter which panel is open; updated in
   place when status changes (no reload). */
.ws-header {
  margin-top: 28px;
  padding: 20px 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  border: 0.5px solid var(--light-border-mid);
  border-radius: 4px;
  background: var(--light-bg-surface);
}
.ws-header.live         { border-left: 2px solid var(--teal-on-light); }
.ws-header.draft        { border-left: 2px solid var(--light-fg-dimmer); }
.ws-header.under_review { border-left: 2px solid var(--prize-on-light); }
.ws-header.closed,
.ws-header.no_award     { border-left: 2px solid var(--light-fg-dim); }

.ws-header-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.ws-title {
  font-family: 'Source Serif 4', serif;
  font-weight: 400; font-style: italic;
  font-size: 19px; color: var(--light-fg); line-height: 1.3;
}

.ws-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--light-fg-dim); letter-spacing: 0.06em;
}
.ws-meta-prize { color: var(--prize-on-light); }
.ws-meta-sep   { color: var(--light-fg-dimmer); }
.ws-meta-urgent { color: var(--urgent-on-light); }

.ws-header-side {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}

/* "See it on the board →" — only shown for live/closed
   problems (a draft isn't on the board). JS toggles. */
.ws-board-link {
  display: none;
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 12px;
  color: var(--teal-on-light);
  border: 1px solid rgba(46,163,163,0.35);
  padding: 8px 16px; border-radius: 3px;
  text-decoration: none; letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 200ms ease;
}
.ws-board-link.visible { display: inline-flex; }
.ws-board-link:hover { background: var(--teal-on-light-soft); }

/* ── The tab bar ──
   Tabs carry state: the answer count + a "new" pill on
   Answers, a rejection dot on The problem. You read the
   problem's state off the bar before clicking. */
.ws-tabs {
  margin-top: 26px;
  display: flex; gap: 2px;
  border-bottom: 0.5px solid var(--light-border-mid);
}

.ws-tab {
  position: relative;
  font-family: 'Source Serif 4', serif;
  font-weight: 500; font-size: 13px; letter-spacing: 0.02em;
  color: var(--light-fg-muted);
  background: none; border: none; cursor: pointer;
  padding: 12px 18px;
  display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: color 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}
.ws-tab:hover { color: var(--light-fg); }
.ws-tab.active {
  color: var(--light-fg);
  border-bottom-color: var(--teal-on-light);
}

/* Answer count chip inside the Answers tab */
.ws-tab-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--light-fg-dim);
  background: var(--light-bg-elevated);
  border: 0.5px solid var(--light-border-mid);
  padding: 1px 7px; border-radius: 2px;
}
.ws-tab.active .ws-tab-count {
  color: var(--teal-on-light);
  border-color: rgba(46,163,163,0.3);
  background: rgba(46,163,163,0.08);
}
/* (the "N new" pill reuses .new-pill from section 18) */

/* Rejection indicator on The problem tab */
.ws-tab-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--urgent-on-light); flex-shrink: 0;
}

/* ── Panels ──
   Only one active at a time. Switching is show/hide on
   already-loaded panels — no reload, state preserved. */
.ws-panel { display: none; }
.ws-panel.active { display: block; }

/* ── Interim stub (panels ported in later steps) ── */
.ws-panel-stub {
  margin-top: 40px; padding: 56px 32px;
  border: 0.5px dashed var(--light-border-strong);
  border-radius: 4px; text-align: center;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.ws-panel-stub-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: 0.05em;
  color: var(--light-fg-dim);
}
.ws-panel-stub-body {
  font-family: 'Source Serif 4', serif;
  font-style: italic; font-weight: 300;
  font-size: 14px; color: var(--light-fg-muted);
  max-width: 420px; line-height: 1.6;
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .ws-header { flex-direction: column; align-items: flex-start; }
  .ws-header-side { width: 100%; justify-content: space-between; }
  .ws-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ws-tab { padding: 12px 14px; }
}
