/* ===== DICP theme — light palette with green accent ===================== */
:root {
  /* Clean tech palette: pure whites, green-tinted panels, confident borders */
  --bg: #fcfdfc;
  --bg-2: #ffffff;
  --on-accent: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --panel-2: #f6fbf6;
  --panel-3: #d8e6db;

  --border: rgba(22, 163, 74, 0.22);
  --border-2: rgba(22, 163, 74, 0.12);
  --border-strong: rgba(22, 163, 74, 0.44);

  --text: #0f172a;
  --text-2: #334155;
  --muted: #526175;
  --muted-2: #7b8699;
  --white: #0b1120;

  --accent: #16a34a;
  --accent-2: #15803d;
  --accent-bg: rgba(22, 163, 74, 0.12);
  --accent-bg-2: rgba(22, 163, 74, 0.18);
  --accent-glow: rgba(22, 163, 74, 0.25);

  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.12);
  --yellow: #ca8a04;
  --yellow-bg: rgba(234, 179, 8, 0.14);
  --orange: #ea580c;
  --orange-bg: rgba(249, 115, 22, 0.14);
  --red: #dc2626;
  --red-bg: rgba(239, 68, 68, 0.12);
  --blue: #0284c7;
  --blue-bg: rgba(56, 189, 248, 0.14);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --sidebar-w: 290px;

  --mono: 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--white); letter-spacing: -0.02em; }
h1 { letter-spacing: -0.03em; }
p { margin: 0; }

/* ===== Layout ============================================================ */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh;
  background:
    radial-gradient(900px 600px at 90% -10%, rgba(22, 163, 74, 0.08) 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(22, 163, 74, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f6fbf6 100%); }

/* ===== Sidebar =========================================================== */
.sidebar { background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-2);
  display: flex; flex-direction: column; padding: 14px 12px 16px; gap: 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }

.sidebar-search { position: relative; }
.sidebar-search input {
  width: 100%; padding: 8px 10px 8px 32px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); font-size: 13px;
}
.sidebar-search input::placeholder { color: var(--muted); }
.sidebar-search input:focus { outline: none; border-color: var(--accent); background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-bg); }
.sidebar-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted); }
.sidebar-search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border-2);
  padding: 1px 6px; border-radius: 4px; font-family: var(--mono); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { padding-top: 6px; border-top: 1px solid var(--border-2); margin-top: 6px; }
.nav-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.nav-item, .nav-group-toggle {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 17px; font-weight: 500; cursor: pointer;
  background: none; border: none; text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item .icon, .nav-group-toggle .icon { width: 24px; height: 24px; flex-shrink: 0; color: var(--muted); }
.nav-item:hover, .nav-group-toggle:hover { background: var(--panel-2); color: var(--white); }
.nav-item:hover .icon, .nav-group-toggle:hover .icon { color: var(--accent); }

.nav-item.active { background: var(--accent-bg); color: var(--accent); }
.nav-item.active .icon { color: var(--accent); }

.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle { justify-content: space-between; }
.nav-group-toggle .label-wrap { display: flex; align-items: center; gap: 12px; }
.nav-group-toggle .chevron { width: 16px; height: 16px; transition: transform 0.15s; color: var(--muted); }
.nav-group.open .nav-group-toggle .chevron { transform: rotate(90deg); }
.nav-group-children { display: none; padding-left: 38px; gap: 2px; flex-direction: column; padding-top: 4px; }
.nav-group.open .nav-group-children { display: flex; }
.nav-group-children .nav-item { padding: 11px 14px; font-size: 15.5px; }

.sidebar-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border-2); }
.framework-pill {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 10px;
  background: var(--panel-2); border-radius: var(--radius-sm); font-size: 12px;
  border: 1px solid var(--border-2);
}
.framework-pill .label { color: var(--muted); }
.framework-pill .value { color: var(--white); font-weight: 600; font-family: var(--mono); }
.btn-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; border: none;
  color: var(--muted); border-radius: var(--radius-sm); font-size: 14px;
}
.btn-link:hover { background: var(--panel-2); color: var(--white); }
.btn-link .icon { width: 18px; height: 18px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 12px;
  border-bottom: 1px solid var(--border-2); margin-bottom: 4px; }
.brand-logo { width: 100%; height: auto; max-height: 60px; display: block; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #22c55e, #16a34a);
  display: grid; place-items: center; color: #ffffff; font-weight: 700; font-size: 14px;
  box-shadow: 0 0 18px rgba(22, 163, 74, 0.35);
}
.brand-text { line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 16px; color: var(--white); letter-spacing: 0.02em; }
.brand-sub { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ===== Topbar / content ================================================== */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 28px 32px 18px; }
.topbar h1 { font-size: 26px; font-weight: 600; color: var(--white); }
.topbar .subtitle { color: var(--muted); margin-top: 4px; font-size: 14px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.content { padding: 8px 32px 40px; flex: 1; }

.app-foot { display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 32px 22px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border-2); margin-top: auto; }
.app-foot .sep { color: var(--muted-2); }

/* ===== Buttons / pills =================================================== */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  transition: border-color 0.2s, color 0.2s, background 0.2s; }
.btn:hover { border-color: var(--accent); color: var(--white); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { box-shadow: 0 0 24px var(--accent-glow); transform: translateY(-1px); color: var(--on-accent); background: var(--accent-2); }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--white); }
.btn .icon { width: 14px; height: 14px; }

.tabs { display: flex; gap: 4px; padding: 0 32px; border-bottom: 1px solid var(--border-2); margin-bottom: 16px; }
.tab { padding: 8px 12px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ===== Cards / KPI ======================================================== */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; backdrop-filter: blur(12px); transition: border-color 0.3s, transform 0.2s, box-shadow 0.25s; }
.card:hover { border-color: var(--border-strong); }
a.card.card-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.card.card-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22, 163, 74, 0.10); border-color: var(--border-strong); }
a.card.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-title { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.card-value { font-size: 32px; font-weight: 700; color: var(--white); letter-spacing: -0.02em; font-family: var(--sans); }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

.bar { height: 5px; background: var(--panel-3); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px;
  box-shadow: 0 0 12px var(--accent-glow); }
.bar.green > span { background: var(--green); }
.bar.yellow > span { background: var(--yellow); box-shadow: 0 0 12px rgba(234, 179, 8, 0.3); }
.bar.orange > span { background: var(--orange); box-shadow: 0 0 12px rgba(249, 115, 22, 0.3); }
.bar.red > span { background: var(--red); box-shadow: 0 0 12px rgba(239, 68, 68, 0.3); }

.delta { font-size: 12px; padding: 2px 7px; border-radius: 5px; font-weight: 600; font-family: var(--mono); }
.delta.up { background: var(--green-bg); color: var(--green); }
.delta.down { background: var(--red-bg); color: var(--red); }

/* ===== Status badges ===================================================== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.green .dot { background: var(--green); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.yellow .dot { background: var(--yellow); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.red .dot { background: var(--red); }
.badge.gray { background: var(--panel-3); color: var(--muted); }
.badge.gray .dot { background: var(--muted); box-shadow: none; }
.badge.purple { background: var(--blue-bg); color: var(--blue); }
.badge.purple .dot { background: var(--blue); }

/* ===== Tables ============================================================ */
.table-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; backdrop-filter: blur(12px); }
.table-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
.table-toolbar .search { flex: 1; max-width: 320px; position: relative; }
.table-toolbar .search input { width: 100%; padding: 7px 10px 7px 30px; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--panel-2); color: var(--text); }
.table-toolbar .search input::placeholder { color: var(--muted); }
.table-toolbar .search input:focus { outline: none; border-color: var(--accent); }
.table-toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); color: var(--text-2); }
.chip:hover { border-color: var(--accent); color: var(--white); }

table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 12px 14px; border-bottom: 1px solid var(--border-2); background: transparent;
  text-transform: uppercase; letter-spacing: 0.08em; }
table.data td { padding: 14px 14px; border-bottom: 1px solid var(--border-2); font-size: 14px; color: var(--text); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--panel-2); }

/* ===== Donut helpers ===================================================== */
.donut { width: 100px; height: 100px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p, 0%), var(--panel-3) 0); display: grid; place-items: center;
  box-shadow: 0 0 32px var(--accent-glow); }
.donut::after { content: attr(data-label); width: 76px; height: 76px; border-radius: 50%;
  background: var(--panel-solid); display: grid; place-items: center; font-weight: 700; font-size: 18px;
  color: var(--white); font-family: var(--sans); }

/* ===== Misc ============================================================== */
.section-title { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.18em;
  margin: 0 0 10px; font-weight: 600; }
.row-gap { display: flex; flex-direction: column; gap: 20px; }

.empty-strip { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--border-strong);
  padding: 10px 14px; border-radius: var(--radius); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.empty-strip strong { color: var(--white); font-weight: 600; }

.mono { font-family: var(--mono); }

/* ===== Stepper (Roadmap) ================================================ */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.step { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--border-2);
  position: relative; cursor: pointer; transition: background 0.2s; }
.step:last-child { border-right: none; }
.step:hover { background: var(--panel-2); }
.step.active { background: var(--accent-bg); }
.step .num { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; font-family: var(--mono); }
.step.done .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step.active .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 16px var(--accent-glow); }
.step .info { line-height: 1.25; }
.step .step-name { color: var(--white); font-weight: 600; font-size: 13px; }
.step .step-date { color: var(--muted); font-size: 11px; font-family: var(--mono); margin-top: 2px; }

.framework-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  backdrop-filter: blur(12px); }
.framework-card .meta { display: flex; align-items: center; gap: 16px; }
.framework-card .meta-text strong { color: var(--white); font-weight: 600; font-size: 15px; display: block; }
.framework-card .meta-text span { color: var(--muted); font-size: 12px; }
.framework-card .progress-row { display: flex; align-items: center; gap: 14px; }
.framework-card .progress-row .bar { width: 220px; margin: 0; }

.phase-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; backdrop-filter: blur(12px); }
.phase-card h2 { font-size: 18px; }
.phase-card .phase-sub { color: var(--muted); font-size: 13px; margin-top: 4px; margin-bottom: 18px; }
.task-group { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; }
.task-group-head { display: flex; align-items: center; gap: 12px; }
.task-group-head .icon-box { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-bg);
  color: var(--accent); display: grid; place-items: center; }
.task-group-head .icon-box svg { width: 16px; height: 16px; }
.task-group-head .grp-title { color: var(--white); font-weight: 600; flex: 1; }
.task-group-head .grp-counter { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.task-group-desc { color: var(--muted); font-size: 13px; margin-top: 4px; padding-left: 44px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 8px 0 8px 44px; font-size: 13px;
  border-top: 1px solid var(--border-2); margin-top: 12px; }
.task-row:first-of-type { border-top: 1px solid var(--border-2); padding-top: 12px; }
.task-row .task-name { flex: 1; color: var(--text); }
.task-row .task-name.done { text-decoration: line-through; color: var(--muted); }
.task-row .task-time { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.task-row .check { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 50%; flex-shrink: 0; }
.task-row.done .check { background: var(--accent); border-color: var(--accent); position: relative; }
.task-row.done .check::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border-right: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(45deg); }

/* ===== Stat block (Tests page) =========================================== */
.stat-block { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; backdrop-filter: blur(12px); }
.stat-block .stat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.stat-block .stat-title { color: var(--white); font-weight: 600; font-size: 14px; }
.stat-block .stat-meta { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.stat-block .stat-value { font-size: 36px; font-weight: 700; color: var(--white); letter-spacing: -0.02em; line-height: 1.1; }
.stat-block .seg-bar { display: flex; height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden;
  margin-top: 14px; }
.stat-block .seg-bar > span { display: block; height: 100%; }
.seg-bar .a { background: var(--accent); }
.seg-bar .b { background: var(--blue); }
.legend-row { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; }
.legend-row .lg { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.legend-row .lg .swatch { width: 8px; height: 8px; border-radius: 2px; }

.attention-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.attention-list .att-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.attention-list .att-row .label-with-dot { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.attention-list .att-row .count { color: var(--white); font-weight: 600; font-family: var(--mono); }

/* ===== Heatmap (Risk Overview) =========================================== */
.heatmap { display: grid; grid-template-columns: 100px repeat(5, 1fr); gap: 4px; }
.heatmap .axis-y, .heatmap .axis-x { color: var(--muted); font-size: 11px; }
.heatmap .axis-y { display: grid; align-items: center; justify-content: end; padding-right: 8px; text-align: right; }
.heatmap .cell { aspect-ratio: 1.6 / 1; border-radius: 6px; display: grid; place-items: center;
  color: var(--white); font-weight: 600; font-size: 14px; font-family: var(--mono); }
.heatmap .cell.low    { background: rgba(34, 197, 94, 0.18);  border: 1px solid rgba(34, 197, 94, 0.35); }
.heatmap .cell.med    { background: rgba(234, 179, 8, 0.18); border: 1px solid rgba(234, 179, 8, 0.35); }
.heatmap .cell.high   { background: rgba(249, 115, 22, 0.18); border: 1px solid rgba(249, 115, 22, 0.35); }
.heatmap .cell.crit   { background: rgba(239, 68, 68, 0.22); border: 1px solid rgba(239, 68, 68, 0.4); }
.heatmap .cell.empty  { color: var(--muted); }
.heatmap-row-axis { color: var(--muted); font-size: 11px; padding-top: 8px; text-align: center; grid-column: 2 / -1;
  display: grid; grid-template-columns: repeat(5, 1fr); }
.heatmap-axis-label { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-size: 11px;
  margin-right: 6px; }

/* ===== Asset tree (Inventory) ============================================ */
.asset-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.asset-tree { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 8px; max-height: 70vh; overflow-y: auto; backdrop-filter: blur(12px); }
.asset-tree .tree-section { font-size: 10px; color: var(--accent); font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 8px 10px 4px; }
.asset-tree .tree-item { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2); cursor: pointer; }
.asset-tree .tree-item:hover { background: var(--panel-2); color: var(--white); }
.asset-tree .tree-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.asset-tree .tree-item .count { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* ===== Sub-nav rail (Vulnerabilities) ==================================== */
.subnav-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.subnav { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px;
  backdrop-filter: blur(12px); }
.subnav a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; }
.subnav a:hover { background: var(--panel-2); color: var(--white); }
.subnav a.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* ===== Banner =========================================================== */
.banner { background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; }
.banner .ico { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-bg); color: var(--accent);
  display: grid; place-items: center; flex-shrink: 0; }
.banner .ico svg { width: 18px; height: 18px; }
.banner .body { flex: 1; }
.banner .body strong { color: var(--white); font-weight: 600; display: block; font-size: 14px; }
.banner .body span { color: var(--muted); font-size: 13px; }

/* ===== Mini donut for tables ============================================ */
.mini-donut { width: 24px; height: 24px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p, 0%), var(--panel-3) 0); display: inline-block; vertical-align: middle;
  margin-right: 8px; position: relative; }
.mini-donut::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel-solid); }

/* ===== Tabs (page-internal) ============================================== */
.local-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-2); margin-bottom: 14px; }
.local-tab { padding: 10px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent;
  font-weight: 500; cursor: pointer; }
.local-tab .count { font-family: var(--mono); margin-left: 6px; color: var(--muted-2); }
.local-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.local-tab.active .count { color: var(--accent); }

/* ===== Integration cards ================================================ */
.integration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .integration-grid { grid-template-columns: repeat(2, 1fr); } }
.integration-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 14px; }
.integration-card .head { display: flex; align-items: center; justify-content: space-between; }
.integration-card .logo { width: 40px; height: 40px; border-radius: 9px; background: var(--panel-2);
  border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--white); font-weight: 700;
  font-size: 14px; font-family: var(--mono); }
.integration-card .name { color: var(--white); font-weight: 600; font-size: 14px; }
.integration-card .meta-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.integration-card .meta-row .v { color: var(--text); font-family: var(--mono); }
.integration-card .actions { display: flex; gap: 8px; }
.integration-card .actions .btn { flex: 1; justify-content: center; }

/* ===== Inline mini chart (donut + bars) ================================== */
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-row .legend { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.donut-row .legend .lg { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }
.donut-row .legend .lg .v { color: var(--white); font-family: var(--mono); }

.split-bar { display: flex; flex-direction: column; gap: 6px; }
.split-bar .label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.split-bar .label .v { color: var(--white); font-family: var(--mono); }

/* ===== Login ============================================================= */
.login-body { min-height: 100vh; background:
  radial-gradient(1200px 700px at 15% 5%, rgba(22, 163, 74, 0.16) 0%, transparent 55%),
  radial-gradient(1000px 700px at 85% 95%, rgba(22, 163, 74, 0.10) 0%, transparent 55%),
  linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  padding: 40px 24px 32px; }
.login-shell { max-width: 1080px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 32px; }

.login-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding-top: 24px; }
.login-logo { width: 100%; max-width: 520px; height: auto; display: block; }
.login-tagline { font-size: 20px; font-weight: 600; color: var(--white); letter-spacing: -0.01em; margin: 0; }
.login-sub { color: var(--muted); font-size: 15px; margin: 0; max-width: 620px; }

.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; width: 100%; max-width: 420px; backdrop-filter: blur(14px); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { font-size: 22px; color: var(--white); }
.login-card .muted { color: var(--muted); font-size: 13px; margin-top: -6px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--accent);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.login-card input { padding: 12px 14px; border-radius: var(--radius-sm); background: #ffffff;
  border: 1px solid var(--border-2); color: var(--text); font-size: 14px; font-family: var(--sans); }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.login-card .alert { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }

.login-info { width: 100%; }
.login-info-title { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.2em;
  font-weight: 700; margin: 0 0 16px; text-align: center; }
.login-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .login-info-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .login-info-grid { grid-template-columns: 1fr; } }

.spotlight-card {
  position: relative; overflow: hidden;
  --mx: 50%; --my: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  display: flex; flex-direction: column; gap: 10px;
}
.spotlight-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(280px circle at var(--mx) var(--my), rgba(22, 163, 74, 0.22), transparent 60%);
  opacity: 0; transition: opacity 0.25s;
}
.spotlight-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx) var(--my), rgba(22, 163, 74, 0.06), transparent 55%);
  opacity: 0; transition: opacity 0.25s;
}
.spotlight-card:hover { border-color: var(--border-strong); transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.12); }
.spotlight-card:hover::before, .spotlight-card:hover::after { opacity: 1; }
.spotlight-card > * { position: relative; z-index: 1; }
.spotlight-card .sc-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-bg);
  color: var(--accent); display: grid; place-items: center; }
.spotlight-card .sc-icon svg { width: 20px; height: 20px; }
.spotlight-card h4 { font-size: 15px; color: var(--white); font-weight: 600; margin: 2px 0 0; }
.spotlight-card p { color: var(--text-2); font-size: 13px; line-height: 1.5; margin: 0; }
.spotlight-card .sc-more { margin-top: 4px; font-size: 12px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.04em; opacity: 0.7; transition: opacity 0.2s; }
.spotlight-card:hover .sc-more { opacity: 1; }
.spotlight-card { cursor: pointer; }
.spotlight-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ===== Spotlight card modal ============================================= */
.sc-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.sc-modal[hidden] { display: none; }
.sc-modal-backdrop { position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(6px); }
.sc-modal-card { position: relative; z-index: 1;
  max-width: 620px; width: 100%; max-height: calc(100vh - 48px); overflow-y: auto;
  background: #ffffff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 36px 36px 32px; box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  animation: sc-pop 0.22s ease-out; }
@keyframes sc-pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sc-modal-close { position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--panel-2); color: var(--muted); display: grid; place-items: center;
  transition: background 0.15s, color 0.15s; }
.sc-modal-close:hover { background: var(--accent-bg); color: var(--accent); }
.sc-modal-close svg { width: 18px; height: 18px; }
.sc-modal-body h3 { font-size: 24px; color: var(--white); margin: 0 0 8px;
  padding-right: 40px; letter-spacing: -0.01em; }
.sc-modal-body .lead { font-size: 15px; color: var(--accent); font-weight: 500; margin: 0 0 18px; }
.sc-modal-body p { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.sc-modal-body h4 { font-size: 13px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.14em; font-weight: 700; margin: 18px 0 8px; }
.sc-modal-body ul { margin: 0 0 12px; padding-left: 20px; }
.sc-modal-body li { color: var(--text); font-size: 14px; line-height: 1.55; margin-bottom: 6px; }

.login-foot { font-size: 12px; color: var(--muted); text-align: center;
  padding-top: 20px; border-top: 1px solid var(--border-2); width: 100%;
  letter-spacing: 0.12em; text-transform: uppercase; }

/* ===== Mobile and tablet ================================================= */
/* Injected hamburger button, hidden on desktop */
.mobile-menu-btn {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border-2); background: var(--panel-solid);
  border-radius: var(--radius-sm); color: var(--text);
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.mobile-menu-btn:hover { border-color: var(--accent); color: var(--accent); }
.mobile-menu-btn svg { width: 20px; height: 20px; }

/* Drawer backdrop */
.drawer-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 998;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.layout.drawer-open .drawer-backdrop { display: block; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 999;
    width: 300px; max-width: 86vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
  }
  .layout.drawer-open .sidebar { transform: translateX(0); }

  .mobile-menu-btn { display: inline-flex; }

  .topbar {
    padding: 14px 14px 10px;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .topbar > div:first-of-type { flex: 1; min-width: 0; }
  .topbar h1 { font-size: 19px; line-height: 1.25; }
  .topbar .subtitle {
    font-size: 12px; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .topbar-actions > * { flex: 0 1 auto; display: flex; }
  .topbar-actions > * > .btn, .topbar-actions > .btn {
    padding: 9px 14px; font-size: 13px; white-space: nowrap;
    justify-content: center;
  }
  .topbar-actions form { margin: 0; }

  .content { padding: 4px 14px 28px; }

  .app-foot { flex-wrap: wrap; row-gap: 4px; padding: 14px 16px 20px; font-size: 11px; }
  .app-foot .sep { display: none; }

  .tabs { padding: 0 14px; overflow-x: auto; white-space: nowrap; }

  /* Grids collapse */
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .integration-grid { grid-template-columns: repeat(2, 1fr); }

  /* Stepper stacks */
  .stepper { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--border-2); }
  .step:last-child { border-bottom: none; }

  /* Asset + subnav layouts stack */
  .asset-layout, .subnav-layout { grid-template-columns: 1fr; }
  .asset-tree { max-height: none; }

  /* Framework card stacks */
  .framework-card { flex-direction: column; align-items: stretch; gap: 12px; }
  .framework-card .meta { justify-content: space-between; }
  .framework-card .progress-row { justify-content: space-between; }
  .framework-card .progress-row .bar { flex: 1; width: auto; min-width: 0; }

  /* Tables: horizontal scroll inside the card */
  .table-card { overflow-x: auto; }
  .table-toolbar { flex-wrap: wrap; }
  .table-toolbar .search { max-width: none; width: 100%; }

  /* Donut row stacks */
  .donut-row { flex-direction: column; align-items: stretch; }
  .donut-row .donut { align-self: center; }

  /* Heatmap compacted */
  .heatmap { grid-template-columns: 70px repeat(5, 1fr); gap: 3px; }
  .heatmap .cell { font-size: 12px; }

  /* Audit modal full width */
  .audit-modal-card { margin: 20px 12px; max-width: none; }

  /* Spotlight modal adapts */
  .sc-modal { padding: 14px; }
  .sc-modal-card { padding: 24px 18px 20px; max-height: calc(100vh - 28px); }
  .sc-modal-body h3 { font-size: 20px; padding-right: 44px; }

  /* Login tweaks */
  .login-body { padding: 24px 16px 20px; }
  .login-hero { padding-top: 8px; }
  .login-logo { max-width: 360px; }
  .login-tagline { font-size: 17px; }
  .login-card { padding: 22px; }

  /* Sidebar search is less relevant on mobile */
  .sidebar-search .kbd { display: none; }
}

@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2, .integration-grid { grid-template-columns: 1fr; }

  .topbar { padding: 14px 12px 10px; }
  .topbar h1 { font-size: 18px; }
  .content { padding: 4px 12px 24px; }

  .card { padding: 14px; }
  .card-value { font-size: 26px; }

  /* Stat block shrinks */
  .stat-block { padding: 16px; }
  .stat-block .stat-value { font-size: 28px; }

  /* Table cells tighter */
  table.data th, table.data td { padding: 10px 10px; font-size: 13px; }
  table.data th { font-size: 11px; }

  /* Banner wraps */
  .banner { flex-wrap: wrap; }

  /* Phase card padding */
  .phase-card { padding: 16px; }
  .task-group-desc, .task-row { padding-left: 0; }
  .task-row { flex-wrap: wrap; }

  /* Buttons full width where they group */
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1; justify-content: center; }

  /* Heatmap tighter */
  .heatmap { grid-template-columns: 52px repeat(5, 1fr); }
  .heatmap .cell { font-size: 11px; }

  /* Login card + footer */
  .login-card { padding: 18px; max-width: 100%; }
  .login-shell { max-width: 100%; }
  .login-logo { max-width: 240px; }
  .login-tagline { font-size: 14px; line-height: 1.3; }
  .login-sub { font-size: 12px; line-height: 1.4; }
  .login-body { padding: 20px 12px 18px; }
  body { overflow-x: hidden; }
}

/* Touch target minimum on tap-capable devices */
@media (hover: none) and (pointer: coarse) {
  .nav-item, .nav-group-toggle, .btn, .btn-link, .mobile-menu-btn, .chip {
    min-height: 44px;
  }
}
