/* ===========================================================
   San Joaquin A+ Portal — Design tokens (UI Style Guide v1.1)
   =========================================================== */
:root {
  /* Brand anchors */
  --color-navy: #193759;      /* Midnight Blue — headings, strong text */
  --color-nav: #064851;       /* Midnight Green — sidebar / dark chrome */

  /* Action */
  --color-primary: #02AB79;   /* Emerald — primary CTA, active state, progress */
  --color-primary-hover: #029468;

  /* Warmth / info */
  --color-sand: #FDE482;      /* Soft Sand — action-needed, student highlights */
  --color-sand-border: #F3D878;
  --color-info: #CAEBFC;      /* Pale Blue — callouts, informational badges */

  /* Neutrals */
  --color-bg: #F7FAFB;        /* app background / nested neutral panels */
  --color-surface: #FFFFFF;   /* cards, inputs, primary content surfaces */
  --color-border: #D9E2E6;    /* card & control borders, dividers */
  --color-muted: #5D6874;     /* secondary/metadata text */

  /* Functional (exception to brand palette) */
  --color-danger: #B83A3A;    /* errors, blocked states */
  --color-danger-bg: #FDF3F3;
  --color-danger-border: #ECC9C9;

  --color-mint: #D8ECD9;      /* 6th brand color -- icon-chip success/action tint */

  --radius-control: 8px;
  --radius-card: 12px;
  --shadow-card: 0 1px 2px rgba(6, 72, 81, 0.06);
}

* { box-sizing: border-box; }

body {
  font-family: "Basic Sans", Arial, Helvetica, sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  background: var(--color-bg);
  color: var(--color-navy);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 400; color: var(--color-navy); margin: 0; }
a { color: var(--color-nav); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.muted { color: var(--color-muted); font-size: 13px; font-weight: 300; }

/* ---------- App shell (§2) ---------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 200px;
  flex: none;
  background: var(--color-nav);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}
.sidebar-brand {
  padding: 4px 8px 20px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.sidebar-logo { width: 100%; height: auto; display: block; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar button[data-view] {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: none; border-radius: var(--radius-control);
  color: rgba(255,255,255,0.82);
  font-family: inherit; font-size: 14px; font-weight: 400;
  padding: 12px 12px; min-height: 44px; cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.sidebar button[data-view]:hover { background: rgba(255,255,255,0.09); color: #fff; }
.sidebar button[data-view].active { background: var(--color-primary); color: #fff; }

/* ---------- Sidebar group (SJA+ Hub) ---------- */
/* A labeled sub-section with its own indented nav buttons, e.g. "SJA+ Hub"
   containing "SJA+ WBL Series" / "Internships" -- see Portal Navigation
   Structure.docx. Only the student portal has one today; other roles'
   sidebar items are unaffected. */
.sidebar-group { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.sidebar-group-label {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 2px; font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.04em; color: rgba(255,255,255,0.5);
}
.sidebar-group button[data-view] { padding-left: 22px; font-size: 13px; }

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.14); }
.avatar-chip { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--color-info); }
.nav-item-signout {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: transparent; border: none; border-radius: var(--radius-control);
  color: rgba(255,255,255,0.7); font-family: inherit; font-size: 13px; font-weight: 400;
  padding: 10px 12px; min-height: 40px; text-align: left; cursor: pointer;
}
.nav-item-signout:hover { background: rgba(255,255,255,0.09); color: #fff; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; flex: none;
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 24px;
}
.topbar-title { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-title h1 { font-size: 18px; font-weight: 400; }

/* ---------- Topbar right side: search + account chip ---------- */
.topbar-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.topbar-account-chip {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: none; border: none; cursor: pointer;
  padding: 6px 8px; border-radius: var(--radius-control); font-family: inherit;
}
.topbar-account-chip:hover { background: var(--color-bg); }
.topbar-account-chip-name { font-size: 13px; color: var(--color-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

/* ---------- Universal search (topbar, persistent across every view) ---------- */
.topbar-search { position: relative; width: 320px; max-width: 40vw; }
.topbar-search input { min-height: 38px; padding: 7px 12px 7px 36px; }
.topbar-search .sja-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 4px); right: 0; width: 320px;
  max-height: 360px; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-card); box-shadow: 0 8px 24px rgba(6, 72, 81, 0.14);
  z-index: 50; padding: 6px 0;
}
.search-result-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); padding: 8px 12px 4px; }
.search-result-item {
  display: flex; flex-direction: column; width: 100%; text-align: left;
  background: none; border: none; padding: 8px 12px; cursor: pointer; font-family: inherit;
}
.search-result-item:hover, .search-result-item:focus-visible { background: var(--color-bg); }
.search-result-item strong { font-size: 13px; color: var(--color-navy); font-weight: 400; }
.search-result-item .muted { font-size: 12px; }
.search-empty { padding: 10px 12px; color: var(--color-muted); font-size: 13px; }

main#app { max-width: 960px; width: 100%; margin: 0 auto; padding: 32px; }
body.wide-view main#app { max-width: 1400px; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 8px 12px; overflow-x: auto; }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; }
  .sidebar-footer { margin-top: 0; padding-top: 0; border-top: none; border-left: 1px solid rgba(255,255,255,0.14); padding-left: 8px; }
  .nav-item-signout { white-space: nowrap; }
  main#app { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
}

/* ---------- Typography (§1.2) ---------- */
h2 { font-size: 17px; font-weight: 400; margin: 0 0 4px; }
label { display: block; font-size: 13px; font-weight: 400; color: var(--color-nav); margin: 16px 0 6px; }

/* ---------- Cards (§3.5) ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.events-tab-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

/* ---------- Icons (SJA+ custom set -- see icons/sja-plus-icons) ---------- */
.sja-icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
/* Sidebar (Midnight Green bg): white icon, Emerald accent; active item uses Soft Sand accent */
.sidebar .sja-icon         { color: #fff; --sja-icon-accent: var(--color-primary); }
.sidebar-group-label .sja-icon { color: rgba(255,255,255,0.5); }
.sidebar .active .sja-icon { --sja-icon-accent: var(--color-sand); }
/* Body content: Midnight Blue icon, Emerald accent */
.content .sja-icon, main .sja-icon { color: var(--color-navy); --sja-icon-accent: var(--color-primary); }
/* Both the icon's base color AND its accent sub-paths (the "+" in
   add-square, the checkmark in document-check, etc.) must track the
   button's own text color here, not the ambient `main .sja-icon` accent
   (emerald) -- left as emerald, that accent sub-path renders emerald on
   an emerald .primary button's background and all but disappears. */
button .sja-icon { color: inherit; --sja-icon-accent: currentColor; }

.icon-chip { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.icon-chip--success   { background: var(--color-mint); color: var(--color-nav); --sja-icon-accent: var(--color-primary); }
.icon-chip--info      { background: var(--color-info); color: var(--color-navy); --sja-icon-accent: var(--color-navy); }
.icon-chip--attention { background: var(--color-sand); color: var(--color-navy); --sja-icon-accent: var(--color-navy); }
.icon-chip--system    { background: #E8EDF2; color: var(--color-navy); --sja-icon-accent: var(--color-primary); }
.icon-chip.small { width: 32px; height: 32px; border-radius: 8px; }
.icon-chip.small .sja-icon { width: 16px; height: 16px; }

/* Buttons that pair an icon with a text label -- gap between the two.
   Deliberately inline-flex, not flex: a button (or any other element this
   is applied to) needs to keep sitting inline next to sibling buttons in
   plain block flow, not become its own full-width block box. */
.icon-label-row { display: inline-flex; align-items: center; gap: 6px; }
button.mini.icon-label-row .sja-icon { width: 13px; height: 13px; }

/* A standalone icon + fact, its own full-width row (e.g. "School: Lincoln
   High", one per line in a Student Info card) -- NOT .icon-label-row:
   that one is inline-flex on purpose for button content, which made every
   sibling "row" here sit on the same line instead of stacking whenever
   its container wasn't already a flex parent. Real block display fixes
   that regardless of what the row sits inside. */
.info-row { display: flex; align-items: center; gap: 6px; }

/* ---------- Modal (pop-up forms) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 26, 31, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 1000;
}
.modal-dialog {
  background: var(--color-surface); border-radius: var(--radius-card);
  box-shadow: 0 16px 48px rgba(6, 72, 81, 0.28);
  width: 100%; max-width: 640px; margin: auto 0;
}
.modal-dialog.wide { max-width: 900px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--color-border);
}
.modal-header h2 { margin: 0; }
.modal-close {
  background: transparent; border: none; font-size: 22px; line-height: 1;
  color: var(--color-muted); cursor: pointer; padding: 4px 8px;
}
.modal-close:hover { color: var(--color-navy); }
.modal-body { padding: 20px 24px 24px; }

/* In-app resource viewers (public/lib/resourceViewer.js) -- share the
   modal's .wide dialog above. */
.resource-viewer-frame { width: 100%; height: 75vh; border: none; display: block; }
.resource-viewer-video { width: 100%; max-height: 75vh; display: block; background: #000; border-radius: var(--radius-control); }
.resource-viewer-docx { max-height: 75vh; overflow-y: auto; line-height: 1.6; }
.resource-viewer-docx img { max-width: 100%; }
.resource-viewer-docx table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.resource-viewer-docx td, .resource-viewer-docx th { border: 1px solid var(--color-border); padding: 6px 8px; font-size: 13px; }

/* ---------- Forms (§3.6) ---------- */
input, select, textarea {
  width: 100%; padding: 10px 12px; min-height: 42px;
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  font-size: 14px; font-family: inherit; font-weight: 300;
  color: var(--color-navy); background: var(--color-surface);
}
textarea { min-height: 72px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(2,171,121,0.18);
}

/* ---------- Buttons (§3.1) ---------- */
/* `.primary`/`.danger` (color variant) and `.small` (size) are meant to
   compose -- iconButton('x', 'y', 'small primary') is used throughout the
   app for a small green button. They used to fight: .small unconditionally
   set its own background/border/color, and since it's declared after
   .primary/.danger with equal specificity, it silently won every time it
   was combined with either -- "small primary" rendered as a plain white/
   bordered button, not green, and .primary's own margin-top (meant for a
   standalone submit button at the end of a form) still applied even in a
   header-row context, throwing off alignment next to a sibling .small
   button. Size (padding/font-size/min-height) and color (background/
   border/color) are now separate rulesets: .small always sets size; its
   color only applies when NOT also .primary/.danger, so a combined class
   keeps the size from .small and the color from whichever variant it's
   paired with. margin-top moved out entirely -- callers that relied on it
   (a lone submit button after a stack of form fields) set it inline.
   See memory and the chat for where this was first caught. */
button { font-family: inherit; }
button.primary {
  background: var(--color-primary); color: #fff; border: none;
  padding: 10px 20px; border-radius: var(--radius-control); cursor: pointer;
  font-size: 14px; font-weight: 400; min-height: 42px;
}
button.primary:hover { background: var(--color-primary-hover); }
/* Text/icon color overridden here too -- button.primary's white (meant for
   the solid emerald background) fails contrast against this lightened
   background otherwise (icons inherit a button's color via `button
   .sja-icon { color: inherit; }` above, so this fixes both at once). */
button.primary:disabled { background: #a9d9c8; color: var(--color-navy); cursor: not-allowed; }

button.small {
  padding: 7px 14px; border-radius: var(--radius-control);
  cursor: pointer; font-size: 13px; font-weight: 400; min-height: 36px;
}
button.small:not(.primary):not(.danger) {
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-navy);
}
button.small:not(.primary):not(.danger):hover { border-color: var(--color-navy); }

button.danger {
  background: var(--color-surface); color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}
button.danger:hover { border-color: var(--color-danger); background: var(--color-danger-bg); }

button.link-btn {
  background: none; border: none; padding: 0; margin-top: 14px;
  color: var(--color-nav); font-size: 13px; font-weight: 400;
  text-decoration: underline; cursor: pointer; display: block;
}
button.link-btn:hover { color: var(--color-primary); }

/* ---------- Tables (§3.8) ---------- */
/* Every table is wrapped in this (see dataTable()/table() in lib/dom.js)
   -- a table with enough columns, or one unbreakable wide cell, can be
   wider than its card; this scrolls horizontally inside the card instead
   of visually overflowing its border. */
.table-scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--color-border); font-size: 13px; }
th {
  background: var(--color-info); color: var(--color-navy); font-weight: 400; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
tbody tr:hover > td { background: var(--color-bg); }

/* ---------- My Account ---------- */
.account-avatar-row { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.avatar-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--color-info); flex: none; }

/* ---------- Video recording (spike) ---------- */
.record-video {
  width: 100%; max-width: 480px; aspect-ratio: 4 / 3;
  background: #111; border-radius: var(--radius-card); display: block;
}

/* ---------- Status badges (§3.7) ---------- */
.badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 400;
  padding: 2px 8px; border-radius: 999px; background: var(--color-info);
  color: var(--color-navy); margin-left: 6px;
}
.badge.write { background: var(--color-sand); color: var(--color-navy); }

.list-item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.list-item-row input { flex: 1; }
.instance-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--color-border); min-height: 48px; }
.instance-row:last-child { border-bottom: none; }
.field-block { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--color-border); }
.field-block:last-child { border-bottom: none; }
.template-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--color-border); min-height: 48px; }
.template-row:last-child { border-bottom: none; }
.config-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.config-row input { flex: 1; }

/* ---------- Warning / action-needed banner (§3.7 "Action needed") ---------- */
.warning-banner {
  background: var(--color-sand); color: var(--color-navy);
  border: 1px solid var(--color-sand-border); border-radius: var(--radius-control);
  padding: 12px 16px; font-size: 13px; margin-bottom: 16px;
}
.warning-banner::before { content: "⚠ "; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.inline-form > div { flex: 1; }
.inline-form label { margin: 0 0 4px; }
.rich-text-content { font-size: 14px; line-height: 1.5; }
.rich-text-content p { margin: 0 0 10px; }
.rich-text-content ul, .rich-text-content ol { margin: 0 0 10px; padding-left: 22px; }
.preview-box { border: 1px dashed var(--color-border); border-radius: var(--radius-control); padding: 10px; }
.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-control); }
video { width: 100%; border-radius: var(--radius-control); }
.doc-image { max-width: 100%; border-radius: var(--radius-control); display: block; }
.divider-line { border: none; border-top: 2px solid var(--color-border); margin: 14px 0; }
.doc-header { margin: 6px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--color-navy); font-size: 17px; }
.signature-input { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 20px; border: none; border-bottom: 2px solid var(--color-navy); border-radius: 0; background: transparent; padding: 6px 4px; }
.page-break-marker { display: flex; align-items: center; gap: 8px; color: var(--color-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin: 12px 0; }
.page-break-marker::before, .page-break-marker::after { content: ''; flex: 1; border-top: 1px dashed var(--color-border); }
@media print { .page-break-host { page-break-before: always; } }

.builder-columns { display: grid; grid-template-columns: 200px 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .builder-columns { grid-template-columns: 1fr; } }

.palette-panel .palette-list { display: flex; flex-direction: column; gap: 6px; }
.palette-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-control); cursor: pointer; font-size: 13px; background: var(--color-surface); }
.palette-item:hover { border-color: var(--color-primary); background: #EAFBF5; }
.palette-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; font-size: 14px; flex-shrink: 0; }

.canvas-panel { min-width: 0; }
.field-preview-card { position: relative; border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 14px 14px 14px 30px; margin-bottom: 14px; background: var(--color-surface); cursor: pointer; }
.field-preview-card:hover { border-color: #b9c7c0; }
.field-preview-card.selected { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.field-preview-card.dragging { opacity: 0.4; }
.field-preview-card.drag-over { border-top: 2px solid var(--color-primary); }
.field-preview-drag-handle { position: absolute; top: 12px; left: 6px; cursor: grab; color: #bbb; font-size: 14px; user-select: none; opacity: 0; transition: opacity .1s; }
.field-preview-card:hover .field-preview-drag-handle { opacity: 1; }
.field-preview-label { display: flex; align-items: center; gap: 8px; }
.field-type-tag { flex-shrink: 0; }
.field-preview-body { margin-top: 8px; }
.field-preview-body input, .field-preview-body textarea, .field-preview-body select { background: var(--color-bg); }
.field-config-panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--color-border); }

.settings-panel-header { display: flex; justify-content: space-between; align-items: center; }
.settings-panel-header h2 { margin: 0; }

.connections-panel .connection-group { margin-bottom: 16px; }
.connections-panel .connection-group:last-child { margin-bottom: 0; }
.connections-panel h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); margin: 0 0 6px; font-weight: 400; }
.connection-item { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--color-border); }
.connection-item:last-child { border-bottom: none; }
.connection-item code { background: var(--color-bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.user-row { padding: 14px 0; border-bottom: 1px solid var(--color-border); min-height: 48px; }
.user-row:last-child { border-bottom: none; }
.user-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.role-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.role-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--color-info); color: var(--color-navy); border-radius: 14px; padding: 4px 10px; font-size: 12px; }
.role-badge.inactive { background: var(--color-border); color: var(--color-muted); }
button.mini { background: transparent; border: 1px solid currentColor; color: inherit; padding: 1px 7px; border-radius: 10px; cursor: pointer; font-size: 11px; opacity: 0.75; }
button.mini:hover { opacity: 1; }
button.mini.danger { color: var(--color-danger); }
.add-role-form .config-row { margin-bottom: 0; }
.add-role-form select, .add-role-form button { width: auto; }

/* ---------- Journey progress ---------- */
.journey-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; flex-wrap: wrap; gap: 10px; }

/* Staff student-detail page (students.js) -- a plain checklist per
   journey template, grouped under the student's current program year.
   Replaced the old locked/connector stepper + card-hub diagrams entirely
   (see the chat -- "do not use the flowchart here"); those, and their
   now-unused CSS, are gone. .journey-subgroup/.journey-checklist below are
   untouched -- still shared with Admin > Journeys' own read-only diagram. */
.journey-flat-block { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.journey-flat-block:last-child { border-bottom: none; }
.journey-flat-header { display: flex; align-items: center; gap: 8px; }
.journey-flat-rollup { margin-left: auto; font-size: 12px; }
.journey-flat-steps { margin-top: 8px; }
.journey-flat-step { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--color-navy); }

/* Simplified "Your Progress" list (public/views/wbl.js) -- a student's own
   view only; staff still see the stepper/cards above on the student
   detail page. Plain rows, 3 statuses, no lock/connector diagram. */
.progress-list { display: flex; flex-direction: column; }
.progress-list-item { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.progress-list-item:last-child { border-bottom: none; }
.progress-list-item-header { display: flex; align-items: center; gap: 12px; }
.progress-list-item-title { font-size: 14px; font-weight: 700; color: var(--color-navy); }
.progress-list-item-status { font-size: 12px; margin-top: 2px; }
.progress-list-item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0 52px; }
.progress-list-item-resources { margin: 10px 0 0 52px; }
/* "Optional: Request Feedback" -- a non-gating sub-item under Build Your
   Resume, not its own numbered step (see routes/journeys.js's
   progress-list route). Indented + lighter so it visually reads as
   secondary to the numbered steps above it. */
.progress-list-item-optional { margin-left: 24px; padding-top: 10px; padding-bottom: 10px; }
.progress-list-item-optional .progress-list-item-title { font-size: 13px; font-weight: 400; color: var(--color-nav); }

/* An any_of/all_of step's children -- "Choose one" (Resume Workshop OR
   Self-Service+Quiz) or "All required" (Materials + Quiz). Used by the
   read-only Admin > Journeys diagram (admin.js) via renderStepGroup() in
   dom.js -- students.js no longer renders a step tree at all (see the
   chat), this is admin.js's own read-only diagram now. */
.journey-subgroup { margin-top: 10px; text-align: left; }
.journey-subgroup-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); margin-bottom: 6px; }
.journey-suboptions { display: flex; align-items: stretch; gap: 8px; }
.journey-suboption-or { align-self: center; font-size: 12px; color: var(--color-muted); font-style: italic; }
.journey-suboption {
  flex: 1; border: 1px dashed var(--color-border); border-radius: var(--radius-control);
  padding: 8px 10px; background: var(--color-bg); min-width: 140px;
}
.journey-suboption-title { font-size: 12px; font-weight: 700; color: var(--color-navy); margin-bottom: 6px; }
.journey-checklist { display: flex; flex-direction: column; gap: 6px; }
.journey-checklist-item {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-navy);
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  padding: 6px 8px; background: var(--color-surface);
}
.journey-checklist-item span { flex: 1; }

/* Admin > Journeys read-only diagram (admin.js) -- top-level phases left
   to right, reusing .journey-subgroup/.journey-checklist/.journey-suboption
   above for any_of/all_of children via the same renderStepGroup(). */
.journey-diagram-row { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; padding: 12px 4px; }
.journey-diagram-box {
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
  padding: 14px; min-width: 200px; max-width: 280px; background: var(--color-surface); flex: none;
}
.journey-diagram-box.any_of { border-style: dashed; border-color: var(--color-primary); }
.journey-diagram-box.all_of { border-color: var(--color-navy); }
.journey-diagram-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--color-navy); }
.journey-diagram-connector { display: flex; align-items: center; color: var(--color-muted); margin-top: 20px; flex: none; }

/* ---------- SJA+ Hub pages (WBL Series / Internships) ---------- */
/* See Portal Navigation Structure.docx: breadcrumb -> page title -> a row
   of "tertiary tabs" across the top of the content area (Overview | Resume
   Workshop | Interview Prep Workshop | Resources for WBL Series). */
.hub-breadcrumb { font-size: 13px; color: var(--color-muted); margin-bottom: 6px; }
.hub-breadcrumb .current { color: var(--color-navy); font-weight: 400; }
.hub-breadcrumb button {
  background: none; border: none; padding: 0; margin: 0; font: inherit;
  color: var(--color-muted); cursor: pointer; text-decoration: none;
}
.hub-breadcrumb button:hover { color: var(--color-primary); text-decoration: underline; }
.hub-title { font-size: 28px; font-weight: 700; color: var(--color-navy); margin: 0 0 6px; }
.hub-title-underline { width: 48px; height: 3px; background: var(--color-sand-border, var(--color-sand)); margin-bottom: 14px; }
.hub-subtitle { font-size: 16px; color: var(--color-navy); margin: 0 0 6px; }

.tertiary-tabs {
  display: flex; gap: 28px; border-bottom: 1px solid var(--color-border);
  margin: 18px 0 20px; overflow-x: auto;
}
.tertiary-tab {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 14px; color: var(--color-muted); white-space: nowrap;
  padding: 0 2px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tertiary-tab:hover { color: var(--color-navy); }
.tertiary-tab.active { color: var(--color-navy); font-weight: 700; border-bottom-color: var(--color-primary); }
.tertiary-tab.locked { opacity: 0.55; }
.tertiary-tab.locked:hover { color: var(--color-muted); }

.resource-list { display: flex; flex-direction: column; }
.resource-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--color-border); color: inherit; text-decoration: none;
}
.resource-item:last-child { border-bottom: none; }
.resource-item-title { font-size: 14px; color: var(--color-navy); }
.resource-item-desc { font-size: 12px; color: var(--color-muted); margin-top: 2px; }

.option-cards { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.option-card {
  flex: 1; min-width: 220px; border: 1px solid var(--color-border); border-radius: var(--radius-card);
  padding: 18px; background: var(--color-surface); font-family: inherit; text-align: left;
}
/* Some option-cards are clickable (e.g. Overview's links into a tertiary
   tab) and some are purely informational (e.g. Resume Workshop's Live
   Session/Self-Paced descriptions) -- .clickable is the only difference. */
.option-card.clickable { cursor: pointer; }
.option-card.clickable:hover { border-color: var(--color-primary); }
.option-card-icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--color-info);
  display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px;
}
.option-card h3 { font-size: 15px; margin: 0 0 6px; color: var(--color-navy); }

.coming-soon-panel {
  text-align: center; padding: 48px 24px; color: var(--color-muted);
}
.coming-soon-panel .icon { font-size: 32px; margin-bottom: 10px; }

/* ---------- Resume review rubric (Employer & Volunteer Feedback) ---------- */
/* See "Sprint 1/Sprint 1/Documents and Videos/(Employer Facing First)_Resume
   Feedback Form.pdf" -- 4 scored criteria (3 Strong/2 Developing/1 Needs
   Attention) + free-text advice, used by public/views/employer-portal.js. */
.rubric-guidance {
  background: var(--color-info); border-radius: var(--radius-control);
  padding: 14px 16px; font-size: 13px; color: var(--color-navy); margin: 0 0 18px;
}
.rubric-row { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.rubric-row:first-child { padding-top: 0; }
.rubric-row-title { font-size: 14px; font-weight: 700; color: var(--color-navy); margin-bottom: 3px; }
.rubric-row-desc { font-size: 13px; margin-bottom: 10px; }
.rubric-row-scale { display: flex; gap: 10px; flex-wrap: wrap; }
.rubric-score {
  display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  padding: 8px 14px; background: var(--color-surface);
}
.rubric-score input { margin: 0; }
.rubric-score--3:has(input:checked) { background: var(--color-mint); border-color: var(--color-primary); color: var(--color-nav); }
.rubric-score--2:has(input:checked) { background: var(--color-sand); border-color: var(--color-sand-border); color: var(--color-navy); }
.rubric-score--1:has(input:checked) { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger); }
.rubric-tip {
  background: var(--color-mint); border-radius: var(--radius-control);
  padding: 14px 16px; font-size: 13px; color: var(--color-nav); margin-top: 18px;
}
.rubric-result-row { padding: 10px 0; border-bottom: 1px dashed var(--color-border); font-size: 14px; }
.rubric-result-row:last-of-type { border-bottom: none; }

/* ---------- Resume builder ---------- */
.resume-field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.resume-field-grid > div label { margin-top: 14px; }
.resume-entries { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.resume-entry-block {
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  padding: 14px 16px; background: var(--color-bg);
}
.resume-entry-block label:first-child { margin-top: 0; }

/* Read-only preview -- deliberately not a pixel clone of the Word
   template, just recognizably resume-shaped: name, contact line, then
   each section's entries with org/location on one line and role/dates on
   the next, matching Resume Template.docx's layout at a glance. */
.resume-preview { max-width: 680px; }
.resume-name { font-size: 22px; font-weight: 700; color: var(--color-navy); text-align: center; }
.resume-contact { font-size: 13px; color: var(--color-muted); text-align: center; margin: 4px 0 20px; }
.resume-section { margin-top: 18px; }
.resume-section h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-navy); border-bottom: 1px solid var(--color-border); padding-bottom: 4px; margin: 0 0 10px;
}
.resume-entry { margin-bottom: 12px; }
.resume-entry-header, .resume-entry-subheader {
  display: flex; justify-content: space-between; gap: 12px; font-size: 14px;
}
.resume-entry-header { color: var(--color-navy); }
.resume-entry-subheader { font-style: italic; color: var(--color-muted); margin-bottom: 4px; }
.resume-entry-desc { font-size: 13px; color: var(--color-navy); white-space: pre-line; }
.resume-bullets { margin: 0; padding-left: 18px; font-size: 13px; color: var(--color-navy); }
.resume-bullets li { margin-bottom: 2px; }
.resume-skills-line { font-size: 13px; margin: 0 0 4px; }

/* Horizontal Sections layout (Resume Builder v2) -- mirrors lib/resumeDocx.js:
   centered header, full-width sections, two highlight categories side by side. */
/* Template fonts: Poppins for the name and headings, Clear Sans for body text
   (what the Horizontal Sections template uses; Open Sans stands in where Clear
   Sans isn't installed). */
/* The preview is drawn as a US Letter page (8.5 x 11), so a short resume still
   fills the page's proportions. Longer content extends the page downward. */
.hz-resume {
  max-width: 760px; width: 100%; margin: 0 auto; box-sizing: border-box;
  aspect-ratio: 8.5 / 11; padding: 56px 64px; background: #fff; color: var(--color-navy);
  font-family: 'Clear Sans', 'Open Sans', Arial, sans-serif;
  border: 1px solid var(--color-border); box-shadow: 0 4px 18px rgba(6, 72, 81, 0.12);
}
.hz-resume .resume-name, .hz-heading, .hz-role { font-family: Poppins, Arial, sans-serif; }
.hz-resume .resume-name { font-size: 22px; font-weight: 700; text-align: center; }
.hz-resume .resume-contact { margin: 4px 0 12px; }
.hz-sep { color: var(--color-muted); margin: 0 4px; }
.hz-summary { font-size: 14px; margin: 0 0 14px; }
.hz-rule { border: 0; border-top: 1px solid var(--color-navy); margin: 14px 0 0; }
.hz-heading { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; margin: 16px 0 6px; }
.hz-edu { font-size: 14px; margin: 0 0 4px; }
.hz-edu-sub { font-size: 13px; margin: 0 0 6px; color: var(--color-muted); }
.hz-highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.hz-highlights .hz-heading { margin-top: 10px; }
.hz-entry { margin-bottom: 12px; }
.hz-role { font-size: 14px; font-weight: 700; margin: 0; }
.hz-org { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.hz-resume .resume-bullets { font-size: 13px; }

.rb-check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; color: var(--color-navy); }
.rb-check input { width: auto; min-height: 0; margin: 0; }
.highlight-panel h2 { margin-bottom: 6px; }

/* Sticky action bar (Save/Preview/Download/Submit for Review/Mark as
   Ready) -- pinned to the bottom of the viewport while editing so none of
   the 5 actions need scrolling to reach on a long form. */
.resume-action-bar {
  position: sticky; bottom: 16px; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.resume-action-bar {
  background: var(--color-navy); color: #fff; border: none;
  box-shadow: 0 10px 28px rgba(6, 72, 81, 0.35); padding: 12px 16px;
  border-top: 4px solid var(--color-primary);
}
.resume-action-bar .muted { font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.resume-action-bar button.small:not(.primary):not(.danger) { border-color: transparent; }

.req-mark { color: var(--color-danger); font-weight: 700; margin-left: 2px; }
.is-empty-required { border-color: var(--color-danger) !important; background: var(--color-danger-bg) !important; }
.hz-resume a { color: var(--color-nav); text-decoration: underline; }

/* Searchable multi-select dropdown (lib/searchableMultiSelect.js) */
.ms-wrap { position: relative; }
.ms-trigger {
  width: 100%; text-align: left; background: var(--color-surface); color: var(--color-navy);
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  padding: 9px 12px; font-size: 14px; cursor: pointer;
}
.ms-trigger:hover { border-color: var(--color-navy); }
.ms-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-control); box-shadow: var(--shadow-card); padding: 8px;
}
.ms-panel[hidden] { display: none; }
.ms-search { width: 100%; }
.ms-list { max-height: 240px; overflow-y: auto; margin-top: 8px; }
.ms-option {
  display: flex; gap: 8px; align-items: center; padding: 6px 6px; border-radius: 6px; cursor: pointer;
}
.ms-option:hover { background: var(--color-bg); }
.ms-option input { width: auto; min-height: 0; margin: 0; }
.ms-empty { margin: 8px 4px; }

/* Headline numbers above a roster -- brand tints with navy text, so every
   tile reads at full contrast. */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card {
  border-radius: var(--radius-card); padding: 16px 18px; color: var(--color-navy);
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-card--mint { background: var(--color-mint); }
.kpi-card--info { background: var(--color-info); }
.kpi-card--sand { background: var(--color-sand); }
.kpi-card--peach { background: #F7D9C4; }
.kpi-card--clickable { cursor: pointer; transition: box-shadow 0.15s; }
.kpi-card--clickable:hover { box-shadow: 0 0 0 2px var(--color-navy); }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 13px; }

.resume-feedback-notice {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--color-info); color: var(--color-navy);
  border-radius: var(--radius-card); padding: 14px 18px; margin-bottom: 16px;
}
@media (max-width: 640px) {
  .resume-action-bar { bottom: 0; border-radius: 0; }
}

/* ---------- Admin CRUD lists (Schools / CTE Pathways / Students) ---------- */
.crud-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.crud-field { display: flex; flex-direction: column; min-width: 140px; flex: 1; }
.crud-field label { margin: 0 0 4px; font-size: 11px; }
.crud-fields > button { flex: none; margin-bottom: 1px; }
/* For a field block too complex/variable-height to safely share a row
   with others in the flex-wrap layout above (e.g. a multi-child section
   like Resources' Source/Workshops/Visible-to blocks) -- forces it onto
   its own full-width row instead of competing for space and wrapping
   unpredictably alongside short simple fields. */
.crud-field-full { flex-basis: 100%; min-width: 100%; }

/* ---------- Filter builder (Students list) ---------- */
.filter-rules { display: flex; flex-direction: column; gap: 10px; }
.filter-rule-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-rule-row select { width: auto; flex: 1 1 150px; }
.filter-rule-value { flex: 1 1 160px; min-width: 120px; }
.filter-rule-value select, .filter-rule-value input { width: 100%; }

/* ---------- Self-paced comprehension quiz ---------- */
/* Was reusing .crud-fields (a flex-wrap row meant for short inline form
   fields side by side), which made multi-line quiz questions sit next to
   each other and wrap unpredictably -- a dedicated stacked layout instead,
   one bordered card per question so each one reads as its own distinct
   unit rather than blending into a form. */
.quiz-questions { display: flex; flex-direction: column; gap: 16px; }
.quiz-question {
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
  background: var(--color-bg); padding: 16px 18px;
}
.quiz-question-title { font-size: 15px; font-weight: 700; color: var(--color-navy); margin: 0 0 12px; line-height: 1.45; }
.quiz-options { display: flex; flex-direction: column; gap: 4px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 300;
  color: var(--color-navy); cursor: pointer; padding: 7px 8px; border-radius: var(--radius-control);
}
.quiz-option:hover { background: var(--color-surface); }
.quiz-option input { width: auto; min-height: 0; margin: 3px 0 0; flex: none; }

/* ---------- Events calendar ---------- */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--color-border); border: 1px solid var(--color-border);
  border-radius: var(--radius-control); overflow: hidden;
}
.calendar-weekday {
  background: var(--color-info); color: var(--color-navy);
  font-size: 11px; font-weight: 400; text-align: center; padding: 6px 0;
}
.calendar-day { background: var(--color-surface); min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.calendar-day.other-month { background: var(--color-bg); }
.calendar-day.other-month .calendar-day-number { color: var(--color-muted); }
.calendar-day-number { font-size: 12px; color: var(--color-navy); }
.calendar-day.today .calendar-day-number {
  color: #fff; background: var(--color-primary); border-radius: 50%;
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
}
.calendar-event-pill {
  display: block; width: 100%; text-align: left; border: none; border-radius: 4px;
  background: var(--color-info); color: var(--color-navy); font-size: 11px; font-family: inherit;
  padding: 2px 5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-event-pill:hover { filter: brightness(0.95); }
.calendar-event-pill.status-completed { background: var(--color-border); color: var(--color-muted); }
.calendar-event-pill.status-cancelled { background: var(--color-danger-bg); color: var(--color-danger); text-decoration: line-through; }
