/* ============================================================
   Investment Plans Workspace — Design System v2 (2026-09-15)
   Modern, data-first, easy to scan. Pure CSS, no dependencies.
   Keeps every legacy class name so all pages restyle at once.
   ============================================================ */
:root {
  /* palette */
  --bg: #f6f7f9;
  --bg-soft: #fbfcfd;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #eef2f6;
  --accent: #4f46e5;
  --accent-ink: #4338ca;
  --accent-light: #eef2ff;
  --accent-ring: rgba(79, 70, 229, .14);
  --ok: #059669;   --ok-bg: #ecfdf5;   --ok-line: #a7f3d0;
  --warn: #b45309; --warn-bg: #fffbeb; --warn-line: #fde68a;
  --danger: #be123c; --danger-bg: #fef2f2; --danger-line: #fecdd3;
  --info: #1d4ed8; --info-bg: #eff6ff; --info-line: #bfdbfe;
  --critical: #881337; --high: #dc2626; --medium: #d97706; --low: #059669;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .14);
  --radius: 14px; --radius-sm: 9px; --radius-xs: 6px;
  --tr: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: var(--tr); /* legacy alias used by dossier.css */
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  font: 14.5px/1.65 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 300px at 50% -80px, rgba(79, 70, 229, .045), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible, .tab:focus-visible, .dz-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
code { background: #f1f5f9; border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; font-family: var(--mono); color: var(--ink-2); }
pre { background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); padding: 18px 22px; overflow: auto; font-size: 13px; line-height: 1.6; font-family: var(--mono); }
pre code { background: transparent; border: 0; color: inherit; }
::selection { background: var(--accent-light); color: var(--ink); }
h1, h2, h3, h4 { text-wrap: balance; }

/* ===== TOPBAR ===== */
.topbar {
  display: flex; align-items: center; gap: 22px; padding: 0 28px; height: 60px;
  background: #0b1220;
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 24px rgba(2, 6, 23, .35);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; white-space: nowrap; letter-spacing: -.01em; }
.brand .logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 2px 10px rgba(79, 70, 229, .5); flex: none; }
.brand .logo svg { display: block; }
.brand span { font-weight: 400; opacity: .5; margin-left: 2px; font-size: 12px; letter-spacing: .01em; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  color: #94a3b8; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  transition: background var(--tr), color var(--tr);
}
.topbar nav a:hover { background: rgba(255, 255, 255, .08); color: #e2e8f0; text-decoration: none; }
.topbar nav a.active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 2px 12px rgba(79, 70, 229, .45); }
.user-info { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-name { font-weight: 600; font-size: 13px; }
.msg-link { color: #94a3b8; font-size: 17px; position: relative; }
.msg-link:hover { color: #fff; }
.msg-badge { position: absolute; top: -7px; right: -9px; background: #f43f5e; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 999px; min-width: 16px; text-align: center; box-shadow: 0 0 0 2px #0b1220; }

/* ===== PAGE SHELL / HEADERS ===== */
.shell { max-width: 1240px; margin: 30px auto 60px; padding: 0 28px; }
h1 { font-size: 26px; font-weight: 750; margin-bottom: 8px; color: var(--ink); letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--ink); letter-spacing: -.01em; }
h3 { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .05em; }
p { color: var(--ink-2); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { max-width: 820px; }

/* ===== CARDS ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); transition: box-shadow var(--tr), border-color var(--tr); }
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h2 { margin-top: 0; }
.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

/* ===== KPI GRID ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px; box-shadow: var(--shadow-sm);
  transition: transform var(--tr), box-shadow var(--tr); position: relative; overflow: hidden;
  text-align: left; display: flex; flex-direction: column; gap: 2px;
}
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .85; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-value.kv-sm { font-size: 22px; }
.kpi-label { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-sub { font-size: 12px; margin-top: 4px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi-sub::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.kpi-sub.ok { color: var(--ok); } .kpi-sub.warn { color: var(--warn); }
.kpi-sub.info { color: var(--info); } .kpi-sub.danger { color: var(--danger); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 960px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  padding: 7px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); cursor: pointer;
  transition: background var(--tr), border-color var(--tr), box-shadow var(--tr), transform var(--tr);
  line-height: 1.4; font-family: inherit;
}
.btn:hover { border-color: #cbd5e1; background: var(--bg-soft); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn-sm { padding: 4px 11px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(79, 70, 229, .28); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .35); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ===== DATA TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 9px 12px; border-bottom: 2px solid var(--line);
  background: var(--bg-soft); font-weight: 700;
}
.data-table th:first-child { border-top-left-radius: var(--radius-xs); }
.data-table th:last-child { border-top-right-radius: var(--radius-xs); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; transition: background var(--tr); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table a { color: var(--ink); font-weight: 550; } .data-table a:hover { color: var(--accent); }
.data-table td.ok { color: var(--ok); font-weight: 600; }
.data-table td.danger { color: var(--danger); font-weight: 600; }
.tablewrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; border: 1px solid transparent; }
.badge-lg { font-size: 12.5px; padding: 6px 14px; }
.badge.ok, .badge.active, .badge.met { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.warn, .badge.pending, .badge.unvalidated { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.info, .badge.discovered, .badge.on-track { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.badge.danger, .badge.critical, .badge.missed, .badge.invalidated { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.badge.acknowledged { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.badge.resolved { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.discharged { color: var(--muted); background: #f1f5f9; border-color: var(--line); }
.badge.deceased { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.badge.direct { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.badge.care_team { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.badge.system { color: var(--muted); background: #f1f5f9; border-color: var(--line); }
.badge.at-risk { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }

/* ===== SEVERITY DOTS ===== */
.severity-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.severity-dot.critical { background: var(--critical); box-shadow: 0 0 0 3px #fecdd3; }
.severity-dot.high { background: var(--high); box-shadow: 0 0 0 3px #fee2e2; }
.severity-dot.medium { background: var(--medium); box-shadow: 0 0 0 3px #fef3c7; }
.severity-dot.low { background: var(--low); box-shadow: 0 0 0 3px #d1fae5; }

/* ===== GRADE BADGES ===== */
.grade-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-xs); margin: 1px 2px; }
.grade-1 { background: #dbeafe; color: #1e40af; }
.grade-2 { background: #fef3c7; color: #92400e; }
.grade-3 { background: #fed7aa; color: #9a3412; }
.grade-4 { background: #fecaca; color: #991b1b; }
.grade-5 { background: #1e293b; color: #f1f5f9; }

.event-icon { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-xs); background: #f1f5f9; color: var(--muted); text-transform: capitalize; }

/* ===== BAR CHART ===== */
.bar-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.bar-label { width: 130px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: right; flex: none; }
.bar-track { flex: 1; height: 26px; background: #f1f5f9; border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; transition: width .8s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-fill.grade-1 { background: linear-gradient(90deg, #93c5fd, #60a5fa); }
.bar-fill.grade-2 { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.bar-fill.grade-3 { background: linear-gradient(90deg, #fb923c, #f97316); }
.bar-fill.grade-4 { background: linear-gradient(90deg, #f87171, #ef4444); }
.bar-fill.grade-5 { background: linear-gradient(90deg, #64748b, #475569); }
.bar-val { min-width: 34px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ===== CHIPS & TAGS ===== */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.chip {
  font-size: 12px; font-weight: 550; background: #f1f5f9; color: var(--ink-2);
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line);
  transition: background var(--tr), border-color var(--tr), transform var(--tr);
}
.chip:hover { text-decoration: none; background: #e8edf3; border-color: #cbd5e1; }
a.chip { color: var(--ink-2); }
a.chip:hover { color: var(--ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.chip.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.chip.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.tag {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600;
  color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line-soft);
  padding: 2px 9px; border-radius: 999px; letter-spacing: .01em;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.constraint-chip { font-size: 11.5px; background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; padding: 3px 10px; border-radius: 999px; }

/* ===== APP ROWS ===== */
.app-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.app-row:last-child { border-bottom: 0; }
.app-row:hover { background: var(--bg-soft); border-radius: var(--radius-sm); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.dot.running { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }

/* ===== PATIENT HEADER ===== */
.patient-header { background: linear-gradient(135deg, var(--info-bg), #f0fdf4); border: 1px solid var(--info-line); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.tab { padding: 10px 18px; font-size: 13.5px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: var(--radius-xs) var(--radius-xs) 0 0; transition: color var(--tr), border-color var(--tr); cursor: pointer; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab:hover { text-decoration: none; color: var(--ink); }

/* ===== CRUMBS ===== */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--accent); } .crumbs span { font-weight: 600; color: var(--ink-2); }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }

/* ===== LOGIN ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0b1220; position: relative; overflow: hidden; }
.login-page::before { content: ""; position: absolute; inset: -50%; background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, .18) 0%, transparent 45%), radial-gradient(circle at 70% 55%, rgba(79, 70, 229, .12) 0%, transparent 45%); }
.login-card { background: var(--panel); border-radius: 18px; padding: 44px; width: 100%; max-width: 430px; box-shadow: var(--shadow-lg); position: relative; z-index: 1; }
.login-card h1 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.login-card p { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.form-control { width: 100%; padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; transition: border-color var(--tr), box-shadow var(--tr); background: var(--bg-soft); font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); background: #fff; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ===== VIEWERS ===== */
.htmlframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.imgwrap { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.imgwrap img { max-width: 100%; border-radius: var(--radius-sm); }
.binary { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; }

/* ===== MARKDOWN ===== */
article.md { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 38px; max-width: 920px; line-height: 1.75; }
article.md h1 { font-size: 24px; } article.md h2 { font-size: 19px; margin-top: 32px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
article.md h3 { font-size: 15.5px; margin-top: 24px; text-transform: none; letter-spacing: 0; }
article.md pre { margin: 14px 0; }
article.md blockquote { border-left: 3px solid var(--accent); margin: 14px 0; padding: 6px 18px; color: var(--ink-2); background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
article.md table { margin: 14px 0; width: 100%; }

/* ===== ADD PROJECT ===== */
.add-project { border-style: dashed; background: var(--bg-soft); }
.add-project:hover { border-color: var(--accent); background: var(--accent-light); }

/* ===== REGISTER GRID (NDIS) ===== */
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.reg-card { display: flex; flex-direction: column; align-items: center; padding: 16px 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: center; transition: transform var(--tr), box-shadow var(--tr); cursor: pointer; }
.reg-card:hover { background: var(--accent-light); border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.reg-label { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.reg-count { font-size: 20px; font-weight: 800; color: var(--accent); }
.reg-open { font-size: 11px; color: var(--warn); font-weight: 500; }

/* ===== PORTFOLIO (INVESTMENTS) ===== */
.flip-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 26px; }
.flip-nav .btn { max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; }
.stage-chip { font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; background: #f1f5f9; color: var(--muted); border: 1px solid var(--line); }
.stage-chip.done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.stage-chip.current { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 10px rgba(79, 70, 229, .35); }
.stage-chip.current.parked { background: var(--warn); border-color: var(--warn); }
.stage-arrow { color: #94a3b8; font-size: 11px; }
.port-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); margin: 8px 0 4px; }
.port-card { border-left: 3px solid transparent; }
.port-card:nth-child(odd) { border-left-color: var(--accent); }
.tl-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.tl-item:last-child { border-bottom: 0; }
.tl-date { min-width: 230px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-note { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.dec-box { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.dec-box h3 { margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-size: 13px; }
.dec-box p { font-size: 13px; color: var(--ink-2); }
.doclist { margin-left: 18px; }
.doclist li { margin: 6px 0; font-size: 13.5px; }

/* ===== DASHBOARD HERO (portfolio state strip) ===== */
.hero-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0 26px; }
.hero-stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; }
.hero-stat .hs-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hero-stat .hs-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hero-stat .hs-sub { font-size: 12px; color: var(--muted); }
.hero-stat.hi { border-color: var(--danger-line); background: linear-gradient(180deg, #fff5f6, var(--panel)); }
.hero-stat.hi .hs-value { color: var(--danger); }
.hero-stat.mid { border-color: var(--warn-line); }
.hero-stat.mid .hs-value { color: var(--warn); }
.gate-alert { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--danger-bg), #fff8f5);
  border: 1px solid var(--danger-line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-size: 13.5px; color: var(--ink-2); }
.gate-alert a { font-weight: 650; }
.howto { margin-top: 26px; }
.howto summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 550; }
.howto summary:hover { color: var(--ink); }
.howto .howto-body { margin-top: 10px; padding: 14px 18px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2); }

/* ===== MESSAGES ===== */
.msg-meta { font-size: 13px; color: var(--muted); margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.msg-body { margin: 18px 0; }
.unread td { font-weight: 600; background: var(--accent-light); }

/* ===== EXECUTIVE-FIRST: VERDICT HERO (Tier 1) ===== */
.verdict-hero {
  background: linear-gradient(135deg, var(--ink) 0%, #1e293b 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.verdict-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -5%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
  pointer-events: none;
}
.verdict-hero .verdict-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 8px;
}
.verdict-hero .verdict-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  max-width: 70ch;
}
.verdict-hero .verdict-sub {
  font-size: 15px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 10px;
  line-height: 1.55;
  max-width: 60ch;
}
.verdict-hero .verdict-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.verdict-hero .verdict-actions .btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}
.verdict-hero .verdict-actions .btn:hover {
  background: rgba(255,255,255,0.25);
}
.verdict-hero .verdict-actions .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== EXECUTIVE-FIRST: ALERT BANNER ===== */
.alert-section { margin-bottom: 20px; }
.gate-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
}
.gate-alert .btn { margin-left: auto; flex-shrink: 0; }
.clear-banner {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.clear-banner.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: var(--ok);
}

/* ===== EXECUTIVE-FIRST: EXEC RIBBON (Tier 2) ===== */
.exec-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.exec-ribbon .ribbon-cell {
  background: var(--panel);
  padding: 18px 20px;
  text-align: center;
}
.exec-ribbon .ribbon-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.exec-ribbon .ribbon-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.exec-ribbon .ribbon-cell.r-urgent .ribbon-value { color: var(--danger); }
.exec-ribbon .ribbon-cell.r-warn .ribbon-value { color: var(--warn); }
.exec-ribbon .ribbon-cell.r-ok .ribbon-value { color: var(--ok); }

/* ===== EXECUTIVE-FIRST: PRIORITY BORDERS ===== */
.card.card-hi { border-left: 4px solid var(--danger); }
.card.card-mid { border-left: 4px solid var(--warn); }
.card.card-lo { border-left: 4px solid var(--ok); }

/* ===== EXECUTIVE-FIRST: KPI SPOTLIGHT ===== */
.kpi-card.kpi-spotlight {
  background: linear-gradient(135deg, var(--accent-light), var(--panel));
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-md);
}
.kpi-card.kpi-spotlight .kpi-value {
  font-size: 36px;
  color: var(--accent);
}

/* ===== EXECUTIVE-FIRST: SECTION STATUS PILLS ===== */
.sec-head .sec-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.sec-head .sec-status.s-green { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.sec-head .sec-status.s-amber { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.sec-head .sec-status.s-red { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }

/* ===== UTILITIES ===== */
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.collapse-toggle { cursor: pointer; user-select: none; }
.collapse-toggle::before { content: "▸ "; }
.collapse-toggle.open::before { content: "▾ "; }

/* ===== ACTION-AWARE DASHBOARD (2026-09-20) ===== */
.act-panel { margin-top: 14px; }
.act-panel .card-head { display: flex; justify-content: space-between; align-items: center; }
.act-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.act-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.act-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
.act-table tr:last-child td { border-bottom: none; }
.act-table tr.row-overdue td { background: var(--danger-bg); }
.act-table td a { font-weight: 600; }
.act-table .badge.danger { white-space: nowrap; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .topbar { padding: 0 16px; gap: 12px; height: auto; flex-wrap: wrap; padding-block: 8px; }
  .topbar nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topbar nav a { font-size: 12px; padding: 6px 10px; white-space: nowrap; }
  .shell { padding: 0 16px; margin-top: 20px; }
  h1 { font-size: 21px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 24px; }
  .card { padding: 16px; }
  .tl-date { min-width: 0; flex-direction: column; align-items: flex-start; }
  .user-name { display: none; }
  .act-table th:nth-child(2), .act-table td:nth-child(2) { display: none; }
}
