/* ============================================================================
   assets/edms.css — EDMS Simulator application shell.

   Deliberately NOT the marketing design system (assets/styles.css is not
   loaded on edms.html at all). This is a dense, utilitarian data-application
   surface: small type, tight rows, neutral grays, one accent color used
   sparingly. Screen space is treated as precious — no hero sections, no
   generous whitespace, no gradients-as-decoration.
   ============================================================================ */

:root {
  --e-bg: #f3f4f6;
  --e-surface: #ffffff;
  --e-surface-2: #f8f9fb;
  --e-border: #e2e5ea;
  --e-border-strong: #c9ced6;
  --e-text: #1a1d23;
  --e-text-secondary: #5b6472;
  --e-text-tertiary: #8993a1;
  --e-accent: #0071e3;
  --e-accent-rgb: 0, 113, 227;
  --e-accent-hover: #005bb8;
  --e-danger: #b02a2a;
  --e-sidebar-bg: #171a23;
  --e-sidebar-bg-hover: #22262f;
  --e-sidebar-text: #c8cdd6;
  --e-sidebar-text-active: #ffffff;
  --e-sidebar-border: #2a2e38;
  --e-radius-sm: 4px;
  --e-radius-md: 6px;
  --e-radius-lg: 12px;
  --e-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --e-shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.16);
  --e-shadow-card: 0 1px 3px rgba(16, 24, 40, 0.08), 0 6px 16px rgba(16, 24, 40, 0.07);
  --e-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --e-bg: #14161b;
    --e-surface: #1c1f26;
    --e-surface-2: #20232b;
    --e-border: #2c303a;
    --e-border-strong: #3a3f4b;
    --e-text: #e7e9ed;
    --e-text-secondary: #99a1af;
    --e-text-tertiary: #6d7686;
    --e-accent: #3b9dff;
    --e-accent-rgb: 59, 157, 255;
    --e-accent-hover: #63b1ff;
    --e-sidebar-bg: #0d0f14;
    --e-sidebar-bg-hover: #1a1d24;
    --e-sidebar-border: #22252d;
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  font-family: var(--e-font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--e-text);
  background: var(--e-bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--e-accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============ App shell ============ */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ---- Sidebar ---- */

.app-sidebar {
  flex-shrink: 0;
  width: 220px;
  background: var(--e-sidebar-bg);
  color: var(--e-sidebar-text);
  display: flex;
  flex-direction: column;
  transition: width 0.15s ease;
  overflow: hidden;
}

.app-shell.is-collapsed .app-sidebar {
  width: 56px;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--e-sidebar-border);
  flex-shrink: 0;
}

.app-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

/* Standard "logo goes home" affordance — subtle, not a marketing element.
   Links to index.html; "Exit to Course Dashboard" below covers the
   course-dashboard use case separately. */
.app-sidebar__logo:hover {
  opacity: 0.8;
}

.app-sidebar__logo-mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.app-sidebar__collapse {
  background: transparent;
  border: none;
  color: var(--e-sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--e-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-sidebar__collapse:hover { background: var(--e-sidebar-bg-hover); color: #fff; }
.app-sidebar__collapse svg { width: 16px; height: 16px; }

.app-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--e-radius-sm);
  color: var(--e-sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.app-nav__item:hover { background: var(--e-sidebar-bg-hover); color: #fff; }
/* Strong, unambiguous active state — a solid accent-filled pill, not a
   faint tint. This is the one item telling the learner where they are;
   it should read instantly, not blend into the dark sidebar. */
.app-nav__item.is-active {
  background: var(--e-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(var(--e-accent-rgb), 0.45);
}
.app-nav__item svg { width: 16px; height: 16px; flex-shrink: 0; }
.app-nav__item span { overflow: hidden; text-overflow: ellipsis; }

.app-nav__section-label {
  padding: 14px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--e-sidebar-text);
  opacity: 0.65;
}
.app-nav__section-label:first-of-type { padding-top: 8px; }

.app-shell.is-collapsed .app-nav__item span,
.app-shell.is-collapsed .app-sidebar__logo span,
.app-shell.is-collapsed .app-sidebar__footer span,
.app-shell.is-collapsed .app-nav__section-label span { display: none; }
.app-shell.is-collapsed .app-nav__item { justify-content: center; }
.app-shell.is-collapsed .app-nav__section-label {
  height: 0; padding: 0; margin: 10px 8px 8px; border-top: 1px solid var(--e-sidebar-border);
}

.app-nav__item .gate-badge {
  margin-left: auto; font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 1px 6px; border-radius: 100px;
  background: rgba(var(--e-accent-rgb), 0.25); color: #fff; flex-shrink: 0;
}
.app-shell.is-collapsed .app-nav__item .gate-badge { display: none; }

.app-sidebar__footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--e-sidebar-border);
  flex-shrink: 0;
}
.app-sidebar__exit {
  color: var(--e-sidebar-text);
  text-decoration: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.app-sidebar__exit:hover { color: #fff; }

.app-sidebar__reset {
  background: none; border: none; padding: 0; margin-top: 8px;
  font-family: inherit; cursor: pointer; width: 100%; text-align: left;
}
.app-sidebar__reset:hover { color: #ff9a9a; }

/* ---- Main column ---- */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.app-topbar {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 48px;
  background: var(--e-surface);
  border-bottom: 1px solid var(--e-border);
}

/* Mobile-only way back into a collapsed sidebar. On <=860px the sidebar
   collapses to width:0 (see Responsive block below), taking its own
   collapse button with it — without this, there was no way to reopen it
   once hidden. Centered in the topbar so it's the first thing a thumb
   finds, independent of whatever else is in the bar. */
.app-topbar__menu-toggle {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: var(--e-surface-2);
  border: 1px solid var(--e-border-strong);
  border-radius: var(--e-radius-md);
  color: var(--e-text);
  cursor: pointer;
  z-index: 5;
}
.app-topbar__menu-toggle:hover { border-color: var(--e-accent); color: var(--e-accent); }
.app-topbar__menu-toggle svg { width: 18px; height: 18px; }

.app-topbar__breadcrumb {
  font-size: 12.5px;
  color: var(--e-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.app-topbar__breadcrumb strong { color: var(--e-text); font-weight: 600; }

.app-topbar__search {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.app-topbar__search input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--e-border);
  border-radius: var(--e-radius-sm);
  background: var(--e-surface-2);
  font-size: 12.5px;
  color: var(--e-text);
}
.app-topbar__search input:focus {
  outline: none; border-color: var(--e-accent); background: var(--e-surface);
  box-shadow: 0 0 0 3px rgba(var(--e-accent-rgb), 0.12);
}
.app-topbar__search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--e-text-tertiary); pointer-events: none;
}
.app-topbar__search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-md);
  box-shadow: var(--e-shadow-lg); max-height: 320px; overflow-y: auto; z-index: 40;
}
.app-topbar__search-result {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; cursor: pointer;
  border-bottom: 1px solid var(--e-border);
}
.app-topbar__search-result:last-child { border-bottom: none; }
.app-topbar__search-result:hover { background: var(--e-surface-2); }
.app-topbar__search-result-num { font-size: 11px; font-weight: 700; color: var(--e-accent); font-family: ui-monospace, monospace; }
.app-topbar__search-result-title { font-size: 12px; color: var(--e-text); }
.app-topbar__search-empty { padding: 12px 10px; font-size: 12px; color: var(--e-text-tertiary); }

.app-topbar__project {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--e-text-secondary);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--e-surface-2);
  border: 1px solid var(--e-border);
  border-radius: var(--e-radius-sm);
}

.app-topbar__user {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--e-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* ---- Notification bell ---- */

.app-topbar__bell-wrap { position: relative; flex-shrink: 0; }
.app-topbar__bell {
  background: none; border: none; cursor: pointer; color: var(--e-text-secondary);
  padding: 5px; border-radius: var(--e-radius-sm); position: relative;
  display: flex; align-items: center; justify-content: center;
}
.app-topbar__bell:hover { background: var(--e-surface-2); color: var(--e-text); }
.app-topbar__bell svg { width: 18px; height: 18px; }
.app-topbar__bell-count {
  position: absolute; top: 0; right: 0; min-width: 14px; height: 14px; padding: 0 3px;
  background: var(--e-danger); color: #fff; border-radius: 100px; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.app-topbar__notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-md);
  box-shadow: var(--e-shadow-lg); z-index: 50;
}
.app-topbar__notif-header {
  padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--e-text);
  border-bottom: 1px solid var(--e-border);
}
.app-topbar__notif-item {
  padding: 10px 12px; border-bottom: 1px solid var(--e-border); font-size: 12px;
}
.app-topbar__notif-item:last-child { border-bottom: none; }
.app-topbar__notif-item-msg { color: var(--e-text); margin-bottom: 3px; }
.app-topbar__notif-item-time { color: var(--e-text-tertiary); font-size: 10.5px; }
.app-topbar__notif-empty { padding: 20px 12px; text-align: center; color: var(--e-text-tertiary); font-size: 12px; }

/* ---- Toasts ---- */

.toast-root {
  position: fixed; bottom: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  background: var(--e-surface); border: 1px solid var(--e-border-strong); border-radius: var(--e-radius-md);
  box-shadow: var(--e-shadow-lg); padding: 10px 14px; font-size: 12.5px; color: var(--e-text);
  max-width: 320px; animation: toastIn 0.15s ease; border-left: 3px solid var(--e-accent);
}
.toast.is-leaving { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}

.app-statusbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 26px;
  background: var(--e-surface);
  border-top: 1px solid var(--e-border);
  font-size: 11px;
  color: var(--e-text-tertiary);
}
.app-statusbar__env {
  margin-left: auto;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--e-accent);
}

/* ============ View header ============ */

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.view-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--e-text);
}
.view-subtitle {
  font-size: 12px;
  color: var(--e-text-secondary);
  margin-top: 2px;
}

/* ============ Placeholder (not-yet-built) views ============ */

.view-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 64px 24px;
  background: var(--e-surface);
  border: 1px solid var(--e-border);
  border-radius: var(--e-radius-md);
  color: var(--e-text-secondary);
}
.view-placeholder svg { width: 32px; height: 32px; color: var(--e-text-tertiary); }
.view-placeholder h2 { font-size: 14px; font-weight: 700; color: var(--e-text); margin: 0; }
.view-placeholder p { font-size: 12.5px; margin: 0; max-width: 360px; }

/* ============ Toolbar (register) ============ */

.reg-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.reg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--e-radius-sm);
  border: 1px solid var(--e-border-strong);
  background: var(--e-surface);
  color: var(--e-text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.reg-btn:hover { background: var(--e-surface-2); border-color: var(--e-text-tertiary); }
.reg-btn svg { width: 14px; height: 14px; }

.reg-btn--primary {
  background: var(--e-accent);
  border-color: var(--e-accent);
  color: #fff;
}
.reg-btn--primary:hover { background: var(--e-accent-hover); border-color: var(--e-accent-hover); }

.reg-toolbar__spacer { flex: 1; }

/* ============ Filter bar ============ */

.reg-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--e-surface);
  border: 1px solid var(--e-border);
  border-radius: var(--e-radius-md);
}

.reg-filters select,
.reg-filters input[type="text"] {
  padding: 5px 8px;
  border: 1px solid var(--e-border-strong);
  border-radius: var(--e-radius-sm);
  background: var(--e-surface-2);
  font-size: 12px;
  color: var(--e-text);
}
.reg-filters select:focus,
.reg-filters input[type="text"]:focus {
  outline: none; border-color: var(--e-accent);
}
.reg-filters input[type="text"] { min-width: 200px; }

.reg-filters__clear {
  font-size: 12px;
  color: var(--e-accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 6px;
}
.reg-filters__clear:hover { text-decoration: underline; }

/* ============ Bulk action bar ============ */

.reg-bulkbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  margin-bottom: 10px;
  background: rgba(var(--e-accent-rgb), 0.08);
  border: 1px solid rgba(var(--e-accent-rgb), 0.3);
  border-radius: var(--e-radius-md);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--e-accent);
}
.reg-bulkbar.is-visible { display: flex; }
.reg-bulkbar__actions { margin-left: auto; display: flex; gap: 8px; }
.reg-bulkbar button {
  background: none; border: none; color: var(--e-accent); font-weight: 700;
  font-size: 12px; cursor: pointer; padding: 2px 4px;
}
.reg-bulkbar button:hover { text-decoration: underline; }

/* ============ Data grid ============ */

.reg-grid-wrap {
  background: var(--e-surface);
  border: 1px solid var(--e-border);
  border-radius: var(--e-radius-md);
  overflow-x: auto;
}

.reg-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.reg-grid thead th {
  position: sticky;
  top: 0;
  background: var(--e-surface-2);
  border-bottom: 1px solid var(--e-border-strong);
  text-align: left;
  padding: 7px 10px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--e-text-secondary);
  cursor: pointer;
  user-select: none;
  z-index: 1;
}
.reg-grid thead th:hover { color: var(--e-text); }
.reg-grid thead th.is-sorted { color: var(--e-accent); }
.reg-grid thead th .sort-arrow { display: inline-block; margin-left: 3px; font-size: 9px; opacity: 0.7; }
.reg-grid thead th.reg-col-check { cursor: default; width: 32px; }

.reg-grid tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--e-border);
  color: var(--e-text);
  vertical-align: middle;
}
.reg-grid tbody tr { cursor: pointer; }
.reg-grid tbody tr:nth-child(even) { background: var(--e-surface-2); }
.reg-grid tbody tr:hover { background: rgba(var(--e-accent-rgb), 0.06); }
.reg-grid tbody tr.is-selected { background: rgba(var(--e-accent-rgb), 0.1); }

.reg-grid .doc-num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; font-weight: 600; }
.reg-grid .doc-title { white-space: normal; max-width: 340px; }
.reg-grid .col-check { width: 32px; text-align: center; }
.reg-grid input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
/* A solid dot in the same colour as the chip's text (each status already
   sets `color` inline from its own colour map) — gives every chip, and the
   donut it echoes, one confident full-strength colour instead of relying
   only on a soft background tint to carry the meaning. */
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.reg-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--e-text-tertiary);
  font-size: 12.5px;
}

/* ============ Pagination / record count ============ */

.reg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--e-text-secondary);
}
.reg-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.reg-pagination button {
  padding: 4px 9px;
  border: 1px solid var(--e-border-strong);
  background: var(--e-surface);
  border-radius: var(--e-radius-sm);
  font-size: 12px;
  cursor: pointer;
  color: var(--e-text);
}
.reg-pagination button:hover:not(:disabled) { background: var(--e-surface-2); }
.reg-pagination button:disabled { opacity: 0.4; cursor: default; }
.reg-pagination button.is-active { background: var(--e-accent); border-color: var(--e-accent); color: #fff; }

/* ============ Slide-over detail panel ============ */

.slideover-back {
  position: fixed; inset: 0; background: rgba(15, 18, 24, 0.35);
  z-index: 90; display: flex; justify-content: flex-end;
}
.slideover {
  width: 420px;
  max-width: 92vw;
  height: 100%;
  background: var(--e-surface);
  box-shadow: var(--e-shadow-lg);
  overflow-y: auto;
  animation: slideIn 0.16s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }

.slideover__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--e-border); position: sticky; top: 0;
  background: var(--e-surface); z-index: 2;
}
.slideover__header h2 { font-size: 14px; margin: 0 0 3px; }
.slideover__header .doc-num { font-size: 12px; color: var(--e-text-secondary); }
.slideover__close {
  background: none; border: none; cursor: pointer; color: var(--e-text-tertiary);
  padding: 4px; border-radius: var(--e-radius-sm); flex-shrink: 0;
}
.slideover__close:hover { background: var(--e-surface-2); color: var(--e-text); }
.slideover__close svg { width: 18px; height: 18px; }

.slideover__body { padding: 16px; }
.slideover__section { margin-bottom: 18px; }
.slideover__section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--e-text-tertiary); margin-bottom: 8px;
}
.slideover__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slideover__meta-item { font-size: 12.5px; }
.slideover__meta-item dt { font-size: 11px; color: var(--e-text-tertiary); margin-bottom: 2px; }
.slideover__meta-item dd { margin: 0; font-weight: 600; }

.slideover__rev-row, .slideover__tr-row {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--e-border); font-size: 12px;
}
.slideover__rev-row:last-child, .slideover__tr-row:last-child { border-bottom: none; }
.slideover__rev-badge {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px; background: var(--e-surface-2);
  border: 1px solid var(--e-border-strong); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}
.slideover__rev-date { color: var(--e-text-tertiary); font-size: 11px; flex-shrink: 0; }
.slideover__rev-note { color: var(--e-text-secondary); }
.slideover__rev-row.is-superseded { opacity: 0.6; }
.slideover__rev-row.is-superseded .slideover__rev-badge { background: transparent; }
.slideover__rev-user { color: var(--e-text-tertiary); font-size: 10.5px; flex-shrink: 0; margin-left: auto; }
.slideover__rev-chip {
  flex-shrink: 0; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 7px; border-radius: 100px;
}
.slideover__rev-chip--current { background: #e4f4e8; color: #1e7b3c; }
.slideover__rev-chip--superseded { background: #efeafb; color: #6d5bd0; }

.slideover__empty-note { font-size: 12px; color: var(--e-text-tertiary); }

.slideover__actions { display: flex; gap: 8px; margin-top: 4px; }

/* ============ Modal ============ */

.edms-e-modal-back {
  position: fixed; inset: 0; background: rgba(15, 18, 24, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.edms-e-modal {
  width: 480px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--e-surface); border-radius: var(--e-radius-md); box-shadow: var(--e-shadow-lg);
  padding: 20px;
}
.edms-e-modal h2 { font-size: 15px; margin: 0 0 4px; }
.edms-e-modal__desc { font-size: 12px; color: var(--e-text-secondary); margin-bottom: 14px; }

.edms-e-field { margin-bottom: 12px; }
.edms-e-field label {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--e-text-secondary);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.02em;
}
.edms-e-field input, .edms-e-field select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--e-border-strong); border-radius: var(--e-radius-sm);
  background: var(--e-surface-2); font-size: 13px; color: var(--e-text);
}
.edms-e-field input:focus, .edms-e-field select:focus { outline: none; border-color: var(--e-accent); }
.edms-e-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.edms-e-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.edms-e-columns-list { display: flex; flex-direction: column; gap: 8px; }
.edms-e-columns-list label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.edms-e-columns-list input { width: 14px; height: 14px; }

.reg-btn--danger { border-color: var(--e-danger); color: var(--e-danger); }
.reg-btn--danger:hover { background: rgba(176, 42, 42, 0.08); }

/* ---- Upload validation / processing ---- */

.upload-filename {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; padding: 6px 9px;
  background: var(--e-surface-2); border: 1px solid var(--e-border); border-radius: var(--e-radius-sm);
  margin-bottom: 14px; word-break: break-all;
}

.upload-error {
  padding: 12px 14px; border-radius: var(--e-radius-md); background: #fbe7e7; border: 1px solid rgba(176, 42, 42, 0.25);
  margin-bottom: 6px;
}
.upload-error__title { font-size: 12.5px; font-weight: 800; color: var(--e-danger); margin-bottom: 6px; }
.upload-error__body { font-size: 12.5px; color: var(--e-text); line-height: 1.5; }
.upload-error__row { display: flex; gap: 6px; margin-top: 4px; }
.upload-error__row dt { font-weight: 700; min-width: 66px; flex-shrink: 0; }
.upload-error__hint { margin-top: 8px; font-size: 11.5px; color: var(--e-text-secondary); font-style: italic; }

.upload-steps { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.upload-step {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--e-text-tertiary);
}
.upload-step.is-done { color: var(--e-text); }
.upload-step__mark {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--e-border-strong);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent;
}
.upload-step.is-done .upload-step__mark { background: #1e7b3c; border-color: #1e7b3c; color: #fff; }

.upload-success {
  padding: 12px 14px; border-radius: var(--e-radius-md); background: #e4f4e8; border: 1px solid rgba(30, 123, 60, 0.25);
  font-size: 12.5px; color: #1e5f30; line-height: 1.5;
}

/* ============ Dashboard (Phase 2.5) ============ */

.dash-welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.dash-welcome h1 { font-size: 16px; margin: 0; }
.dash-welcome__role { display: block; font-size: 12px; color: var(--e-text-secondary); margin-top: 2px; }

.dash-kpis {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px;
}
.dash-kpi {
  position: relative;
  background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-lg);
  padding: 14px 16px 16px; box-shadow: var(--e-shadow-card); overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dash-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 24, 40, 0.13); }
.dash-kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.dash-kpi__icon {
  width: 34px; height: 34px; border-radius: var(--e-radius-md);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.dash-kpi__icon svg { width: 18px; height: 18px; }
.dash-kpi__n { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--e-text); line-height: 1.1; }
.dash-kpi__label { font-size: 11px; font-weight: 700; color: var(--e-text-secondary); margin-top: 4px; }
.dash-kpi__sub { font-size: 10.5px; color: var(--e-text-tertiary); margin-top: 6px; }

/* Per-metric colour identity — a tinted icon badge in the metric's full-
   strength colour, echoed as a thin top accent bar on the card itself, so
   each KPI reads instantly instead of blending into a row of white boxes. */
.dash-kpi--docs::before { background: #0071e3; }
.dash-kpi--docs .dash-kpi__icon { background: rgba(0, 113, 227, 0.12); color: #0071e3; }
.dash-kpi--transmittals::before { background: #7c3aed; }
.dash-kpi--transmittals .dash-kpi__icon { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.dash-kpi--submittals::before { background: #0891b2; }
.dash-kpi--submittals .dash-kpi__icon { background: rgba(8, 145, 178, 0.12); color: #0891b2; }
.dash-kpi--reviews::before { background: #b26a00; }
.dash-kpi--reviews .dash-kpi__icon { background: rgba(178, 106, 0, 0.12); color: #b26a00; }
.dash-kpi--packages::before { background: #1e7b3c; }
.dash-kpi--packages .dash-kpi__icon { background: rgba(30, 123, 60, 0.12); color: #1e7b3c; }

.dash-quickactions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.dash-qa {
  display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; min-width: 96px;
  padding: 10px 8px; background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-md);
  color: var(--e-text-secondary); font-size: 10.5px; font-weight: 600; cursor: pointer; text-align: center;
  box-shadow: var(--e-shadow);
}
.dash-qa:hover { border-color: var(--e-accent); color: var(--e-accent); background: rgba(var(--e-accent-rgb), 0.05); }
.dash-qa svg { width: 18px; height: 18px; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.dash-widget {
  background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-lg);
  padding: 14px 16px; box-shadow: var(--e-shadow-card);
}
.dash-widget__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--e-border);
}
.dash-widget__title { font-size: 13px; font-weight: 800; color: var(--e-text); margin: 0; }
.dash-widget__note { font-weight: 500; color: var(--e-text-tertiary); font-size: 11px; }
.dash-widget__link { background: none; border: none; color: var(--e-accent); font-size: 11px; font-weight: 700; cursor: pointer; }
.dash-widget__link:hover { text-decoration: underline; }

.dash-compact-grid th, .dash-compact-grid td { padding: 6px 8px; font-size: 11.5px; }
.dash-compact-grid .doc-title { max-width: 220px; }
.dash-compact-grid thead th {
  background: var(--e-surface-2); font-weight: 700; text-transform: uppercase;
  font-size: 9.5px; letter-spacing: 0.03em; color: var(--e-text-tertiary);
}
.dash-compact-grid tbody tr:nth-child(even) { background: var(--e-surface-2); }
.dash-compact-grid tbody tr:hover { background: rgba(var(--e-accent-rgb), 0.05); }

.dash-row-action {
  background: none; border: none; color: var(--e-accent); cursor: pointer; font-size: 11px; font-weight: 700;
}
.dash-row-action:hover { text-decoration: underline; }

/* ---- Donut ---- */

.dash-donut-wrap { display: flex; align-items: center; gap: 18px; }
.dash-donut {
  width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.04);
}
.dash-donut::before {
  content: ""; position: absolute; inset: 22px; border-radius: 50%;
  background: var(--e-surface); box-shadow: var(--e-shadow);
}
.dash-donut__total { position: relative; font-size: 24px; font-weight: 800; color: var(--e-text); letter-spacing: -0.02em; }
.dash-donut__legend { display: flex; flex-direction: column; gap: 7px; font-size: 12px; flex: 1; }
.dash-donut__legend-item { display: flex; align-items: center; gap: 7px; color: var(--e-text-secondary); font-weight: 500; }
.dash-donut__legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.dash-donut__legend-n { margin-left: auto; font-weight: 800; color: var(--e-text); font-size: 12.5px; }

/* ---- Status matrix ---- */

.dash-matrix { font-size: 11px; }
.dash-matrix th, .dash-matrix td { padding: 6px 8px; text-align: center; }
.dash-matrix th:first-child, .dash-matrix td:first-child { text-align: left; }
.dash-matrix thead th {
  background: var(--e-surface-2); font-weight: 700; text-transform: uppercase;
  font-size: 9.5px; letter-spacing: 0.03em; color: var(--e-text-tertiary);
  border-bottom: 1px solid var(--e-border-strong);
}
.dash-matrix tbody tr:nth-child(even) { background: var(--e-surface-2); }
.dash-matrix tfoot td { font-weight: 800; border-top: 2px solid var(--e-border-strong); background: var(--e-surface-2); }

/* ---- My Tasks ---- */

.dash-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dash-task {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--e-border); font-size: 11.5px;
}
.dash-task:last-child { border-bottom: none; }
.dash-task__body { flex: 1; min-width: 0; }
.dash-task__title { color: var(--e-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-task__due { color: var(--e-text-tertiary); font-size: 10.5px; margin-top: 1px; }
.dash-task__due.is-overdue { color: var(--e-danger); font-weight: 700; }
.dash-tasks-empty { font-size: 11.5px; color: var(--e-text-tertiary); padding: 6px 0; }

/* ---- Simulation progress stub (Phase 4 backs this later — inert now) ---- */

.dash-progress-stub__text { font-size: 13px; font-weight: 700; color: var(--e-text); margin: 0 0 8px; }
.dash-progress-stub__bar { height: 6px; border-radius: 100px; background: var(--e-surface-2); overflow: hidden; }
.dash-progress-stub__bar i { display: block; height: 100%; width: 0; background: var(--e-accent); transition: width 0.2s ease; }
.dash-progress-stub__note { font-size: 10.5px; color: var(--e-text-tertiary); margin: 8px 0 0; font-style: italic; }

/* ============ Missions (Phase 3) ============ */

.mission-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
}
.mission-card {
  text-align: left; background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-md);
  padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
}
.mission-card:hover { border-color: var(--e-accent); box-shadow: var(--e-shadow); }
.mission-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mission-card__order {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--e-surface-2);
  border: 1px solid var(--e-border-strong); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--e-text-secondary);
}
.mission-card__title { font-size: 13px; font-weight: 700; color: var(--e-text); margin: 0; }
.mission-card__brief { font-size: 11.5px; color: var(--e-text-secondary); line-height: 1.5; flex: 1; }
.mission-card__meta { display: flex; align-items: center; gap: 6px; }
.mission-diff {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 100px; background: var(--e-surface-2); color: var(--e-text-secondary);
}
.mission-status {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 100px; display: inline-flex; align-items: center; gap: 4px;
}
.mission-status--not_started { background: var(--e-surface-2); color: var(--e-text-tertiary); }
.mission-status--in_progress { background: #fff3dd; color: #b26a00; }
.mission-status--completed { background: #e4f4e8; color: #1e7b3c; }

/* ---- Briefing / detail ---- */

.mission-briefing { margin-top: 12px; max-width: 720px; }
.mission-briefing__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.mission-briefing__head h2 { font-size: 16px; margin: 0; }
.mission-briefing__section { margin-bottom: 16px; }
.mission-briefing__label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--e-text-tertiary); margin-bottom: 6px;
}
.mission-briefing__text { font-size: 13px; color: var(--e-text); line-height: 1.65; }
.mission-briefing__objective {
  font-size: 13px; color: var(--e-text); line-height: 1.6; font-weight: 600;
  padding: 10px 12px; background: rgba(var(--e-accent-rgb), 0.06); border-left: 3px solid var(--e-accent); border-radius: 0 var(--e-radius-sm) var(--e-radius-sm) 0;
}

.mission-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mission-step { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--e-text-secondary); }
.mission-step__mark {
  flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--e-border-strong);
  margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent;
}
.mission-step.is-done { color: var(--e-text); }
.mission-step.is-done .mission-step__mark { background: #1e7b3c; border-color: #1e7b3c; color: #fff; }

.mission-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.mission-mentor {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--e-radius-md);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.07), rgba(var(--e-accent-rgb), 0.07));
  border: 1px solid rgba(124, 58, 237, 0.25); display: flex; gap: 10px;
}
.mission-mentor__icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--e-accent), #7c3aed);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800;
}
.mission-mentor__body { flex: 1; }
.mission-mentor__label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #7c3aed; margin-bottom: 3px; }
.mission-mentor__text { font-size: 12.5px; color: var(--e-text); line-height: 1.55; }

.mission-complete {
  margin-top: 16px; padding: 14px; border-radius: var(--e-radius-md); background: #e4f4e8; border: 1px solid rgba(30, 123, 60, 0.25);
}
.mission-complete__title { font-size: 13px; font-weight: 800; color: #1e5f30; margin-bottom: 6px; }
.mission-complete__body { font-size: 12.5px; color: #1e5f30; line-height: 1.55; }
.mission-complete__mistakes { margin-top: 8px; font-size: 11.5px; color: #4a6e52; }

.mission-quiz { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.mission-prereq {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--e-radius-md); background: #fff3dd; border: 1px solid rgba(178, 106, 0, 0.25);
  font-size: 12.5px; color: #7a4d00; line-height: 1.5;
}

/* ============ Modes & Scoring (Phase 4) ============ */

.mode-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mode-btn {
  display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px;
  background: var(--e-surface); border: 1.5px solid var(--e-border); border-radius: var(--e-radius-md); cursor: pointer;
}
.mode-btn:hover { border-color: var(--e-text-tertiary); }
.mode-btn.is-active { border-color: var(--e-accent); background: rgba(var(--e-accent-rgb), 0.06); }
.mode-btn__title { font-size: 12.5px; font-weight: 700; color: var(--e-text); }
.mode-btn.is-active .mode-btn__title { color: var(--e-accent); }
.mode-btn__desc { font-size: 10.5px; color: var(--e-text-tertiary); line-height: 1.4; }

.mission-mode-label {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  color: var(--e-text-secondary); background: var(--e-surface-2); padding: 3px 9px; border-radius: 100px;
  margin-bottom: 10px;
}

.mission-timer {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800;
  color: var(--e-danger); background: #fbe7e7; padding: 4px 11px; border-radius: 100px; margin-bottom: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.mission-lock-note {
  font-size: 11px; color: var(--e-text-tertiary); font-style: italic; margin-bottom: 10px;
}

/* ---- Results screen ---- */

.mission-results { margin-top: 12px; }
.mission-results__head { font-size: 15px; font-weight: 800; color: var(--e-text); margin-bottom: 12px; }
.mission-results__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px;
}
.mission-results__stat {
  background: var(--e-surface-2); border: 1px solid var(--e-border); border-radius: var(--e-radius-md); padding: 10px 12px;
}
.mission-results__stat-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--e-text-tertiary); margin-bottom: 4px; }
.mission-results__stat-value { font-size: 18px; font-weight: 800; color: var(--e-text); }
.mission-results__stat-value .delta { font-size: 12px; font-weight: 700; margin-left: 4px; }
.mission-results__stat-value .delta.is-up { color: #1e7b3c; }
.mission-results__stat-value .delta.is-down { color: var(--e-danger); }

.mission-results__mistakes { margin-top: 4px; }
.mission-results__mistake {
  padding: 10px 12px; border-radius: var(--e-radius-md); background: var(--e-surface-2); border: 1px solid var(--e-border);
  margin-bottom: 8px; font-size: 12px; line-height: 1.5;
}
.mission-results__mistake-label { font-weight: 700; color: var(--e-danger); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }

/* ---- Level pill + badges (Dashboard) ---- */

.dash-level-pill {
  margin-left: auto; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 9px; border-radius: 100px; background: rgba(var(--e-accent-rgb), 0.12); color: var(--e-accent);
}
.dash-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.dash-badge {
  display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--e-text-secondary);
  background: var(--e-surface-2); border: 1px solid var(--e-border-strong); padding: 4px 9px; border-radius: 100px;
}
.dash-badge__icon { font-size: 12px; }
.dash-badges-empty { font-size: 11px; color: var(--e-text-tertiary); font-style: italic; margin-top: 10px; }

/* ============ Transmittals / Submittals / Reviews / MDR (Phase 5) ============ */

.reg-btn--success { border-color: #1e7b3c; color: #1e7b3c; }
.reg-btn--success:hover { background: rgba(30, 123, 60, 0.08); }

/* ---- Create Transmittal / Log Submittal doc-picker ---- */

.doc-picker {
  max-height: 240px; overflow-y: auto; border: 1px solid var(--e-border); border-radius: var(--e-radius-sm);
  padding: 6px 8px; margin-bottom: 4px;
}
.doc-picker__row {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 12px; border-bottom: 1px solid var(--e-border);
  cursor: pointer;
}
.doc-picker__row:last-child { border-bottom: none; }
.doc-picker__row input { width: 14px; height: 14px; flex-shrink: 0; }
.doc-picker__row-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--e-text-secondary); }
.doc-picker__count { font-size: 11px; color: var(--e-text-tertiary); margin: 4px 0 12px; }

/* ---- Review action panel (slide-over) ---- */

.review-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.review-comment-box {
  width: 100%; min-height: 70px; padding: 8px 10px; border: 1px solid var(--e-border-strong); border-radius: var(--e-radius-sm);
  background: var(--e-surface-2); font-size: 12.5px; font-family: inherit; color: var(--e-text); resize: vertical; margin-bottom: 10px;
}
.review-comment-log { display: flex; flex-direction: column; gap: 8px; }
.review-comment {
  padding: 8px 10px; border-radius: var(--e-radius-sm); background: var(--e-surface-2); border: 1px solid var(--e-border);
  font-size: 12px; line-height: 1.5;
}
.review-comment__meta { font-size: 10.5px; color: var(--e-text-tertiary); margin-bottom: 3px; font-weight: 700; }

/* ---- Transmittal / submittal cover-sheet (slide-over) ---- */

.cover-sheet-docs { display: flex; flex-direction: column; gap: 6px; }
.cover-sheet-doc {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--e-border); font-size: 12px;
}
.cover-sheet-doc:last-child { border-bottom: none; }
.cover-sheet-doc .doc-title { flex: 1; color: var(--e-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- MDR stage row ---- */

.mdr-stage-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.mdr-stage-card {
  background: var(--e-surface); border: 1px solid var(--e-border); border-radius: var(--e-radius-md); padding: 12px 14px;
}
.mdr-stage-card__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--e-text-tertiary); margin-bottom: 4px; }
.mdr-stage-card__n { font-size: 20px; font-weight: 800; color: var(--e-text); }
.mdr-stage-card__pct { font-size: 11px; color: var(--e-text-secondary); margin-left: 4px; }
.mdr-stage-card__bar { height: 5px; border-radius: 100px; background: var(--e-surface-2); margin-top: 8px; overflow: hidden; }
.mdr-stage-card__bar i { display: block; height: 100%; background: var(--e-accent); }

.mdr-days-late { font-weight: 800; color: var(--e-danger); }

/* ============ Mini-Project — capstone assessment (Phase 6) ============
   Reuses .mission-briefing/.mission-grid/.mission-card/.mission-results
   wholesale — the capstone is a new frame around the mission engine's own
   UI language, not a new visual dialect. Only the "Capstone" tag and the
   sidebar nav item's icon accent are genuinely new. ============ */

.app-nav__item--capstone svg { color: #ffd166; }

.capstone-tag {
  display: inline-flex; align-items: center; font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 8px; border-radius: 100px; color: #fff;
  background: linear-gradient(135deg, var(--e-accent), #7c3aed);
}
.capstone-tag--nav { margin-left: auto; flex-shrink: 0; }
.app-shell.is-collapsed .app-nav__item--capstone .capstone-tag--nav { display: none; }

.dash-progress-stub__miniproject {
  margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--e-border);
  font-size: 11.5px; color: var(--e-text-secondary);
}
.dash-progress-stub__miniproject strong { color: var(--e-text); }

/* ============ Responsive ============ */

@media (max-width: 860px) {
  .app-sidebar { position: fixed; z-index: 80; height: 100vh; box-shadow: var(--e-shadow-lg); }
  .app-shell:not(.is-collapsed) .app-sidebar { width: 220px; }
  .app-shell.is-collapsed .app-sidebar { width: 0; }
  .app-topbar__project { display: none; }
  /* Mobile topbar simplifies to just the essentials so the centered
     reopen toggle has room and nothing sits underneath it. */
  .app-topbar__breadcrumb { display: none; }
  .app-topbar__search { display: none; }
  .app-topbar__menu-toggle { display: flex; }
  .slideover__meta { grid-template-columns: 1fr; }
  .edms-e-field-row { grid-template-columns: 1fr; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .mode-selector { grid-template-columns: 1fr; }
  .mdr-stage-row { grid-template-columns: repeat(2, 1fr); }
}
