/* ===================================================================
   Frydensberg Tech — M365 Automation Portal, real app
   app.css — one stylesheet, no build step, same house rule as
   website/public/assets/site.css and portal-demo/public/assets/app.css.
   Self-hosted fonts (no Google Fonts CDN request leaking a visitor's IP
   before consent).

   Palette and component shapes come from the design canvas
   ("M365 Automation Portal", 19 artboards,
   https://claude.ai/code/artifact/e2738f3b-31b9-4ebc-98b9-094043d603ac)
   and portal-demo/public/assets/app.css for the screens both share.
   Dark chrome tokens are byte-identical to portal-demo's --* tokens.
   The light report-card palette (--r-*) is scoped to .report-card only
   and must never leak into app chrome.

   NOTE (25 Aug 2026): a second, independent frontend build was found
   mid-session under public/js/ + a competing shorter app.css using
   different class names (.pill-preview, etc.) — flagged to the lead as
   a cross-agent collision. This file is the fuller component set (the
   confirm-flow modal/drawer/wizard classes the brief calls the core
   screen), restored after being overwritten once. If you're
   reconciling the two builds, diff against public/js/api.js and
   public/js/health-score-model.js before deleting either side.
   =================================================================== */

:root {
  --bg: #070E18;
  --surface: #0C1624;
  --surface2: #111E30;
  --line: #1B2A3F;
  --ink: #E9EFF6;
  --muted: #93A6BC;
  --accent: #3ECFAE;
  --accent-ink: #04140F;
  --warn: #E9A23B;
  --danger: #E2566E;

  --r-navy: #0B2545;
  --r-teal: #2A9D8F;
  --r-warn: #E9A23B;
  --r-danger: #D1495B;
  --r-ink: #1c2430;
  --r-muted: #6b7684;
  --r-line: #e3e8ef;

  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --font-report: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

  --max-w-content: 1440px;
}

/* ------------------------------------------------------------------
   Self-hosted fonts.
   ------------------------------------------------------------------ */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
button { font-family: var(--font-sans); cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { cursor: not-allowed; }

/* ------------------------------------------------------------------
   App shell — top nav shared by every screen.
   ------------------------------------------------------------------ */
.topnav {
  height: 64px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 28px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.topnav .brand-group { display: flex; align-items: center; gap: 26px; }
.wordmark { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.wordmark .dot { color: var(--accent); }
.topnav .divider { width: 1px; height: 22px; background: var(--line); }
.topnav nav { display: flex; gap: 22px; }
.navlink { font-size: 13.5px; color: var(--muted); padding: 8px 4px; cursor: pointer; border-bottom: 2px solid transparent; }
.navlink.active { color: var(--ink); border-bottom-color: var(--accent); }
.navlink.disabled { color: #4a5a70; cursor: not-allowed; }
.topnav .right { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--line); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink);
}
.hamburger-btn {
  display: none; background: transparent; border: none; padding: 6px;
  color: var(--ink); width: 34px; height: 34px; align-items: center; justify-content: center;
}
.pill-demo {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 100px; cursor: pointer;
}
.pill-demo .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.pill-demo span.label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.searchbox {
  display: flex; align-items: center; gap: 8px; background: var(--surface2);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; width: 220px;
}
.searchbox input { background: none; border: none; outline: none; color: var(--ink); font-family: var(--font-sans); font-size: 13px; width: 100%; }
.searchbox input::placeholder { color: var(--muted); }

.page { padding: 32px 40px 60px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 16px; }
.page-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.page-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.page-head .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-bottom: 26px; }
.head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.back-link { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; display: inline-block; }
.back-link:hover { color: var(--ink); }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }

/* ------------------------------------------------------------------
   Backend-status / sample-data badges — honesty labelling for anything
   this build talks to that isn't a real endpoint yet. Distinct from
   portal-demo's "Preview build" badge: this is the REAL app, so the
   badge only appears per-section, when that section's data is a
   documented mock, never app-wide.
   ------------------------------------------------------------------ */
.stub-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid rgba(233,162,59,.35); background: rgba(233,162,59,.08);
  border-radius: 100px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--warn);
}
.stub-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }

/* ------------------------------------------------------------------
   Buttons.
   ------------------------------------------------------------------ */
.btn {
  border-radius: 7px; padding: 9px 16px; font-family: var(--font-sans);
  font-size: 13.5px; border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn-primary { background: var(--accent); border: none; color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:disabled { background: var(--line); color: #5a6b80; }
.btn-danger-outline { background: transparent; border: 1px solid rgba(226, 86, 110, .5); color: var(--danger); font-weight: 600; }
.btn-ghost { color: var(--muted); border-color: transparent; background: transparent; }
.btn-full { width: 100%; }

/* ------------------------------------------------------------------
   Stat tiles.
   ------------------------------------------------------------------ */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 18px 20px;
}
.stat-tile.at-risk { border-left: 2px solid var(--danger); }
.stat-tile .value { font-size: 26px; font-weight: 600; }
.stat-tile .value.warn { color: var(--warn); }
.stat-tile .value.danger { color: var(--danger); }
.stat-tile .caption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------------
   Table.
   ------------------------------------------------------------------ */
.data-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.tenant-table { border-collapse: collapse; width: 100%; }
table.tenant-table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 0 16px 12px; border-bottom: 1px solid var(--line);
}
table.tenant-table thead tr { padding-top: 16px; display: table-row; }
table.tenant-table td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
table.tenant-table tr:last-child td { border-bottom: none; }
table.tenant-table tbody tr:hover { background: var(--surface2); }
.tenant-name { font-weight: 600; font-size: 14px; }
.tenant-domain { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.score-cell { display: flex; align-items: center; gap: 10px; }
.score-cell .num { font-weight: 600; font-size: 14.5px; }
.score-cell .grade { font-size: 11px; font-weight: 600; }
.auto-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 100px; font-size: 12px;
}
.auto-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.view-link { font-size: 12.5px; color: var(--accent); cursor: pointer; background: none; border: none; font-family: var(--font-sans); }
.view-link.disabled { color: var(--muted); cursor: default; }
.reconnect-link { font-size: 12.5px; color: var(--warn); font-weight: 600; background: none; border: none; font-family: var(--font-sans); cursor: pointer; }
.status-flag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 12px; }
.stale-note { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; font-size: 12px; color: var(--muted); }
.filter-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 100px; font-size: 12px; color: var(--muted); background: transparent; font-family: var(--font-sans); cursor: pointer; }
.filter-chip.active { background: var(--surface2); color: var(--ink); border-color: var(--accent); }

/* ------------------------------------------------------------------
   Skeleton (loading state).
   ------------------------------------------------------------------ */
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }
.skel { background: var(--surface2); border-radius: 4px; animation: pulse 1.6s ease-in-out infinite; }

/* ------------------------------------------------------------------
   Empty / error states.
   ------------------------------------------------------------------ */
.empty-state {
  border: 1px dashed var(--line); border-radius: 12px; padding: 100px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.empty-state h2 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.empty-state p { font-size: 13.5px; color: var(--muted); max-width: 400px; margin: 0 0 26px; line-height: 1.6; }
.steps-note { margin-top: 34px; display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.step-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 150px; }
.step-mini .n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--font-mono); color: var(--muted); }
.step-mini .t { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.error-banner {
  border: 1px solid rgba(226, 86, 110, .35); background: rgba(226, 86, 110, .06);
  border-radius: 10px; padding: 18px 22px; display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px;
}
.error-banner .title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.error-banner .body { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.error-banner button { flex-shrink: 0; }

/* ------------------------------------------------------------------
   Onboarding wizard.
   ------------------------------------------------------------------ */
.wizard-wrap { display: flex; justify-content: center; padding: 56px 20px; flex: 1; }
.wizard { width: 100%; max-width: 600px; }
.step-track { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; justify-content: center; }
.step-track .seg { width: 38px; height: 3px; border-radius: 100px; background: var(--line); }
.step-track .seg.done { background: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px 34px; }
.card.centered { padding: 40px 34px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.card h1 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.card.centered h1 { font-size: 20px; }
.lead { margin: 0 0 26px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.lead.narrow { max-width: 440px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.text-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--line); border-radius: 7px;
  padding: 11px 13px; color: var(--ink); font-family: var(--font-sans); font-size: 14px; margin-bottom: 22px;
}
.text-input:focus { border-color: var(--accent); }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.scope-cat { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; }
.scope-cat .h { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.scope-cat .l { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.trust-note {
  display: flex; gap: 10px; padding: 13px 15px; background: rgba(62, 207, 174, .07);
  border: 1px solid rgba(62, 207, 174, .28); border-radius: 8px; font-size: 12.5px; line-height: 1.6; margin-bottom: 26px;
}
.trust-note.warn { background: rgba(233, 162, 59, .07); border-color: rgba(233, 162, 59, .3); }
.trust-note svg { flex-shrink: 0; margin-top: 1px; }
.under-note { margin-top: 16px; font-size: 11.5px; color: var(--muted); text-align: center; }
.what-next { width: 100%; text-align: left; background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-top: 8px; }
.what-next .l, .scope-recap .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 9px; }
.what-next ol { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink); line-height: 1.9; }
.check-circle, .x-circle { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.check-circle { background: rgba(62, 207, 174, .12); }
.x-circle { background: rgba(226, 86, 110, .12); }
.scope-recap { width: 100%; text-align: left; background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 24px; }
.scope-recap .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 0; }
.wizard .actions { display: flex; gap: 10px; width: 100%; }
.wizard .actions.with-margin { margin-bottom: 22px; }
.wizard .actions .btn { flex: 1; padding: 12px 16px; font-size: 13.5px; font-weight: 600; }
.other-reasons { width: 100%; text-align: left; border-top: 1px solid var(--line); padding-top: 20px; }
.other-reasons .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.other-reasons .row { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.6; padding: 6px 0; }
.other-reasons .row strong { color: var(--ink); font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1.1s linear infinite; transform-origin: center; }

/* ------------------------------------------------------------------
   Health score gauge + breakdown + findings + drilldown drawer.
   ------------------------------------------------------------------ */
.grid-health { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.score-gauge-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center; height: fit-content;
}
.score-gauge-card .grade-label { margin-top: 14px; font-size: 15px; font-weight: 600; }
.score-gauge-card .coverage-note { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.breakdown-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 26px; }
.breakdown-card .heading, .findings-card .heading, .card .heading { font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.dimrow { display: grid; grid-template-columns: 170px 44px 1fr; gap: 16px; align-items: center; padding: 14px 0; cursor: pointer; }
.dimrow + .dimrow { border-top: 1px solid var(--line); }
.dimrow .dim-name { font-size: 13.5px; font-weight: 600; }
.dimrow .dim-weight { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dimrow .dim-score { font-size: 15px; font-weight: 600; text-align: right; }
.dimrow .bar-track { height: 7px; border-radius: 100px; background: var(--surface2); overflow: hidden; margin-bottom: 7px; }
.dimrow .bar-fill { height: 100%; border-radius: 100px; }
.dimrow .dim-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

.findings-card { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 26px; }
.finding-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.finding-row:last-child { border-bottom: none; }
.finding-row .sev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.finding-row .sev-label {
  width: 70px; flex-shrink: 0; font-family: var(--font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .04em;
}
.finding-row .text { flex: 1; font-size: 13.5px; }
.finding-row .action { font-size: 12.5px; color: var(--accent); cursor: pointer; flex-shrink: 0; background: none; border: none; font-family: var(--font-sans); }

/* Drawer (finding drill-down) */
.drawer-scrim { position: fixed; inset: 0; background: rgba(3, 7, 13, .6); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .6); display: flex; flex-direction: column; z-index: 41;
}
.drawer-head { padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .close-btn { float: right; width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); border: none; display: flex; align-items: center; justify-content: center; }
.sev-tag {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: 100px; margin-bottom: 12px;
}
.sev-tag.critical { color: var(--danger); background: rgba(226, 86, 110, .12); }
.sev-tag.medium { color: var(--warn); background: rgba(233, 162, 59, .12); }
.sev-tag.low { color: var(--muted); background: rgba(147, 166, 188, .12); }
.drawer-head h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.drawer-head .dim { font-size: 12.5px; color: var(--muted); }
.drawer-body { padding: 22px 28px; flex: 1; overflow-y: auto; }
.section { margin-bottom: 22px; }
.section:last-child { margin-bottom: 0; }
.section-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.affected-list { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.affected-row { display: flex; justify-content: space-between; padding: 11px 14px; font-size: 13px; }
.affected-row + .affected-row { border-top: 1px solid var(--line); }
.affected-row .role { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.evidence { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.evidence .k { color: var(--ink); }
.remediation-opt { border: 1px solid var(--line); border-radius: 8px; padding: 15px 16px; margin-bottom: 10px; }
.remediation-opt .t { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.remediation-opt .d { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }

/* ------------------------------------------------------------------
   Automation run view — list + timeline + trigger + confirm modal.
   ------------------------------------------------------------------ */
.grid-run { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
.run-list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: fit-content; }
.run-item { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; }
.run-item:last-child { border-bottom: none; }
.run-item.selected { background: var(--surface2); border-left: 2px solid var(--accent); }
.run-item.failed.selected { border-left-color: var(--danger); }
.run-item .head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.run-item .title { font-size: 13px; font-weight: 600; color: var(--ink); }
.run-item .sub { font-size: 12px; color: var(--muted); }

.run-summary { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 16px; }
.run-summary .head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.run-summary .subject { font-size: 15px; font-weight: 600; }
.run-summary .subject-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 3px; }
.status-pill { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill.running { background: rgba(62, 207, 174, .12); color: var(--accent); }
.status-pill.running .dot { background: var(--accent); }
.status-pill.completed { background: rgba(62, 207, 174, .12); color: var(--accent); }
.status-pill.completed .dot { background: var(--accent); }
.status-pill.failed { background: rgba(226, 86, 110, .12); color: var(--danger); }
.status-pill.failed .dot { background: var(--danger); }
.status-pill.waiting { background: rgba(233, 162, 59, .12); color: var(--warn); }
.status-pill.waiting .dot { background: var(--warn); }
.run-summary .meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.run-summary .meta-grid .k { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.run-summary .meta-grid .v { font-size: 13px; }
.run-summary .meta-grid .v.mono { font-family: var(--font-mono); }

.step-timeline { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.step { display: flex; gap: 16px; padding: 18px 24px; }
.step + .step { border-top: 1px solid var(--line); }
.step .icon { flex-shrink: 0; width: 22px; padding-top: 1px; }
.step .body { flex: 1; }
.step .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step .step-title { font-size: 14px; font-weight: 600; }
.step .step-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.step .step-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.step .step-log {
  margin-top: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 11px; font-family: var(--font-mono); font-size: 11.5px; color: var(--accent);
}
.step.is-failed .step-desc { color: var(--danger); }
.step.is-failed .step-log { color: var(--danger); }
.step.is-pending .step-title, .step.is-pending .step-desc { color: var(--muted); }

.confirmation-note { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.irreversible-note { margin-top: 14px; padding: 12px 14px; background: rgba(233, 162, 59, .07); border: 1px solid rgba(233, 162, 59, .3); border-radius: 8px; font-size: 12px; color: var(--ink); line-height: 1.6; }
.state-card { margin-top: 16px; background: rgba(226, 86, 110, .06); border: 1px solid rgba(226, 86, 110, .3); border-radius: 10px; padding: 20px 24px; }
.state-card .heading { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.state-list { font-size: 13px; line-height: 1.9; }
.state-list .ok { color: var(--accent); }
.state-list .no { color: var(--muted); }
.actions-row { display: flex; gap: 10px; margin-top: 18px; }
.idem-note { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.summary-card { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 0; border-top: 1px solid var(--line); }
.summary-row:first-of-type { border-top: none; }
.summary-row .v { color: var(--accent); font-weight: 600; }
.audit-link { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 12px 14px; background: var(--surface2); border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.audit-link a { font-weight: 600; }

/* Trigger screen */
.finding-summary { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--surface2); border-radius: 8px; margin-bottom: 18px; }
.finding-summary svg { flex-shrink: 0; margin-top: 1px; }
.finding-summary .t { font-size: 13px; line-height: 1.55; }
.will-run { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.will-run .label { font-size: 11px; color: var(--muted); margin-bottom: 7px; letter-spacing: .04em; text-transform: uppercase; }
.will-run .steps { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.9; color: var(--ink); }
.mode-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.mode-toggle { display: inline-flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 100px; padding: 3px; }
.mode-toggle .opt { padding: 7px 15px; border-radius: 100px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: none; font-family: var(--font-sans); cursor: pointer; }
.mode-toggle .opt.active { background: var(--accent); color: var(--accent-ink); }
.mode-note { font-size: 12px; color: var(--muted); }

/* Confirm modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(3, 7, 13, .72); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 56px 20px; overflow-y: auto; }
.modal { width: 100%; max-width: 660px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .65); overflow: hidden; margin: auto; }
.modal-head { padding: 26px 30px 20px; border-bottom: 1px solid var(--line); }
.modal-head .eyebrow2 { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); margin-bottom: 10px; }
.modal-head h1 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.modal-head .sub { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.modal-body { padding: 22px 30px; max-height: 560px; overflow-y: auto; }
.blast-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.blast-tile { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 13px; }
.blast-tile .n { font-size: 19px; font-weight: 600; }
.blast-tile .l { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.steplist { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepline { display: flex; gap: 12px; padding: 12px 15px; align-items: flex-start; }
.stepline + .stepline { border-top: 1px solid var(--line); }
.stepline .num { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 1px; }
.stepline .body { flex: 1; }
.stepline .row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepline .title { font-size: 13px; font-weight: 600; }
.rev-badge { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: 100px; flex-shrink: 0; white-space: nowrap; }
.rev-badge.rev { color: var(--accent); background: rgba(62, 207, 174, .12); }
.rev-badge.irrev { color: var(--danger); background: rgba(226, 86, 110, .12); }
.stepline .desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.diff { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-family: var(--font-mono); font-size: 12px; line-height: 1.9; }
.diff .row { display: flex; gap: 8px; flex-wrap: wrap; }
.diff .k { color: var(--muted); width: 168px; flex-shrink: 0; }
.diff .old { color: var(--danger); text-decoration: line-through; opacity: .75; }
.diff .arrow { color: var(--muted); }
.diff .new { color: var(--accent); }
.diff-note { font-size: 11.5px; color: var(--muted); margin-top: 9px; line-height: 1.6; }
.ack-box { display: flex; gap: 11px; align-items: flex-start; background: rgba(233, 162, 59, .07); border: 1px solid rgba(233, 162, 59, .3); border-radius: 8px; padding: 14px 15px; }
.ack-box input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--warn); flex-shrink: 0; }
.ack-box label { font-size: 12.5px; line-height: 1.55; color: var(--ink); cursor: pointer; }
.ack-box .fine { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.modal-foot { padding: 18px 30px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.modal-foot .started-by { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.foot-actions { display: flex; gap: 10px; }
.btn-reject { color: var(--muted); }
.btn-approve { background: var(--line); border: none; color: #5a6b80; font-weight: 600; cursor: not-allowed; }
.btn-approve.enabled { background: var(--accent); color: var(--accent-ink); cursor: pointer; }

/* ------------------------------------------------------------------
   Reports view + light report-card palette (scoped, never mixed into
   app chrome).
   ------------------------------------------------------------------ */
.grid-reports { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.report-history { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: fit-content; }
.report-row { padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; }
.report-row:last-child { border-bottom: none; }
.report-row.selected { background: var(--surface2); border-left: 2px solid var(--accent); }
.report-row .title { font-size: 13px; font-weight: 600; margin-bottom: 3px; color: var(--ink); }
.report-row .sub { font-size: 11.5px; color: var(--muted); }

.lang-toggle { display: inline-flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 100px; padding: 3px; }
.lang-toggle button {
  padding: 6px 16px; border-radius: 100px; font-size: 12.5px; font-weight: 600;
  border: none; background: transparent; color: var(--muted); font-family: var(--font-sans); cursor: pointer;
}
.lang-toggle button.active { background: var(--accent); color: var(--accent-ink); }
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.report-note { font-size: 13px; color: var(--muted); }

.report-card {
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); color: var(--r-ink);
}
.report-card .header {
  background: var(--r-navy); color: #fff; padding: 22px 26px; border-bottom: 4px solid var(--r-teal);
}
.report-card .eyebrow-r { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #9FB3CC; }
.report-card h2 { margin: 5px 0 3px; font-size: 21px; font-weight: 600; font-family: var(--font-report); }
.report-card .subtitle { font-size: 12.5px; color: #C3D2E4; font-family: var(--font-report); }
.report-card .body { padding: 22px 26px; }
.report-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.report-tile {
  background: #fff; border: 1px solid var(--r-line); border-left: 4px solid var(--r-teal);
  border-radius: 6px; padding: 12px 16px; min-width: 150px; flex: 1 1 150px; font-family: var(--font-report);
}
.report-tile .value { font-size: 24px; font-weight: 600; color: var(--r-navy); }
.report-tile .label { font-size: 11px; color: var(--r-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.report-card .details-heading { font-size: 14px; font-weight: 600; color: var(--r-navy); margin-bottom: 10px; font-family: var(--font-report); }
.report-table-wrap { overflow-x: auto; border: 1px solid var(--r-line); border-radius: 6px; }
table.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-family: var(--font-report); }
table.report-table th {
  text-align: left; background: #eef2f7; color: var(--r-navy); font-weight: 600;
  padding: 8px 9px; border-bottom: 2px solid var(--r-line); white-space: nowrap;
}
table.report-table td { padding: 7px 9px; border-bottom: 1px solid var(--r-line); color: var(--r-ink); }
.report-card .footer { padding: 0 26px 20px; font-size: 11.5px; color: var(--r-muted); font-family: var(--font-report); }

/* ------------------------------------------------------------------
   Billing.
   ------------------------------------------------------------------ */
.page-narrow { max-width: 980px; }
.plan-banner { display: flex; gap: 12px; padding: 13px 16px; background: rgba(233, 162, 59, .07); border: 1px solid rgba(233, 162, 59, .3); border-radius: 8px; font-size: 12px; line-height: 1.6; color: var(--ink); margin-bottom: 24px; }
.plan-banner svg { flex-shrink: 0; margin-top: 1px; }
.billing-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px 26px; margin-bottom: 18px; }
.billing-card .heading { font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tier-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.tier-tile { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; position: relative; }
.tier-tile.current { border-color: var(--accent); background: var(--surface2); }
.tier-tile .badge { position: absolute; top: -9px; left: 14px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 100px; letter-spacing: .03em; }
.tier-tile .range { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.tier-tile .price { font-size: 19px; font-weight: 600; }
.tier-tile .unit { font-size: 11px; color: var(--muted); }
.usage-meter { margin-bottom: 8px; }
.meter-track { height: 8px; border-radius: 100px; background: var(--surface2); overflow: hidden; margin-bottom: 8px; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 100px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); flex-wrap: wrap; gap: 4px; }
.meter-note { font-size: 12px; color: var(--accent); margin-top: 6px; }
.billing-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 6px; }
.billing-row:first-of-type { border-top: none; }
.billing-row .k { font-size: 13px; }
.billing-row .v { font-size: 13px; color: var(--muted); }
.pm-card { display: flex; align-items: center; gap: 12px; }
.pm-icon { width: 38px; height: 26px; background: #635bff; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; font-family: var(--font-mono); letter-spacing: .02em; flex-shrink: 0; }
table.billing-table { border-collapse: collapse; width: 100%; }
table.billing-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
table.billing-table td { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
table.billing-table tr:last-child td { border-bottom: none; }
.status-paid { color: var(--accent); font-weight: 600; font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ===================================================================
   Responsive — same discipline as portal-demo, tested down to 390px.
   =================================================================== */
@media (max-width: 900px) {
  .grid-health, .grid-run, .grid-reports { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .page { padding: 20px 16px 40px; }
  .topnav { padding: 0 16px; }
  .topnav .divider { display: none; }
  .topnav nav { display: none; }
  .hamburger-btn { display: flex; }
  .topnav .right .searchbox { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-tile { padding: 14px 15px; }
  .stat-tile .value { font-size: 21px; }
  .stat-tile .caption { font-size: 11px; }

  /* table -> stacked cards */
  table.tenant-table thead { display: none; }
  table.tenant-table, table.tenant-table tbody, table.tenant-table tr, table.tenant-table td { display: block; width: 100%; }
  .data-card { border-radius: 10px; }
  table.tenant-table tr {
    background: var(--surface); border-radius: 10px; padding: 14px 15px; margin: 10px;
    border: 1px solid var(--line);
  }
  table.tenant-table td { padding: 0; border-bottom: none; }
  table.tenant-table td:not(:first-child) { margin-top: 9px; }
  table.tenant-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 10.5px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px;
  }
  .score-cell svg { width: 28px; height: 28px; }

  .blast-grid { grid-template-columns: 1fr 1fr; }
  .modal-scrim { padding: 0; align-items: stretch; }
  .modal { max-width: 100%; height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; }
  .modal-foot { flex-direction: column; align-items: stretch; }
  .foot-actions { flex-direction: column-reverse; }
  .foot-actions .btn { width: 100%; }

  .drawer { width: 100%; }

  .tier-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-row { gap: 8px; }
  .diff .k { width: 100%; font-size: 10.5px; }
}
