/* Learnium portal: case.css (F6, 2026-10-26). The case backbone screens: the staff "Case and deadlines" tab
   (case-views.js), the case parts of My work, and the student's key dates, team, report, visa and invoice list.
   Tokens from tokens.css only (light and dark); radius 0 (brand); no layout values inline. */

/* ---------- staff: Case and deadlines ---------- */
.case-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.case-sec { min-width: 0; }
.case-sec h3 + .sv-note { margin-top: -4px; }
.case-plan-form .sp-row, .case-add .sp-row { flex-wrap: wrap; }
.case-anchors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.case-anchor-det, .case-add-det, .case-closed { margin: 8px 0; }
.case-anchor-det > summary, .case-add-det > summary, .case-closed > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); }

.case-gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.case-gates > li { padding: 8px 12px; border: 1px solid var(--border); background: var(--surface); }
.case-gates > li.is-done { border-color: var(--border); background: var(--bg-subtle); }
.cg-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.cg-due { font-size: 12px; color: var(--fg-muted); }
.cg-ev { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; line-height: 18px; color: var(--fg-muted); }
.cg-ev li.met { color: var(--fg); }

.case-tasks { list-style: none; margin: 0; padding: 0; }
.case-tasks > li, .ca-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px;
  padding: 8px 0; border-top: 1px solid var(--border); }
.case-tasks > li:first-child, .ca-row:first-of-type { border-top: 0; }
.ct-main, .ca-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; font-size: 13px; line-height: 18px; }
.ct-meta { font-size: 12px; color: var(--fg-muted); overflow-wrap: anywhere; }
.ct-detail { font-size: 12px; color: var(--fg); overflow-wrap: anywhere; }
.ct-src { font-size: 11px; color: var(--fg-subtle); overflow-wrap: anywhere; }
.ct-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ct-side select { max-width: 160px; }
.ct-empty { padding: 8px 0; font-size: 13px; color: var(--fg-muted); }
.case-tasks.is-closed .ct-main b { font-weight: 500; color: var(--fg-muted); }
.case-line { margin: 0 0 6px; font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.case-line.is-handover { padding: 6px 8px; background: var(--accent-soft); color: var(--accent-soft-text); }

/* ---------- staff: My work ---------- */
.mw-case { display: grid; gap: 16px; margin-bottom: 16px; }
.mw-list li.is-hot .l1 { font-weight: 600; }
.case-mw .ca-row { padding: 8px 16px; }

/* ---------- billing: every invoice (instalments) ---------- */
.b-invlist { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; line-height: 20px; }
.b-invlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 0; border-top: 1px solid var(--border); }
.b-invlist li.is-focus b { color: var(--accent-text); }
.b-more { margin-top: 8px; }
.b-more > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); }
.b-guardian { margin: 4px 0; }

/* ---------- student: journey, dates, team, report, visa, invoices ---------- */
.route-milestones { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0; }
.route-milestones li { display: flex; justify-content: space-between; gap: 8px 16px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.route-milestones li:first-child { border-top: 0; }
.route-milestones li.is-done .ms-name { color: var(--fg-muted); }
.route-milestones li.is-current .ms-name { font-weight: 600; color: var(--accent-text); }
.route-milestones .ms-when { flex: none; font-size: 13px; color: var(--fg-muted); text-align: right; }
.case-dates { list-style: none; margin: 8px 0 0; padding: 0; }
.case-dates li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.case-dates li:first-child { border-top: 0; }
.case-dates li.is-over .cd-when { color: var(--danger-text); font-weight: 600; }
.cd-when { font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.cd-text { display: flex; flex-direction: column; min-width: 0; }
.cd-note { font-size: 12px; color: var(--fg-muted); }
.case-team { list-style: none; margin: 8px 0 0; padding: 0; }
.case-team li { display: flex; flex-direction: column; padding: 4px 0; font-size: 14px; line-height: 20px; }
.case-team li span { font-size: 12px; color: var(--fg-muted); }
.invoice-list { margin-top: 16px; }
.inv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.inv-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.inv-list li.is-shown b { color: var(--accent-text); }
.inv-list .inv-main { flex: 1 1 220px; min-width: 0; }
.inv-list label.btn input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-due { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--fg-muted); }
.doc-due.is-over { color: var(--danger-text); font-weight: 600; }

@media (max-width: 640px) {
  .case-dates li { grid-template-columns: minmax(0, 1fr); }
  .route-milestones li { flex-direction: column; gap: 0; }
  .route-milestones .ms-when { text-align: left; }
  .ct-side select { max-width: 100%; }
  .case-anchors { grid-template-columns: minmax(0, 1fr); }
}

/* 040 (RC-P13): what stops the case, and the owner's override */
.case-stop { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger-text); }
.case-stop.is-overridden { border-color: var(--warning); background: var(--warning-soft); color: var(--warning-text); }
.case-stop .sv-note { flex-basis: 100%; margin: 0; }
/* 040 (RC-P7): watch months that have begun; the owner's own ladder */
.case-mw .mw-sub { margin: var(--space-4) 16px var(--space-2); font-size: 0.95rem; }
.case-watch { list-style: none; margin: 0; padding: 0 16px; }
.case-watch li { display: flex; flex-wrap: wrap; gap: 4px var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--border); min-width: 0; }
.case-mw.is-owner { border-left: 3px solid var(--danger); }

/* Add a programme: search the Program Finder, or type it under "Not in the list" */
.case-pick-host { margin: 8px 0; }
.case-picker-list { list-style: none; margin: 4px 0 0; padding: 0; }
.case-picker-list .btn { width: 100%; text-align: left; justify-content: flex-start; white-space: normal; }
.case-chosen { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.case-free { margin: 8px 0; }
.case-free > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); }

/* ---------- staff: Transcript mapping (transcript-panel.js, migration 049, 2026-10-29) ---------- */
.tm-wrap { overflow-x: auto; margin: 8px 0 12px; }
.tm-table th, .tm-table td { vertical-align: top; }
.tm-table td { height: auto; }
.tm-course { min-width: 180px; overflow-wrap: anywhere; }
.tm-title { display: block; font-weight: 500; }
.tm-src, .tm-when { display: block; font-size: 11px; line-height: 16px; color: var(--fg-subtle); }
.tm-note { display: block; margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--fg-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.tm-credits { min-width: 130px; }
.tm-credits input { width: 72px; margin-right: 6px; }
.tm-credits select { max-width: 130px; margin-top: 4px; }
.tm-year { width: 80px; }
.tm-year input { width: 64px; }
.tm-areacell { min-width: 260px; }
.tm-area { display: flex; flex-direction: column; gap: 4px; }
.tm-area .tm-filter, .tm-area select { width: 100%; max-width: 360px; }
.tm-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; margin-right: 8px; }
.tm-areaname { font-size: 12px; color: var(--fg-muted); overflow-wrap: anywhere; }
.tm-none { font-size: 13px; color: var(--fg-muted); }
.tm-side { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-summary { margin: 0; font-size: 13px; color: var(--fg-muted); }
.tm-import { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tm-import .sv-note, .tm-import .field-hint { margin: 0; }
.tm-add { margin: 8px 0; }
.tm-add > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); }
.tm-addform { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; align-items: end; margin-top: 8px; }
.tm-addform .field { margin: 0; }
.tm-totals { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.tm-totals h4 { margin: 0 0 4px; font-size: 14px; }
.tm-totallist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.tm-totallist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tm-sum { font-variant-numeric: tabular-nums; }
.tm-extra { font-size: 12px; color: var(--warning-text); }

/* ============ Document review (doc-review.js, DOCUMENT_READING_PLAN §7, 2026-11-01) ============ */
.dr-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.dr-chip { font-size: 12px; padding: 2px 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--fg-muted); }
.dr-chip.is-look { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.dr-chip.is-ok { background: var(--info-soft); color: var(--info-text); border-color: transparent; }
.dr-chip.is-done { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.dr-chip.is-person, .dr-chip.is-wait { background: var(--surface-2); color: var(--fg-muted); }
.dr-dialog {
  position: fixed; inset: 0; margin: auto; width: calc(100% - 24px); height: calc(100% - 24px); max-width: none; max-height: none;
  padding: 0; border: 1px solid var(--border); border-radius: 0; background: var(--surface-raised); color: var(--fg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.dr-dialog[open] { display: grid; grid-template-rows: auto 1fr; }
.dr-dialog::backdrop { background: var(--overlay); }
.dr-head { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dr-title { font-family: var(--font-head); font-weight: 400; font-size: 18px; line-height: 24px; margin: 0; }
.dr-sub { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--fg-muted); }
.dr-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); min-height: 0; }
.dr-left { display: grid; grid-template-rows: auto 1fr; min-height: 0; padding: 0; background: var(--bg-subtle); border-right: 1px solid var(--border); }
.dr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dr-page { font-size: 13px; color: var(--fg-muted); padding: 0 6px; }
.dr-stage-wrap { overflow: auto; padding: 12px; min-height: 0; }
.dr-stage { position: relative; margin: 0 auto; }
.dr-sheet, .dr-boxes { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.dr-sheet { background: var(--surface); box-shadow: var(--shadow-md); }
.dr-img, .dr-canvas { display: block; }
.dr-box { position: absolute; border: 2px solid var(--info); background: color-mix(in srgb, var(--info) 10%, transparent); cursor: pointer; }
.dr-box.is-look { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.dr-box.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); outline: 2px solid var(--accent); outline-offset: 2px; }
.dr-right { overflow: auto; padding: 12px 16px 24px; min-height: 0; }
.dr-progress { font-size: 13px; color: var(--fg-muted); margin: 0 0 8px; }
.dr-sec { margin: 0 0 16px; }
.dr-sec h3 { font-family: var(--font-head); font-weight: 400; font-size: 15px; margin: 0 0 6px; }
.dr-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dr-sec-head h3 { margin: 0; }
.dr-checks, .dr-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dr-checks li { display: flex; gap: 8px; font-size: 13px; }
.dr-checks .is-bad { color: var(--danger-text); }
.dr-checks .is-unknown { color: var(--fg-muted); }
.dr-mark { width: 14px; flex: none; }
.dr-fact { border: 1px solid var(--border); background: var(--surface); padding: 8px 10px; cursor: pointer; }
.dr-fact.is-look { border-left: 3px solid var(--warning); }
.dr-fact.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dr-fact:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dr-fact-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.dr-key { font-size: 13px; color: var(--fg-muted); }
.dr-val { margin: 2px 0; font-size: 15px; color: var(--fg); overflow-wrap: anywhere; }
.dr-meta, .dr-reason { margin: 2px 0; font-size: 12px; color: var(--fg-muted); overflow-wrap: anywhere; }
.dr-reason { color: var(--warning-text); }
.dr-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 860px) {
  .dr-dialog { width: 100%; height: 100%; }
  .dr-body { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 45%) 1fr; }
  .dr-left { border-right: 0; border-bottom: 1px solid var(--border); }
}
