/* ============================================================================
   C3 SECURITY COMMAND CENTER
   LeadtheAI Design System — Ink + Signal Amber
   Framework-agnostic. Light & Dark via .dark class on <html>.
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   THREAT INTELLIGENCE V2
   ============================================ */
.threat-intel-page {
    --ti-cyan: #087ea4;
    --ti-green: #16865b;
    --ti-amber: #a86008;
    --ti-red: #c43d55;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-bottom: var(--space-8);
	animation: none;
}

.dark .threat-intel-page {
    --ti-cyan: #38bdf8;
    --ti-green: #4ade80;
    --ti-amber: #fbbf24;
    --ti-red: #fb7185;
}

.threat-intel-commandbar,
.threat-intel-viewbar,
.threat-intel-panel__header,
.threat-intel-commandbar__context,
.threat-intel-commandbar__actions,
.threat-intel-report__meta,
.threat-intel-report__footer,
.threat-intel-detail__actions,
.threat-intel-report-detail-meta {
    display: flex;
    align-items: center;
}

.threat-intel-commandbar {
    min-height: 52px;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.threat-intel-commandbar__context { gap: var(--space-4); min-width: 0; }
.threat-intel-commandbar__actions { gap: var(--space-3); flex-shrink: 0; }
.threat-intel-eyebrow {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
}
.threat-intel-freshness { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); font-size: var(--text-sm); }
.threat-intel-freshness__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-muted) 14%, transparent); }
.threat-intel-freshness.healthy .threat-intel-freshness__dot { background: var(--ti-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ti-green) 14%, transparent); }
.threat-intel-freshness.degraded .threat-intel-freshness__dot { background: var(--ti-amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ti-amber) 14%, transparent); }
.threat-intel-freshness.checking .threat-intel-freshness__dot { background: var(--ti-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ti-blue) 14%, transparent); }
.threat-intel-refreshed { color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-refresh { width: 36px; height: 36px; border: 1px solid var(--border-default); background: var(--bg-elevated); }

.threat-intel-degraded {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid color-mix(in srgb, var(--ti-amber) 38%, var(--border-default));
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--ti-amber) 7%, var(--bg-surface));
    color: var(--text-secondary);
}
.threat-intel-degraded > i { color: var(--ti-amber); font-size: 21px; }
.threat-intel-degraded > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.threat-intel-degraded strong { color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-degraded span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); }

.threat-intel-source-strip { display: flex; align-items: center; gap: var(--space-3); min-height: 46px; padding: var(--space-2) var(--space-3); overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.threat-intel-source-strip__label { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding-right: var(--space-3); border-right: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.threat-intel-source-strip__label i { color: var(--ti-cyan); font-size: 16px; }
.threat-intel-source-strip__items { display: flex; align-items: center; gap: var(--space-2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.threat-intel-source-strip__items::-webkit-scrollbar { display: none; }
.threat-intel-source-chip { display: inline-grid; grid-template-columns: 7px auto auto; align-items: center; gap: 6px; flex-shrink: 0; min-height: 28px; padding: 3px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-elevated); }
.threat-intel-source-chip > i { width: 7px; height: 7px; border-radius: 50%; background: var(--ti-green); }
.threat-intel-source-chip > strong { color: var(--text-primary); font-size: var(--text-xs); font-weight: 600; }
.threat-intel-source-chip > span { color: var(--text-muted); font-size: 9px; text-transform: uppercase; }
.threat-intel-source-chip > time { grid-column: 2 / -1; display: none; color: var(--text-muted); font-size: 9px; }
.threat-intel-source-chip.is-stale > i, .threat-intel-source-chip.is-degraded > i { background: var(--ti-amber); }
.threat-intel-source-chip.is-failed > i { background: var(--ti-red); }
.threat-intel-source-chip.is-disabled { opacity: .62; }
.threat-intel-source-chip.is-disabled > i { background: var(--text-muted); }
.threat-intel-source-chip.is-syncing > i { background: var(--ti-cyan); animation: ti-pulse 1.4s ease-in-out infinite; }
.threat-intel-source-strip__loading { display: flex; gap: var(--space-2); }
.threat-intel-source-strip__loading span { width: 116px; height: 28px; border-radius: var(--radius-md); background: var(--bg-elevated); animation: ti-pulse 1.5s ease-in-out infinite; }
.threat-intel-source-strip__empty { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex: 1; color: var(--text-muted); font-size: var(--text-xs); }

.threat-intel-view { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.threat-intel-viewbar { justify-content: space-between; gap: var(--space-4); min-height: 48px; }
.threat-intel-viewbar__actions { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.threat-intel-viewbar h2 { margin: 0 0 3px; color: var(--text-primary); font-size: var(--text-xl); font-weight: 650; }
.threat-intel-viewbar p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.threat-intel-result-count { flex-shrink: 0; color: var(--text-secondary); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.threat-intel-scope { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; border: 1px solid color-mix(in srgb, var(--ti-cyan) 26%, var(--border-default)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--ti-cyan) 7%, var(--bg-surface)); color: var(--text-secondary); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.threat-intel-scope i { color: var(--ti-cyan); font-size: 14px; }

.threat-intel-range,
.threat-intel-mode {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
}
.threat-intel-range button,
.threat-intel-mode button {
    min-height: 30px;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
}
.threat-intel-range button:hover,
.threat-intel-mode button:hover { color: var(--text-primary); }
.threat-intel-range button.active,
.threat-intel-mode button.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.threat-intel-mode button:disabled { color: var(--text-muted); cursor: not-allowed; opacity: .55; }

.threat-intel-catalog-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
.threat-intel-catalog-metric { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: var(--space-3); min-height: 82px; padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.threat-intel-catalog-metric__icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid color-mix(in srgb, var(--ti-cyan) 24%, var(--border-default)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--ti-cyan) 7%, var(--bg-elevated)); color: var(--ti-cyan); font-size: 18px; }
.threat-intel-catalog-metric > span:last-child { display: grid; gap: 3px; min-width: 0; }
.threat-intel-catalog-metric small { overflow: hidden; color: var(--text-muted); font-size: 10px; font-weight: 700; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.threat-intel-catalog-metric strong { color: var(--text-primary); font-size: var(--text-xl); font-weight: 550; line-height: 1; font-variant-numeric: tabular-nums; }
.threat-intel-partial-note { display: flex; align-items: center; gap: 6px; margin: calc(var(--space-3) * -1) 0 0; color: var(--text-muted); font-size: 10px; }
.threat-intel-partial-note i { color: var(--ti-amber); font-size: 13px; }

.threat-intel-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.threat-intel-kpi {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: var(--space-3);
    min-height: 132px;
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}
.threat-intel-kpi--priority { border-color: color-mix(in srgb, var(--ti-cyan) 45%, var(--border-subtle)); }
.threat-intel-kpi__icon,
.threat-intel-type-icon,
.threat-intel-report__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--ti-cyan);
}
.threat-intel-kpi__icon { width: 42px; height: 42px; border-radius: var(--radius-md); font-size: 20px; }
.threat-intel-kpi__body { display: flex; flex-direction: column; min-width: 0; }
.threat-intel-kpi__body > span { color: var(--text-secondary); font-size: var(--text-xs); font-weight: 600; }
.threat-intel-kpi__body > strong { margin: 4px 0; color: var(--text-primary); font-size: 2.125rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.threat-intel-kpi__body > strong em { color: var(--text-muted); font-size: var(--text-base); font-style: normal; }
.threat-intel-kpi__body > small { color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.threat-intel-delta { position: absolute; top: var(--space-3); right: var(--space-3); display: inline-flex; align-items: center; gap: 3px; color: var(--ti-green); font-size: var(--text-xs); }
.threat-intel-delta.down { color: var(--ti-red); }

.threat-intel-overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--space-4); }
.threat-intel-overview-grid--lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.threat-intel-panel { min-width: 0; padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.threat-intel-panel__header { justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.threat-intel-panel__header h3 { margin: 0 0 3px; color: var(--text-primary); font-size: var(--text-base); }
.threat-intel-panel__header p { margin: 0; color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-panel__signal { flex-shrink: 0; color: var(--ti-cyan); font-size: 21px; }
.threat-intel-panel__signal--red { color: var(--ti-red); }
.threat-intel-panel__signal--amber { color: var(--ti-amber); }

.threat-intel-activity { display: flex; align-items: stretch; gap: clamp(4px, 1vw, 12px); height: 210px; padding-top: 22px; overflow: hidden; }
.threat-intel-activity__point { position: relative; display: flex; flex: 1 1 0; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 8px; }
.threat-intel-activity__bar { width: min(32px, 72%); min-height: 3px; border-radius: 3px 3px 0 0; background: var(--ti-cyan); opacity: .78; transition: opacity var(--duration-fast); }
.threat-intel-activity__point:hover .threat-intel-activity__bar { opacity: 1; }
.threat-intel-activity__value { position: absolute; top: -18px; color: var(--text-secondary); font-size: 10px; opacity: 0; }
.threat-intel-activity__point:hover .threat-intel-activity__value { opacity: 1; }
.threat-intel-activity time { width: 100%; overflow: hidden; color: var(--text-muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.threat-intel-bars { display: grid; gap: var(--space-3); }
.threat-intel-bar-row { display: grid; gap: 6px; }
.threat-intel-bar-row > div { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--text-secondary); font-size: var(--text-xs); }
.threat-intel-bar-row strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.threat-intel-bar-track { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--bg-elevated); }
.threat-intel-bar-track > span { display: block; height: 100%; border-radius: inherit; background: var(--ti-cyan); }
.threat-intel-bar-track--red > span { background: var(--ti-red); }
.threat-intel-bar-track--amber > span { background: var(--ti-amber); }

.threat-intel-ranked-list,
.threat-intel-vulnerability-list { margin: 0; list-style: none; }
.threat-intel-ranked-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 64px; border-top: 1px solid var(--border-subtle); }
.threat-intel-ranked-list li:first-child { border-top: 0; }
.threat-intel-rank { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; font-variant-numeric: tabular-nums; }
.threat-intel-ranked-list__body { display: grid; gap: 4px; min-width: 0; }
.threat-intel-ranked-list__body strong { overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-ranked-list__body small { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-ranked-list__value { min-width: 32px; color: var(--text-secondary); font-size: var(--text-sm); font-variant-numeric: tabular-nums; text-align: right; }

.threat-intel-country-list,
.threat-intel-sector-list { display: grid; }
.threat-intel-country-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 56px; border-top: 1px solid var(--border-subtle); }
.threat-intel-country-row:first-child,
.threat-intel-sector-row:first-child { border-top: 0; }
.threat-intel-country-code { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 28px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-secondary); font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.threat-intel-country-code i { color: var(--ti-cyan); font-size: 15px; }
.threat-intel-country-row > span:nth-child(2) { display: grid; gap: 7px; min-width: 0; }
.threat-intel-country-row strong,
.threat-intel-sector-row strong { overflow: hidden; color: var(--text-primary); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-country-row > strong,
.threat-intel-sector-row > strong { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.threat-intel-sector-row { display: grid; grid-template-columns: minmax(130px, .75fr) minmax(100px, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 56px; border-top: 1px solid var(--border-subtle); }
.threat-intel-sector-row__label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.threat-intel-sector-row__label i { flex-shrink: 0; color: var(--ti-amber); }

.threat-intel-relationship-chart { display: flex; align-items: stretch; gap: clamp(4px, 1vw, 10px); height: 190px; padding-top: 24px; overflow: hidden; }
.threat-intel-relationship-chart__point { position: relative; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 7px; }
.threat-intel-relationship-chart__point > span { width: min(26px, 72%); min-height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--ti-cyan), color-mix(in srgb, var(--ti-cyan) 52%, var(--ti-green))); opacity: .84; }
.threat-intel-relationship-chart__point > strong { position: absolute; top: -19px; color: var(--text-secondary); font-size: 10px; opacity: 0; }
.threat-intel-relationship-chart__point:hover > strong { opacity: 1; }
.threat-intel-relationship-chart__point time { width: 100%; overflow: hidden; color: var(--text-muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.threat-intel-vulnerability-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 52px; border-top: 1px solid var(--border-subtle); }
.threat-intel-vulnerability-list li:first-child { border-top: 0; }
.threat-intel-vulnerability-list__icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid color-mix(in srgb, var(--ti-red) 28%, var(--border-default)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--ti-red) 7%, var(--bg-surface)); color: var(--ti-red); }
.threat-intel-vulnerability-list strong { overflow: hidden; color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-vulnerability-list > li > span:last-child { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.threat-intel-operational-list { display: grid; }
.threat-intel-operational-list button { display: grid; grid-template-columns: 34px minmax(180px, 1fr) minmax(120px, auto) minmax(90px, auto) 16px; align-items: center; gap: var(--space-3); width: 100%; min-height: 62px; padding: var(--space-2) 0; border: 0; border-top: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); text-align: left; cursor: pointer; }
.threat-intel-operational-list button:first-child { border-top: 0; }
.threat-intel-operational-list button:hover:not(:disabled) { background: var(--bg-hover); }
.threat-intel-operational-list button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.threat-intel-operational-list button:disabled { cursor: default; opacity: .72; }
.threat-intel-operational-list__body { display: grid; gap: 4px; min-width: 0; }
.threat-intel-operational-list__body strong,
.threat-intel-operational-list__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-operational-list__body strong { color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-operational-list__body small,
.threat-intel-operational-list time { color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-operational-list > button > .ph-caret-right { color: var(--text-muted); }
.threat-intel-tenant-badge { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 190px; min-height: 24px; padding: 0 7px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ti-cyan) 23%, var(--border-default)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--ti-cyan) 6%, var(--bg-elevated)); color: var(--text-secondary); font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-tenant-badge i { flex-shrink: 0; color: var(--ti-cyan); }

.threat-intel-tenant-table { overflow-x: auto; }
.threat-intel-tenant-table__header,
.threat-intel-tenant-table__row { display: grid; grid-template-columns: minmax(190px, 1.3fr) repeat(3, minmax(80px, .55fr)) minmax(125px, .8fr); align-items: center; gap: var(--space-3); min-width: 690px; }
.threat-intel-tenant-table__header { min-height: 34px; color: var(--text-muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.threat-intel-tenant-table__row { min-height: 52px; border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: var(--text-xs); }
.threat-intel-tenant-table__row > strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.threat-intel-tenant-table__row time { color: var(--text-muted); }
.threat-intel-tenant-name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.threat-intel-tenant-name i { flex-shrink: 0; color: var(--ti-cyan); }
.threat-intel-tenant-name strong { overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }

.threat-intel-compact-list { display: grid; }
.threat-intel-compact-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 16px; align-items: center; gap: var(--space-3); width: 100%; min-height: 60px; padding: var(--space-2) 0; border: 0; border-top: 1px solid var(--border-subtle); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.threat-intel-compact-row:first-child { border-top: 0; }
.threat-intel-compact-row:hover strong { color: var(--ti-cyan); }
.threat-intel-type-icon { width: 34px; height: 34px; border-radius: var(--radius-md); }
.threat-intel-compact-row__main { display: grid; gap: 3px; min-width: 0; }
.threat-intel-compact-row__main strong,
.threat-intel-compact-row__main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-compact-row__main strong { color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-compact-row__main small { color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-match-count { display: grid; color: var(--text-muted); text-align: right; }
.threat-intel-match-count strong { color: var(--ti-cyan); font-size: var(--text-base); }
.threat-intel-match-count small { font-size: 10px; }
.threat-intel-tlp { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 10px; font-weight: 700; white-space: nowrap; }

.threat-intel-state { display: flex; align-items: center; justify-content: center; gap: var(--space-4); min-height: 180px; padding: var(--space-6); border: 1px dashed var(--border-default); border-radius: var(--radius-lg); color: var(--text-muted); text-align: left; }
.threat-intel-state > i { color: var(--ti-cyan); font-size: 30px; }
.threat-intel-state > div { display: grid; gap: 4px; }
.threat-intel-state strong { color: var(--text-primary); }
.threat-intel-state p { margin: 0; font-size: var(--text-sm); }
.threat-intel-state--error { border-style: solid; border-color: color-mix(in srgb, var(--ti-red) 40%, var(--border-default)); background: color-mix(in srgb, var(--ti-red) 5%, var(--bg-surface)); }
.threat-intel-state--error > i { color: var(--ti-red); }
.threat-intel-inline-empty { display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 120px; color: var(--text-muted); font-size: var(--text-sm); }
.threat-intel-inline-empty i { font-size: 20px; }
.threat-intel-skeleton { overflow: hidden; background: var(--bg-surface); }
.threat-intel-skeleton::after,
.threat-intel-table-skeleton span { content: ''; display: block; width: 100%; height: 100%; background: var(--bg-elevated); animation: ti-pulse 1.4s ease-in-out infinite; }
@keyframes ti-pulse { 0%, 100% { opacity: .38; } 50% { opacity: .8; } }

.threat-intel-filters { position: relative; z-index: 4; display: grid; grid-template-columns: minmax(250px, 1.6fr) repeat(5, minmax(120px, .8fr)) minmax(150px, 1fr) auto; gap: var(--space-2); align-items: center; padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.threat-intel-filters--reports { grid-template-columns: minmax(280px, 1.35fr) repeat(2, minmax(150px, 1fr)) repeat(2, minmax(130px, .9fr)) minmax(160px, 1fr) auto; }
.threat-intel-filters--matches { grid-template-columns: minmax(300px, 1fr) minmax(190px, .3fr) auto; }
.threat-intel-search { position: relative; min-width: 0; }
.threat-intel-search > i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.threat-intel-search input,
.threat-intel-filters select { width: 100%; height: 40px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-search input { padding: 0 12px 0 38px; }
.threat-intel-filters select { min-width: 0; padding: 0 32px 0 11px; }
.threat-intel-filters select[aria-label="Lifecycle status"] { min-width: 150px; }
.threat-intel-search input:focus,
.threat-intel-filters select:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: var(--primary); }
.threat-intel-calendar { width: auto; min-width: 160px; }
.calendar-filter.threat-intel-calendar { background: var(--bg-surface); color: var(--text-primary); }
.threat-intel-calendar .calendar-filter-trigger { min-height: 38px; }
.threat-intel-reset { min-height: 40px; white-space: nowrap; }

.threat-intel-table-wrap { overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.threat-intel-table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.threat-intel-table th { height: 44px; padding: 0 var(--space-3); border-bottom: 1px solid var(--border-default); background: var(--bg-elevated); color: var(--text-muted); font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
.threat-intel-table td { height: 68px; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: var(--text-sm); }
.threat-intel-table tbody tr { cursor: pointer; transition: background var(--duration-fast); }
.threat-intel-table tbody tr:hover { background: var(--bg-hover); }
.threat-intel-table tbody tr:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.threat-intel-indicator-cell { display: grid; grid-template-columns: 36px minmax(0, 1fr) 30px; align-items: center; gap: var(--space-2); min-width: 300px; }
.threat-intel-indicator-cell > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.threat-intel-indicator-cell strong { overflow: hidden; color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-indicator-cell small { color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; }
.threat-intel-indicator-cell .btn-icon { width: 28px; height: 28px; opacity: 0; }
.threat-intel-table tr:hover .threat-intel-indicator-cell .btn-icon,
.threat-intel-indicator-cell .btn-icon:focus { opacity: 1; }
.threat-intel-score { display: grid; gap: 2px; }
.threat-intel-score strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.threat-intel-score small { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.threat-intel-status { display: inline-flex; align-items: center; gap: 7px; min-height: 27px; padding: 0 9px; border: 1px solid var(--border-default); border-radius: 14px; color: var(--text-secondary); font-size: var(--text-xs); font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.threat-intel-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.threat-intel-status.active i, .threat-intel-status.healthy i { background: var(--ti-green); }
.threat-intel-status.expired i, .threat-intel-status.stale i { background: var(--ti-amber); }
.threat-intel-status.revoked i, .threat-intel-status.failed i { background: var(--ti-red); }
.threat-intel-sources { display: flex; flex-wrap: wrap; gap: 5px; max-width: 210px; }
.threat-intel-sources > span { padding: 3px 7px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-secondary); font-size: 10px; }
.threat-intel-sources small, .threat-intel-muted { color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-match-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 9px; border: 1px solid color-mix(in srgb, var(--ti-cyan) 35%, var(--border-default)); border-radius: 14px; background: color-mix(in srgb, var(--ti-cyan) 7%, var(--bg-surface)); color: var(--ti-cyan); font-size: var(--text-xs); cursor: pointer; white-space: nowrap; }
.threat-intel-row-caret { color: var(--text-muted); }
.threat-intel-table-skeleton td { padding: var(--space-3); }
.threat-intel-table-skeleton span { height: 32px; border-radius: var(--radius-sm); }
.threat-intel-table-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: 260px; padding: var(--space-6); color: var(--text-muted); text-align: center; }
.threat-intel-table-empty > i { margin-bottom: var(--space-2); color: var(--ti-cyan); font-size: 34px; }
.threat-intel-table-empty strong { color: var(--text-primary); }
.threat-intel-table-empty p { max-width: 480px; margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.threat-intel-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.threat-intel-pagination { margin-top: 0; }

.threat-intel-report-list { display: grid; gap: var(--space-2); }
.threat-intel-report { display: grid; grid-template-columns: 42px minmax(0, 1fr) 18px; align-items: center; gap: var(--space-4); min-height: 104px; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); cursor: pointer; transition: border-color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast); }
.threat-intel-report:hover { border-color: color-mix(in srgb, var(--ti-cyan) 32%, var(--border-default)); background: color-mix(in srgb, var(--ti-cyan) 3%, var(--bg-hover)); transform: translateY(-1px); }
.threat-intel-report:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.threat-intel-report__icon { width: 42px; height: 42px; border-radius: var(--radius-md); font-size: 20px; }
.threat-intel-report__body { display: grid; gap: 7px; min-width: 0; }
.threat-intel-report__meta { gap: var(--space-2); color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.threat-intel-report__meta > span:not(.threat-intel-tlp) + span:not(.threat-intel-tlp)::before { content: '·'; margin-right: var(--space-2); }
.threat-intel-report h3 { margin: 0; overflow: hidden; color: var(--text-primary); font-size: var(--text-base); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-report p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.threat-intel-report__footer { flex-wrap: wrap; gap: var(--space-4); color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-report__footer > * { display: inline-flex; align-items: center; gap: 5px; }

.threat-intel-detail-layer { position: fixed; inset: 0; z-index: 1200; display: flex; justify-content: flex-end; width: 100vw; height: 100vh; height: 100dvh; }
.threat-intel-detail-backdrop { position: absolute; inset: 0; border: 0; background: rgb(2 6 12 / .68); cursor: default; }
.threat-intel-detail { position: relative; display: flex; flex-direction: column; width: min(720px, 94vw); height: 100%; border-left: 1px solid var(--border-default); background: var(--bg-base); box-shadow: var(--shadow-xl); }
.threat-intel-detail__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-shrink: 0; min-height: 82px; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.threat-intel-detail__header > div { display: grid; gap: 5px; min-width: 0; }
.threat-intel-detail__header span { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.threat-intel-detail__header h2 { margin: 0; overflow-wrap: anywhere; color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-lg); }
.threat-intel-detail__body { display: flex; flex: 1; flex-direction: column; gap: var(--space-4); overflow-y: auto; padding: var(--space-5); }
.threat-intel-detail__loading { display: flex; flex: 1; align-items: center; justify-content: center; gap: var(--space-3); color: var(--text-muted); }
.threat-intel-detail__actions { flex-wrap: wrap; gap: var(--space-2); }
.threat-intel-detail-section { padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.threat-intel-detail-section > h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 var(--space-4); color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-detail-section > h3 > span { color: var(--text-muted); font-size: var(--text-xs); font-weight: 500; }
.threat-intel-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: 0; }
.threat-intel-detail-grid > div { min-width: 0; }
.threat-intel-detail-grid dt { margin-bottom: 5px; color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.threat-intel-detail-grid dd { margin: 0; overflow-wrap: anywhere; color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-pattern { display: grid; gap: 7px; margin-top: var(--space-4); }
.threat-intel-pattern > span { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.threat-intel-pattern code { overflow-x: auto; padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-base); color: var(--ti-cyan); font-size: var(--text-xs); white-space: pre-wrap; overflow-wrap: anywhere; }
.threat-intel-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-4); }
.threat-intel-tags > span { padding: 4px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-secondary); font-size: var(--text-xs); }
.threat-intel-evidence-list,
.threat-intel-match-list,
.threat-intel-reference-list { display: grid; gap: var(--space-2); }
.threat-intel-evidence-list article { display: grid; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-elevated); }
.threat-intel-evidence-list article > div { display: flex; justify-content: space-between; gap: var(--space-3); }
.threat-intel-evidence-list article > div span { color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-evidence-list dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: 0; }
.threat-intel-evidence-list dt { color: var(--text-muted); font-size: 9px; text-transform: uppercase; }
.threat-intel-evidence-list dd { margin: 3px 0 0; color: var(--text-secondary); font-size: var(--text-xs); }
.threat-intel-evidence-list a { justify-self: start; color: var(--ti-cyan); font-size: var(--text-xs); }
.threat-intel-match-list button,
.threat-intel-reference-list a { display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; align-items: center; gap: var(--space-2); min-height: 50px; padding: var(--space-2); border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); text-align: left; text-decoration: none; cursor: pointer; }
.threat-intel-match-list button:hover,
.threat-intel-reference-list a:hover { border-color: var(--border-subtle); background: var(--bg-hover); }
.threat-intel-match-list button span,
.threat-intel-reference-list a span { display: grid; gap: 3px; min-width: 0; }
.threat-intel-match-list strong,
.threat-intel-reference-list strong { color: var(--text-primary); font-size: var(--text-sm); }
.threat-intel-match-list small,
.threat-intel-reference-list small { overflow: hidden; color: var(--text-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-match-list .threat-intel-tenant-badge { display: inline-flex; margin-right: 6px; vertical-align: middle; }
.threat-intel-report-detail-meta { flex-wrap: wrap; gap: var(--space-2); color: var(--text-muted); font-size: var(--text-xs); }
.threat-intel-report-content { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.65; white-space: pre-wrap; }
.threat-intel-alert-title { display: block; max-width: 320px; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.threat-intel-cell-meta { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.threat-intel-match-table { min-width: 1040px; }

@media (max-width: 1180px) {
	.threat-intel-catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .threat-intel-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .threat-intel-filters { grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(130px, 1fr)); }
    .threat-intel-calendar { min-width: 0; }
    .threat-intel-filters--reports { grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 820px) {
    .threat-intel-commandbar { align-items: flex-start; }
    .threat-intel-commandbar__context { align-items: flex-start; flex-direction: column; gap: 5px; }
    .threat-intel-refreshed { display: none; }
	.threat-intel-viewbar { align-items: flex-start; }
	.threat-intel-viewbar__actions { align-items: flex-end; flex-direction: column; }
	.threat-intel-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .threat-intel-overview-grid,
    .threat-intel-overview-grid--lists { grid-template-columns: 1fr; }
    .threat-intel-filters,
    .threat-intel-filters--reports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .threat-intel-filters select[aria-label="Lifecycle status"] { min-width: 0; }
    .threat-intel-search { grid-column: 1 / -1; }
    .threat-intel-detail { width: 100%; border-left: 0; }
    .threat-intel-detail-backdrop { display: none; }
	.threat-intel-operational-list button { grid-template-columns: 34px minmax(0, 1fr) 16px; }
	.threat-intel-operational-list .threat-intel-tenant-badge,
	.threat-intel-operational-list time { grid-column: 2; }
	.threat-intel-operational-list > button > .ph-caret-right { grid-column: 3; grid-row: 1 / span 3; }
}

@media (max-width: 560px) {
	.header-actions > .header-btn { display: none; }
	.page-subnav--threats .sub-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.page-subnav--threats .sub-tab { justify-content: center; min-width: 0; padding-right: var(--space-2); padding-left: var(--space-2); }
    .threat-intel-page { gap: var(--space-3); }
    .threat-intel-commandbar { min-height: 48px; padding: var(--space-2) var(--space-3); }
    .threat-intel-eyebrow { display: none; }
    .threat-intel-degraded { align-items: flex-start; }
	.threat-intel-degraded .threat-intel-source-action { display: none; }
	.threat-intel-source-strip { align-items: flex-start; flex-direction: column; gap: var(--space-2); }
	.threat-intel-source-strip__label { width: 100%; padding: 0 0 var(--space-2); border-right: 0; border-bottom: 1px solid var(--border-subtle); }
	.threat-intel-source-strip__items { flex-wrap: wrap; width: 100%; overflow: visible; }
	.threat-intel-kpi-grid { grid-template-columns: 1fr; }
	.threat-intel-catalog-grid { gap: var(--space-2); }
	.threat-intel-catalog-metric { grid-template-columns: 32px minmax(0, 1fr); min-height: 68px; padding: var(--space-2); }
	.threat-intel-catalog-metric__icon { width: 32px; height: 32px; font-size: 16px; }
	.threat-intel-catalog-metric strong { font-size: var(--text-lg); }
    .threat-intel-kpi { min-height: 108px; }
    .threat-intel-viewbar { flex-direction: column; }
	.threat-intel-viewbar__actions { align-items: stretch; width: 100%; }
	.threat-intel-viewbar__actions > .threat-intel-scope { align-self: flex-start; }
    .threat-intel-range { width: 100%; }
    .threat-intel-range button { flex: 1; }
    .threat-intel-panel { padding: var(--space-3); }
    .threat-intel-panel__header { align-items: flex-start; }
    .threat-intel-panel__header p { display: none; }
    .threat-intel-activity { height: 170px; }
	.threat-intel-activity time { display: none; }
	.threat-intel-relationship-chart__point time { display: none; }
	.threat-intel-country-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
	.threat-intel-sector-row { grid-template-columns: minmax(100px, .9fr) minmax(70px, 1fr) auto; gap: var(--space-2); }
    .threat-intel-filters,
	.threat-intel-filters--reports,
	.threat-intel-filters--matches { grid-template-columns: 1fr; padding: var(--space-2); }
    .threat-intel-filters select { min-width: 0; font-size: var(--text-xs); }
    .threat-intel-calendar,
    .threat-intel-reset { width: 100%; }
    .threat-intel-reset { justify-content: center; }
    .threat-intel-report { grid-template-columns: 36px minmax(0, 1fr) 14px; min-height: 112px; padding: var(--space-3); gap: var(--space-3); }
    .threat-intel-report__icon { width: 36px; height: 36px; }
    .threat-intel-report__footer { gap: var(--space-2); }
    .threat-intel-report__footer span:last-child { display: none; }
    .threat-intel-detail__header { min-height: 70px; padding: var(--space-3) var(--space-4); }
    .threat-intel-detail__body { padding: var(--space-3); }
    .threat-intel-detail-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
    .threat-intel-evidence-list dl { grid-template-columns: 1fr 1fr; }
	.threat-intel-kpi__body > strong { font-size: 1.875rem; }
}

@media (prefers-reduced-motion: reduce) {
    .threat-intel-skeleton::after,
    .threat-intel-table-skeleton span { animation: none; }
}

/* Prevent horizontal overflow and improve mobile viewport */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

/* ============================================
   DESIGN TOKENS — LeadtheAI
   ============================================ */
:root {
    /* ── LeadtheAI Ink scale ── */
    --ink-1000: #0B0F14;
    --ink-900:  #11161D;
    --ink-800:  #1A2230;
    --ink-750:  #222C3A; /* midpoint between ink-800 and ink-700 */
    --ink-700:  #2A3445;
    --ink-600:  #3E4A5E;
    --ink-500:  #5C6878;
    --ink-400:  #8A95A4;
    --ink-300:  #B7BFCB;
    --ink-200:  #D7DCE3;
    --ink-100:  #ECEFF3;
    --ink-50:   #F6F7F9;
    --ink-0:    #FDFDFC;

    /* ── Signal Amber ── */
    --signal-900: #7E4A12;
    --signal-700: #B97324;
    --signal-500: #E8A23A;
    --signal-300: #F1C57A;
    --signal-100: #FBEBC9;

    /* ── Functional ── */
    --ok:    #3FB37F;
    --warn:  #E8B23A;
    --error: #D3573D;
    --info:  #5B9BD8;

    /* ── Level system L0→L4 ── */
    --level-0: #C4CBD5;
    --level-1: #E5C784;
    --level-2: #D9A958;
    --level-3: #C18434;
    --level-4: var(--ink-1000);
    --on-level-4: var(--signal-500);

    /* ── Radius scale (LeadtheAI) ── */
    --radius-none: 0px;
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   14px;
    --radius-xl:   22px;
    --radius-pill: 999px;

    /* legacy radius aliases for component compatibility */
    --radius: 0.625rem;
    --radius-xs: 4px;
    --radius-2xl: 18px;
    --radius-3xl: 22px;
    --radius-4xl: 26px;
    --radius-full: 999px;

    /* ── Spacing scale (4px base) ── */
    --space-0:  0px;
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  24px;
    --space-6:  32px;
    --space-7:  48px;
    --space-8:  64px;
    --space-9:  96px;

    /* ── Shadows (flat-with-hairlines; shadows for overlays only) ── */
    --shadow-sm: 0 1px 2px rgba(11,15,20,.06), 0 1px 1px rgba(11,15,20,.04);
    --shadow-md: 0 6px 16px rgba(11,15,20,.08), 0 2px 4px rgba(11,15,20,.05);
    --shadow-lg: 0 24px 48px rgba(11,15,20,.12), 0 6px 12px rgba(11,15,20,.06);
    --shadow-xl: 0 24px 48px rgba(11,15,20,.12), 0 6px 12px rgba(11,15,20,.06);
    --shadow-glow: none;
    --shadow-glow-accent: none;

    /* Legacy shadow aliases */
    --shadow-01: var(--shadow-sm);
    --shadow-02: var(--shadow-sm);
    --shadow-03: var(--shadow-md);
    --shadow-04: var(--shadow-lg);
    --shadow-05: var(--shadow-xl);

    /* ── Font families (LeadtheAI) ── */
    --font-display: 'Manrope', 'General Sans', 'Inter Tight', system-ui, sans-serif;
    --font-sans: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
    --font-arabic: 'Cairo', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

    /* ── Typography sizes ── */
    --text-xs:   0.6875rem; /* 11px — label-caps */
    --text-sm:   0.8125rem; /* 13px — body-sm */
    --text-base: 1rem;      /* 16px — body-md */
    --text-lg:   1.1875rem; /* 19px — body-lg */
    --text-xl:   1.25rem;   /* 20px — h4 */
    --text-2xl:  1.75rem;   /* 28px — h3 */
    --text-3xl:  2.5rem;    /* 40px — h2 */
    --text-4xl:  3.5rem;    /* 56px — h1 */

    /* ── Line heights ── */
    --leading-tight:   1.05;
    --leading-normal:  1.55;
    --leading-relaxed: 1.7;

    /* ── Letter spacing ── */
    --tracking-tighter: -0.035em;
    --tracking-tight:   -0.02em;
    --tracking-normal:  0em;
    --tracking-wide:    0.05em;
    --tracking-wider:   0.14em;

    /* ── Font weights ── */
    --font-normal:   400;
    --font-medium:   500;
    --font-semibold: 500;
    --font-bold:     700;
    --font-black:    900;

    /* ── Light mode semantic tokens (cool grey paper — clear canvas vs surface) ── */
    --background: #EBEEF2;
    --foreground: var(--ink-1000);

    --card: #FFFFFF;
    --card-foreground: var(--ink-1000);

    --popover: #FFFFFF;
    --popover-foreground: var(--ink-1000);

    --primary: var(--ink-1000);
    --primary-foreground: var(--ink-0);

    --secondary: #E8EBF0;
    --secondary-foreground: var(--ink-700);

    --muted: #E8EBF0;
    --muted-foreground: var(--ink-500);

    --accent: #F2F4F7;
    --accent-foreground: var(--ink-700);

    --destructive: var(--error);

    --success: var(--ok);
    --success-foreground: var(--ink-0);

    --warning: var(--warn);
    --warning-foreground: var(--ink-1000);

    --info-color: var(--info);
    --info-foreground: var(--ink-0);

    --border: #C5CCD6;
    --input: #C5CCD6;
    --ring: var(--ink-700);

    /* Toggle switch (light) */
    --toggle-track-off: var(--ink-400);
    --toggle-track-on: var(--primary);
    --toggle-thumb: var(--ink-0);
    --toggle-border: var(--ink-500);

    /* ── Chart palette ── */
    --chart-1: var(--info);
    --chart-2: var(--ok);
    --chart-3: var(--signal-500);
    --chart-4: #9B6ED8;
    --chart-5: var(--error);

    /* ── Sidebar (light) ── */
    --sidebar: #EDF0F4;
    --sidebar-foreground: var(--ink-700);
    --sidebar-primary: var(--ink-1000);
    --sidebar-primary-foreground: var(--ink-0);
    --sidebar-accent: #DDE1E8;
    --sidebar-accent-foreground: var(--ink-1000);
    --sidebar-border: #C5CCD6;
    --sidebar-ring: var(--ink-500);

    /* ── Agent accent colors ── */
    --agent-budget: #3D9C8A;
    --agent-project: var(--signal-500);
    --agent-knowledge: #9B6ED8;
    --agent-budget-bg: #F0FAF7;
    --agent-project-bg: var(--signal-100);
    --agent-knowledge-bg: #F5F0FC;
    --agent-budget-glow: 0 0 20px rgba(61,156,138,.2);
    --agent-project-glow: 0 0 20px rgba(232,162,58,.2);
    --agent-knowledge-glow: 0 0 20px rgba(155,110,216,.2);

    /* ── Glassmorphism ── */
    --glass-bg: rgba(253,253,252,.85);
    --glass-border: rgba(11,15,20,.06);
    --glass-blur: 12px;

    /* ── AI gradient (amber-based) ── */
    --ai-gradient-from: var(--signal-700);
    --ai-gradient-to: var(--signal-500);

    /* ── Z-index scale ── */
    --z-base: 1;
    --z-below: -1;
    --z-nav: 100;
    --z-dropdown: 50;
    --z-sticky: 100;
    --z-overlay: 200;
    --z-modal: 300;
    --z-popover: 400;
    --z-toast: 500;
    --z-tooltip: 600;

    /* ── Transitions ── */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-level:   cubic-bezier(.2,.7,.2,1);
    --duration-instant: 0.08s;
    --duration-fast:    0.15s;
    --duration-normal:  0.25s;
    --duration-slow:    0.3s;
    --duration-slower:  0.4s;

    /* ── Card and Grid System ── */
    --card-min-width: 260px;
    --card-mini-min-width: 180px;
    --card-fixed-width: 520px;
    --card-fixed-height: 322px;
    --list-card-width: 550px;
    --list-card-height: auto;
    --list-card-min-height: 300px;
    --card-grid-gap: var(--space-4);
    --card-padding: var(--space-5);
    --section-padding: var(--space-6);

    /* ── Layout ── */
    --sidebar-width: 64px;
    --header-height: 64px;
    --content-max-width: min(100%, 1600px);
    --content-padding: var(--space-6);

    /* ── Semantic aliases for component compatibility ── */
    --bg-base: var(--background);
    --bg-surface: var(--card);
    --bg-elevated: var(--accent);
    --bg-overlay: var(--popover);
    --bg-hover: rgba(11,15,20,.07);
    --bg-active: rgba(11,15,20,.05);
    --bg-hover-strong: rgba(11,15,20,.10);
    --bg-selected: rgba(11,15,20,.12);
    --bg-primary: var(--background);
    --bg-secondary: var(--card);
    --bg-tertiary: var(--accent);
    --surface-2: var(--accent);

    --text-primary: var(--foreground);
    --text-secondary: var(--ink-700);
    --text-tertiary: var(--ink-500);
    --text-quaternary: var(--ink-400);
    --text-muted: var(--ink-500);

    --accent-hover: var(--ink-100);
    --accent-muted: var(--ink-700);
    --accent-subtle: rgba(11,15,20,.06);
    --accent-surface: rgba(11,15,20,.04);
    --accent-glow: rgba(11,15,20,.08);
    --accent-secondary: var(--ink-500);
    --accent-secondary-subtle: rgba(92,104,120,.12);

    --border-subtle: #C5CCD6;
    --border-default: #AEB7C4;
    --border-strong: #949EAE;
    --border-focus: var(--ink-700);
    --border-glow: rgba(11,15,20,.12);

    --status-danger: var(--error);
    --status-danger-subtle: rgba(211,87,61,.10);
    --status-warning: var(--warn);
    --status-warning-subtle: rgba(232,178,58,.10);
    --status-success: var(--ok);
    --status-success-subtle: rgba(63,179,127,.10);
    --status-info: var(--info);
    --status-info-subtle: rgba(91,155,216,.10);

    --severity-critical: var(--error);
    --severity-critical-bg: rgba(211,87,61,.08);
    --severity-high: #C97C35;
    --severity-high-bg: rgba(201,124,53,.08);
    --severity-medium: var(--signal-500);
    --severity-medium-bg: rgba(232,162,58,.08);
    --severity-low: var(--ok);
    --severity-low-bg: rgba(63,179,127,.08);

    --color-success: var(--ok);
    --color-danger: var(--error);
    --color-warning: var(--warn);
    --color-info: var(--info);

    --bg-gradient-radial: radial-gradient(ellipse at top, rgba(11,15,20,.04) 0%, transparent 55%);
    --bg-gradient-mesh:
        radial-gradient(at 25% 25%, rgba(11,15,20,.02) 0%, transparent 50%),
        radial-gradient(at 75% 75%, rgba(11,15,20,.015) 0%, transparent 55%);

    --grid-cols: 1;
}

/* ============================================
   DARK THEME — LeadtheAI Ink inverse
   Activated by class="dark" on <html>.
   ============================================ */
.dark {
    --background: var(--ink-1000);
    --foreground: var(--ink-100);

    --card: var(--ink-900);
    --card-foreground: var(--ink-100);

    --popover: var(--ink-900);
    --popover-foreground: var(--ink-100);

    --primary: var(--ink-0);
    --primary-foreground: var(--ink-1000);

    --secondary: var(--ink-800);
    --secondary-foreground: var(--ink-200);

    --muted: var(--ink-800);
    --muted-foreground: var(--ink-400);

    --accent: var(--ink-800);
    --accent-foreground: var(--ink-200);

    --destructive: #E06A52;

    --success: #52C497;
    --success-foreground: var(--ink-1000);

    --warning: #EBB84A;
    --warning-foreground: var(--ink-1000);

    --info-color: #7AB4E8;
    --info-foreground: var(--ink-1000);

    --border: var(--ink-700);
    --input: var(--ink-700);
    --ring: var(--ink-300);

    --chart-1: #7AB4E8;
    --chart-2: #52C497;
    --chart-3: var(--signal-500);
    --chart-4: #B88AE8;
    --chart-5: #E06A52;

    --sidebar: var(--ink-900);
    --sidebar-foreground: var(--ink-200);
    --sidebar-primary: var(--ink-0);
    --sidebar-primary-foreground: var(--ink-1000);
    --sidebar-accent: var(--ink-800);
    --sidebar-accent-foreground: var(--ink-100);
    --sidebar-border: var(--ink-700);
    --sidebar-ring: var(--ink-400);

    --agent-budget: #5BBFAB;
    --agent-project: var(--signal-300);
    --agent-knowledge: #B88AE8;
    --agent-budget-bg: rgba(91,191,171,.12);
    --agent-project-bg: rgba(241,197,122,.10);
    --agent-knowledge-bg: rgba(184,138,232,.12);
    --agent-budget-glow: 0 0 20px rgba(91,191,171,.2);
    --agent-project-glow: 0 0 20px rgba(232,162,58,.2);
    --agent-knowledge-glow: 0 0 20px rgba(184,138,232,.2);

    --glass-bg: rgba(17,22,29,.85);
    --glass-border: rgba(255,255,255,.06);
    --glass-blur: 12px;

    --ai-gradient-from: var(--signal-700);
    --ai-gradient-to: var(--signal-500);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 6px 16px rgba(0,0,0,.35);
    --shadow-lg: 0 24px 48px rgba(0,0,0,.4);
    --shadow-xl: 0 24px 48px rgba(0,0,0,.4);
    --shadow-glow: none;
    --shadow-glow-accent: none;

    --bg-base: var(--background);
    --bg-surface: var(--card);
    --bg-elevated: var(--accent);
    --bg-overlay: var(--popover);
    --bg-hover: var(--ink-800);
    --bg-active: rgba(255,255,255,.06);
    --bg-hover-strong: rgba(255,255,255,.10);
    --bg-selected: rgba(255,255,255,.10);
    --bg-primary: var(--background);
    --bg-secondary: var(--card);
    --bg-tertiary: var(--accent);
    --surface-2: var(--accent);

    --text-primary: var(--foreground);
    --text-secondary: var(--ink-300);
    --text-tertiary: var(--ink-400);
    --text-quaternary: var(--ink-500);
    --text-muted: var(--ink-400);

    --accent-hover: var(--ink-700);
    --accent-muted: var(--ink-300);
    --accent-subtle: rgba(255,255,255,.08);
    --accent-surface: rgba(255,255,255,.04);
    --accent-glow: rgba(255,255,255,.12);
    --accent-secondary: var(--ink-400);
    --accent-secondary-subtle: rgba(138,149,164,.12);

    --border-subtle: var(--ink-700);
    --border-default: var(--ink-700);
    --border-strong: var(--ink-600);
    --border-focus: var(--ink-300);
    --border-glow: rgba(255,255,255,.15);

    --toggle-track-off: var(--ink-600);
    --toggle-track-on: var(--primary);
    --toggle-thumb: var(--ink-0);
    --toggle-border: var(--ink-500);

    --status-danger: #E06A52;
    --status-danger-subtle: rgba(224,106,82,.12);
    --status-warning: #EBB84A;
    --status-warning-subtle: rgba(235,184,74,.12);
    --status-success: #52C497;
    --status-success-subtle: rgba(82,196,151,.12);
    --status-info: #7AB4E8;
    --status-info-subtle: rgba(122,180,232,.12);

    --severity-critical: #E06A52;
    --severity-critical-bg: rgba(224,106,82,.10);
    --severity-high: #D4924A;
    --severity-high-bg: rgba(212,146,74,.10);
    --severity-medium: var(--signal-300);
    --severity-medium-bg: rgba(241,197,122,.10);
    --severity-low: #52C497;
    --severity-low-bg: rgba(82,196,151,.10);

    --color-success: #52C497;
    --color-danger: #E06A52;
    --color-warning: #EBB84A;
    --color-info: #7AB4E8;

    --bg-gradient-radial: radial-gradient(ellipse at top, rgba(255,255,255,.03) 0%, transparent 60%);
    --bg-gradient-mesh:
        radial-gradient(at 25% 25%, rgba(255,255,255,.02) 0%, transparent 50%),
        radial-gradient(at 75% 75%, rgba(255,255,255,.015) 0%, transparent 55%);
}

/* ============================================
   BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    border-color: var(--border);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    letter-spacing: var(--tracking-normal);
    background: var(--background);
    background-image: var(--bg-gradient-mesh);
    color: var(--foreground);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1;
}

#app {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    padding-top: 0;
    position: relative;
    box-sizing: border-box;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Agent-specific focus rings */
.focus-budget:focus-visible { outline: 2px solid oklch(0.50 0.14 175); outline-offset: 2px; }
.focus-project:focus-visible { outline: 2px solid oklch(0.60 0.16 55); outline-offset: 2px; }
.focus-knowledge:focus-visible { outline: 2px solid oklch(0.50 0.18 300); outline-offset: 2px; }

/* Selection — force visible contrast in both themes */
::selection {
    background: oklch(0.45 0.15 260);
    color: #fff;
}
input::selection, textarea::selection {
    background: oklch(0.45 0.15 260);
    color: #fff;
}

/* ============================================
   CPOD ANIMATIONS & KEYFRAMES
   ============================================ */
@keyframes cpod-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes cpod-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes cpod-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cpod-slide-in-right {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes cpod-slide-in-left {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes cpod-scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes cpod-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Animation classes ── */
.cpod-pulse { animation: cpod-pulse 2s ease-in-out infinite; }
.cpod-gradient-shift { background-size: 200% 200%; animation: cpod-gradient-shift 8s ease infinite; }
.cpod-fade-in { animation: cpod-fade-in var(--transition-slow) both; }
.cpod-slide-right { animation: cpod-slide-in-right var(--transition-slow) both; }
.cpod-slide-left { animation: cpod-slide-in-left var(--transition-slow) both; }
.cpod-scale-in { animation: cpod-scale-in var(--transition-slow) both; }
.cpod-spin { animation: cpod-spin 1s linear infinite; }

/* ── Agent glow shadows ── */
.cpod-glow-budget { box-shadow: var(--agent-budget-glow); }
.cpod-glow-project { box-shadow: var(--agent-project-glow); }
.cpod-glow-knowledge { box-shadow: var(--agent-knowledge-glow); }

/* ── Glassmorphism card ── */
.cpod-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ── Semantic surface cards ── */
.cpod-card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.cpod-popover {
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ── CPOD Buttons ── */
.cpod-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}
.cpod-btn-primary { background: var(--primary); color: var(--primary-foreground); }
.cpod-btn-primary:hover { filter: brightness(1.15); }
.cpod-btn-secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: var(--border); }
.cpod-btn-secondary:hover { background: var(--accent); }
.cpod-btn-destructive { background: var(--destructive); color: var(--primary-foreground); }
.cpod-btn-destructive:hover { opacity: 0.9; }
.cpod-btn-ghost { background: transparent; color: var(--foreground); }
.cpod-btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }

/* ── CPOD Form inputs ── */
.cpod-input {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cpod-input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2); }
.cpod-input::placeholder { color: var(--muted-foreground); }

/* ── CPOD Labels ── */
.cpod-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--foreground);
    margin-bottom: var(--space-1);
}

/* ── CPOD Badges ── */
.cpod-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}
.cpod-badge-primary { background: var(--primary); color: var(--primary-foreground); }
.cpod-badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.cpod-badge-destructive { background: var(--destructive); color: var(--primary-foreground); }
.cpod-badge-success { background: var(--success); color: var(--success-foreground); }
.cpod-badge-warning { background: var(--warning); color: var(--warning-foreground); }
.cpod-badge-info { background: var(--info); color: var(--info-foreground); }
.cpod-badge-budget { background: var(--agent-budget-bg); color: var(--agent-budget); }
.cpod-badge-project { background: var(--agent-project-bg); color: var(--agent-project); }
.cpod-badge-knowledge { background: var(--agent-knowledge-bg); color: var(--agent-knowledge); }

/* ── LeadtheAI Level Badges (L0→L4) ── */
.lvl-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}

.lvl-badge-0 { background: var(--ink-100); color: var(--ink-700); }
.lvl-badge-1 { background: var(--signal-100); color: var(--ink-800); }
.lvl-badge-2 { background: var(--signal-300); color: var(--ink-800); }
.lvl-badge-3 { background: var(--signal-500); color: var(--ink-900); }
.lvl-badge-4 { background: var(--ink-1000); color: var(--signal-500); }

/* ── LeadtheAI Typography helpers ── */
.lta-display {
    font-family: var(--font-display);
    font-size: 80px;
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.035em;
}
.lta-h1 {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.lta-h2 {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
.lta-h3 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.lta-h4 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.005em;
}
.lta-body-lg { font-family: var(--font-sans); font-size: 19px; font-weight: 400; line-height: 1.55; }
.lta-body-md { font-family: var(--font-sans); font-size: 16px; font-weight: 400; line-height: 1.55; }
.lta-body-sm { font-family: var(--font-sans); font-size: 13px; font-weight: 400; line-height: 1.5; }
.lta-label-caps {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.4;
}
.lta-mono-sm {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.5;
}
.lta-number {
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1;
}

/* ── LeadtheAI Eyebrow ── */
.lta-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-500);
}

/* ── LeadtheAI signal accent text ── */
.lta-signal { color: var(--signal-500); }
.lta-signal-text { color: var(--signal-700); }

/* ── LevelMark SVG (four ascending bars) ── */
.level-mark {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
}
.level-mark span {
    display: block;
    width: 4px;
    border-radius: 1.5px;
    background: currentColor;
}
.level-mark span:nth-child(1) { height: 5px; }
.level-mark span:nth-child(2) { height: 9px; }
.level-mark span:nth-child(3) { height: 14px; }
.level-mark span:nth-child(4) { height: 20px; }

/* ── CPOD Typography helpers ── */
.cpod-h1 { font-size: var(--text-3xl); font-weight: var(--font-bold); letter-spacing: -0.025em; line-height: var(--leading-tight); }
.cpod-h2 { font-size: var(--text-2xl); font-weight: var(--font-semibold); letter-spacing: -0.025em; line-height: var(--leading-tight); }
.cpod-h3 { font-size: var(--text-xl); font-weight: var(--font-semibold); line-height: var(--leading-tight); }
.cpod-h4 { font-size: var(--text-lg); font-weight: var(--font-medium); line-height: var(--leading-tight); }
.cpod-body { font-size: var(--text-sm); line-height: var(--leading-normal); }
.cpod-small { font-size: var(--text-xs); line-height: var(--leading-normal); }
.cpod-muted { font-size: var(--text-sm); color: var(--muted-foreground); }
.cpod-mono { font-family: var(--font-mono); }
.cpod-value-hero { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: var(--font-black); }

/* ── Agent-colored text ── */
.cpod-text-budget { color: var(--agent-budget); }
.cpod-text-project { color: var(--agent-project); }
.cpod-text-knowledge { color: var(--agent-knowledge); }

/* ── Agent-colored backgrounds ── */
.cpod-bg-budget { background: var(--agent-budget-bg); }
.cpod-bg-project { background: var(--agent-project-bg); }
.cpod-bg-knowledge { background: var(--agent-knowledge-bg); }

/* ── Separator ── */
.cpod-separator { height: 1px; background: var(--border); border: none; margin: var(--space-4) 0; }

/* ── AI gradient background ── */
.cpod-ai-gradient { background: linear-gradient(135deg, var(--ai-gradient-from), var(--ai-gradient-to)); }

/* ── CPOD Sidebar utility ── */
.cpod-sidebar { background: var(--sidebar); color: var(--sidebar-foreground); border-inline-end: 1px solid var(--sidebar-border); }
.cpod-sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--sidebar-foreground);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--transition-fast);
}
.cpod-sidebar-item:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.cpod-sidebar-item[aria-current="page"],
.cpod-sidebar-item.active { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }

/* ── RTL font switch ── */
[dir='rtl'] { --font-sans: var(--font-arabic); }

/* ── Responsive grid columns ── */
@media (min-width: 640px) { :root { --grid-cols: 2; } }
@media (min-width: 768px) { :root { --grid-cols: 2; } }
@media (min-width: 1024px) { :root { --grid-cols: 4; } }
@media (min-width: 1280px) { :root { --grid-cols: 4; } }

/* ============================================
   SIDEBAR - Icon Rail
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0 var(--space-3) 0;
    position: relative;
    z-index: 100;
    transition: width var(--duration-slow) var(--ease-out);
}

/* Light mode: sidebar slightly warm-tinted so it reads as a distinct panel */
:root .sidebar {
    background: var(--sidebar);
}
/* Dark mode: sidebar one step lighter than the base to act as a rail */
.dark .sidebar {
    background: var(--sidebar);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, var(--bg-hover) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar-header {
    height: var(--header-height);
    min-height: var(--header-height);
    padding: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    width: clamp(32px, 2.5vw, 40px);
    height: clamp(32px, 2.5vw, 40px);
    background: var(--ink-0);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    box-shadow: var(--shadow-md);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-lg);
    background: var(--ink-1000);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-normal) var(--ease-out);
    filter: blur(8px);
}

.logo:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.logo:hover::after {
    opacity: 0.08;
}

.logo i {
    font-size: clamp(16px, 1.2vw, 20px);
    color: var(--signal-900);
}

.nav-menu {
    list-style: none;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) 0;
}

.nav-item {
    width: clamp(36px, 2.8vw, 44px);
    height: clamp(36px, 2.8vw, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}

.nav-item i {
    font-size: clamp(18px, 1.3vw, 22px);
    transition: transform var(--duration-fast) var(--ease-spring);
}

.nav-item span {
    display: none;
}

.nav-item:hover,
.nav-item:focus-visible {
    color: var(--sidebar-foreground);
    background: var(--sidebar-accent);
}

.nav-item:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: -2px;
    border-radius: var(--radius-md);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item {
    /* Inactive items: deliberately dimmer than the secondary text so the
       active item reads as the unmistakable focus point of the rail. The
       `color` declared earlier (line ~976) is overridden via opacity here
       so the cascade for :hover / .active continues to win. */
    opacity: 0.62;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    opacity: 1;
}

.nav-item.active {
    color: var(--signal-900);
    background: var(--sidebar-accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    /* Wider + taller accent stripe so the active item's "where am I"
       affordance survives across light + dark + AR/RTL without depending
       on background-color contrast alone. */
    width: 4px;
    height: 32px;
    background: var(--signal-500);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px color-mix(in srgb, var(--signal-500) 45%, transparent);
}

/* RTL: anchor the accent stripe to the logical-start edge, which in
   ``dir="rtl"`` is the visual right. */
[dir="rtl"] .nav-item.active::before {
    left: auto;
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* Nav Tooltip - pointer-events: none so it never blocks clicks on adjacent nav items */
.nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    background: var(--bg-overlay);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: all var(--duration-fast) var(--ease-out);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    pointer-events: none;
}

.nav-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Approvals nav — Coming Soon (Area 2) */
.nav-item--soon {
    opacity: 0.45;
    cursor: not-allowed;
}
.nav-item--soon:hover {
    background: transparent;
    transform: none;
}
.nav-item--soon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}
.nav-item--soon::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning, var(--signal-500));
    border: 1.5px solid var(--bg-sidebar, var(--bg));
    z-index: 2;
}

.sidebar-footer {
    /* Push to the bottom of the flex column. The sidebar is a flex-column
       at full height (#app is 100vh, sidebar inherits cross-axis stretch),
       so ``margin-top: auto`` parks this group flush with the bottom and
       splits the rail into "work nav" (top) + "account/settings" (bottom),
       matching the Linear/Slack/Notion/Vercel convention. Before this rule
       the footer floated ~80% down the column with empty space below it,
       which read as "forgotten" rather than "intentionally separated". */
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    /* No vertical padding — the parent ``.sidebar`` already provides the
       bottom inset via its ``padding: 0 0 var(--space-3) 0;`` rule. Adding
       padding here was stacking with the nested ``.nav-menu`` rule
       (``padding: var(--space-4) 0``) and pushing the Settings icon ~40px
       above the bottom edge, making it look like it was floating mid-air. */
    padding: 0;
}

/* The nested ``.nav-menu`` inside ``.sidebar-footer`` would otherwise inherit
   the top-rail nav-menu's ``flex: 1; padding: var(--space-4) 0`` — that
   ``flex: 1`` would fight ``.sidebar-footer { margin-top: auto }`` and the
   padding would stack on top of the parent's. Reset both so the footer item
   sits flush with the sidebar's bottom inset. */
.sidebar-footer .nav-menu {
    flex: 0 0 auto;
    padding: 0;
}

.user-info {
    width: clamp(28px, 2vw, 36px);
    height: clamp(28px, 2vw, 36px);
    background: linear-gradient(135deg, var(--bg-overlay) 0%, var(--bg-elevated) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.user-info:hover {
    background: var(--bg-active);
    border-color: var(--border-strong);
    transform: scale(1.05);
}

.user-info i, .user-info span {
    display: none;
}

.user-info::before {
    content: 'A';
}

.status-online::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--status-success);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 8px var(--status-success);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.content {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    background-image: var(--bg-gradient-radial);
    overflow: hidden;
    position: relative;
}

/* ============================================
   HEADER - Minimal with Glow
   ============================================ */
.page-header {
    min-height: var(--header-height);
    height: auto;
    padding: var(--space-2) var(--content-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: var(--space-4);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    flex-shrink: 0;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-subtle) 50%, transparent 100%);
}

.header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    min-width: 0;
    flex: 1 1 auto;
}

.header-title-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    min-width: 0;
    flex: 1 1 auto;
}

/* Inline org / impersonation tag — sits next to the page title, not a side panel */
.context-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    max-width: min(100%, 420px);
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid var(--border-subtle);
    flex-shrink: 1;
    min-width: 0;
}

.context-chip i {
    flex-shrink: 0;
    font-size: var(--text-sm);
}

.context-chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.context-chip__action {
    flex-shrink: 0;
    margin-left: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}

.context-chip__action:hover {
    background: rgba(11, 15, 20, .08);
}

.context-chip--org {
    background: var(--signal-100);
    color: var(--signal-900);
    border-color: var(--signal-300);
}

.context-chip--org i {
    color: var(--signal-700);
}

.context-chip--warn {
    background: var(--status-warning-subtle);
    color: var(--ink-700);
    border-color: var(--severity-high);
}

.dark .context-chip--org {
    background: rgba(232, 162, 58, .12);
    color: var(--signal-300);
    border-color: rgba(232, 162, 58, .35);
}

.dark .context-chip--org i {
    color: var(--signal-500);
}

.dark .context-chip--warn {
    background: rgba(235, 184, 74, .12);
    color: var(--signal-300);
    border-color: rgba(235, 184, 74, .35);
}

.dark .context-chip__action:hover {
    background: rgba(255, 255, 255, .1);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem; /* 24px — clear visual separation from section h3s */
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    white-space: nowrap;
    gap: var(--space-3);
    color: var(--text-primary);
    min-width: 0;
}

.page-header h1 i {
    font-size: var(--text-2xl);
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--accent-muted));
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    align-content: center;
    gap: var(--space-2);
    flex-shrink: 0;
    flex-wrap: nowrap;
}

/* Section sub-navigation — below top bar, separate from utility actions */
.page-subnav {
    display: flex;
    align-items: stretch;
    padding: 0 var(--content-padding);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    min-height: 44px;
    flex-shrink: 0;
}

.page-subnav .sub-tabs {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    gap: 0;
    width: 100%;
    min-height: 44px;
}

.page-subnav .sub-tab {
    border-radius: 0;
    border: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-3) var(--space-4);
    margin-bottom: -1px;
    height: 100%;
}

.page-subnav .sub-tab:hover {
    background: var(--bg-hover);
    border-color: transparent;
}

.page-subnav .sub-tab.active {
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: none;
    border: none;
    border-bottom: 2px solid var(--primary);
}

.page-subnav .sub-tab.active::after {
    display: none;
}

/* Queue depth on sub-nav tabs — muted metadata, not notification badges */
.tab-meta {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.page-subnav .sub-tab.active .tab-meta {
    color: var(--text-secondary);
}

.header-btn {
    width: clamp(32px, 2vw, 40px);
    height: clamp(32px, 2vw, 40px);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
}

.header-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.header-btn i {
    font-size: var(--text-lg);
}

.header-language {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    height: clamp(32px, 2vw, 40px);
    padding: 0 var(--space-2);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.header-language:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.header-language i {
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.header-language-select {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
    min-width: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 14px;
}

.header-language-select:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.header-language-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ============================================
   RTL - Arabic (dir="rtl")
   ============================================ */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body,
html[dir="rtl"] #app {
    font-family: var(--font-arabic);
}

html[dir="rtl"] #app {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--sidebar-border);
}

html[dir="rtl"] .nav-item.active::before {
    left: auto;
    right: 0;
    border-radius: 2px 0 0 2px;
}

html[dir="rtl"] .nav-item::after {
    left: auto;
    right: calc(100% + 12px);
    transform: translateX(8px);
}

html[dir="rtl"] .nav-item:hover::after {
    transform: translateX(0);
}

html[dir="rtl"] .header-language {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-language-select {
    background-position: left center;
    padding-right: 0;
    padding-left: 14px;
}

html[dir="rtl"] .page-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .page-header h1 {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .findings-table th,
html[dir="rtl"] .findings-table td,
html[dir="rtl"] table th,
html[dir="rtl"] table td {
    text-align: right;
}

html[dir="rtl"] .sub-tabs {
    flex-direction: row-reverse;
}

html[dir="rtl"] .pref-row,
html[dir="rtl"] .pref-label,
html[dir="rtl"] .pref-rows {
    text-align: right;
}

html[dir="rtl"] .pref-row-select select,
html[dir="rtl"] .pref-row input {
    text-align: right;
}

html[dir="rtl"] .card-header,
html[dir="rtl"] .card-title,
html[dir="rtl"] .kpi-value,
html[dir="rtl"] .kpi-label,
html[dir="rtl"] .filter-row,
html[dir="rtl"] .empty-state,
html[dir="rtl"] .loading-state {
    text-align: right;
}

html[dir="rtl"] .toast-container {
    margin-left: 0;
    margin-right: auto;
}

html[dir="rtl"] .modal,
html[dir="rtl"] .overlay-panel {
    text-align: right;
}

html[dir="rtl"] .modal-header,
html[dir="rtl"] .overlay-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .btn-group,
html[dir="rtl"] .filter-row .filters {
    flex-direction: row-reverse;
}

html[dir="rtl"] .overlay-backdrop {
    justify-content: flex-start;
}

html[dir="rtl"] .overlay-panel {
    border-left: none;
    border-right: 1px solid var(--border-default);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

html[dir="rtl"] .slide-enter-from .overlay-panel,
html[dir="rtl"] .slide-leave-to .overlay-panel {
    transform: translateX(-100%);
}

/* ============================================
   SUB-TABS - Pill Style with Glow
   ============================================ */
.sub-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--space-1);
    background: var(--bg-elevated);
    padding: var(--space-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    min-width: 0;
    align-items: center;
    align-content: center;
    height: auto;
}
.sub-tabs::-webkit-scrollbar { display: none; }

/* Soft fade on the edge that has hidden content past it — gated by the
   ``has-fade-start`` / ``has-fade-end`` classes that ``v-overflow-fade``
   (app.ts) toggles based on actual scroll position. Previous version
   applied a fade unconditionally, which painted a transparent right edge
   on pages where the strip fit comfortably (e.g. Approvals with two
   sub-tabs), making it look like an unfinished gradient. */
.sub-tabs.has-fade-end {
    mask-image: linear-gradient(
        to right,
        #000 0%,
        #000 calc(100% - 24px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        #000 0%,
        #000 calc(100% - 24px),
        transparent 100%
    );
}
.sub-tabs.has-fade-start {
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 24px,
        #000 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 24px,
        #000 100%
    );
}
.sub-tabs.has-fade-start.has-fade-end {
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%
    );
}

/* RTL: ``has-fade-start`` is still the logical start (visual right in
   RTL), ``has-fade-end`` is still the logical end (visual left). Mirror
   the gradient direction so each fade lands on the right visual edge. */
[dir="rtl"] .sub-tabs.has-fade-end {
    mask-image: linear-gradient(
        to left,
        #000 0%,
        #000 calc(100% - 24px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to left,
        #000 0%,
        #000 calc(100% - 24px),
        transparent 100%
    );
}
[dir="rtl"] .sub-tabs.has-fade-start {
    mask-image: linear-gradient(
        to left,
        transparent 0%,
        #000 24px,
        #000 100%
    );
    -webkit-mask-image: linear-gradient(
        to left,
        transparent 0%,
        #000 24px,
        #000 100%
    );
}
[dir="rtl"] .sub-tabs.has-fade-start.has-fade-end {
    mask-image: linear-gradient(
        to left,
        transparent 0%,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to left,
        transparent 0%,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%
    );
}

.sub-tab {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
    white-space: nowrap;
}

.sub-tab i {
    font-size: var(--text-lg);
}

.sub-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-subtle);
}

.sub-tab.active {
    background: var(--card);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm), 0 0 0 1px oklch(from var(--primary) l c h / 0.08);
    border: 1px solid var(--border);
    position: relative;
}

.sub-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-pill);
}

.tab-count {
    background: var(--secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary);
}

.tab-badge-v2 {
    background: linear-gradient(135deg, oklch(from var(--chart-1) l c h / 0.08), oklch(from var(--chart-4) l c h / 0.08));
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    color: var(--chart-1);
    border: 1px solid oklch(from var(--chart-1) l c h / 0.15);
    margin-left: 4px;
    letter-spacing: 0.5px;
}

/* ============================================
   PAGE CONTENT - Fluid Container
   ============================================ */
.page-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-y: auto;
    padding: var(--content-padding);
    background: var(--bg-base);
}

/* Light theme — page-content inherits :root CPOD tokens by default. No override needed. */

/* Middle body — dashboard UI: alignment, spacing, visual polish */
.page-content .dashboard-grid {
    gap: var(--space-5);
    width: 100%;
    max-width: 100%;
}
.page-content .kpi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: stretch;
    width: 100%;
}
@media (min-width: 768px) {
    .page-content .kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-4);
    }
}
@media (min-width: 1200px) {
    .page-content .kpi-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
.page-content .kpi-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    box-shadow:
        0 1px 0 var(--shadow-color, rgba(15, 23, 42, 0.02)),
        var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
    min-height: 88px;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* LeadtheAI – KPI cards lift off the paper canvas */
:root .page-content .kpi-card {
    border-color: var(--border-subtle);
    background: var(--bg-surface);
}
.dark .page-content .kpi-card {
    border-color: var(--ink-800);
    background: var(--ink-900);
}

.page-content .kpi-card:hover {
    background: var(--bg-elevated);
}
.dark .page-content .kpi-card:hover {
    background: var(--ink-800);
}
.page-content .kpi-icon {
    flex-shrink: 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
}
.page-content .kpi-icon i {
    font-size: 1.6rem;
}
.page-content .kpi-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    justify-content: center;
}
.page-content .kpi-value {
    font-family: var(--font-display);
    font-size: clamp(var(--text-2xl), 2vw, var(--text-3xl));
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-tighter);
    color: var(--text-primary);
    line-height: 1.15;
}
.page-content .kpi-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    line-height: 1.35;
    white-space: normal;
}
/* Dashboard rows: equal-height cards */
.page-content .dashboard-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    align-items: stretch;
    width: 100%;
    min-width: 0;
}
@media (max-width: 900px) {
    .page-content .dashboard-sections-row {
        grid-template-columns: 1fr;
    }
}
.overview-stats-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.overview-apt-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.page-content .dashboard-section {
    border-radius: var(--radius-xl);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.page-content .dashboard-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    min-height: 32px;
    flex-shrink: 0;
}
.page-content .dashboard-section .section-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-sm); /* 13px — section labels, clearly sub-page-title */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-secondary);
    margin: 0;
    min-width: 0;
}
.page-content .dashboard-section .section-header h3 i {
    flex-shrink: 0;
    font-size: var(--text-base);
    color: var(--text-tertiary);
}
.page-content .dashboard-section .section-header .btn-link {
    flex-shrink: 0;
    margin-left: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}
.page-content .dashboard-section .section-header .btn-link:hover {
    color: var(--primary);
}
/* Title + muted subtitle stacked on the left of a section header
   (e.g. the Triage Queue card). Keeps the View-All link aligned right. */
.page-content .dashboard-section .section-header .section-header-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.page-content .dashboard-section .section-header .section-subtitle {
    font-size: var(--text-xs);
    font-weight: 400;
    text-transform: none;
    letter-spacing: var(--tracking-normal);
    color: var(--text-tertiary);
    line-height: 1.2;
    /* Optically align with the h3 text, past its leading icon. */
    padding-left: calc(var(--text-base) + var(--space-3));
}
/* Recent Alerts list: alignment and spacing */
.page-content .dashboard-section .alerts-mini-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}

.page-content .dashboard-section .empty-state.small {
    min-height: 112px;
    padding: var(--space-4);
}

.page-content .dashboard-grid .onboarding-card {
    margin-bottom: 0;
    padding: var(--space-5);
}

.page-content .dashboard-grid .onboarding-header {
    margin-bottom: var(--space-4);
}
.page-content .dashboard-section .alert-mini-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-active);
    min-height: 52px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.page-content .dashboard-section .alert-mini-card:hover {
    background: var(--bg-hover-strong);
    border-color: var(--border-default);
}
.page-content .dashboard-section .alert-severity {
    flex-shrink: 0;
    width: 4px;
    height: 40px;
    border-radius: var(--radius-full);
    align-self: center;
}
.page-content .dashboard-section .alert-mini-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}
.page-content .dashboard-section .alert-mini-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-content .dashboard-section .alert-mini-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.3;
}
.page-content .dashboard-section .alert-status-badge {
    flex-shrink: 0;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Active Threat Groups: alignment */
.page-content .dashboard-section .threats-mini-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.page-content .dashboard-section .threat-mini-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-active);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
    min-width: 0;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.page-content .dashboard-section .threat-mini-card:hover {
    background: var(--bg-hover-strong);
    border-color: var(--border-default);
}
.page-content .dashboard-section .threat-origin {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    line-height: 1.3;
}
.page-content .dashboard-section .threat-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.page-content .dashboard-section .threat-iocs {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.3;
}
/* Security Overview widget (3rd column) */
.security-overview {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
/* Stats stacked vertically as compact key-value rows */
.overview-stat-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.overview-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-active);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: background var(--duration-fast), border-color var(--duration-fast);
}

.overview-stat:hover {
    background: var(--bg-hover-strong);
    border-color: var(--border-default);
}

/* Dark mode overview-stat: consistent darker background */
.dark .overview-stat {
    background: var(--ink-900);
}
.overview-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.overview-value {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1;
    flex-shrink: 0;
}
.overview-value.text-success { color: var(--status-success); }
.overview-value.text-warning { color: var(--warning); }

/* Dark mode: subtle hover with clear contrast for white text */
.dark .overview-stat:hover {
    background: var(--ink-850, #161D28);
    border-color: var(--ink-700);
}
.dark .overview-stat:hover .overview-label {
    color: var(--ink-200);
}
.dark .overview-stat:hover .overview-value {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.overview-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-2) 0;
}
.apt-mini-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast), border-color var(--duration-fast);
}
.apt-mini-row:hover {
    background: var(--accent);
}
.dark .apt-mini-row:hover {
    background: var(--bg-hover-strong);
}
.apt-mini-origin {
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 1px var(--space-2);
    border-radius: var(--radius-sm);
    min-width: 32px;
    text-align: center;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.apt-mini-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.apt-mini-iocs {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.page-content .section-header a,
.page-content .section-header .btn-link {
    color: var(--text-secondary);
    font-weight: 500;
}
.page-content .section-header a:hover,
.page-content .section-header .btn-link:hover {
    color: var(--primary);
}
/* Dashboard: responsive */
@media (max-width: 768px) {
    .page-content .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-content .dashboard-sections-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .page-content .kpi-row {
        grid-template-columns: 1fr;
    }
}
/* Consistent spacing; top padding for content, horizontal padding from .page-content only (avoid double padding) */
.page-content .page {
    padding-top: var(--space-4);
    padding-left: 0;
    padding-right: 0;
}

/* Remove any padding from subtab-content wrapper to ensure consistent spacing across all pages */
.subtab-content {
    padding: 0;
    margin: 0;
}

/* Middle body (nude) — All pages: full-width layout, consistent spacing */
.page-content .page.dashboard-page,
.page-content .page.investigations-page,
.page-content .page.threats-page,
.page-content .page.tasks-page,
.page-content .page.settings-page,
.page-content .page.approvals-page {
    max-width: none;
    width: 100%;
}
.page-content .tasks-page {
    padding-bottom: var(--space-8);
}
/* Consistent section header spacing across all main pages */
.page-content .tasks-page .section-header,
.page-content .threats-page .section-header,
.page-content .investigations-page .section-header,
.page-content .settings-page .section-header,
.page-content .approvals-page .section-header {
    margin-bottom: var(--space-4);
    width: 100%;
}
.page-content .investigations-page .section-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
/* Consistent filter bar spacing across all main pages */
.page-content .tasks-page .filter-bar,
.page-content .threats-page .filter-bar,
.page-content .investigations-page .filter-bar,
.page-content .approvals-page .filter-bar,
.page-content .settings-page .filter-bar {
    width: 100%;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

/* Settings/Connectors filter row: the third dropdown (scope) was getting
   squeezed to "All Sco..." because the inner filter-group had no min-width
   on its dropdowns and the search box ate the remaining space. Allow the
   group to wrap to a new line if needed and give each dropdown enough
   room to render its longest label. */
.page-content .settings-page .filter-bar .filter-group {
    flex-wrap: wrap;
    flex-shrink: 0;
}
.page-content .settings-page .filter-bar .filter-group select {
    min-width: 9rem;
}
.page-content .tasks-page .filter-group {
    flex-shrink: 0;
}
.page-content .tasks-page .filter-group select {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-primary, #e2e8f0);
    padding: var(--space-2) var(--space-6) var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-2) center;
    appearance: none;
    -webkit-appearance: none;
}
.page-content .tasks-page .filter-group select:hover,
.page-content .tasks-page .filter-group select:focus {
    border-color: var(--primary);
    background: var(--bg-hover);
}
/* Fixed-width cards matching APT group cards */
.page-content .tasks-page .tasks-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
    align-items: start;
    justify-content: start;
}
/* Card dimensions and style matching APT cards */
.page-content .tasks-page .task-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: var(--list-card-min-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: none;
    padding: var(--space-4);
    padding-top: var(--space-3);
    gap: var(--space-3);
    background: var(--bg-surface);
    transition: all var(--duration-normal) var(--ease-spring);
    cursor: pointer;
    position: relative;
}
/* No top accent line */
.page-content .tasks-page .task-card::before {
    display: none;
}
.page-content .tasks-page .task-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--border-subtle),
        0 8px 32px var(--shadow-glow);
}
.page-content .tasks-page .task-card:hover .task-name {
    color: var(--primary);
}
/* Inactive tasks — greyed out like APT inactive */
.page-content .tasks-page .task-card.inactive {
    opacity: 0.5;
    filter: grayscale(30%);
}
.page-content .tasks-page .task-card.inactive:hover {
    opacity: 0.7;
    filter: grayscale(10%);
}
.page-content .tasks-page .task-header {
    flex-shrink: 0;
}
.page-content .tasks-page .task-icon-name {
    flex-shrink: 0;
}
.page-content .tasks-page .task-description {
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-content .tasks-page .task-card-info {
    flex-shrink: 0;
}
.page-content .tasks-page .task-card-footer {
    flex-shrink: 0;
    margin-top: auto;
}
.page-content .tasks-page .task-badge {
    border-radius: var(--radius-sm);
    font-weight: 600;
    border-color: var(--border-subtle);
}
.page-content .tasks-page .task-badge.ai {
    background: var(--accent-surface);
    color: var(--primary);
    border-color: transparent;
}
.page-content .tasks-page .task-trigger-badge {
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.page-content .tasks-page .task-status.active {
    color: var(--status-success);
}
.page-content .tasks-page .task-icon-name i {
    color: var(--primary);
    font-size: 18px;
}
.page-content .tasks-page .task-name {
    font-size: var(--text-base);
    color: var(--text-secondary);
    transition: color var(--duration-fast);
}
.page-content .tasks-page .task-description {
    color: var(--text-secondary);
}
.page-content .tasks-page .task-role-badge {
    background: var(--accent-surface);
    color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-full);
    padding: var(--space-1) var(--space-3);
}
.page-content .tasks-page .task-skills {
    color: var(--text-secondary);
}
.page-content .tasks-page .task-skills i {
    color: var(--primary);
}
.page-content .tasks-page .task-card-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-4);
}
.page-content .tasks-page .task-last-run {
    color: var(--text-secondary);
}
.page-content .tasks-page .task-last-run i {
    color: var(--text-secondary);
    opacity: 0.9;
}
.page-content .tasks-page .task-card-footer .btn-primary.small {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-4);
    transition: transform var(--duration-fast), box-shadow var(--duration-fast), opacity var(--duration-fast);
}
.page-content .tasks-page .task-card-footer .btn-primary.small:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.page-content .tasks-page .task-card-footer .btn-primary.small:disabled {
    opacity: 0.4;
}
.page-content .tasks-page .history-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.page-content .tasks-page .history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.page-content .tasks-page .empty-state {
    color: var(--text-secondary);
    width: 100%;
}

/* Middle body — Threats: APT grid cards, same fixed width as Tasks/Playbooks */
.page-content .threats-page .apt-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    gap: var(--space-5);
    margin-top: var(--space-4);
    align-items: stretch;
    justify-content: stretch;
}

.page-content .threats-page .apt-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: var(--list-card-min-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    padding-top: var(--space-4);
    border-radius: var(--radius-xl);
    border: none;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}

/* Remove top colored lines from APT cards and task cards */
.page-content .threats-page .apt-risk-meter,
.page-content .threats-page .apt-card::before,
.page-content .tasks-page .apt-risk-meter,
.page-content .tasks-page .apt-card::before {
    display: none;
}

/* Task category colors — map to CPOD chart palette */
.tasks-page .apt-origin.incident-response {
    color: var(--chart-1);
    background: oklch(from var(--chart-1) l c h / 0.12);
    border-color: transparent;
}
.tasks-page .apt-origin.compliance {
    color: var(--chart-2);
    background: oklch(from var(--chart-2) l c h / 0.12);
    border-color: transparent;
}
.tasks-page .apt-origin.monitoring {
    color: var(--chart-3);
    background: oklch(from var(--chart-3) l c h / 0.12);
    border-color: transparent;
}
.tasks-page .apt-origin.vulnerability {
    color: var(--chart-4);
    background: oklch(from var(--chart-4) l c h / 0.12);
    border-color: transparent;
}
.tasks-page .apt-origin.threat-detection {
    color: var(--severity-critical);
    background: var(--severity-critical-bg);
    border-color: transparent;
}
.tasks-page .apt-origin.privileged-account {
    color: var(--chart-5, var(--chart-4));
    background: oklch(from var(--chart-5, var(--chart-4)) l c h / 0.12);
    border-color: transparent;
}
.tasks-page .apt-origin.ai {
    color: var(--primary);
    background: var(--accent-surface);
    border-color: transparent;
}

/* Task card descriptions — always visible */

.page-content .threats-page .apt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.page-content .threats-page .apt-header {
    flex-shrink: 0;
}

.page-content .threats-page .apt-name {
    flex-shrink: 0;
}

.page-content .threats-page .apt-description {
    flex: 1;
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-content .threats-page .apt-aliases,
.page-content .threats-page .apt-meta {
    font-weight: 500;
}
.page-content .threats-page .apt-meta i {
    color: var(--primary);
}
.page-content .threats-page .apt-stats {
    flex-shrink: 0;
}

/* Medium confidence badge: clear and vibrant (not dull) */
.page-content .threats-page .apt-confidence.medium {
    color: var(--status-warning);
    background: var(--status-warning-subtle);
    font-weight: 600;
}

@media (max-width: 600px) {
    .page-content .threats-page .apt-grid {
        grid-template-columns: 1fr;
    }
}

/* Playbooks page — match Agents tab card grid */
.page-content .investigations-page .playbooks-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
    align-items: start;
    justify-content: start;
}

.page-content .investigations-page .playbooks-grid .apt-card {
    cursor: pointer;
}

.page-content .investigations-page .playbooks-grid .apt-card:hover .apt-name {
    color: var(--primary);
}

.page-content .investigations-page .playbooks-grid .apt-name {
    transition: color var(--duration-fast);
}

/* Playbooks page — apt-card overrides (unified design with APT Groups + Tasks) */
.page-content .investigations-page .playbooks-grid .apt-risk-meter,
.page-content .investigations-page .playbooks-grid .apt-card::before { display: none; }

.page-content .investigations-page .playbooks-grid .apt-card.inactive { opacity: 0.5; filter: grayscale(30%); }

/* Playbook card descriptions — always visible */

/* Category color variants for playbook origin pills + card left border */
.investigations-page .apt-origin.credential-theft      { color: var(--chart-1); background: oklch(from var(--chart-1) l c h / 0.12); }
.investigations-page .apt-origin.lateral-movement      { color: var(--chart-2); background: oklch(from var(--chart-2) l c h / 0.12); }
.investigations-page .apt-origin.malware               { color: var(--severity-critical); background: var(--severity-critical-bg); }
.investigations-page .apt-origin.phishing              { color: var(--chart-3); background: oklch(from var(--chart-3) l c h / 0.12); }
.investigations-page .apt-origin.ransomware            { color: var(--chart-4); background: oklch(from var(--chart-4) l c h / 0.12); }
.investigations-page .apt-origin.incident-response     { color: var(--chart-5); background: oklch(from var(--chart-5) l c h / 0.12); }

/* Playbook card left accent border by category */
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.credential-theft)  { border-left: 3px solid var(--chart-1); }
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.lateral-movement)  { border-left: 3px solid var(--chart-2); }
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.malware)           { border-left: 3px solid var(--severity-critical); }
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.phishing)          { border-left: 3px solid var(--chart-3); }
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.ransomware)        { border-left: 3px solid var(--chart-4); }
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.incident-response) { border-left: 3px solid var(--chart-5); }
.investigations-page .playbooks-grid .apt-card:has(.apt-origin.investigation)     { border-left: 3px solid var(--info); }

.page {
    flex: 1 1 0;
    min-height: 0;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--content-padding) var(--content-padding);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: fadeSlideIn var(--duration-normal) var(--ease-out);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    gap: var(--space-4);
    color: var(--text-secondary);
}

.spinner {
    width: clamp(24px, 1.5vw, 32px);
    height: clamp(24px, 1.5vw, 32px);
    border: 2.5px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: cpod-spin 0.8s linear infinite;
    box-shadow: 0 0 16px var(--accent-surface);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-secondary);
    padding: var(--space-9);
    position: relative;
}

.empty-state::before {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
    pointer-events: none;
}

.empty-state-icon {
    width: clamp(100px, 8vw, 140px);
    height: clamp(100px, 8vw, 140px);
    background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all var(--duration-normal) var(--ease-spring);
}

.empty-state-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, transparent 0%, var(--accent-subtle) 50%, transparent 100%);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.empty-state:hover .empty-state-icon::before {
    opacity: 1;
}

.empty-state:hover .empty-state-icon {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.empty-state-icon i {
    font-size: clamp(40px, 3vw, 56px);
    background: linear-gradient(135deg, var(--chart-1) 0%, var(--chart-4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--duration-fast) var(--ease-out);
}

.empty-state:hover .empty-state-icon i {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: var(--tracking-tight);
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    letter-spacing: var(--tracking-tight);
}

.empty-state p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 400px;
    line-height: var(--leading-relaxed);
}

.empty-state.small {
    min-height: 180px;
    padding: var(--space-6);
}

.empty-state.small .empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
}

.empty-state.small .empty-state-icon i {
    font-size: var(--text-2xl);
}

.empty-state-action {
    margin-top: var(--space-6);
}

.empty-state-action .btn-primary {
    padding: var(--space-3) var(--space-6);
}

/* ============================================
   BUTTONS - Premium with Glow Effects
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--primary-foreground);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Dark theme – primary buttons use same monochrome accent */
.dark .btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-md);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, oklch(1 0 0 / 0.12) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-link:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn-icon:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
    border-radius: var(--radius-md);
}

.btn-danger:focus-visible {
    outline: 2px solid var(--destructive);
    outline-offset: 2px;
}

.sub-tab:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: -2px;
    border-radius: var(--radius-md);
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary i {
    font-size: var(--text-lg);
}

.btn-primary.small {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--secondary-foreground);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-secondary:hover {
    background: var(--accent);
    border-color: var(--accent-subtle);
    color: var(--accent-foreground);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary.small {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}

.btn-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--duration-fast) var(--ease-out);
}

.btn-link:hover::after {
    width: 100%;
}

/* ============================================
   FILTER BAR - Glass Effect
   ============================================ */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
}

.filter-bar.has-calendar-open {
    position: relative;
    z-index: 1000;
}

/* Severity filter pills */
.filter-pills {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.filter-pill {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    text-transform: capitalize;
}

.filter-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-pill.active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

.filter-pill.critical.active { background: var(--severity-critical); color: #fff; border-color: var(--severity-critical); }
.filter-pill.critical:not(.active):hover { color: var(--severity-critical); border-color: var(--severity-critical); }

.filter-pill.high.active { background: var(--severity-high); color: #fff; border-color: var(--severity-high); }
.filter-pill.high:not(.active):hover { color: var(--severity-high); border-color: var(--severity-high); }

.filter-pill.medium.active { background: var(--severity-medium); color: #fff; border-color: var(--severity-medium); }
.filter-pill.medium:not(.active):hover { color: var(--severity-medium); border-color: var(--severity-medium); }

.filter-pill.low.active { background: var(--severity-low); color: var(--text-primary); border-color: var(--severity-low); }
.filter-pill.low:not(.active):hover { color: var(--severity-low); border-color: var(--severity-low); }
.filter-pill.informational.active { background: var(--info); color: #fff; border-color: var(--info); }
.filter-pill.informational:not(.active):hover { color: var(--info); border-color: var(--info); }

.search-box {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    max-width: clamp(280px, 20vw, 360px);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.search-box:focus-within {
    border-color: var(--accent-subtle);
    box-shadow: 0 0 0 3px var(--accent-surface);
}

.search-box i {
    color: var(--text-quaternary);
    font-size: var(--text-lg);
}

.search-box input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--text-sm);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-quaternary);
}

.filter-group {
    display: flex;
    gap: var(--space-2);
}

.calendar-filter {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 190px;
    height: 38px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}

.calendar-filter:hover,
.calendar-filter.is-open {
    border-color: var(--text-tertiary);
    background: var(--bg-hover);
}

.calendar-filter.is-active {
    border-color: var(--primary);
    color: var(--text-primary);
}

.calendar-filter.is-open {
    z-index: 1002;
}

.calendar-filter-trigger {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    height: 100%;
    padding: 0 var(--space-3);
    border: 0;
    background: transparent;
    color: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
}

.calendar-filter-trigger > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-filter-trigger:focus-visible,
.calendar-filter-clear:focus-visible,
.calendar-popover button:focus-visible,
.calendar-popover input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.calendar-filter-trigger > .ph-calendar-blank {
    color: var(--text-tertiary);
    font-size: var(--text-base);
}

.calendar-filter-caret {
    margin-left: auto;
    color: var(--text-quaternary);
    transition: transform var(--duration-fast) var(--ease-out);
}

.calendar-filter.is-open .calendar-filter-caret {
    transform: rotate(180deg);
}

.calendar-filter-clear,
.calendar-popover-close {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 3px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
}

.calendar-filter-clear:hover,
.calendar-popover-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.calendar-popover {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    z-index: 1003;
    width: 360px;
    box-sizing: border-box;
    padding: var(--space-4);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
    color: var(--text-primary);
}

.calendar-popover--datetime {
    width: min(620px, calc(100vw - 32px));
}

.calendar-popover-header,
.calendar-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-popover-header strong {
    font-size: var(--text-sm);
    font-weight: 600;
}

.calendar-popover-close {
    margin: 0;
}

.calendar-timezone-note {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: fit-content;
    margin-top: var(--space-2);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

.calendar-timezone-note i {
    color: var(--primary);
}

.calendar-timezone-note strong {
    color: var(--text-primary);
    font-weight: 600;
}

.calendar-presets {
    display: flex;
    gap: var(--space-2);
    margin: var(--space-3) 0 var(--space-4);
}

.calendar-presets button {
    flex: 1;
    min-height: 30px;
    padding: 0 var(--space-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
}

.calendar-presets button:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.calendar-presets button.active {
    border-color: var(--primary);
    background: var(--accent-surface);
    color: var(--text-primary);
}

.calendar-popover-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: var(--space-2);
}

.calendar-popover-fields label {
    display: grid;
    gap: var(--space-2);
    min-width: 0;
}

.calendar-popover-fields label > span {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: 500;
}

.calendar-popover-fields > i {
    margin-bottom: 11px;
    color: var(--text-quaternary);
}

.calendar-datetime-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    gap: var(--space-2);
}

.calendar-popover-fields input[type="date"],
.calendar-popover-fields input[type="time"] {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    height: 38px;
    padding: 0 var(--space-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font: inherit;
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

.dark .calendar-popover-fields input[type="date"]::-webkit-calendar-picker-indicator,
.dark .calendar-popover-fields input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.72;
}

.calendar-popover-error {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    color: var(--danger);
    font-size: var(--text-xs);
}

.calendar-popover-footer {
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

.calendar-popover-footer button {
    min-height: 34px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
}

.calendar-popover-clear {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
}

.calendar-popover-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.calendar-popover-apply {
    margin-left: auto;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
}

.calendar-popover-apply:hover {
    filter: brightness(1.06);
}

.calendar-popover-apply:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.cases-list-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

@media (max-width: 768px) {
    .calendar-filter {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-popover {
        right: 0;
        width: 100%;
        padding: var(--space-3);
    }

    .calendar-presets {
        gap: var(--space-1);
    }

    .calendar-popover--datetime {
        position: fixed;
        top: 230px;
        right: 12px;
        left: 0;
        width: auto;
        max-height: calc(100vh - 242px);
        overflow-y: auto;
    }

    .calendar-popover--datetime .calendar-popover-fields {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .calendar-popover--datetime .calendar-popover-fields > i {
        margin: 0;
        transform: rotate(90deg);
        justify-self: center;
    }

    .calendar-datetime-inputs {
        grid-template-columns: minmax(0, 1fr) 122px;
    }

    .cases-list-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .cases-list-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.filter-group select {
    min-width: 0;
    height: 36px;
    padding: var(--space-2) var(--space-6) var(--space-2) var(--space-4);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-elevated);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.filter-group select:hover,
.filter-group select:focus {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.dashboard-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--card-grid-gap);
    align-items: stretch;
}
@media (max-width: 900px) {
    .dashboard-sections-row { grid-template-columns: 1fr; }
}

/* ============================================
   KPI CARDS - Premium Stats
   ============================================ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    width: 100%;
}
@media (min-width: 768px) {
    .kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (min-width: 1200px) {
    .kpi-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--card-padding);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.kpi-card:hover {
    border-color: var(--border-default);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card--clickable {
    cursor: pointer;
    user-select: none;
}
.kpi-card--clickable:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
    transform: translateY(-2px);
}
.kpi-card--clickable:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.kpi-card--warning {
    border-color: var(--severity-high);
    border-left: 3px solid var(--severity-critical);
}
.kpi-card--warning .kpi-value {
    color: var(--severity-critical);
}

.kpi-icon {
    width: clamp(44px, 3vw, 56px);
    height: clamp(44px, 3vw, 56px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.05);
}

.kpi-icon i {
    font-size: clamp(20px, 1.4vw, 26px);
    color: var(--text-secondary);
}

.kpi-icon.critical {
    background: var(--severity-critical-bg);
    border-color: oklch(from var(--severity-critical) l c h / 0.2);
}
.kpi-icon.critical i { color: var(--severity-critical); }

.kpi-icon.high {
    background: var(--severity-high-bg);
    border-color: oklch(from var(--severity-high) l c h / 0.2);
}
.kpi-icon.high i { color: var(--severity-high); }

.kpi-icon.success {
    background: var(--status-success-subtle);
    border-color: oklch(from var(--status-success) l c h / 0.2);
}
.kpi-icon.success i { color: var(--status-success); }

.kpi-icon.info {
    background: var(--accent-surface);
    border-color: var(--accent-subtle);
}
.kpi-icon.info i { color: var(--primary); }

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-tighter);
    color: var(--text-primary);
    line-height: 1;
}

.kpi-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.kpi-sublabel {
    display: block;
    margin-top: 4px;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
}

/* Platform dashboard & admin (global_admin cross-tenant views) */
.page-content .dashboard-grid.platform-dashboard {
    /* Platform stacks toolbar + KPIs + two feed tables vertically. */
    gap: var(--space-5);
}

.platform-dashboard {
    gap: var(--space-5);
}

.platform-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, oklch(from var(--primary) l c h / 0.06), transparent 55%),
        var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.platform-toolbar--compact {
    margin-bottom: var(--space-5);
}

.platform-toolbar-copy {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    min-width: 0;
}

.platform-toolbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: oklch(from var(--primary) l c h / 0.12);
    color: var(--primary);
    flex-shrink: 0;
}

.platform-toolbar-badge i {
    font-size: 20px;
}

.platform-toolbar-title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.platform-toolbar-hint {
    margin: 2px 0 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.35;
}

.platform-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    padding: var(--space-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
}

.platform-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.platform-meta-chip i {
    color: var(--text-tertiary);
}

.platform-refresh-btn {
    margin: 0;
    border: none;
    box-shadow: none;
}

.platform-refresh-btn:hover:not(:disabled) {
    transform: none;
}

.platform-refresh-btn:disabled {
    opacity: 0.65;
}

.platform-refresh-btn i.spinning {
    animation: auth-spin 0.8s linear infinite;
}

.platform-dashboard .platform-kpi-row {
    gap: var(--space-3);
}

.platform-dashboard .platform-kpi-row .kpi-card {
    min-height: 92px;
    padding: var(--space-4);
}

.platform-dashboard .platform-kpi-row .kpi-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
}

.platform-dashboard .platform-kpi-row .kpi-content {
    min-width: 0;
}

.platform-dashboard .platform-tenant-section,
.platform-dashboard .platform-cases-section,
.platform-dashboard .platform-alerts-section {
    margin-top: 0;
    padding: var(--space-5);
}

.platform-section-desc {
    margin: -4px 0 var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
}

.platform-dashboard .platform-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.platform-dashboard .platform-section-header h3 {
    text-transform: none;
    letter-spacing: normal;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.platform-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.platform-dashboard .platform-tenant-table,
.platform-dashboard .platform-cases-table,
.platform-dashboard .platform-alerts-table,
.platform-admin-page .platform-tenant-table {
    margin: 0;
    width: 100%;
}

.platform-tenant-table th,
.platform-cases-table th,
.platform-alerts-table th {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-tertiary);
    white-space: nowrap;
    background: var(--bg-elevated);
}

.platform-tenant-table td,
.platform-cases-table td,
.platform-alerts-table td {
    vertical-align: middle;
}

.platform-tenant-row:hover td,
.platform-case-row:hover td,
.platform-alert-row:hover td {
    background: oklch(from var(--primary) l c h / 0.04);
}

.platform-cases-table tbody tr,
.platform-alerts-table tbody tr {
    cursor: pointer;
}

.platform-cases-table tbody tr.sev-critical td:first-child {
    box-shadow: inset 3px 0 0 0 var(--severity-critical);
}

.platform-cases-table tbody tr.sev-high td:first-child {
    box-shadow: inset 3px 0 0 0 var(--severity-high);
}

.platform-cases-table tbody tr.sev-medium td:first-child {
    box-shadow: inset 3px 0 0 0 var(--severity-medium);
}

.platform-cases-table tbody tr.sev-low td:first-child {
    box-shadow: inset 3px 0 0 0 var(--severity-low);
}

.platform-cases-table tbody tr:focus-visible,
.platform-alerts-table tbody tr:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
    background: var(--bg-hover);
}

.platform-dashboard .platform-cases-section .empty-state.small,
.platform-dashboard .platform-alerts-section .empty-state.small {
    gap: var(--space-2);
    min-height: 112px;
    padding: var(--space-4);
}

.platform-cases-filters {
    margin-bottom: var(--space-3);
}

.platform-org-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}

.platform-org-name {
    font-weight: 600;
    color: var(--text-primary);
}

.platform-org-slug {
    display: inline-block;
    width: fit-content;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.platform-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.platform-pill--tier-enterprise,
.platform-pill--status-active {
    color: var(--status-success);
    background: var(--status-success-subtle);
    border-color: oklch(from var(--status-success) l c h / 0.25);
}

.platform-pill--tier-professional,
.platform-pill--status-trial {
    color: var(--primary);
    background: oklch(from var(--primary) l c h / 0.12);
    border-color: oklch(from var(--primary) l c h / 0.2);
}

.platform-pill--tier-free,
.platform-pill--status-open {
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
}

.platform-pill--status-suspended,
.platform-pill--status-deactivated {
    color: var(--severity-high);
    background: var(--severity-high-bg);
    border-color: oklch(from var(--severity-high) l c h / 0.25);
}

.platform-metric {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.platform-metric--warn {
    color: var(--severity-high);
}

.platform-metric-note {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.platform-actions-col {
    width: 1%;
    white-space: nowrap;
}

.platform-view-org-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.platform-admin-page .platform-table-section {
    padding: 0;
    overflow: hidden;
}

.platform-admin-page .platform-table-section .platform-table-wrap {
    border: none;
    border-radius: 0;
}

@media (max-width: 768px) {
    .platform-toolbar {
        padding: var(--space-4);
    }

    .platform-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .platform-meta-chip {
        white-space: normal;
    }

    .platform-refresh-btn span {
        display: none;
    }

    .platform-refresh-btn {
        padding: var(--space-2) var(--space-3);
    }
}

@media (max-width: 640px) {
    .platform-dashboard .platform-kpi-row .kpi-label {
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    margin-bottom: var(--space-4);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-secondary);
}

.section-header h3 i {
    font-size: var(--text-base);
    color: var(--text-tertiary);
}

/* Reduce button padding in section-headers to fit within min-height */
.section-header .btn-primary {
    padding: 8px 16px;
    min-height: 40px;
    max-height: 40px;
    box-sizing: border-box;
}

/* ============================================
   DASHBOARD SECTIONS
   ============================================ */
.dashboard-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--section-padding);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: visible;
}

.dashboard-section::before {
    display: none;
}

/* ============================================
   ALERT CARDS - Mini List
   ============================================ */
.alerts-mini-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.alert-mini-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.alert-mini-card:hover {
    background: var(--bg-overlay);
    border-color: var(--border-subtle);
    transform: translateX(4px);
}

.alert-severity {
    width: 4px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--text-tertiary);
    transition: all var(--duration-fast) var(--ease-out);
}

.alert-mini-card:hover .alert-severity {
    height: 44px;
    box-shadow: 0 0 12px currentColor;
}

.alert-severity.critical { background: var(--severity-critical); }
.alert-severity.high { background: var(--severity-high); }
.alert-severity.medium { background: var(--severity-medium); }
.alert-severity.low { background: var(--severity-low); }

.alert-mini-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.alert-mini-title {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-mini-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.alert-status-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: var(--bg-active);
    color: var(--text-secondary);
}

.alert-status-badge.open {
    color: var(--severity-critical);
    background: var(--severity-critical-bg);
}
.alert-status-badge.investigating {
    color: var(--severity-high);
    background: var(--severity-high-bg);
}
.alert-status-badge.escalated_to_customer {
    color: var(--severity-medium);
    background: var(--severity-medium-bg);
}
.alert-status-badge.resolved {
    color: var(--status-success);
    background: var(--status-success-subtle);
}
.alert-status-badge.false-positive {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

/* ============================================
   THREATS MINI GRID
   ============================================ */
.threats-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-mini-min-width), 1fr));
    gap: var(--card-grid-gap);
}

/* Dashboard: 1 per line, compact */
.dashboard-section .threats-mini-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
}

.dashboard-section .threat-mini-card {
    padding: var(--space-3);
    gap: var(--space-2);
}

.threat-mini-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--card-padding);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.threat-mini-card:hover {
    border-color: var(--border-subtle);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.threat-origin {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    width: fit-content;
    background: var(--bg-active);
    color: var(--text-secondary);
}

.threat-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.threat-iocs {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ============================================
   ALERTS LIST - Full Cards
   ============================================ */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.alert-card {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.alert-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.alert-severity-indicator {
    width: 4px;
    flex-shrink: 0;
    background: var(--text-tertiary);
    transition: all var(--duration-fast) var(--ease-out);
}

.alert-card:hover .alert-severity-indicator {
    width: 6px;
}

.alert-severity-indicator.critical { background: var(--severity-critical); }
.alert-severity-indicator.high { background: var(--severity-high); }
.alert-severity-indicator.medium { background: var(--severity-medium); }
.alert-severity-indicator.low { background: var(--severity-low); }

.alert-main {
    flex: 1;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.alert-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.alert-id {
    font-size: var(--text-xs);
    color: var(--text-quaternary);
    font-family: var(--font-mono);
}

.alert-title {
    flex: 1;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.alert-time {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.alert-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Shared description/caption font for card body text */
.alert-description,
.playbook-description,
.apt-description,
.connector-category,
.live-event-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

.alert-tags {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.tag {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.tag:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.tag.kill-chain,
.tag.mitre,
.tag.source {
    background: var(--accent-surface);
    color: var(--primary);
    border-color: var(--accent-subtle);
}

.tag.small {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}

.alert-classification-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 190px;
    margin-left: 0;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-default);
    white-space: nowrap;
}

.alert-classification-chip > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alerts-table .col-classification {
    min-width: 170px;
    max-width: 220px;
}

.classification-pending {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: 500;
}

/* Severity-colored tags — apply the palette that already exists as tokens */
.tag.critical {
    background: var(--severity-critical-bg);
    color: var(--severity-critical);
    border-color: var(--severity-critical);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag.high {
    background: var(--severity-high-bg);
    color: var(--severity-high);
    border-color: var(--severity-high);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag.medium {
    background: var(--severity-medium-bg);
    color: var(--severity-medium);
    border-color: var(--severity-medium);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag.low {
    background: var(--severity-low-bg);
    color: var(--severity-low);
    border-color: var(--severity-low);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag.info {
    background: var(--accent-surface);
    color: var(--primary);
    border-color: var(--accent-subtle);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.alert-footer {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.alert-host,
.alert-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Status is a SECONDARY signal — kept visually quieter than severity so
   the two never compete on hue. An outline chip with a leading state
   dot, not a saturated fill (saturated fills are reserved for severity).
   See frontend/DESIGN.md. */
.alert-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}
.alert-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-quaternary);
    flex-shrink: 0;
}

.text-muted-sm {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* State dot colors carry the status hue subtly; the chip text stays
   neutral. Note ``false_positive`` uses an underscore to match the
   backend enum value bound in the template — the previous
   ``.false-positive`` (hyphen) selector never matched. */
.alert-status.open::before { background: var(--info); }
.alert-status.investigating::before { background: var(--warning); }
.alert-status.resolved::before { background: var(--status-success); }
.alert-status.false_positive::before { background: var(--text-quaternary); }
.alert-status.false_positive { color: var(--text-quaternary); }
.alert-status.resolved { color: var(--status-success); }

/* ============================================
   PLAYBOOKS GRID — uses apt-grid / apt-card system
   (old .playbook-card styles removed; see investigations-page overrides above)
   ============================================ */
.playbook-status {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: none;
    box-shadow: none;
}

.playbook-status.active {
    color: var(--status-success);
    background: var(--status-success-subtle);
}
.playbook-status.inactive {
    color: var(--text-secondary);
}
.playbook-status.draft { color: var(--warning); background: var(--status-warning-subtle); }
.playbook-status.deprecated { color: var(--muted-foreground); background: var(--muted); text-decoration: line-through; }
.playbook-status.large {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

/* ============================================
   FINDINGS TABLE
   ============================================ */
.findings-table {
    background: transparent;
    border: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Tables with action menus need visible overflow so dropdowns aren't clipped */
.findings-table.has-actions {
    overflow: visible;
}

.findings-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.findings-table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}

.findings-table thead {
    background: var(--card);
}

/* Sortable column headers — click to sort; caret shows direction.
   Severity + status are ranked semantically server-side (see DESIGN.md /
   alert_service rank maps), not alphabetically. */
.findings-table th.th-sortable,
.data-table th.th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.findings-table th.th-sortable:hover,
.data-table th.th-sortable:hover { color: var(--text-primary); }
.th-sort-caret {
    display: inline-block;
    position: relative;
    width: 10px;
    height: 15px;
    margin-left: 6px;
    opacity: 1;
    vertical-align: -2px;
    font-size: 0;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.th-sort-caret::before,
.th-sort-caret::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    transition:
        border-color var(--duration-fast) var(--ease-out),
        opacity var(--duration-fast) var(--ease-out);
}
.th-sort-caret::before {
    top: 1px;
    border-bottom: 4.5px solid currentColor;
    opacity: 0.72;
}
.th-sort-caret::after {
    bottom: 1px;
    border-top: 4.5px solid currentColor;
    opacity: 0.72;
}
.th-sort-caret.ph-caret-up::before,
.th-sort-caret.ph-caret-down::after {
    color: var(--signal-500);
    opacity: 1;
}
.th-sort-caret.ph-caret-up::after,
.th-sort-caret.ph-caret-down::before {
    opacity: 0.22;
}
.findings-table th.th-sorted,
.data-table th.th-sorted { color: var(--text-primary); }
.findings-table th.th-sorted .th-sort-caret,
.data-table th.th-sorted .th-sort-caret { opacity: 1; }
.findings-table th.th-with-filter {
    white-space: nowrap;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}
.th-with-filter {
    color: var(--text-secondary);
}
.th-header-actions,
.th-with-filter {
    user-select: none;
}
/* Unified chip — filter + sort read as one control in both themes */
.th-header-actions {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    max-width: 100%;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--foreground) 5%, transparent);
    overflow: hidden;
}
.th-filter-trigger,
.th-sort-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    line-height: 1.2;
}
.th-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 0;
    cursor: pointer;
    transition:
        background var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
}
.th-filter-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.th-filter-caret {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.9;
    transition:
        transform var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
}
.th-filter-trigger:hover,
.th-filter-trigger.is-open {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.th-filter-trigger:hover .th-filter-caret,
.th-filter-trigger.is-open .th-filter-caret {
    color: var(--text-primary);
}
.th-filter-trigger.is-open .th-filter-caret {
    transform: rotate(180deg);
}
.th-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    min-height: 28px;
    padding: 0;
    border-left: 1px solid var(--border-default);
    border-radius: 0;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 1;
    transition:
        color var(--duration-fast) var(--ease-out),
        background var(--duration-fast) var(--ease-out);
}
.th-sort-button .th-sort-caret {
    margin-left: 0;
}
.th-sort-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.th-sort-button:hover .th-sort-caret {
    color: var(--text-primary);
}
.th-filter-trigger:focus-visible,
.th-sort-button:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: -2px;
    z-index: 1;
}
.th-with-filter.th-filtered {
    color: var(--text-primary);
}
.th-with-filter.th-filtered .th-header-actions,
.th-header-actions:has(.th-filter-trigger.is-open) {
    border-color: color-mix(in srgb, var(--info) 45%, var(--border-default));
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--info) 12%, transparent),
        0 1px 0 color-mix(in srgb, var(--foreground) 5%, transparent);
}
.th-with-filter.th-filtered .th-filter-trigger,
.th-filter-trigger.is-open {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--info) 10%, var(--bg-surface));
}
.th-with-filter.th-filtered .th-filter-trigger .th-filter-caret,
.th-filter-trigger.is-open .th-filter-caret {
    color: var(--info);
    opacity: 1;
}
.th-with-filter.th-sorted .th-header-actions {
    border-color: color-mix(in srgb, var(--signal-500) 38%, var(--border-default));
}
.th-with-filter.th-sorted .th-sort-button {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--signal-500) 10%, var(--bg-surface));
}
.th-header-actions--filter-only .th-filter-trigger {
    border-radius: calc(var(--radius-md) - 1px);
}

.th-sortable-label,
.th-static-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    margin: -4px -8px;
    color: var(--text-primary);
    font-weight: 600;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--foreground) 5%, transparent);
}
.th-sortable-label {
    gap: 5px;
    transition:
        background var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
}
.findings-table th.th-static {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}
.th-static-label {
    cursor: default;
    user-select: none;
}
.findings-table th.th-sortable:hover .th-sortable-label,
.data-table th.th-sortable:hover .th-sortable-label {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}
.findings-table th.th-sortable.th-sorted .th-sortable-label,
.data-table th.th-sortable.th-sorted .th-sortable-label {
    border-color: color-mix(in srgb, var(--signal-500) 42%, var(--border-default));
    background: color-mix(in srgb, var(--signal-500) 12%, var(--bg-surface));
}
.findings-table th.th-sortable.th-sorted .th-sortable-label .th-sort-caret,
.data-table th.th-sortable.th-sorted .th-sortable-label .th-sort-caret {
    color: var(--signal-500);
}

.findings-table td {
    /* Compact density — SOC queues are high-volume; tighter rows fit ~40%
       more alerts on screen. Vertical 8px / horizontal 16px (was 16px all
       round). Font drops to --text-sm for the denser grid. */
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-subtle);
}

.findings-table tr {
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.findings-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Keyboard-focus ring for the now-clickable findings rows (rows wired to
   ``openFindingDetail`` with role="button" + tabindex=0). ``cursor: pointer``
   is already set on the row above; mouse-only hover keeps it subtle. */
.findings-table tbody tr:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* Severity row accent — the primary at-a-glance triage signal. A 3px
   left bar keyed on the row's severity, so an analyst reads severity
   without parsing the badge text. Applied as an inset box-shadow on the
   first cell (reliable under ``border-collapse: collapse``, and adds no
   layout shift the way ``border-left`` would). See frontend/DESIGN.md. */
.findings-table tbody tr.sev-critical td:first-child { box-shadow: inset 3px 0 0 0 var(--severity-critical); }
.findings-table tbody tr.sev-high td:first-child { box-shadow: inset 3px 0 0 0 var(--severity-high); }
.findings-table tbody tr.sev-medium td:first-child { box-shadow: inset 3px 0 0 0 var(--severity-medium); }
.findings-table tbody tr.sev-low td:first-child { box-shadow: inset 3px 0 0 0 var(--severity-low); }

/* ---- Inline-accordion variant of the findings table (PR #480) -------------
   Replaces the popup-modal click target with a row that toggles a detail
   panel underneath itself. The expanded row stays highlighted; the detail
   row carries no severity bar of its own and adopts the elevated bg.

   Background token choice: ``--bg-elevated`` (not ``--bg-hover``). The
   hover token in light theme is a *dark* ink overlay at 7 % opacity, which
   composites onto the table's already-tinted parent (and against the
   tinted ``--severity-*-bg`` banner inside the panel) to read as a peach
   wash. ``--bg-elevated`` is the dedicated neutral elevation token: pure
   cool-grey in both themes, no brand-colour mixing, visibly raised over
   the page background. The row → panel join stays seamless because the
   same token is applied to both the expanded row and the detail cell. */
.findings-table--accordion .finding-row.is-expanded {
    background: var(--bg-elevated);
}
.findings-table--accordion .finding-row.is-expanded + .finding-detail-row {
    background: var(--bg-elevated);
}
.findings-table--accordion .finding-expand-cell {
    width: 32px;
    padding-right: 0;
    text-align: center;
}
.findings-table--accordion .finding-chevron {
    color: var(--text-tertiary);
    font-size: var(--text-base);
    transition: transform var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
    display: inline-block;
}
.findings-table--accordion .finding-chevron--open {
    transform: rotate(90deg);
    color: var(--text-primary);
}
.findings-table--accordion .finding-detail-row > td.finding-detail-cell {
    /* Strip default row padding so the inner content owns spacing. The
       severity rail flows in from td:first-child below — DO NOT suppress
       it here, the whole point of the accordion is that the row and the
       detail panel read as one continuous block keyed by severity. */
    padding: 0;
    background: var(--bg-elevated);
    border-top: 0;
}
/* Severity rail continues from the parent row into the detail cell. We
   re-declare here (rather than inheriting) because the parent row's
   .sev-X td:first-child selector is scoped per-row, and the detail row
   needs its own .sev-X to keep the rail visually connected. The
   ``inset 3px 0 0 0 <colour>`` matches the parent row's rule exactly so
   the rail is pixel-continuous from row top to panel bottom — no gap,
   no colour change. */
.findings-table--accordion .finding-detail-row.sev-critical > td.finding-detail-cell {
    box-shadow: inset 3px 0 0 0 var(--severity-critical);
}
.findings-table--accordion .finding-detail-row.sev-high > td.finding-detail-cell {
    box-shadow: inset 3px 0 0 0 var(--severity-high);
}
.findings-table--accordion .finding-detail-row.sev-medium > td.finding-detail-cell {
    box-shadow: inset 3px 0 0 0 var(--severity-medium);
}
.findings-table--accordion .finding-detail-row.sev-low > td.finding-detail-cell {
    box-shadow: inset 3px 0 0 0 var(--severity-low);
}
.findings-table--accordion .finding-detail-row.sev-info > td.finding-detail-cell {
    box-shadow: inset 3px 0 0 0 var(--severity-info, var(--border-strong));
}
.findings-table--accordion .finding-detail-row {
    cursor: default;
}
.findings-table--accordion .finding-detail-row:hover {
    /* Keep the elevated bg — don't pick up the .findings-table tbody tr:hover
       shade (which would visually disconnect the detail panel from its
       parent row). */
    background: var(--bg-elevated);
}
/* Match the parent row's expanded bg exactly so the row → panel join is
   seamless. ``--bg-elevated`` is the same token applied on .is-expanded. */
.findings-table--accordion .finding-detail-row > td.finding-detail-cell,
.findings-table--accordion .finding-row.is-expanded + .finding-detail-row {
    background: var(--bg-elevated);
}
.finding-accordion-content {
    /* Padding starts inside the severity rail (3px) — keep the left
       padding slightly larger so text doesn't crowd the rail. No
       border, no margin-left: the rail is owned by the parent <td>
       so it stays pixel-continuous with the row above. */
    padding: var(--space-4) var(--space-5) var(--space-5) calc(var(--space-5) + 3px);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.finding-accordion-content .severity-banner,
.dark .finding-accordion-content .severity-banner {
    /* Inside the inline accordion the popup-overlay's hero strip is
       redundant — severity is already conveyed by the parent row, the
       severity badge in the row, and the rail painted by .finding-detail
       -row.sev-X above. Strip the tinted backdrop, padding, border
       (incl. the dark-theme bottom hairline) and shadow so the banner
       collapses to a quiet inline label row. The severity label + type
       badge stay on one line.

       Why not display:none? Keeping the restatement lets an analyst
       focused on the open panel still see the severity context without
       glancing back up at the row. */
    background: transparent;
    border: 0;
    border-left: 0;
    border-bottom: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    gap: var(--space-3);
}
.finding-accordion-content .severity-banner.critical,
.finding-accordion-content .severity-banner.high,
.finding-accordion-content .severity-banner.medium,
.finding-accordion-content .severity-banner.low {
    /* Override the per-severity backdrop + left-border from the popup
       overlay variant — same reason as above. The severity dot in
       ``.severity-label::before`` still carries the colour cue. */
    background: transparent;
    border-left: 0;
}
.finding-accordion-content .severity-banner .severity-label {
    /* De-emphasise: this is a section label, not a hero title. The dot
       glyph in ::before still renders so the severity colour is visible
       inline with the label text. */
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-secondary);
}
.finding-accordion-content .detail-section {
    /* Sections are denser inline than in the popup overlay. */
    background: transparent;
    padding: 0;
    border: 0;
    margin: 0;
}
.finding-accordion-content .detail-section h4 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    font-weight: 600;
}
.finding-accordion-content .finding-description-text {
    margin: 0;
    color: var(--text-primary);
}
.finding-accordion-content .finding-metadata-footer {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle, var(--border));
}

.finding-title {
    font-weight: 500;
    color: var(--text-primary);
}

.col-entity-id {
    width: 220px;
    max-width: 230px;
    white-space: nowrap;
}

.entity-id-token {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bg-tertiary) 74%, transparent);
    color: var(--text-secondary);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11.5px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.entity-id-token:hover,
.entity-id-token:focus-visible {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-elevated));
    outline: none;
}

.entity-id-token i {
    flex: 0 0 auto;
    font-size: 12px;
}

.entity-id-token__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Keyboard focus affordance. Findings/cases rows are role=button; alert
   rows keep their interactive children (checkbox/assignee/promote) so the
   title cell is the keyboard entry point instead of the whole row. */
.findings-table tbody tr:focus-visible,
.findings-table .finding-title:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
    background: var(--bg-hover);
}

/* Bulk action bar — selection mode toolbar; matches filter-bar + table header chips */
.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    box-shadow:
        inset 3px 0 0 var(--info),
        0 1px 0 color-mix(in srgb, var(--foreground) 4%, transparent),
        0 4px 14px color-mix(in srgb, var(--foreground) 5%, transparent);
    animation: bulk-bar-in var(--duration-normal) var(--ease-out);
}

@keyframes bulk-bar-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bulk-action-bar__summary,
.bulk-action-bar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.bulk-action-bar__summary {
    min-width: 0;
    flex: 1 1 420px;
    max-width: 560px;
    flex-wrap: wrap;
}

.bulk-action-bar__divider {
    flex-shrink: 0;
    align-self: stretch;
    width: 1px;
    min-height: 28px;
    background: var(--border-subtle);
    margin: 0 var(--space-1);
}

.bulk-action-bar__actions {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bulk-action-button,
.bulk-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0 var(--space-3);
    cursor: pointer;
    box-shadow: 0 1px 0 color-mix(in srgb, var(--foreground) 4%, transparent);
    transition:
        background var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out);
}

.bulk-icon-button {
    width: 28px;
    padding: 0;
}

.bulk-action-button:hover:not(:disabled),
.bulk-icon-button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.bulk-action-button:focus-visible,
.bulk-icon-button:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

.bulk-action-button:disabled,
.bulk-icon-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bulk-action-button--promote:not(:disabled) {
    border-color: color-mix(in srgb, var(--signal-500) 38%, var(--border-default));
    background: color-mix(in srgb, var(--signal-500) 10%, var(--bg-surface));
}

.bulk-action-button--promote:not(:disabled):hover {
    background: color-mix(in srgb, var(--signal-500) 16%, var(--bg-surface));
    border-color: color-mix(in srgb, var(--signal-500) 48%, var(--border-default));
}

.bulk-icon-button--dismiss {
    color: var(--text-secondary);
}

.bulk-icon-button--dismiss:hover:not(:disabled) {
    color: var(--text-primary);
}

.bulk-count {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    min-height: 28px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--info) 32%, var(--border-subtle));
    background: color-mix(in srgb, var(--info) 10%, var(--bg-surface));
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.bulk-count i {
    color: var(--info);
    font-size: 1rem;
}

.bulk-meta,
.bulk-message {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    padding: 0 var(--space-3);
    min-height: 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    background: var(--bg-elevated);
    font-size: var(--text-sm);
    font-weight: 500;
}

.bulk-meta i {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.bulk-message {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--warning) 34%, var(--border-subtle));
    background: var(--status-warning-subtle);
    max-width: min(560px, 52vw);
}

.bulk-message i {
    color: var(--warning);
    flex-shrink: 0;
}

.bulk-message span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Row selection state */
.findings-table tr.row-selected td {
    background: color-mix(in srgb, var(--info) 8%, var(--bg-surface));
}

.modal-panel--bulk-status {
    width: min(560px, calc(100vw - 32px));
}

.modal-title-context {
    margin: var(--space-1) 0 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.findings-table .col-check {
    width: 36px;
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
}

@media (max-width: 900px) {
    .bulk-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .bulk-action-bar__divider {
        display: none;
    }

    .bulk-action-bar__summary,
    .bulk-action-bar__actions {
        width: 100%;
    }

    .bulk-action-bar__actions {
        justify-content: flex-start;
    }

    .bulk-message {
        max-width: 100%;
    }
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: var(--bg-active);
    color: var(--text-secondary);
}

/* Unified on the ``--severity-*`` tokens so a badge's color is the exact
   same hue as the row's left-accent (C1) and the theme's intended
   contrast pairs apply — previously these used ad-hoc ``oklch()``
   literals that drifted from the tokens. See frontend/DESIGN.md. */
.severity-badge.critical { color: var(--severity-critical); background: var(--severity-critical-bg); }
.severity-badge.high { color: var(--severity-high); background: var(--severity-high-bg); }
.severity-badge.medium { color: var(--severity-medium); background: var(--severity-medium-bg); }
.severity-badge.low { color: var(--severity-low); background: var(--severity-low-bg); }
.severity-badge.info,
.severity-badge.informational { color: var(--info); background: var(--status-info-subtle); }

.type-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.alert-link {
    color: var(--primary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.alert-link:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}


/* ============================================
   APT GRID - Premium Threat Actor Cards
   (Uses --list-card-width/height for alignment with Tasks page)
   ============================================ */
.apt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    gap: var(--card-grid-gap);
    margin-top: var(--space-4);
}

.apt-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: var(--list-card-min-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    padding-top: var(--space-3);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    overflow: hidden;
}

/* Risk meter at top - uses --risk-pct (0%–100%) from inline style */
.apt-risk-meter {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-overlay);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.apt-risk-meter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--risk-pct, 50%);
    max-width: 100%;
    background: linear-gradient(90deg, var(--severity-low), var(--severity-medium), var(--severity-high), var(--severity-critical));
    border-radius: var(--radius-lg) 0 0 0;
    transition: width var(--duration-normal) var(--ease-out);
}

/* Subtle border glow below risk meter */
.apt-card::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border-subtle) 30%,
        var(--text-tertiary) 50%,
        var(--border-subtle) 70%,
        transparent 100%
    );
    opacity: 0.5;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.apt-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--border-subtle),
        0 8px 32px var(--shadow-glow);
}

.apt-card:hover::before {
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 30%,
        var(--accent) 70%,
        transparent 100%
    );
    opacity: 1;
}

.apt-card.inactive {
    opacity: 0.5;
    filter: grayscale(30%);
}

.apt-card.inactive:hover {
    opacity: 0.7;
    filter: grayscale(10%);
}

.apt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apt-origin {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    background: var(--bg-overlay);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Country-specific origin colors */
.apt-origin.russia {
    color: var(--severity-critical);
    background: var(--severity-critical-bg);
    border-color: transparent;
}

.apt-origin.china {
    color: var(--severity-high);
    background: var(--severity-high-bg);
    border-color: transparent;
}

.apt-origin.north.korea,
.apt-origin[class*="north korea"] {
    color: var(--severity-medium);
    background: var(--severity-medium-bg);
    border-color: transparent;
}

.apt-origin.iran {
    color: var(--accent-secondary);
    background: var(--accent-subtle);
    border-color: transparent;
}

.apt-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.apt-status.active {
    color: var(--status-success);
}

/* Pulsing dot for active status */
.apt-status.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-success);
    animation: pulse 2s var(--ease-out) infinite;
}

.apt-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
    transition: color var(--duration-fast) var(--ease-out);
}

.apt-card:hover .apt-name {
    color: var(--primary);
}

.apt-card .apt-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--text-sm);
}

.apt-aliases {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.alias-tag {
    padding: var(--space-1) var(--space-3);
    background: var(--bg-overlay);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.apt-card:hover .alias-tag {
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.connector-tag {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all var(--duration-fast) var(--ease-out);
}

.connector-tag.required.ok {
    background: var(--status-success-subtle);
    color: var(--status-success);
    border: 1px solid var(--status-success-subtle);
}

.connector-tag.required.missing {
    background: var(--status-danger-subtle);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-subtle);
}

.connector-tag.optional {
    background: var(--bg-overlay);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.connector-tag.optional.ok {
    background: var(--status-info-subtle);
    color: var(--info);
    border: 1px solid var(--status-info-subtle);
}

.apt-card:hover .connector-tag.required.ok {
    border-color: var(--status-success);
}

.apt-card:hover .connector-tag.required.missing {
    border-color: var(--status-danger);
}

.apt-card:hover .connector-tag.optional {
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.apt-card:hover .connector-tag.optional.ok {
    border-color: var(--info);
}

.apt-meta {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.apt-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.apt-meta i {
    color: var(--primary);
    opacity: 0.7;
}

.apt-sectors {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.sector-tag {
    font-size: 10px;
    padding: 1px var(--space-2);
    text-transform: capitalize;
}

.apt-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
}

.apt-actions-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.apt-iocs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.apt-iocs i {
    color: var(--primary);
}

.playbook-last-run {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.playbook-last-run i {
    color: var(--text-tertiary);
}

.apt-confidence {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--bg-active);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.apt-confidence.high {
    color: var(--status-success);
    background: var(--status-success-subtle);
}

.apt-confidence.medium {
    color: var(--severity-medium);
    background: var(--severity-medium-bg);
}

.apt-confidence.low {
    color: var(--text-secondary);
    background: var(--bg-overlay);
}

/* ============================================
   TASKS PAGE — Modern, compact layout
   ============================================ */
.tasks-page {
    padding-bottom: var(--space-8);
}

/* Tasks page uses shared section-header + filter-bar (same as threats/apt-groups) */

/* Fixed-size grid: same as APT grid (--list-card-width/height) for consistent alignment */
.tasks-page .tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    gap: var(--card-grid-gap);
    margin-top: 0;
}

/* Task card — aligned with APT cards */
.tasks-page .task-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: var(--list-card-min-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tasks-page .task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--border-subtle);
    transition: background var(--duration-fast);
}

.tasks-page .task-card:hover {
    border-color: var(--accent-subtle);
    box-shadow: var(--shadow-md);
}

.tasks-page .task-card:hover::before {
    background: var(--accent);
}

.tasks-page .task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
}

.tasks-page .task-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tasks-page .task-badge {
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: var(--bg-overlay);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.tasks-page .task-badge.ai {
    color: var(--primary);
    background: var(--accent-surface, var(--bg-overlay));
    border-color: transparent;
}

.tasks-page .task-trigger-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-overlay);
    color: var(--text-secondary);
}

.tasks-page .task-status {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: capitalize;
    color: var(--text-secondary);
}

.tasks-page .task-status.active {
    color: var(--status-success);
}

.tasks-page .task-icon-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.tasks-page .task-icon-name i {
    font-size: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.tasks-page .task-name {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: var(--tracking-tight);
    margin: 0;
    line-height: 1.3;
    transition: color var(--duration-fast);
}

.tasks-page .task-card:hover .task-name {
    color: var(--primary);
}

.tasks-page .task-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 4px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

/* Card info: role + skills in one row */
.tasks-page .task-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: auto;
    min-height: 0;
}

.tasks-page .task-card-info .task-role-badge {
    margin: 0;
}

.tasks-page .task-card-info .task-skills {
    margin: 0;
    flex-shrink: 0;
}

.tasks-page .task-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: 0;
}

.tasks-page .task-role-badge {
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--status-info-subtle, var(--accent-surface));
    color: var(--status-info, var(--info));
    font-weight: 500;
}

.tasks-page .task-execution-badge.container {
    font-size: var(--text-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-surface);
    color: var(--accent-secondary);
}

.tasks-page .task-connectors {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
    margin-bottom: 0;
}

.tasks-page .task-connector-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.tasks-page .task-skills {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Connector requirement pills on task cards */
.tasks-page .task-connectors {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--space-2);
    margin-bottom: var(--space-1);
}

.tasks-page .task-connector-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: default;
    transition: opacity 0.15s;
}

.tasks-page .task-connector-tag i {
    font-size: 11px;
}

/* Required — missing (red) */
.tasks-page .task-connector-tag.required.missing {
    background: var(--status-danger-subtle, var(--severity-critical-bg));
    color: var(--status-danger, var(--destructive));
    border: 1px solid oklch(from var(--destructive) l c h / 0.25);
}

/* Required — configured (green) */
.tasks-page .task-connector-tag.required.ok {
    background: var(--status-success-subtle);
    color: var(--status-success);
    border: 1px solid oklch(from var(--status-success) l c h / 0.25);
}

/* Optional — not configured (muted) */
.tasks-page .task-connector-tag.optional {
    background: var(--bg-active);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Optional — configured (blue tint) */
.tasks-page .task-connector-tag.optional.ok {
    background: var(--accent-surface);
    color: var(--primary);
    border: 1px solid var(--accent-subtle);
}

.tasks-page .task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-3);
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    gap: var(--space-3);
}

.tasks-page .task-last-run {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    padding-top: 0;
    border-top: none;
}

.tasks-page .task-last-run i {
    color: var(--text-secondary);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .page-content .tasks-page .tasks-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .apt-grid,
    .tasks-page .tasks-grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
    .apt-card,
    .tasks-page .task-card {
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        min-height: 0;
        max-height: none;
    }
}

/* ============================================
   TASK HISTORY
   ============================================ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.history-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.history-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--border-subtle);
    transition: background var(--duration-fast);
}

.history-card:hover {
    border-color: var(--accent-subtle);
    box-shadow: var(--shadow-sm);
}

.history-card:hover::before {
    background: var(--accent);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}

.history-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
}

.history-info i {
    font-size: 18px;
    color: var(--status-success);
    flex-shrink: 0;
}

.history-task-name {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
}

.task-run-status-badge {
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    text-transform: capitalize;
}

.task-run-status-badge.completed {
    background: var(--status-success-subtle);
    color: var(--status-success);
}

.task-run-status-badge.running {
    background: var(--status-info-subtle, var(--accent-surface));
    color: var(--status-info, var(--info));
}

.task-run-status-badge.queued {
    background: var(--accent-surface);
    color: var(--accent-secondary);
}

.task-run-status-badge.failed {
    background: var(--status-danger-subtle, var(--severity-critical-bg));
    color: var(--status-danger, var(--destructive));
}

.task-run-status-badge.cancelled {
    background: var(--bg-active);
    color: var(--text-secondary);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* History action buttons (view/download) – icons only, no boxes */
.history-actions .btn-icon.small {
    width: auto;
    height: auto;
    padding: 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out);
}

.history-actions .btn-icon.small i {
    font-size: var(--text-base);
}

.history-actions .btn-icon.small:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.history-details {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.history-timestamp,
.history-duration {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.history-timestamp i,
.history-duration i {
    font-size: 14px;
    opacity: 0.8;
}

.history-error {
    font-size: var(--text-sm);
    color: var(--severity-critical);
    padding: var(--space-2);
    background: var(--status-danger-subtle, var(--severity-critical-bg));
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--severity-critical);
    margin-top: var(--space-2);
}

.history-triggered-by,
.history-repo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-detail-panel {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-value.mono {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    word-break: break-all;
}

.detail-section {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-default);
}

.triage-feedback {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.triage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-inset);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    font-size: var(--text-base);
}

.triage-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Investigation Notes */
.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.notes-header h4 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.notes-textarea {
    width: 100%;
    padding: var(--space-3);
    background: var(--bg-inset);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    resize: vertical;
    line-height: 1.6;
    transition: border-color var(--duration-fast) var(--ease-out);
    box-sizing: border-box;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px oklch(from var(--primary) l c h / 0.15);
}

.notes-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.notes-text {
    white-space: pre-wrap;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-inset);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin: 0;
}

.detail-params {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.detail-param {
    display: flex;
    gap: var(--space-1);
    font-size: var(--text-xs);
    background: var(--bg-inset);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.param-key {
    color: var(--text-muted);
    font-weight: 600;
}

.param-val {
    color: var(--text-primary);
    font-family: var(--font-mono);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-details {
        flex-wrap: wrap;
    }
}

/* Global task card (used outside tasks page if any) and shared base */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-fixed-width), 1fr));
    gap: var(--card-grid-gap);
    margin-top: var(--space-4);
}

.task-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: var(--card-fixed-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--card-padding);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border-subtle) 30%,
        var(--text-tertiary) 50%,
        var(--border-subtle) 70%,
        transparent 100%
    );
    opacity: 0.5;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.task-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--border-subtle),
        0 8px 32px var(--shadow-glow);
}

.task-card:hover::before {
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 30%,
        var(--accent) 70%,
        transparent 100%
    );
    opacity: 1;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    background: var(--bg-overlay);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.task-badge.ai {
    color: var(--primary);
    background: var(--accent-subtle, var(--bg-overlay));
    border-color: transparent;
}

.task-badge.human {
    color: var(--text-secondary);
    background: var(--bg-overlay);
}

.task-status {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text-secondary);
}

.task-status.active {
    color: var(--status-success);
}

.task-status.idle {
    color: var(--text-secondary);
}

.task-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: var(--tracking-tight);
    transition: color var(--duration-fast) var(--ease-out);
}

.task-card:hover .task-name {
    color: var(--primary);
}

.task-role {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.task-stats {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-top: var(--space-2);
    margin-top: auto;
}

.task-tasks {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.task-tasks i {
    color: var(--primary);
}

.task-last-run {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-4);
}

.task-last-run i {
    color: var(--primary);
    opacity: 0.7;
}


/* ============================================
   CONNECTORS GRID
   ============================================ */
.connectors-list-wrap {
    margin-top: var(--space-5);
}

.connectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-fixed-width), 1fr));
    gap: var(--card-grid-gap);
}

.connectors-scroll-sentinel,
.tasks-scroll-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Middle body — Connectors: 4-column fixed grid, golden ratio proportions */
.page-content .settings-page .connectors-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-top: var(--space-4);
    align-items: stretch;
}

.page-content .settings-page .connector-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 260px;
    max-height: none;
    overflow: visible;
    box-sizing: border-box;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
}

@media (max-width: 1100px) {
    .page-content .settings-page .connectors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .page-content .settings-page .connectors-grid {
        grid-template-columns: 1fr;
    }
}

.spinner.small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.connector-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: var(--card-fixed-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--card-padding);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.connector-card:hover {
    /* Subtle brand-orange accent on hover so the card reads as
       interactive — matches the active chip + sidebar indicator color
       so the brand identity stays consistent. ``color-mix`` keeps the
       border subtle (40% mix toward the brand) instead of a hard orange
       outline which would feel aggressive on a list of cards. */
    border-color: color-mix(in srgb, var(--signal-500) 40%, var(--border-subtle));
    transform: translateY(-2px);
    box-shadow:
        var(--shadow-md),
        0 4px 12px color-mix(in srgb, var(--signal-500) 8%, transparent);
}

.connector-card:hover .connector-icon {
    /* Icon swatch also picks up a brand-orange tint on hover (subtle
       inner shadow) to reinforce that the card is interactive. The
       icon glyph color stays as ``text-secondary`` so vendor logos
       (GitHub, Splunk, …) don't get recoloured. */
    border-color: color-mix(in srgb, var(--signal-500) 35%, var(--border-subtle));
    background: color-mix(in srgb, var(--signal-500) 8%, var(--bg-overlay));
}

.connector-card.error {
    border-color: var(--severity-critical);
    border-left: 3px solid var(--severity-critical);
    background: var(--severity-critical-bg);
}

.connector-card.warning {
    border-color: var(--severity-high);
    border-left: 3px solid var(--severity-high);
}

.connector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.connector-icon {
    width: clamp(40px, 2.5vw, 48px);
    height: clamp(40px, 2.5vw, 48px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-spring);
}

.connector-card:hover .connector-icon {
    transform: scale(1.05);
}

.connector-icon i {
    font-size: clamp(18px, 1.2vw, 22px);
    color: var(--text-secondary);
}

/* Stub integration indicators */
.stub-badge {
    margin-left: auto;
    padding: 4px 10px;
    background: var(--status-warning-subtle);
    color: var(--status-warning);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
    line-height: 1;
    pointer-events: none;
}

.stub-connector {
    border: 1px dashed var(--border-subtle);
    opacity: 0.85;
}

.stub-connector:hover {
    opacity: 1;
}

.stub-integration {
    opacity: 0.7;
}

.status-badge {
    font-size: 0.85em;
    opacity: 0.7;
    margin-left: 4px;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.connector-status {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: var(--bg-active);
    color: var(--text-secondary);
}

.connector-status.connected {
    color: var(--status-success);
    background: var(--status-success-subtle);
}
.connector-status.degraded {
    color: var(--status-warning);
    background: var(--status-warning-subtle);
}
.connector-status.disconnected {
    color: var(--severity-critical);
    background: var(--severity-critical-bg);
}
.connector-status.error { color: var(--destructive); background: var(--status-danger-subtle); }
.connector-status.configuring { color: var(--info); background: var(--status-info-subtle); }
.connector-status.large {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.connector-name {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

.connector-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-4);
    align-items: start;
    min-width: 0;
}

.connector-body-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}

.connector-category {
    display: block;
    margin: 0;
}

.connector-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: right;
}

.connector-stats span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.connector-sync {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-quaternary);
}

.sync-time {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.connector-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

.connector-actions .btn-secondary,
.connector-actions .btn-primary,
.connector-actions .btn-danger-subtle {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
}

/* ============================================
   TEAM MEMBERS
   ============================================ */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.team-member-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.team-member-card:hover {
    background: var(--bg-overlay);
    border-color: var(--border-default);
}

.team-member-avatar {
    width: clamp(44px, 3vw, 56px);
    height: clamp(44px, 3vw, 56px);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-lg);
    box-shadow: 0 4px 12px var(--accent-subtle);
}

.team-member-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.team-member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-base);
}

.team-member-email {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.team-member-role {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.team-member-status {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: var(--bg-active);
    color: var(--text-secondary);
}

.team-member-status.active {
    color: var(--status-success);
    background: var(--status-success-subtle);
}
.team-member-status.inactive { color: var(--text-secondary); }

.team-member-last-active {
    font-size: var(--text-sm);
    color: var(--text-quaternary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ============================================
   LIVE FEED PANEL — below Alert Triage on the Live Alerts tab
   ============================================ */
.live-feed-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-top: var(--space-5);
    overflow: hidden;
}

.live-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color var(--duration-fast) var(--ease-out);
}

.live-feed-panel--collapsed .live-feed-header {
    border-bottom-color: transparent;
}

.live-feed-header:hover,
.live-feed-header:focus-visible {
    background: var(--bg-overlay);
    outline: none;
}

.live-feed-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.live-feed-header-left h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.live-feed-header-left > i {
    color: var(--signal-500);
    font-size: var(--text-lg);
}

.live-feed-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.live-feed-count {
    color: var(--text-secondary);
}

.live-feed-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--signal-500) 14%, transparent);
    color: var(--signal-500);
    font-size: var(--text-xs);
    font-weight: 500;
}

.live-feed-status.paused {
    background: var(--bg-overlay);
    color: var(--text-quaternary);
}

.live-feed-header-right {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.live-feed-body {
    padding: var(--space-3) var(--space-4) var(--space-4);
}

.live-feed-body .live-events-list {
    margin-top: 0;
}

/* Row action button: hide label on narrow screens (icon-only) */
@media (max-width: 640px) {
    .row-action-btn-label { display: none; }
}

/* ============================================
   LIVE EVENTS
   ============================================ */
.live-events-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.live-event-row {
    display: grid;
    grid-template-columns: 90px 1fr auto auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--border-default);
    font-size: var(--text-base);
    transition: all var(--duration-fast) var(--ease-out);
}

.live-event-row:hover {
    background: var(--bg-overlay);
}

/* Live Feed: cell types for grid layout (time / message / source / badge) */
.live-event-time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-quaternary);
    white-space: nowrap;
}
.live-event-message {
    font-size: var(--text-sm);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-event-source {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.live-event-row.critical {
    border-left-color: var(--severity-critical);
    background: var(--severity-critical-bg);
}
.live-event-row.high { border-left-color: var(--severity-high); }
.live-event-row.medium { border-left-color: var(--severity-medium); }
.live-event-row.low,
.live-event-row.info { border-left-color: var(--text-quaternary); }

.live-event-time {
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--text-quaternary);
}

.live-event-source {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ============================================
   PREFERENCES FORM - Premium Settings Experience
   ============================================ */
.preferences-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--card-grid-gap);
    margin-top: var(--space-5);
}

.pref-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
    overflow: visible;
}

.pref-section::before {
    display: none;
}

.pref-section:hover::before {
    display: none;
}

.pref-section h4 {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    letter-spacing: var(--tracking-tight);
}

.pref-section h4 i {
    font-size: var(--text-lg);
    color: var(--primary);
}

.pref-section h4::before {
    display: none;
}

.pref-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-out);
}

.pref-row:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.pref-row:hover {
    background: var(--bg-hover-strong);
}

.pref-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
}

.pref-label i {
    font-size: var(--text-base);
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Custom toggle switch */
.pref-row input[type="checkbox"] {
    position: relative;
    width: 44px;
    height: 24px;
    margin: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: var(--toggle-track-off);
    border-radius: var(--radius-full);
    border: 1px solid var(--toggle-border);
    box-shadow: inset 0 1px 2px rgba(11,15,20,.12);
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.pref-row input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--toggle-thumb);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(11,15,20,.2);
    transition: transform 0.2s ease;
}

.pref-row input[type="checkbox"]:checked {
    background: var(--toggle-track-on);
    border-color: var(--toggle-track-on);
    box-shadow: inset 0 1px 2px rgba(11,15,20,.15);
}

.pref-row input[type="checkbox"]:checked::before {
    transform: translateX(20px);
    background: var(--toggle-thumb);
}

.pref-row input[type="checkbox"]:hover {
    border-color: var(--border-strong);
}

.pref-row input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.pref-row input[type="checkbox"]:checked:hover {
    border-color: var(--toggle-track-on);
}

.pref-row select {
    padding: var(--space-2) var(--space-4);
    padding-right: var(--space-8);
    background: var(--bg-surface);
    border: 1px solid var(--border, oklch(0.75 0.005 260));
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--duration-fast) var(--ease-out);
    min-width: 140px;
}

.pref-row select:hover,
.pref-row select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px oklch(0.55 0.15 250 / 0.15);
}

.pref-row select option {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: var(--space-2);
}

/* Preferences placeholder/promo state */
.preferences-promo,
.subtab-content .settings-content:has(> :only-child:not(.preferences-form)) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-9);
    min-height: 400px;
}

.preferences-promo-icon,
.settings-content > div:only-child:not(.preferences-form) > *:first-child {
    width: clamp(64px, 5vw, 80px);
    height: clamp(64px, 5vw, 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
    font-size: var(--text-3xl);
    color: var(--text-secondary);
}

/* Reporting settings - template config & generate */
.reporting-settings .settings-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.report-template-form,
.report-generate-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    max-width: 560px;
}

/* Collapsible report sections (accordion) */
.report-template-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 760px;
}

.report-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--duration-fast);
}

.report-section:hover {
    border-color: var(--border-default);
}

.report-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--duration-fast);
}

.report-section-header:hover {
    background: var(--bg-elevated);
}

.report-section-header:active {
    background: var(--bg-overlay);
}

.report-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.report-section-title i {
    font-size: var(--text-lg);
    color: var(--primary);
}

.report-section-title h4 {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: var(--tracking-tight);
}

.report-section-header > i {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast);
}

.report-section-header:hover > i {
    color: var(--text-secondary);
}

.report-section-content {
    padding: 0 var(--space-5) var(--space-5) var(--space-5);
}

/* Expand transition for collapsible sections */
.expand-enter-active,
.expand-leave-active {
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
}

.expand-enter-from,
.expand-leave-to {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.expand-enter-to,
.expand-leave-from {
    opacity: 1;
    max-height: 1000px;
}

.reporting-settings .section-header-spaced {
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-subtle);
}

.reporting-settings .report-generate-inline {
    margin-top: var(--space-8);
}

/* Generate report form (shared: inline + modal) */
.report-generate-form .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
    gap: var(--space-5);
    align-items: flex-end;
}

.report-generate-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.report-generate-form .form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.report-generate-form .form-input,
.report-generate-form .date-input {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.report-generate-form .date-range-row {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.report-generate-form .date-range-row .date-input {
    flex: 1;
    min-width: 0;
}

.reporting-settings .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.reporting-settings .form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.reporting-settings .form-label i {
    color: var(--primary);
    opacity: 0.9;
}

.reporting-settings .form-input {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

/* Modern selects across settings (report format etc.) */
.reporting-settings select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: var(--space-6);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
}

.reporting-settings .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.reporting-settings .form-input::placeholder {
    color: var(--text-secondary);
}

/* Dark theme – ensure date inputs and selects match dark palette */
.dark .reporting-settings .form-input[type="date"],
.dark .reporting-settings .form-input[type="text"],
.dark .reporting-settings .form-input[type="number"],
.dark .reporting-settings .form-input select {
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.dark .reporting-settings .form-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}

.reporting-settings .form-hint {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.reporting-settings .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
}

.reporting-settings .form-row-2 {
    grid-template-columns: 1fr auto;
}

/* Generate report – date range row */
.reporting-settings .date-range-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.reporting-settings .date-range-row .date-input {
    flex: 1;
    min-width: 0;
}

.reporting-settings .date-sep {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.reporting-settings .form-group-inline .form-inline-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.reporting-settings .form-input-narrow {
    width: 5rem;
    min-width: 4rem;
}

.reporting-settings .form-inline-sep {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.reporting-settings .form-input[type="number"] {
    width: auto;
}

.reporting-settings code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.reporting-settings .form-actions {
    margin-top: var(--space-2);
    display: flex;
    justify-content: flex-start;
}

.reporting-settings .form-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.reporting-settings .form-actions .spinner.small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* Generate report - modern card styling */
.reporting-settings .report-generate-form {
    margin-top: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 900px) {
    .reporting-settings .report-generate-form .form-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ============================================
   OVERLAY PANEL - Premium Slide-Out
   ============================================ */
.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.overlay-panel {
    width: min(560px, 95vw);
    max-height: 85vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.overlay-backdrop:has(.overlay-panel--alert) {
    padding: var(--space-4);
}

.overlay-panel--alert {
    /* Widened from 580px → 760px so long PowerShell command lines and
       base64 payloads have room to breathe, and the 3-column DETAILS
       grid below gets ~225px per card instead of cramped ~170px. The
       viewport cap (calc(100vw - 48px)) keeps narrow screens safe. */
    width: min(760px, calc(100vw - 2 * var(--space-6)));
    max-width: 760px;
    max-height: min(88vh, 820px);
    min-height: 0;
    overflow: visible;
    box-shadow: var(--shadow-xl);
}

.overlay-panel--alert .overlay-header h2 {
    font-size: var(--text-xl);
    line-height: var(--leading-tight);
    margin-top: 0;
}

.overlay-panel--alert .overlay-subtitle {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.alert-header-byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.alert-header-byline__source {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.alert-header-byline__sep {
    color: var(--text-quaternary);
    user-select: none;
}

.alert-header-byline__time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.alert-header-byline__tenant {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
}
.alert-header-byline__tenant .ph { font-size: 0.95rem; opacity: .85; }

.alert-header-byline .alert-header-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.overlay-subtitle--muted {
    display: block;
    color: var(--text-tertiary) !important;
}

.overlay-header--alert {
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    overflow: visible;
    z-index: 25;
}

.overlay-header--alert::after {
    display: none;
}

.alert-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.alert-workflow {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    flex-shrink: 0;
}

.alert-workflow__bar {
    display: flex;
    gap: 6px;
    height: 4px;
}

.alert-workflow__segment {
    flex: 1 1 0;
    border-radius: var(--radius-full);
    background: var(--border-subtle);
    transition: background var(--duration-fast) var(--ease-out);
}

.alert-workflow__segment.is-done {
    background: var(--ink-300);
}

.dark .alert-workflow__segment.is-done {
    background: var(--ink-600);
}

.alert-workflow__segment.is-active {
    background: var(--signal-500);
    box-shadow: 0 0 8px rgba(232, 162, 58, .35);
}

.alert-workflow__labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.alert-workflow__labels span {
    font-size: var(--text-xs);
    line-height: 1.3;
    font-weight: 600;
    text-align: center;
    color: var(--text-quaternary);
}

.alert-workflow__labels span.is-done {
    color: var(--text-tertiary);
}

.alert-workflow__labels span.is-active {
    color: var(--signal-500);
}

.dark .alert-workflow__labels span.is-active {
    color: var(--signal-300);
}

.overlay-panel--alert .overlay-body {
    flex: 1 1 auto;
    min-height: 0;
}

.overlay-content--alert {
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5) var(--space-5);
}

.alert-severity-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-active);
}

.alert-severity-strip__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.alert-severity-strip__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.alert-severity-strip__label.critical .alert-severity-strip__dot { background: var(--severity-critical); }
.alert-severity-strip__label.high .alert-severity-strip__dot { background: var(--severity-high); }
.alert-severity-strip__label.medium .alert-severity-strip__dot { background: var(--severity-medium); }
.alert-severity-strip__label.low .alert-severity-strip__dot { background: var(--severity-low); }

.alert-detail-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.alert-detail-section__label {
    margin: 0;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Resolution block (SL#7): closure verdict + comment shown on terminal alerts. */
.alert-resolution__comment-label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.alert-resolution__comment {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    /* Preserve analyst line breaks; wrap long tokens so the panel never overflows. */
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

/* Verdict badge — reuse the status palette; colour by verdict. */
.verdict-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill, 999px);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: capitalize;
    background: var(--bg-subtle, rgba(127, 127, 127, 0.12));
    color: var(--text-secondary);
}

.verdict-badge.true_positive {
    background: var(--danger-soft, rgba(220, 38, 38, 0.12));
    color: var(--danger, #dc2626);
}

.verdict-badge.false_positive,
.verdict-badge.benign {
    background: var(--success-soft, rgba(22, 163, 74, 0.12));
    color: var(--success, #16a34a);
}

.alert-detail-section__text {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
}

.detail-grid--alert {
    grid-template-columns: 1fr;
    gap: var(--space-2);
}

.detail-grid--alert .detail-item {
    padding: var(--space-3) var(--space-4);
}

.alert-detail-section--notes {
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle);
}

.alert-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.alert-detail-section--notes .notes-textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

.alert-detail-section--notes .notes-text,
.alert-detail-section--notes .notes-empty {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
}

.alert-detail-section--notes .notes-empty {
    color: var(--text-tertiary);
    font-style: italic;
}

.alert-detail-section--notes .notes-actions {
    display: flex;
    gap: var(--space-2);
}

.alert-detail-section .technique-name {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.alert-detail-section .triage-feedback {
    padding-left: var(--space-1);
}

/* Structured process-context block (Wazuh decoder output). Replaces the
   wall of raw log text the alert modal used to show as its primary view. */
.alert-process-context {
    display: grid;
    grid-template-columns: minmax(110px, max-content) 1fr;
    gap: var(--space-2) var(--space-3);
    margin: 0;
}
.alert-process-context dt {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 4px;
}
.alert-process-context dd {
    margin: 0;
    word-break: break-word;
    /* Without min-width: 0, a grid cell takes the intrinsic width of its
       children — a <pre> with white-space: pre forces the cell to expand
       past the modal, then the modal can't clip and the page itself
       starts overflowing. min-width: 0 lets the cell shrink so the
       codeblock's own overflow-x scroll (or wrap variant) actually kicks in. */
    min-width: 0;
}
.alert-codeblock {
    margin: 0;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-secondary, color-mix(in srgb, var(--text) 6%, transparent));
    border-radius: 4px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    font-size: var(--text-xs);
    overflow-x: auto;
    white-space: pre;
    max-width: 100%;
}
.alert-codeblock--wrap {
    white-space: pre-wrap;
    /* overflow-wrap: anywhere prefers space-breaks (good for commands)
       but falls back to mid-token break (good for base64). Better than
       word-break: break-all, which always shatters words mid-character. */
    overflow-wrap: anywhere;
    word-break: normal;
    /* Cap tall expansions (a full base64 payload could be 30+ lines)
       and let the user scroll within instead of stretching the modal. */
    max-height: 240px;
    overflow-y: auto;
}
.alert-encoded-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    /* Same flex-shrink problem as the dd above — without min-width: 0
       the long <code> child sets the min-content and the wrap doesn't
       constrain. */
    min-width: 0;
    max-width: 100%;
}
.alert-encoded {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    font-size: var(--text-xs);
    color: var(--text);
    word-break: break-all;
    min-width: 0;
    flex: 1 1 auto;
}
.alert-expand-details {
    margin-top: var(--space-2);
}
/* Raw payload collapsible now sits inside the Details section — give it a
   little breathing room below the detail grid + a divider. */
.alert-raw-details--in-detail {
    margin-top: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle, var(--border-color, #2a2a3a));
}
.alert-expand-details > summary,
.alert-raw-details > summary {
    cursor: pointer;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.alert-expand-details > summary:hover,
.alert-raw-details > summary:hover {
    color: var(--text);
}
.alert-detail-section__text--raw {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    font-size: var(--text-xs);
    background: var(--bg-secondary, color-mix(in srgb, var(--text) 6%, transparent));
    padding: var(--space-2) var(--space-3);
    border-radius: 4px;
    margin-top: var(--space-2);
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

/* Raw alert payload JSON viewer (bottom of the alert overlay). Reuses the
   .alert-raw-details chip summary; the <pre> here is the scrollable,
   monospace, bordered JSON body. Theme-agnostic — every colour resolves
   through a token so it reads correctly in both dark and light. */
.alert-raw-json__pre {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    font-size: var(--text-xs);
    line-height: 1.5;
    background: var(--bg-secondary, color-mix(in srgb, var(--text) 6%, transparent));
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: var(--space-3);
    border-radius: var(--radius-md, 8px);
    margin-top: var(--space-2);
    margin-bottom: 0;
    max-height: 360px;
    overflow: auto;
    white-space: pre;
    tab-size: 2;
    -moz-tab-size: 2;
}

.overlay-panel--alert .overlay-header-actions {
    align-self: flex-start;
    padding-top: var(--space-1);
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-4) var(--space-5);
    background: transparent;
    border-bottom: none;
    position: relative;
}

.overlay-panel--alert .overlay-header {
    padding: var(--space-4) var(--space-4) var(--space-3);
}

.modal-panel--disposition {
    width: min(420px, 92vw);
}

.overlay-header-actions {
    position: relative;
    z-index: 30;
    flex-shrink: 0;
}

.action-menu-backdrop--elevated {
    z-index: 10000;
}

.action-menu-dropdown--elevated {
    z-index: 10001;
    min-width: 260px;
}

.overlay-actions-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
}

.action-menu-label {
    padding: var(--space-2) var(--space-4) var(--space-1);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.action-menu-item--escalate i {
    color: var(--severity-high);
}

.overlay-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
}

.overlay-header-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1 1 auto;
    min-width: 0;
}

.overlay-header h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
}

.overlay-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.overlay-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
}

.overlay-close:hover {
    background: var(--bg-active);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.overlay-close i {
    font-size: var(--text-lg);
}

.overlay-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--space-2);
    background: var(--bg-surface);
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.overlay-body:hover {
    scrollbar-width: thin;
}

.overlay-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--space-6) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    background: var(--bg-surface);
    scrollbar-width: none; /* Firefox – hide scrollbar but keep scroll */
}

/* Hide scrollbars inside overlay while keeping scroll behavior */
.overlay-body::-webkit-scrollbar,
.overlay-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Overlay Footer */
.overlay-footer {
    padding: var(--space-4) var(--space-6) var(--space-5);
    background: transparent;
    border-top: none;
    display: flex;
    gap: var(--space-3);
}

.overlay-footer .btn-primary,
.overlay-footer .btn-secondary {
    flex: 1;
    justify-content: center;
    padding: var(--space-4);
}

.overlay-footer .btn-secondary:only-child {
    flex: 1;
}

/* Full-width button utility */
.btn-block {
    width: 100%;
    flex: 1;
    justify-content: center;
}

/* Success Value Display */
.overlay-value-display {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--accent-subtle), var(--bg-surface));
    border: 1px solid var(--border-default);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--border-subtle);
}

.overlay-value-icon {
    width: var(--space-8);
    height: var(--space-8);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--status-success-subtle);
    color: var(--status-success);
    flex-shrink: 0;
    box-shadow: 0 0 24px var(--status-success-subtle);
}

.overlay-value-icon.connected {
    background: var(--status-success-subtle);
    color: var(--status-success);
    box-shadow: 0 0 24px var(--status-success-subtle);
}

.overlay-value-icon.disconnected {
    background: var(--status-danger-subtle);
    color: var(--status-danger);
    box-shadow: 0 0 24px var(--status-danger-subtle);
}

.overlay-value-icon i {
    font-size: var(--text-2xl);
}

.overlay-value-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.overlay-value-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.overlay-value-number {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: var(--tracking-tighter);
    text-transform: capitalize;
}

.value.capitalize {
    text-transform: capitalize;
}

/* Detail Sections – simple, card-like blocks */
.detail-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.overlay-content > .detail-section:first-of-type {
    margin-top: var(--space-1);
}

.detail-section h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-secondary);
    /* Hairline under each section title so the flyout's stacked cards
       (Description / Details / MITRE / Indicators / Notes) read as
       distinct titled blocks instead of blending. */
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.detail-section p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* Severity Banner */
.severity-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--border-subtle);
    gap: var(--space-4);
}

.overlay-content > .severity-banner {
    margin-bottom: var(--space-2);
}

.severity-banner.critical {
    border-left: 4px solid var(--severity-critical);
    background: var(--severity-critical-bg);
}

.severity-banner.high {
    border-left: 4px solid var(--severity-high);
    background: var(--severity-high-bg);
}

.severity-banner.medium {
    border-left: 4px solid var(--severity-medium);
    background: var(--severity-medium-bg);
}

.severity-banner.low {
    border-left: 4px solid var(--severity-low);
    background: var(--severity-low-bg);
}

.severity-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.severity-label::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.severity-banner.critical .severity-label::before { background: var(--severity-critical); }
.severity-banner.high .severity-label::before { background: var(--severity-high); }
.severity-banner.medium .severity-label::before { background: var(--severity-medium); }
.severity-banner.low .severity-label::before { background: var(--severity-low); }

.status-badge {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.status-badge.open {
    color: var(--text-primary);
    background: var(--bg-active);
}
.status-badge.investigating {
    color: var(--primary);
    background: var(--accent-surface);
    border-color: var(--accent-subtle);
}
.status-badge.escalated_to_customer {
    color: var(--severity-medium);
    background: var(--severity-medium-bg);
    border-color: var(--severity-medium-bg);
}
.status-badge.resolved {
    color: var(--status-success);
    background: var(--status-success-subtle);
    border-color: var(--status-success-subtle);
}

.scope-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.scope-badge.org {
    /* Previous styling hard-coded a dark surface (``#2a2a2a``) so the
       ORGANIZATION badge painted near-black-on-near-black in light mode
       on the Connectors card. Use theme-aware tokens instead: a subtle
       neutral fill + thin border that reads as a labeled pill in both
       themes and stays distinct from the PERSONAL purple pill below. */
    background: color-mix(in srgb, var(--text-primary) 8%, transparent);
    color: var(--text-secondary);
    border: 1px solid color-mix(in srgb, var(--text-primary) 14%, transparent);
}
.scope-badge.user {
    background: rgba(147, 112, 219, 0.15);
    color: #8a6bd0;
    border: 1px solid rgba(147, 112, 219, 0.35);
}
.dark .scope-badge.user {
    color: #b39ddb;
}
.btn-danger-subtle {
    background: transparent;
    color: var(--text-tertiary, #666);
    border: 1px solid transparent;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-md, 6px);
    transition: color 0.15s, background 0.15s;
}
.btn-danger-subtle:hover {
    color: var(--destructive, oklch(0.55 0.22 25));
    background: rgba(220, 50, 50, 0.08);
}
.btn-danger-subtle.small {
    padding: 4px 6px;
    font-size: var(--text-xs, 11px);
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    min-width: 0;
}

.detail-item .label {
    font-size: var(--text-xs);
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.detail-item .value {
    font-size: var(--text-base);
    color: var(--text-primary);
    font-weight: 500;
    min-width: 0;
    word-break: break-word;
}

.detail-item .value.code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    word-break: break-all;
    font-weight: 400;
}

.detail-item--id .value--mono {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    word-break: break-all;
    font-weight: 400;
}

.btn-copy-id {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-quaternary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-copy-id:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}
/* Wazuh "open in source" button shown before the dashboard URL is configured:
   muted + dashed so it reads as "set me up" rather than a live deep-link, but
   stays discoverable. Clicking routes the admin to Settings → Integrations.
   Theme-aware — inherits the base button's custom properties. */
.btn-copy-id--unset {
    border-style: dashed;
    opacity: 0.65;
}
.btn-copy-id--unset:hover {
    opacity: 1;
}

/* "View linked case" (and similar) anchors live as <a class="link"> INSIDE
   <span class="value"> — the compound `.value.link` selector never matched
   them, so they fell back to the browser-default blue (unreadable on the dark
   theme). Target the child anchor and use the theme-flipped --info-color
   (#5B9BD8 light / #7AB4E8 dark) so the link reads well in both themes. */
.detail-item .value .link,
.detail-item .value.link {
    color: var(--info-color);
    cursor: pointer;
    text-decoration: none;
}

.detail-item .value .link:hover,
.detail-item .value .link:focus-visible,
.detail-item .value.link:hover {
    text-decoration: underline;
}

.tags-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.technique-name {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

/* Indicators List */
.indicators-list {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.indicator-chip {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
    cursor: pointer;
}

.indicator-chip:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-subtle);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Steps List */
.steps-list {
    list-style: none;
    counter-reset: step;
    position: relative;
}

.steps-list::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-subtle), var(--border-subtle));
}

.steps-list li {
    position: relative;
    padding: var(--space-4) var(--space-5);
    padding-left: 48px;
    margin-bottom: var(--space-3);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    line-height: var(--leading-relaxed);
    transition: all var(--duration-fast) var(--ease-out);
}

.steps-list li:hover {
    background: var(--bg-elevated);
    border-color: var(--border-default);
    transform: translateX(4px);
}

.steps-list li:last-child {
    margin-bottom: 0;
}

.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--primary-foreground);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 0 12px var(--accent-subtle);
}

/* Config and Analysis Data */
.config-list,
.analysis-data {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Finding reasoning chain — ordered list of analytical observations
   that led to a finding. Lives inside ``.detail-section`` in the
   finding detail overlay; numerals are slightly muted so the prose
   reads first. */
.finding-reasoning-list {
    list-style: decimal;
    list-style-position: outside;
    padding-left: var(--space-5);
    margin: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
    line-height: 1.55;
}
.finding-reasoning-list li {
    padding-left: var(--space-1);
    margin: var(--space-2) 0;
}
.finding-reasoning-list li::marker {
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Finding description / analyst-notes prose blocks. Descriptions are
   the full Sysmon-event line in many cases, so preserve embedded
   newlines and let long tokens (commands, hashes) wrap. */
.finding-description-text {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Metadata footer — detected / first-observed / last-observed /
   confidence. Visually de-emphasized vs the rest of the overlay so
   the analyst's eye skims past it unless they're auditing timings. */
.finding-metadata-footer {
    opacity: 0.85;
}
.finding-metadata-footer dl dt,
.finding-metadata-footer dl dd {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

.config-item,
.analysis-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.config-item .label,
.analysis-item .label {
    font-size: var(--text-xs);
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.config-item .value,
.analysis-item .value {
    font-size: var(--text-base);
    color: var(--text-primary);
    font-weight: 500;
}

.config-item .value.code {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--text-secondary);
}

/* Health Badge */
.health-badge {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-left: var(--space-3);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.health-badge.healthy {
    color: var(--status-success);
    background: var(--status-success-subtle);
    border-color: var(--status-success-subtle);
}
.health-badge.warning {
    color: var(--status-warning);
    background: var(--status-warning-subtle);
    border-color: var(--status-warning-subtle);
}
.health-badge.error {
    color: var(--status-danger);
    background: var(--status-danger-subtle);
    border-color: var(--status-danger-subtle);
}

/* ============================================
   TRANSITIONS & ANIMATIONS
   ============================================ */
.slide-enter-active,
.slide-leave-active {
    transition: opacity var(--duration-normal) var(--ease-out);
}

.slide-enter-active .overlay-panel,
.slide-leave-active .overlay-panel {
    transition: transform var(--duration-normal) var(--ease-out), opacity var(--duration-normal) var(--ease-out);
}

.slide-enter-from .overlay-panel,
.slide-leave-to .overlay-panel {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
}

.slide-enter-from,
.slide-leave-to {
    opacity: 0;
}

/* Pulse Animation for Live Data */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Glow Animation */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--accent-subtle); }
    50% { box-shadow: 0 0 40px var(--accent-muted); }
}

.glow {
    animation: glow 3s ease-in-out infinite;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* ============================================
   RESPONSIVE - LARGE SCREENS
   ============================================ */

/* 1600px+ - Wide Desktop (cap content width for readability) */
@media (min-width: 1600px) {
    :root {
        --content-max-width: min(100%, 1720px);
    }

    .playbooks-grid,
    .connectors-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    }
    .apt-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    }
}

/* 2560px+ - 2K/QHD (no extra-wide content) */
@media (min-width: 2560px) {
    :root {
        --content-max-width: min(100%, 1720px);
    }

    .live-event-row {
        grid-template-columns: 120px 1fr auto auto;
    }

    .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 3840px+ - 4K/UHD (keep content contained, no giant boxes) */
@media (min-width: 3840px) {
    :root {
        --sidebar-width: 80px;
        --header-height: 72px;
        --content-max-width: min(100%, 1720px);
    }

    .kpi-row {
        grid-template-columns: repeat(5, 1fr);
    }

    .playbooks-grid,
    .connectors-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    }
    .apt-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    }

    .overlay-panel {
        width: min(520px, 90vw);
        max-width: 520px;
    }

    .detail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   RESPONSIVE - STANDARD SCREENS
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-sections-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --content-padding: var(--space-4);
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Row actions: fade in on row hover (actions are hidden by default) */
.row-actions-visible {
    opacity: 0;
    transition: opacity var(--duration-fast);
}
tr:hover .row-actions-visible,
tr:focus-within .row-actions-visible {
    opacity: 1;
}

/* Live Feed collapsed: last-event snippet */
.live-feed-last {
    color: var(--text-quaternary);
    font-size: var(--text-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 768px) {
    /* Investigations: compact spacing on small screens */
    .investigations-page .section-header {
        margin-bottom: var(--space-3);
    }
    .investigations-page .filter-bar {
        margin-bottom: var(--space-4);
        padding: var(--space-3);
    }
    .investigations-page .playbooks-grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
        gap: var(--space-3);
    }
    .investigations-page .playbooks-grid .apt-card {
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: var(--space-4);
        gap: var(--space-3);
    }
    .investigations-page .apt-actions-row {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding-top: var(--space-3);
    }
    .investigations-page .apt-meta {
        gap: var(--space-3);
    }

    .overlay-panel {
        width: 100%;
    }

    .header-left {
        gap: var(--space-2);
    }

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

    .detail-grid--alert {
        grid-template-columns: 1fr;
    }

    .overlay-panel--alert {
        width: min(100%, calc(100vw - 2 * var(--space-3)));
        max-height: 92vh;
    }

    .page-header {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
        flex-wrap: nowrap;
        gap: var(--space-2);
    }

    .page-subnav {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .header-actions {
        flex-wrap: nowrap;
        gap: var(--space-1);
    }

    .profile-trigger-name {
        display: none;
    }

    .header-language-select {
        max-width: 4.5rem;
    }

    .notif-panel {
        width: min(360px, calc(100vw - 2 * var(--space-4)));
        right: calc(-1 * var(--space-2));
    }

    .modal-backdrop {
        padding: var(--space-4);
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-panel {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 2 * var(--space-4));
        max-height: calc(100vh - 2 * var(--space-4));
        margin: auto 0;
        flex-shrink: 0;
    }

    .modal-body {
        padding: var(--space-4) var(--space-4);
    }

    .task-run-progress-header {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .task-run-info {
        flex-wrap: wrap;
    }

    .task-run-actions {
        flex-shrink: 0;
    }
}

@media (max-width: 560px) {
    .page-header {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
        gap: var(--space-1);
    }

    .header-left,
    .header-title-group {
        min-width: 0;
        overflow: hidden;
    }

    .header-title-group {
        flex-wrap: nowrap;
        gap: var(--space-2);
    }

    .page-header h1 {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1.25rem;
        gap: var(--space-2);
    }

    .page-header h1 i {
        font-size: var(--text-xl);
    }

    .header-actions {
        flex: 0 0 auto;
    }

    .header-language {
        position: relative;
        justify-content: center;
        width: clamp(32px, 2vw, 40px);
        padding: 0;
    }

    .header-language-select {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: none;
        opacity: 0;
        padding: 0;
    }

    .profile-trigger {
        width: clamp(32px, 2vw, 40px);
        height: clamp(32px, 2vw, 40px);
        padding: 0;
        justify-content: center;
    }

    .profile-trigger-caret {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --content-padding: var(--space-3);
    }

    .page-header {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }

    .context-chip {
        max-width: 100%;
    }

    .page {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    /* Investigations playbooks: maximum space efficiency */
    .investigations-page .section-header {
        margin-bottom: var(--space-2);
    }
    .investigations-page .section-header h3 {
        font-size: var(--text-base);
    }
    .investigations-page .filter-bar {
        margin-bottom: var(--space-3);
        padding: var(--space-2) var(--space-3);
    }
    .investigations-page .playbooks-grid {
        gap: var(--space-2);
    }
    .investigations-page .playbooks-grid .apt-card {
        padding: var(--space-3);
        gap: var(--space-2);
    }
    .investigations-page .apt-actions-row {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding-top: var(--space-2);
    }
    .investigations-page .apt-meta {
        gap: var(--space-2);
    }

    .modal-backdrop {
        padding: var(--space-3);
    }

    .modal-panel {
        max-height: calc(100dvh - 2 * var(--space-3));
        max-height: calc(100vh - 2 * var(--space-3));
    }

    .toast-container {
        left: var(--space-3);
        right: var(--space-3);
        max-width: min(400px, calc(100vw - 2 * var(--space-3)));
    }

    .sub-tab {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }

    .empty-state,
    .loading-state {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* ============================================
   PAGINATION & SCROLL CONTROLS
   ============================================ */

/* CSS Custom Property for list heights */
:root {
    --list-max-height: calc(100vh - 350px);
    --list-max-height-compact: calc(100vh - 400px);
}

/* Pagination Controls Container */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Pagination Info Text */
.pagination-info {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    letter-spacing: var(--tracking-normal);
}

.pagination-info .current-range {
    color: var(--text-primary);
    font-weight: 500;
}

.pagination-info .total-count {
    color: var(--text-secondary);
}

/* Pagination Buttons Container */
.pagination-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Pagination Icon Buttons */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-overlay);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.pagination-btn:active:not(:disabled) {
    background: var(--bg-active);
    transform: scale(0.96);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-btn i {
    font-size: var(--text-base);
}

/* Page Number Display */
.pagination-page-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-family: var(--font-mono);
}

.pagination-page-info .current-page {
    color: var(--text-primary);
    font-weight: 600;
}

/* Page Size Select Dropdown */
.page-size-select {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-size-select label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.page-size-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 70px;
    padding: var(--space-2) var(--space-5) var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.page-size-select select:hover {
    border-color: var(--border-strong);
    background-color: var(--bg-overlay);
}

.page-size-select select:focus {
    outline: none;
    border-color: var(--accent-subtle);
    box-shadow: 0 0 0 3px var(--accent-surface);
}

.page-size-select select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Middle body — modern, simple pagination styling */
.page-content .pagination-controls {
    padding: var(--space-3) 0;
    margin-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    background: transparent;
    border-radius: 0;
    gap: var(--space-4);
    font-size: var(--text-sm);
}

.page-content .pagination-controls .pagination-info {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.page-content .pagination-controls .pagination-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-content .pagination-controls .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
}

.page-content .pagination-controls .btn-icon:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.page-content .pagination-controls .btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-content .pagination-controls .page-indicator {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: 0 var(--space-2);
}

.page-content .pagination-controls .page-size-select {
    min-width: 0;
}

.page-content .pagination-controls .page-size-select {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-content .pagination-controls .page-size-select select {
    min-width: 80px;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    font-size: var(--text-xs);
}


/* ============================================
   SCROLLABLE LIST CONTAINERS
   ============================================ */

/* Virtual Scroll Container */
.scroll-container {
    overflow-y: auto;
    max-height: var(--list-max-height);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar Styling */
.scroll-container::-webkit-scrollbar {
    width: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: var(--radius-full);
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-quaternary);
}

/* Firefox Scrollbar */
.scroll-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) var(--bg-surface);
}

/* Apply scrollable behavior to list containers */
.alerts-list.scroll-container,
.alerts-list-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

.playbooks-grid.scroll-container,
.playbooks-grid-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

.findings-table.scroll-container,
.findings-table-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

.connectors-grid.scroll-container,
.connectors-grid-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

.team-table.scroll-container,
.team-table-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

.apt-grid.scroll-container,
.apt-grid-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

.events-list.scroll-container,
.events-list-scrollable {
    max-height: var(--list-max-height);
    overflow-y: auto;
}

/* Compact variant for smaller sections */
.scroll-container-compact {
    max-height: var(--list-max-height-compact);
}

/* ============================================
   FILTER BAR RESPONSIVE ENHANCEMENTS
   ============================================ */

.filter-bar-responsive {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}

.filter-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.filter-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Filter chips/tags */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--accent-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.filter-chip:hover {
    background: var(--accent-subtle);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-subtle);
    border-color: var(--accent-muted);
    color: var(--primary);
}

.filter-chip .remove-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: var(--space-1);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.filter-chip .remove-chip:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

/* Active filters count badge */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-2);
    background: var(--accent);
    border-radius: var(--radius-full);
    color: var(--bg-base);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* Clear all filters button */
.clear-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.clear-filters-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

/* Responsive filter bar adjustments */
@media (max-width: 1024px) {
    .filter-bar-responsive {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar-left,
    .filter-bar-right {
        width: 100%;
    }

    .filter-bar-right {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }

    .pagination-info {
        text-align: center;
    }

    .pagination-buttons {
        justify-content: center;
    }

    .page-size-select {
        justify-content: center;
    }

    .filter-bar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-chips {
        justify-content: center;
    }
}

/* ============================================
   LOADING STATE FOR PAGINATED LISTS
   ============================================ */

.list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--text-secondary);
}

.list-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: cpod-spin 0.8s linear infinite;
}

/* Empty state for paginated lists */
.list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--text-secondary);
    text-align: center;
}

.list-empty i {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.list-empty-title {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.list-empty-description {
    font-size: var(--text-sm);
    max-width: 320px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: min(400px, calc(100vw - 2 * var(--space-4)));
    margin-left: auto;
    pointer-events: none;
}

.toast-clear-all {
    pointer-events: all;
    display: flex;
    justify-content: flex-end;
}

.toast-clear-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--ink-900);
    color: var(--ink-200);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.toast-clear-btn:hover {
    opacity: 1;
}

.toast-container .toast {
    pointer-events: auto;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    animation: toast-in 0.3s ease-out;
}

.toast.success { border-left: 3px solid var(--status-success); }
.toast.error { border-left: 3px solid var(--status-danger); }
.toast.warning { border-left: 3px solid var(--status-warning); }
.toast.info { border-left: 3px solid var(--info); }

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast.success .toast-icon { color: var(--status-success); }
.toast.error .toast-icon { color: var(--status-danger); }
.toast.warning .toast-icon { color: var(--status-warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.toast-message {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: var(--leading-normal);
}

.toast-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.toast-dismiss:hover {
    color: var(--text-primary);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-enter-active { animation: toast-in 0.3s ease-out; }
.toast-leave-active { animation: toast-in 0.2s ease-in reverse; }

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    animation: confirm-overlay-in 0.2s ease-out;
}

@keyframes confirm-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-dialog {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: confirm-dialog-in 0.25s ease-out;
}

@keyframes confirm-dialog-in {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.confirm-dialog.warning .confirm-icon {
    background: rgba(234, 179, 8, 0.12);
    color: var(--status-warning);
}

.confirm-dialog.danger .confirm-icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-danger);
}

.confirm-dialog.info .confirm-icon {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.confirm-title {
    margin: 0 0 8px;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-message {
    margin: 0 0 24px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    min-width: 100px;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.confirm-actions .btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.confirm-actions .btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.confirm-actions .btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
}

.confirm-actions .btn-primary:hover {
    filter: brightness(1.1);
}

.confirm-actions .btn-danger {
    background: var(--status-danger);
    border: 1px solid var(--status-danger);
    color: #fff;
}

.confirm-actions .btn-danger:hover {
    filter: brightness(1.1);
}

/* ============================================
   TASK RUN PROGRESS PANEL
   ============================================ */
.task-run-progress {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.task-run-progress.minimized {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    width: 360px;
    padding: var(--space-3);
    margin-bottom: 0;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.task-run-progress.minimized .task-run-progress-header {
    margin-bottom: 0;
    cursor: pointer;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.task-run-progress.minimized .task-run-progress-header:hover {
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    margin: calc(var(--space-1) * -1);
    padding: var(--space-1);
}

.task-run-progress.minimized .task-run-steps {
    display: none;
}

.task-run-progress.minimized .task-run-info {
    flex: 1;
    min-width: 0;
}

.task-run-progress.minimized .task-run-name {
    font-size: var(--text-sm);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-run-progress.minimized .task-run-actions .btn-secondary,
.task-run-progress.minimized .task-run-actions .btn-primary {
    display: none;
}

.task-run-mini-progress {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-left: auto;
    font-family: var(--font-mono);
}

.task-run-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.task-run-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.task-run-name {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.task-run-status-badge {
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    text-transform: capitalize;
}

.task-run-status-badge.running,
.task-run-status-badge.queued {
    background: var(--status-info-subtle);
    color: var(--info);
}

.task-run-status-badge.completed {
    background: var(--status-success-subtle);
    color: var(--status-success);
}

.task-run-status-badge.failed {
    background: var(--status-danger-subtle);
    color: var(--status-danger);
}

.task-run-status-badge.partial {
    background: var(--status-warning-subtle);
    color: var(--status-warning);
}

.task-run-status-badge.cancelled {
    background: var(--bg-overlay);
    color: var(--text-secondary);
}

.task-run-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.task-run-actions .btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.task-run-actions .btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.task-run-step-progress {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.progress-bar {
    height: 6px;
    background: var(--muted);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--info), var(--chart-4));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* ── Container task progress ─────────────────────────────── */

/* Shimmer bar */
@keyframes container-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.container-progress {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.container-progress-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.container-shimmer-track {
    flex: 1;
    height: 5px;
    background: var(--muted);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}
.container-shimmer-track.done {
    background: var(--status-success);
    opacity: 0.6;
}
.container-shimmer-track.done .container-shimmer-fill {
    display: none;
}
.container-shimmer-fill {
    position: absolute;
    inset: 0;
    width: 50%;
    background: linear-gradient(90deg, transparent 0%, var(--info) 50%, transparent 100%);
    animation: container-shimmer 1.6s ease-in-out infinite;
}

.elapsed-time {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: right;
}

/* Timeline */
.container-timeline {
    position: relative;
    padding-left: 20px;
}
.container-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 1.5px;
    background: var(--border);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding: 4px 0 8px 0;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-dot.completed {
    background: var(--color-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 15%, transparent);
}
.timeline-dot.active {
    background: var(--info);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 25%, transparent);
    animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 25%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 12%, transparent); }
}

/* Completed panel: green left accent */
.task-run-progress:has(.task-run-status-badge.completed) {
    border-left: 3px solid var(--color-success);
}
.task-run-progress:has(.task-run-status-badge.failed) {
    border-left: 3px solid var(--color-danger);
}
.task-run-progress:has(.task-run-status-badge.partial) {
    border-left: 3px solid var(--color-warning);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.timeline-stage {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}
.timeline-item.completed .timeline-stage {
    color: var(--text-secondary);
    font-weight: 400;
}
.timeline-msg {
    font-size: var(--text-xs);
    color: var(--text-tertiary, var(--text-secondary));
    opacity: 0.8;
}

/* Container console */
.container-console {
    background: var(--bg-secondary, rgba(0,0,0,0.2));
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    margin-top: var(--space-1);
}
.container-console .console-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    user-select: none;
}
.container-console .console-header:hover {
    color: var(--text-primary);
}
.container-console .console-log-count {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    opacity: 0.7;
}
.container-console-lines {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 12px 8px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.6;
}
.container-log-entry {
    display: flex;
    gap: 10px;
    padding: 1px 0;
}
.container-log-entry .log-ts {
    color: var(--text-secondary);
    opacity: 0.5;
    white-space: nowrap;
    flex-shrink: 0;
}
.container-log-entry .log-msg {
    color: var(--text-secondary);
    word-break: break-word;
}
.container-log-entry.info .log-msg  { color: var(--text-primary); }
.container-log-entry.warn .log-msg  { color: var(--color-warning); }
.container-log-entry.error .log-msg { color: var(--color-danger); }
.container-console-empty {
    padding: 16px 0;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: var(--text-sm);
}
.container-console .console-actions {
    border-top: 1px solid var(--border);
    padding: 6px 12px;
}

.task-run-step-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.task-run-step-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: var(--space-1) 0;
}

.task-run-step-item.completed { color: var(--status-success); }
.task-run-step-item.running { color: var(--info); }
.task-run-step-item.failed { color: var(--status-danger); }

.step-duration {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.task-run-error {
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--status-danger-subtle);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--status-danger);
}

.task-run-warnings {
    margin-top: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.task-run-warning {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    color: var(--status-warning);
}

.task-run-output {
    margin-top: var(--space-3);
    border-top: 1px solid var(--border-default);
    padding-top: var(--space-3);
}

.task-run-output-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.task-run-output-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    max-height: 400px;
    overflow-y: auto;
}

.task-run-output-content pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-status-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}
.output-status-badge.success { background: var(--status-success-subtle); color: var(--status-success); }
.output-status-badge.failed { background: var(--status-danger-subtle); color: var(--status-danger); }

.output-summary {
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.output-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
    margin-top: var(--space-3);
}

.output-finding-item {
    padding: var(--space-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.finding-severity {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: var(--space-2);
}
.finding-severity.critical { background: rgba(var(--red-rgb, 248,113,113), 0.2); color: var(--color-danger); }
.finding-severity.high { background: oklch(from var(--severity-high, #f59e0b) l c h / 0.2); color: var(--severity-high, #f59e0b); }
.finding-severity.medium { background: oklch(from var(--severity-medium, #eab308) l c h / 0.15); color: var(--severity-medium, #eab308); }
.finding-severity.low { background: rgba(var(--green-rgb, 74,222,128), 0.15); color: var(--color-success); }
.finding-severity.info { background: rgba(var(--blue-rgb, 96,165,250), 0.15); color: var(--accent); }

.finding-title { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.finding-desc { font-size: var(--text-xs); color: var(--text-secondary); margin: var(--space-1) 0 0; }

.output-recommendations ul {
    margin: 0;
    padding-left: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.8;
}

.output-more {
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--space-1) 0;
}

.output-raw-toggle {
    margin-top: var(--space-3);
    border-top: 1px solid var(--border-default);
    padding-top: var(--space-2);
}
.output-raw-toggle summary {
    font-size: var(--text-xs);
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.output-raw-toggle pre {
    margin-top: var(--space-2);
    max-height: 300px;
    overflow-y: auto;
}

/* ============================================
   CONSOLE LOG VIEWER
   ============================================ */
.task-run-console {
    margin-top: var(--space-4);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.console-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--muted);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    font-size: var(--text-sm);
}

.console-header:hover {
    background: var(--bg-overlay);
}

.console-header i:last-child {
    margin-left: auto;
    font-size: 1.2rem;
}

.console-logs-container {
    padding: var(--space-3);
    max-height: 500px;
    overflow-y: auto;
}

.console-step-section {
    margin-bottom: var(--space-3);
}

.console-step-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.console-step-header:hover {
    background: var(--bg-overlay);
}

.console-log-count {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.console-log-lines {
    margin-top: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
}

.console-log-line {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.6;
    padding: 2px 0;
    display: flex;
    gap: var(--space-2);
}

.console-log-line.error {
    color: var(--color-danger);
}

.console-log-line.info {
    color: var(--text-primary);
}

.console-log-empty {
    padding: var(--space-6);
    text-align: center;
    color: var(--muted-foreground);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-style: italic;
}

.console-log-empty i {
    font-size: 1.2rem;
}

.log-timestamp {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.log-source {
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 60px;
}

.log-line {
    flex: 1;
    word-break: break-all;
}

.console-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-default);
}

.console-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    font-size: var(--text-sm);
}

.console-checkbox input[type="checkbox"] {
    cursor: pointer;
}

/* ============================================
   TASK CARD ENHANCEMENTS
   ============================================ */
.task-card {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.task-card:hover {
    border-color: var(--border-active, var(--border-subtle));
    box-shadow: var(--shadow-md);
}

.task-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.task-trigger-badge {
    font-size: var(--text-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-overlay);
    color: var(--text-secondary);
}

.task-icon-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-2) 0 var(--space-1);
}

.task-icon-name i {
    font-size: 20px;
    color: var(--text-secondary);
}

.task-description {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.task-role-badge {
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--status-info-subtle);
    color: var(--info);
    font-weight: 500;
}

.task-execution-badge {
    font-size: var(--text-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-execution-badge.container {
    background: var(--accent-subtle);
    color: var(--primary);
}

.task-connectors {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.task-connector-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.task-skills {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================
   MODAL (Task Run)
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--shadow-overlay, rgba(0, 0, 0, 0.7));
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.modal-backdrop.modal-backdrop--stacked {
    z-index: 10100;
}

.modal-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl, var(--radius-lg));
    width: min(640px, 96vw);
    max-height: 82vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl, var(--shadow-lg));
}

.modal-panel--form {
    width: min(520px, 96vw);
}

.modal-panel--narrow {
    width: min(480px, 96vw);
}

.modal-panel--credentials {
    width: min(500px, 96vw);
}

.modal-title-icon--success {
    color: var(--success);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.modal-title-icon {
    font-size: var(--text-xl);
    color: var(--signal-700);
    flex-shrink: 0;
}

.dark .modal-title-icon {
    color: var(--signal-500);
}

.modal-info-box {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-active);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-normal);
}

.modal-info-box strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.credentials-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-active);
}

.credentials-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}

.credentials-row + .credentials-row {
    border-top: 1px solid var(--border-subtle);
}

.credentials-row__content {
    min-width: 0;
    flex: 1 1 auto;
}

.credentials-row__label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-1);
}

.credentials-row__value {
    display: block;
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--text-primary);
    word-break: break-all;
}

/* Copy button — bordered icon affordance against the mono code value. */
.credentials-row__copy {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.credentials-row__copy:hover,
.credentials-row__copy:focus-visible {
    background: var(--accent);
    color: var(--text-primary);
    border-color: var(--border);
    outline: none;
}

.runner-setup-panel {
    margin-bottom: var(--space-5);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-active);
}

.runner-setup-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.runner-setup-panel__title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--success);
}

.runner-setup-panel__close {
    position: static;
    flex-shrink: 0;
}

.modal-info-box p {
    margin: var(--space-1) 0 0;
}

.form-label-optional {
    font-weight: 400;
    color: var(--text-tertiary);
}

.modal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.assignee-cell--field {
    width: 100%;
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    transition: border-color var(--duration-fast), background var(--duration-fast);
}

.assignee-cell--field:hover {
    border-color: var(--border-default);
    background: var(--bg-hover);
}

@media (max-width: 480px) {
    .modal-form-row {
        grid-template-columns: 1fr;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-overlay);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-5) var(--space-6);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    background: var(--bg-surface);
    -webkit-overflow-scrolling: touch;
}

.modal-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
    padding-bottom: 0;
    border-bottom: none;
}

.invite-tenant-context {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent) 7%, var(--bg-surface));
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.invite-tenant-context > i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--accent);
}

.invite-tenant-context strong {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4) 0;
}

.modal-form .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.modal-form .form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.modal-form .required {
    color: var(--destructive);
}

/* Report Preview */
.report-preview-content { font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.report-preview-content h2 { font-size: 20px; font-weight: 600; margin: 16px 0 8px; color: var(--text-primary); }
.report-preview-content h3 { font-size: 17px; font-weight: 600; margin: 14px 0 6px; color: var(--text-primary); }
.report-preview-content h4 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; color: var(--text-secondary); }
.report-preview-content pre.code-block { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 12px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 8px 0; }
.report-preview-content ul { margin: 4px 0; padding-left: 20px; }
.report-preview-content li { margin: 2px 0; }
.report-preview-content hr { border: none; border-top: 1px solid var(--border-default); margin: 16px 0; }
.report-preview-content strong { color: var(--text-primary); }

.modal-form .form-input,
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="url"],
.modal-form input[type="password"],
.modal-form input[type="number"],
.modal-form select,
.modal-form textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.modal-form .form-input:focus,
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Placeholders + helper hints in modal forms should clearly read as
 * GUIDANCE, not pre-filled values. The previous --text-secondary was
 * close enough to body text that analysts confused the example string
 * ("Select a status…", "What changed? e.g. …") with a real selection.
 * Use a low-opacity tertiary tone with opacity:1 to defeat Firefox's
 * default 0.54 override (which compounds on already-translucent colors).
 *
 * For ``<select>`` the placeholder pseudo doesn't apply — we use
 * ``:invalid`` (the select must carry ``required``) plus ``:has`` for
 * Safari < 16. ``option[value=""]`` is rendered disabled so a user
 * can't re-select the placeholder line by accident.
 */
.modal-form .form-input::placeholder,
.modal-form input::placeholder,
.modal-form textarea::placeholder,
.modal-form select.form-input:invalid,
.modal-form select.form-input:has(option[value=""]:checked) {
    color: color-mix(in srgb, var(--text-tertiary) 55%, transparent);
    opacity: 1;
    font-style: italic;
}

/* Disabled placeholder option in dropdowns — render at the same
 * dimmed tone in the open menu so it visually matches the closed state. */
.modal-form select.form-input option[value=""][disabled] {
    color: color-mix(in srgb, var(--text-tertiary) 55%, transparent);
    font-style: italic;
}

.modal-form .form-textarea,
.modal-form textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-form .form-hint {
    font-size: var(--text-xs);
    color: color-mix(in srgb, var(--text-tertiary) 65%, transparent);
    margin-top: var(--space-1);
    line-height: 1.4;
    display: block;
}

.modal-panel--notify-customer .modal-description {
    margin-bottom: var(--space-4);
    color: color-mix(in srgb, var(--text-secondary) 72%, transparent);
}

.modal-panel--notify-customer .form-hint {
    color: color-mix(in srgb, var(--text-tertiary) 55%, transparent);
    opacity: 0.85;
}

.modal-panel--notify-customer .form-input::placeholder,
.modal-panel--notify-customer textarea::placeholder {
    color: color-mix(in srgb, var(--text-tertiary) 45%, transparent);
    opacity: 1;
    font-style: italic;
}

.modal-panel--notify-customer .form-textarea {
    min-height: 72px;
}

/* The notify modal now carries the full email body — give it room. */
.modal-panel--notify-customer {
    max-width: 720px;
    width: 92vw;
}

.notify-draft-empty {
    display: grid;
    justify-items: start;
    gap: var(--space-3);
    padding: var(--space-6);
    border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--border-default));
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--danger) 6%, var(--bg-surface));
    color: var(--text-secondary);
}

.notify-draft-empty > i {
    color: var(--danger);
    font-size: 1.5rem;
}

.notify-draft-empty h4,
.notify-draft-empty p { margin: 0; }

.notify-draft-empty h4 { color: var(--text-primary); }

.notify-draft-error {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.notify-draft-error span { flex: 1 1 280px; }
.modal-form .form-checkbox + .form-hint {
    margin-top: var(--space-2);
}

.modal-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: 2rem;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.4;
}

.form-checkbox .form-checkbox-label {
    flex: 1;
    min-width: 0;
    margin-top: 2px;
}

.modal-form .form-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal-no-inputs {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   ENHANCED FORM STYLES (Input UX Improvements)
   ============================================ */
.modal-form-enhanced {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form-group-enhanced {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label-enhanced {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.required-indicator {
    color: var(--destructive);
    font-size: 1.1rem;
    font-weight: 700;
}

.help-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: help;
}

.form-help-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.form-example {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-style: italic;
    margin-top: calc(var(--space-1) * -1);
}

.validation-error {
    border-color: var(--destructive) !important;
    background: var(--status-danger-subtle) !important;
}

.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-danger);
    margin-top: calc(var(--space-1) * -1);
}

.error-message i {
    font-size: 1rem;
}

.modal-connectors-notice {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Connector readiness section in run modal */
.modal-connectors-section {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.modal-connectors-label {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.modal-connectors-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-connector-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.modal-connector-tag .connector-tag-note {
    font-weight: 400;
    opacity: 0.75;
    text-transform: none;
    letter-spacing: 0;
}

.modal-connector-tag.required.missing {
    background: var(--status-danger-subtle);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-subtle);
}

.modal-connector-tag.required.ok {
    background: var(--status-success-subtle);
    color: var(--status-success);
    border: 1px solid var(--status-success-subtle);
}

.modal-connector-tag.optional {
    background: var(--bg-overlay);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.modal-connector-tag.optional.ok {
    background: var(--status-info-subtle);
    color: var(--info);
    border: 1px solid var(--status-info-subtle);
}

.modal-connectors-warning {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--status-danger-subtle);
    border: 1px solid var(--status-danger-subtle);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--status-danger);
    line-height: 1.5;
}

.modal-connectors-warning i {
    margin-top: 1px;
    flex-shrink: 0;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

.fade-enter-active { animation: fade-in 0.2s ease-out; }
.fade-leave-active { animation: fade-in 0.15s ease-in reverse; }

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   TASK DETAIL OVERLAY ADDITIONS
   ============================================ */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--status-info-subtle);
    color: var(--info);
}

.input-schema-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.input-schema-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.input-schema-item .label {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.input-schema-item .value {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.input-schema-desc {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-style: italic;
}

/* spinning: consolidated to cpod-spin at bottom of file */

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-icon-danger:hover {
    background: var(--status-danger-subtle);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    transition: all var(--duration-fast) var(--ease-out);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--accent-surface);
}

.file-upload-area .hint {
    margin-top: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.selected-file {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.selected-file i {
    font-size: 1.5rem;
    color: var(--primary);
}

.selected-file span {
    flex: 1;
    text-align: left;
    font-size: var(--text-sm);
}

/* Connector catalog grouped view */
.connectors-catalog {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.connector-solution-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.connector-solution-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.connector-solution-header i {
    font-size: 1rem;
    color: var(--muted-foreground);
}

.solution-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.solution-count {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-left: auto;
}

.connector-status.available {
    color: var(--muted-foreground);
    background: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Connector Config Modal */
.connector-config-modal {
    max-width: 640px;
    width: 100%;
}

.connector-config-modal .modal-body {
    padding: 0;
}

.connector-config-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--bg-active) 38%, var(--bg-surface));
}

.connector-config-intro .modal-description {
    margin: 0;
    color: var(--text-secondary);
}

.connector-config-endpoint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

.connector-config-endpoint i {
    color: var(--success);
    font-family: inherit;
}

.connector-config-docs {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
    min-height: 32px;
    padding: 0 var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}

.connector-config-docs:hover,
.connector-config-docs:focus-visible {
    border-color: var(--border-default);
    background: var(--bg-hover);
    color: var(--text-primary);
    outline: none;
}

.connector-scope {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.connector-scope__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.connector-scope__heading .form-label {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
}

.connector-scope__value {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: 600;
}

.connector-scope__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.connector-scope__options button {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    min-height: 64px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast), box-shadow var(--duration-fast);
}

.connector-scope__options button:hover {
    border-color: var(--border-default);
    background: var(--bg-hover);
}

.connector-scope__options button:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.connector-scope__options button.active {
    border-color: color-mix(in srgb, var(--primary) 68%, var(--border-default));
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-surface));
    color: var(--text-primary);
}

.connector-scope__options button > i {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--bg-active);
    color: var(--text-tertiary);
    font-size: 18px;
}

.connector-scope__options button.active > i {
    background: color-mix(in srgb, var(--primary) 16%, var(--bg-active));
    color: var(--primary);
}

.connector-scope__options button span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.connector-scope__options button strong {
    font-size: var(--text-sm);
    font-weight: 600;
}

.connector-scope__options button small {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

.connector-scope__locked {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.connector-scope__help {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.connector-scope__help i {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}

.connector-config-fields {
    padding: var(--space-5) var(--space-6) var(--space-6);
}

.connector-config-fields .form-group {
    min-width: 0;
}

.connector-config-field--api_key {
    grid-column: 1 / -1;
}

.connector-config-fields .form-label {
    min-height: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.connector-config-fields .form-label-optional {
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.connector-secret-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    color: var(--success);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.connector-input-shell {
    position: relative;
    min-width: 0;
}

.connector-input-shell .form-input {
    min-height: 46px;
    padding-right: 58px;
}

.connector-input-shell--secret .form-input {
    padding-right: 46px;
    font-family: var(--font-mono);
}

.connector-input-unit {
    position: absolute;
    top: 50%;
    right: var(--space-3);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    pointer-events: none;
    transform: translateY(-50%);
}

.connector-secret-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transform: translateY(-50%);
}

.connector-secret-toggle:hover,
.connector-secret-toggle:focus-visible {
    background: var(--bg-hover);
    color: var(--text-primary);
    outline: none;
}

.connector-config-fields .form-group.has-error .form-input {
    border-color: var(--destructive);
}

.connector-config-fields .field-error {
    color: var(--destructive);
    font-size: var(--text-xs);
}

.connector-config-modal .modal-footer {
    background: color-mix(in srgb, var(--bg-active) 32%, var(--bg-surface));
}

@media (max-width: 640px) {
    .connector-config-modal {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 24px);
    }

    .connector-config-intro,
    .connector-scope,
    .connector-config-fields {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .connector-config-intro {
        align-items: stretch;
        flex-direction: column;
    }

    .connector-config-docs {
        align-self: flex-start;
    }

    .connector-config-field--api_key {
        grid-column: auto;
    }
}

@media (max-width: 420px) {
    .connector-scope__options {
        grid-template-columns: 1fr;
    }
}

.modal-title-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 0.5rem;
}

.modal-badge {
    margin-left: 0.5rem;
    vertical-align: middle;
}

.test-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.test-result.success {
    background: var(--status-success-subtle);
    color: var(--status-success);
    border: 1px solid var(--status-success-subtle);
}

.test-result.error {
    background: var(--status-danger-subtle);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-subtle);
}

.field-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

input.form-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Connector tabs */
.connector-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0;
}

.connector-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    margin-bottom: -1px;
    transition: all var(--duration-fast) var(--ease-out);
}

.connector-tab:hover {
    color: var(--text-primary);
}

.connector-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.connector-tab .tab-count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: var(--radius-full);
}

.connector-tab.active .tab-count {
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.15);
    color: var(--primary);
}

/* Configured list */
.configured-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    text-align: center;
    gap: 8px;
}

.configured-empty > i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 8px;
}

.configured-empty p {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.configured-empty span {
    font-size: var(--text-sm);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

.configured-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.configured-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease;
}

.configured-row:hover {
    border-color: var(--border-default);
}

.configured-row-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.configured-type-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
}

.configured-vendor {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.configured-row-status {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.configured-row-status .status-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.configured-row-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.configured-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-sm {
    padding: 5px 10px;
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-sm.btn-ghost {
    background: none;
    color: var(--text-secondary);
}

.btn-sm.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm.btn-secondary:hover {
    background: var(--border-subtle);
}

/* =============================================
   LOGIN SCREEN  — CPOD-aligned tokens
   ============================================= */

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}

/* Auth checking splash — shown while /auth/me is in flight on initial load.
   Prevents the login screen from flashing for users with a valid session. */
.auth-checking-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}
.auth-checking-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
}
.auth-checking-logo {
    font-size: 48px;
    color: var(--primary);
    opacity: 0.85;
}
.auth-checking-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    animation: auth-spin 0.8s linear infinite;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--signal-500);
    border-radius: var(--radius-xl);
    padding: 40px 36px 36px;
    box-shadow: var(--shadow-xl);
    animation: cpod-scale-in 0.4s var(--ease-out) both;
}

@keyframes cpod-scale-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    font-size: 48px;
    color: var(--signal-900);
    display: block;
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    font-family: var(--font-display);
    letter-spacing: var(--tracking-tight);
    color: var(--foreground);
    margin: 0 0 4px;
}

.login-subtitle {
    font-size: var(--text-sm);
    color: var(--muted-foreground);
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    font-family: var(--font-mono);
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.login-form input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--foreground);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.login-form .password-field-wrapper input {
    padding-right: 2.5rem;
}

.login-form input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--border-glow);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: oklch(from var(--destructive) l c h / 0.1);
    color: var(--destructive);
    font-size: var(--text-sm);
}

.field-error {
    color: var(--destructive, #e74c3c);
    font-size: 12px;
    margin-top: 4px;
}

.login-submit {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--ink-1000);
    color: var(--ink-0);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: var(--tracking-wide);
}

.dark .login-submit {
    background: var(--ink-0);
    color: var(--ink-1000);
}

.login-submit:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.login-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Forgot Password & Password Toggle */
.forgot-password-link {
    color: var(--muted-foreground);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color 0.15s ease;
}
.forgot-password-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
}
.password-toggle:hover {
    color: var(--foreground);
}
.login-success {
    text-align: center;
    padding: 2rem 0;
}

/* Dev Quick Login */

.dev-login-section {
    margin-top: 24px;
}

.dev-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dev-login-divider::before,
.dev-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.dev-login-divider span {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.dev-accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dev-account-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--signal-500);
    border-radius: var(--radius-md);
    background: var(--secondary);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.dev-account-btn[data-role="global_admin"] { border-left-color: #10b981; }
.dev-account-btn[data-role="admin"] { border-left-color: var(--signal-500); }
.dev-account-btn[data-role="analyst"] { border-left-color: var(--ink-400); }
.dev-account-btn[data-role="compliance_approver"] { border-left-color: var(--ink-500); }
.dev-account-btn[data-role="viewer"] { border-left-color: var(--ink-300); }

.dev-account-btn:hover {
    background: var(--accent);
    box-shadow: var(--shadow-sm);
}

.dev-account-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: var(--font-bold);
    font-family: var(--font-mono);
    background: var(--ink-100);
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.dev-account-btn[data-role="global_admin"] .dev-account-role {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.dev-account-btn[data-role="admin"] .dev-account-role {
    background: var(--signal-100);
    color: var(--signal-700);
}

.dev-account-btn[data-role="analyst"] .dev-account-role {
    background: var(--ink-100);
    color: var(--ink-600);
}

.dev-account-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--foreground);
}

.dev-account-desc {
    font-size: var(--text-xs);
    color: var(--muted-foreground);
    line-height: 1.3;
}

/* =============================================
   PLATFORM SETTINGS
   ============================================= */

.section-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

.settings-category {
    margin-bottom: 24px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.category-title i {
    font-size: 16px;
    color: var(--text-secondary);
}

.platform-settings-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platform-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.1s ease;
}

.platform-setting-row:hover {
    background: var(--bg-tertiary);
}

.artifact-storage-settings {
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-secondary);
}

.artifact-storage-settings .category-title {
    margin-bottom: 10px;
}

.artifact-storage-guidance {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm, 6px);
    background: color-mix(in srgb, var(--info) 8%, transparent);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.artifact-storage-guidance i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--info);
    font-size: 15px;
}

.artifact-storage-guidance p {
    margin: 0;
}

.artifact-storage-setting-row {
    min-height: 56px;
}

.artifact-setting-control {
    position: relative;
    display: flex;
    align-items: center;
}

.artifact-setting-control .setting-edit-input {
    width: 132px;
    padding-right: 42px;
}

.artifact-setting-control .setting-edit-input::-webkit-inner-spin-button {
    opacity: 1;
}

.setting-unit {
    position: absolute;
    right: 10px;
    color: var(--text-tertiary);
    font-size: 11px;
    pointer-events: none;
}

.artifact-setting-value {
    min-width: 72px;
    text-align: right;
}

@media (max-width: 640px) {
    .artifact-storage-setting-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .artifact-storage-setting-row .setting-value {
        width: 100%;
        flex-wrap: wrap;
    }

    .artifact-storage-setting-row .btn-sm {
        min-width: 44px;
        min-height: 44px;
    }
}

.configs-console {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.configs-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    margin-bottom: 18px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 42%),
        var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.configs-hero-copy {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.configs-hero-icon,
.configs-side-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border-subtle));
    border-radius: 8px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-primary));
}

.configs-hero-icon i,
.configs-side-icon i {
    font-size: 19px;
}

.configs-kicker {
    margin: 0 0 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.configs-hero h3,
.configs-panel-header h4,
.configs-side-section h4 {
    margin: 0;
    color: var(--text-primary);
}

.configs-hero h3 {
    font-size: 24px;
    line-height: 1.2;
}

.configs-hero p:not(.configs-kicker),
.configs-side-section p {
    margin: 7px 0 0;
    max-width: 780px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

.configs-readiness {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-primary);
}

.configs-readiness-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--warning);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 16%, transparent);
}

.configs-readiness.is-ready .configs-readiness-dot {
    background: var(--success);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 16%, transparent);
}

.configs-readiness strong,
.configs-readiness span {
    display: block;
}

.configs-readiness strong {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

.configs-readiness span {
    max-width: 280px;
    margin-top: 3px;
    color: var(--text-secondary);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.configs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.configs-panel,
.configs-side-panel,
.configs-loading,
.configs-empty {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.configs-panel {
    min-width: 0;
    overflow: hidden;
}

.configs-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.configs-panel-header h4 {
    font-size: 17px;
}

.configs-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border-subtle));
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 10%, var(--bg-primary));
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.configs-pill.is-ready {
    border-color: color-mix(in srgb, var(--success) 30%, var(--border-subtle));
    color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--bg-primary));
}

.configs-setting-list {
    display: flex;
    flex-direction: column;
}

.configs-setting-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.72fr);
    gap: 20px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.configs-setting-row:last-child {
    border-bottom: none;
}

.configs-setting-row:hover {
    background: color-mix(in srgb, var(--primary) 4%, transparent);
}

.configs-setting-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.configs-setting-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.configs-setting-help {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.configs-setting-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.configs-setting-input {
    width: min(360px, 100%);
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--border-strong, var(--border-subtle));
    border-radius: 8px;
    outline: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 13px;
}

.configs-setting-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.configs-value {
    min-width: 0;
    max-width: 360px;
    padding: 7px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.configs-value.is-empty {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.configs-source {
    min-width: 56px;
    padding: 5px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.configs-source.source-db {
    color: var(--info);
    background: color-mix(in srgb, var(--info) 14%, var(--bg-primary));
}

.configs-source.source-env {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 14%, var(--bg-primary));
}

.configs-source.source-none {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.configs-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.configs-icon-button:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.configs-icon-button.is-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-foreground, #fff);
}

.configs-side-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.configs-side-section {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.configs-side-section:last-child {
    border-bottom: none;
}

.configs-side-section h4 {
    font-size: 14px;
}

.configs-side-section code {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 12px;
}

.configs-loading,
.configs-empty {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
}

.configs-empty i {
    font-size: 30px;
    color: var(--text-secondary);
}

.configs-empty p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.configs-empty span {
    font-size: 13px;
}

@media (max-width: 1100px) {
    .configs-hero,
    .configs-grid {
        grid-template-columns: 1fr;
    }

    .configs-hero {
        flex-direction: column;
    }

    .configs-readiness {
        min-width: 0;
    }

    .configs-setting-row {
        grid-template-columns: 1fr;
    }

    .configs-setting-control {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .configs-hero,
    .configs-panel-header,
    .configs-setting-row,
    .configs-side-section {
        padding: 15px;
    }

    .configs-hero-copy,
    .configs-panel-header {
        flex-direction: column;
    }

    .configs-hero h3 {
        font-size: 20px;
    }

    .configs-setting-control {
        flex-wrap: wrap;
    }

    .configs-value,
    .configs-setting-input {
        max-width: none;
        width: 100%;
        flex-basis: 100%;
    }
}

.global-config-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-secondary);
}

.global-config-tabs button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 0;
    border-radius: 7px;
    color: var(--text-secondary);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.global-config-tabs button:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.global-config-tabs button.active {
    color: var(--text-primary);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.global-config-tabs button:focus-visible,
.global-threat-form input:focus-visible,
.global-threat-access-filters input:focus-visible,
.global-threat-access-filters select:focus-visible,
.global-threat-switch:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.global-threat-context-block {
    min-height: 240px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--border-subtle));
    border-radius: 10px;
    background: color-mix(in srgb, var(--warning) 7%, var(--bg-secondary));
}

.global-threat-context-block__icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 14%, transparent);
    font-size: 22px;
}

.global-threat-context-block h3,
.global-threat-context-block p {
    margin: 0;
}

.global-threat-context-block h3 {
    color: var(--text-primary);
    font-size: 17px;
}

.global-threat-context-block p {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.global-threat-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 84% -30%, color-mix(in srgb, var(--info) 16%, transparent), transparent 48%),
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent 45%),
        var(--bg-secondary);
}

.global-threat-readiness.is-healthy .configs-readiness-dot {
    background: var(--success);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 16%, transparent);
}

.global-threat-readiness.is-failed .configs-readiness-dot,
.global-threat-readiness.is-degraded .configs-readiness-dot {
    background: var(--danger);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 15%, transparent);
}

.global-threat-readiness.is-initial_syncing .configs-readiness-dot,
.global-threat-readiness.is-incremental_syncing .configs-readiness-dot,
.global-threat-readiness.is-sync_queued .configs-readiness-dot,
.global-threat-readiness.is-migrating .configs-readiness-dot {
    background: var(--info);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--info) 16%, transparent);
}

.global-threat-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.global-threat-alert > i {
    color: var(--info);
    font-size: 20px;
}

.global-threat-alert > div:not(.spinner) {
    min-width: 0;
    display: grid;
    gap: 2px;
    flex: 1;
}

.global-threat-alert strong {
    color: var(--text-primary);
    font-size: 13px;
}

.global-threat-alert span {
    font-size: 12px;
    line-height: 1.45;
}

.global-threat-alert.is-warning {
    border-color: color-mix(in srgb, var(--warning) 32%, var(--border-subtle));
    background: color-mix(in srgb, var(--warning) 7%, var(--bg-secondary));
}

.global-threat-alert.is-warning > i { color: var(--warning); }

.global-threat-alert.is-error {
    border-color: color-mix(in srgb, var(--danger) 34%, var(--border-subtle));
    background: color-mix(in srgb, var(--danger) 7%, var(--bg-secondary));
}

.global-threat-alert.is-error > i { color: var(--danger); }

.global-threat-alert.is-progress {
    border-color: color-mix(in srgb, var(--info) 30%, var(--border-subtle));
    background: color-mix(in srgb, var(--info) 7%, var(--bg-secondary));
}

.global-threat-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.global-threat-metric {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.global-threat-metric span {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.global-threat-metric strong {
    color: var(--text-primary);
    font-size: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-threat-metric.is-stale {
    border-color: color-mix(in srgb, var(--warning) 35%, var(--border-subtle));
}

.global-threat-metric-loading,
.global-threat-metric-unavailable {
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.global-threat-metric-loading { animation: globalThreatMetricPulse 1.2s ease-in-out infinite; }

@keyframes globalThreatMetricPulse {
    0%, 100% { opacity: .48; }
    50% { opacity: 1; }
}

.global-threat-catalog-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: -8px 0 18px;
    color: var(--danger);
    font-size: 12px;
}

.global-threat-catalog-status.is-stale { color: var(--warning); }
.global-threat-catalog-status .btn-link { margin-left: auto; }

.global-threat-grid { margin-bottom: 18px; }

.global-threat-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 20px;
}

.global-threat-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.global-threat-field--wide { grid-column: 1 / -1; }

.global-threat-field > label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

.global-threat-field > small {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
}

.global-threat-form input,
.global-threat-form select,
.global-threat-access-filters input,
.global-threat-access-filters select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-strong, var(--border-subtle));
    border-radius: 8px;
    outline: none;
    color: var(--text-primary);
    background: var(--bg-primary);
    font: inherit;
    font-size: 13px;
}

.global-threat-form input[aria-invalid="true"],
.global-threat-form select[aria-invalid="true"] {
    border-color: var(--danger);
}

.global-threat-form input:disabled {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

.global-threat-secret-control,
.global-threat-number-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-threat-secret-control input { min-width: 0; }

.global-threat-number-control {
    position: relative;
}

.global-threat-number-control span {
    position: absolute;
    right: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
}

.global-threat-number-control input { padding-right: 48px; }

.global-threat-field-error {
    color: var(--danger);
    font-size: 11px;
}

.global-threat-test-result {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 12px;
}

.global-threat-test-result.is-success {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--bg-primary));
}

.global-threat-test-result.is-error {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--bg-primary));
}

.global-threat-test-result small { margin-left: auto; }

.global-threat-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 2px;
}

.global-threat-form-actions button,
.global-threat-source-actions button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.spinner--small { width: 14px; height: 14px; }

.global-threat-side-panel { align-self: stretch; }

.global-threat-source-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.global-threat-provider {
    position: relative;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-secondary);
}

.global-threat-provider__summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 72px;
    padding: 12px 18px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
}

button.global-threat-provider__summary { cursor: pointer; }
button.global-threat-provider__summary:hover { background: var(--bg-hover); }
.global-threat-provider__icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--border-default); border-radius: 9px; color: var(--primary); font-size: 20px; }
.global-threat-provider__identity { display: grid; gap: 4px; min-width: 0; }
.global-threat-provider__identity strong { font-size: 15px; }
.global-threat-provider__identity small { overflow: hidden; color: var(--text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.global-threat-provider__state { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.global-threat-provider__state > i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.global-threat-provider__state.is-failed > i,
.global-threat-provider__state.is-degraded > i { background: var(--warning); }
.global-threat-provider__state.is-planned > i,
.global-threat-provider.is-disabled .global-threat-provider__state > i { background: var(--text-tertiary); }
.global-threat-provider__caret { color: var(--text-secondary); }
.global-threat-provider__toggle { position: absolute; top: 22px; right: 54px; z-index: 1; }
.global-threat-provider:not(.is-placeholder) .global-threat-provider__summary { padding-right: 190px; }
.global-threat-provider__body { display: contents; }
.global-threat-provider.is-placeholder { opacity: .78; }
.global-threat-provider.is-placeholder .global-threat-provider__summary { grid-template-columns: 42px minmax(0, 1fr) auto 74px; }
.global-threat-provider.is-placeholder .global-threat-provider__toggle { position: static; cursor: not-allowed; opacity: .58; }

@media (max-width: 640px) {
    .global-threat-provider__summary,
    .global-threat-provider.is-placeholder .global-threat-provider__summary {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 12px;
    }
    .global-threat-provider:not(.is-placeholder) .global-threat-provider__summary { padding-right: 12px; }
    .global-threat-provider__icon { width: 38px; height: 38px; }
    .global-threat-provider__identity small { white-space: normal; }
    .global-threat-provider__state { grid-column: 2; }
    .global-threat-provider__caret { grid-column: 3; grid-row: 1; }
    .global-threat-provider__toggle,
    .global-threat-provider.is-placeholder .global-threat-provider__toggle {
        position: static;
        grid-column: 3;
        grid-row: 2;
    }
}

.global-threat-runs,
.global-threat-access {
    margin-bottom: 18px;
}

.global-threat-inline-loading {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.global-threat-compact-empty { min-height: 160px; border: 0; box-shadow: none; }

.global-threat-run-list,
.global-threat-access-list {
    display: flex;
    flex-direction: column;
}

.global-threat-run-row {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(150px, .7fr) minmax(280px, 1.6fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 12px;
}

.global-threat-run-row:last-child { border-bottom: 0; }
.global-threat-run-row small { color: var(--danger); font-family: var(--font-mono, monospace); }

.global-threat-run-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-primary);
    font-weight: 700;
}

.global-threat-run-status i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--text-tertiary);
}

.global-threat-run-status.is-succeeded i { background: var(--success); }
.global-threat-run-status.is-running i,
.global-threat-run-status.is-queued i { background: var(--info); }
.global-threat-run-status.is-failed i { background: var(--danger); }
.global-threat-run-status.is-partial i { background: var(--warning); }

.global-threat-access-header { align-items: center; }

.global-threat-access-header > div:first-child > span {
    display: block;
    max-width: 700px;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.global-threat-access-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-threat-search {
    position: relative;
    display: block;
}

.global-threat-search i {
    position: absolute;
    top: 50%;
    left: 11px;
    color: var(--text-secondary);
    transform: translateY(-50%);
    pointer-events: none;
}

.global-threat-search input { width: 240px; padding-left: 34px; }
.global-threat-access-filters select { width: 160px; }
.global-threat-access-error { margin: 14px; }

.global-threat-access-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(130px, .6fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 62px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.global-threat-tenant {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-threat-tenant-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--bg-primary));
    font-size: 12px;
    font-weight: 800;
}

.global-threat-tenant div { min-width: 0; display: grid; gap: 3px; }
.global-threat-tenant strong { color: var(--text-primary); font-size: 13px; }
.global-threat-tenant small,
.global-threat-access-row > time { color: var(--text-secondary); font-size: 11px; }
.global-threat-tenant small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-threat-reconciliation-pending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--warning) !important;
}

.global-threat-switch {
    min-width: 96px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    border: 0;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
}

.global-threat-switch > span {
    width: 34px;
    height: 20px;
    position: relative;
    display: inline-block;
    border-radius: 999px;
    background: var(--bg-tertiary);
    box-shadow: inset 0 0 0 1px var(--border-strong, var(--border-subtle));
    transition: background .16s ease;
}

.global-threat-switch > span::after {
    content: '';
    width: 14px;
    height: 14px;
    position: absolute;
    top: 3px;
    left: 3px;
    border-radius: 999px;
    background: var(--text-secondary);
    transition: transform .16s ease, background .16s ease;
}

.global-threat-switch.is-on > span { background: color-mix(in srgb, var(--success) 28%, var(--bg-tertiary)); }
.global-threat-switch.is-on > span::after { background: var(--success); transform: translateX(14px); }
.global-threat-switch em { min-width: 48px; font-style: normal; font-size: 11px; font-weight: 700; }
.global-threat-switch:disabled { opacity: .55; cursor: wait; }

.global-threat-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 9px 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
}

.global-threat-pagination > div { display: flex; gap: 7px; }

.threat-intel-platform-managed {
    padding: 2px 6px;
    border: 1px solid color-mix(in srgb, var(--info) 24%, var(--border-subtle));
    border-radius: 999px;
    color: var(--info) !important;
    background: color-mix(in srgb, var(--info) 8%, transparent);
    font-size: 9px !important;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    .global-threat-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .global-threat-run-row { grid-template-columns: minmax(130px, .7fr) minmax(130px, .7fr) 1.5fr; }
    .global-threat-run-row small { grid-column: 1 / -1; }
    .global-threat-access-header { align-items: stretch; flex-direction: column; }
    .global-threat-access-filters { width: 100%; }
    .global-threat-search { flex: 1; }
    .global-threat-search input { width: 100%; }
}

@media (max-width: 640px) {
    .global-config-tabs { width: 100%; }
    .global-config-tabs button { min-height: 44px; flex: 1; justify-content: center; padding: 0 9px; }
    .global-threat-context-block { grid-template-columns: auto 1fr; padding: 18px; }
    .global-threat-context-block .btn-secondary { grid-column: 1 / -1; min-height: 44px; }
    .global-threat-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
    .global-threat-metric { padding: 12px; }
    .global-threat-form { grid-template-columns: 1fr; padding: 15px; }
    .global-threat-field--wide,
    .global-threat-test-result,
    .global-threat-form-actions { grid-column: auto; }
    .global-threat-form-actions { flex-direction: column-reverse; }
    .global-threat-form-actions button { width: 100%; min-height: 44px; }
    .global-threat-source-actions { grid-template-columns: 1fr; }
    .global-threat-source-actions button { min-height: 44px; }
    .global-threat-run-row { grid-template-columns: 1fr; gap: 5px; padding: 12px 15px; }
    .global-threat-run-row small { grid-column: auto; }
    .global-threat-access-filters { align-items: stretch; flex-direction: column; }
    .global-threat-access-filters select { width: 100%; min-height: 44px; }
    .global-threat-search input { min-height: 44px; }
    .global-threat-access-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 15px; }
    .global-threat-access-row > time { grid-column: 1 / -1; grid-row: 2; padding-left: 44px; }
    .global-threat-switch { grid-column: 2; grid-row: 1; }
    .global-threat-switch em { display: none; }
    .global-threat-pagination { padding: 9px 15px; }
    .global-threat-pagination .configs-icon-button { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .global-threat-switch > span,
    .global-threat-switch > span::after { transition: none; }
}

.customerops-console {
    --cops-surface: var(--bg-secondary);
    --cops-surface-raised: var(--bg-primary);
    --cops-border: var(--border-subtle);
    --cops-muted: var(--text-secondary);
    --cops-strong: var(--text-primary);
    --cops-input: var(--bg-tertiary);
    display: block;
    align-items: initial;
    justify-content: initial;
    text-align: left;
    min-height: 0;
    padding: 0;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.subtab-content .settings-content.customerops-console:has(> :only-child:not(.preferences-form)) {
    display: block;
    text-align: left;
    padding: 0;
    min-height: 0;
}

.settings-content.customerops-console > div:only-child:not(.preferences-form) > *:first-child {
    width: auto;
    height: auto;
    display: flex;
    background: var(--cops-surface);
    border: 1px solid var(--cops-border);
    border-radius: 8px;
}

.customerops-loading {
    min-height: 360px;
}

.customerops-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.customerops-hero,
.customerops-actions,
.customerops-panel,
.customerops-metric,
.customerops-alert {
    border: 1px solid var(--cops-border);
    background: var(--cops-surface);
    border-radius: 8px;
}

.customerops-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.customerops-hero-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.customerops-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: var(--warning, #d99a2b);
    background: color-mix(in srgb, var(--warning, #d99a2b) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--warning, #d99a2b) 26%, transparent);
}

.customerops-mark i {
    font-size: 22px;
}

.customerops-eyebrow,
.customerops-metric-label,
.customerops-field label,
.customerops-secret-row span,
.customerops-pull-meta span {
    color: var(--cops-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.customerops-hero h3,
.customerops-panel h4 {
    margin: 0;
    color: var(--cops-strong);
}

.customerops-hero h3 {
    font-size: 22px;
    line-height: 1.25;
}

.customerops-hero p,
.customerops-panel-head p {
    margin: 4px 0 0;
    color: var(--cops-muted);
    line-height: 1.45;
}

.customerops-hero p {
    max-width: 660px;
    font-size: 13px;
}

.customerops-hero-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.customerops-status-pill,
.customerops-mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.customerops-status-pill {
    padding: 8px 10px;
    border: 1px solid var(--cops-border);
    color: var(--cops-muted);
    background: var(--cops-input);
}

.customerops-status-pill span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.customerops-status-pill.is-active {
    color: var(--status-success, #22a06b);
    background: color-mix(in srgb, var(--status-success, #22a06b) 12%, transparent);
    border-color: color-mix(in srgb, var(--status-success, #22a06b) 26%, transparent);
}

.customerops-status-pill.is-paused,
.customerops-status-pill.is-warning {
    color: var(--warning, #d99a2b);
    background: color-mix(in srgb, var(--warning, #d99a2b) 13%, transparent);
    border-color: color-mix(in srgb, var(--warning, #d99a2b) 30%, transparent);
}

.customerops-status-pill.is-off {
    color: var(--cops-muted);
}

.customerops-status-meta {
    color: var(--cops-muted);
    font-size: 12px;
}

.customerops-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px;
}

.customerops-actions .btn-primary,
.customerops-actions .btn-secondary {
    min-height: 38px;
}

.customerops-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
}

.customerops-metric {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
}

.customerops-metric-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--cops-input);
    color: var(--cops-muted);
}

.customerops-metric-icon.is-pending {
    color: var(--info, #3b82f6);
    background: color-mix(in srgb, var(--info, #3b82f6) 12%, transparent);
}

.customerops-metric-icon.is-failed,
.customerops-metric-icon.is-blocked {
    color: var(--danger, #e05260);
    background: color-mix(in srgb, var(--danger, #e05260) 12%, transparent);
}

.customerops-metric-icon.is-dead {
    color: var(--warning, #d99a2b);
    background: color-mix(in srgb, var(--warning, #d99a2b) 13%, transparent);
}

.customerops-metric-value {
    display: block;
    color: var(--cops-strong);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.05;
}

.customerops-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.customerops-panel {
    padding: 16px;
}

.customerops-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.customerops-panel h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.customerops-panel-head p {
    font-size: 12px;
}

.customerops-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
}

.customerops-input-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid var(--cops-border);
    border-radius: 8px;
    background: var(--cops-input);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.customerops-input-wrap:focus-within {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b82f6) 16%, transparent);
}

.customerops-input-wrap i {
    color: var(--cops-muted);
    font-size: 17px;
    flex: 0 0 auto;
}

.customerops-input-wrap input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--cops-strong);
    font-size: 13px;
    font-family: 'Inter', system-ui, sans-serif;
}

.customerops-input-wrap input::placeholder {
    color: color-mix(in srgb, var(--cops-muted) 72%, transparent);
}

.customerops-two-col,
.customerops-pull-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.customerops-field-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--cops-muted);
    font-size: 12px;
}

.customerops-mini-pill {
    padding: 6px 8px;
}

.customerops-mini-pill.is-ok {
    color: var(--status-success, #22a06b);
    background: color-mix(in srgb, var(--status-success, #22a06b) 12%, transparent);
}

.customerops-mini-pill.is-muted {
    color: var(--cops-muted);
    background: var(--cops-input);
}

.customerops-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.customerops-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.customerops-toggle span {
    width: 42px;
    height: 24px;
    padding: 3px;
    border-radius: 999px;
    background: var(--cops-input);
    border: 1px solid var(--cops-border);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.customerops-toggle span::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--cops-muted);
    transition: transform 0.15s ease, background 0.15s ease;
}

.customerops-toggle input:checked + span {
    background: color-mix(in srgb, var(--status-success, #22a06b) 18%, transparent);
    border-color: color-mix(in srgb, var(--status-success, #22a06b) 34%, transparent);
}

.customerops-toggle input:checked + span::before {
    transform: translateX(18px);
    background: var(--status-success, #22a06b);
}

.customerops-toggle strong {
    color: var(--cops-strong);
    font-size: 13px;
}

.customerops-secret-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 9px 10px;
    border: 1px solid var(--cops-border);
    border-radius: 8px;
    background: var(--cops-input);
    margin-top: 10px;
}

.customerops-secret-row code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cops-strong);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.customerops-icon-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--cops-border);
    border-radius: 8px;
    color: var(--cops-muted);
    background: var(--cops-surface-raised);
    cursor: pointer;
}

.customerops-icon-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.customerops-empty-secret {
    display: flex;
    gap: 9px;
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed var(--cops-border);
    border-radius: 8px;
    color: var(--cops-muted);
    background: var(--cops-input);
    font-size: 12px;
    line-height: 1.45;
}

.customerops-pull-meta {
    margin-top: 12px;
}

.customerops-pull-meta div {
    padding: 10px;
    border: 1px solid var(--cops-border);
    border-radius: 8px;
    background: var(--cops-input);
}

.customerops-pull-meta strong {
    display: block;
    margin-top: 4px;
    color: var(--cops-strong);
    font-size: 13px;
}

.customerops-feedback {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.customerops-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 11px 12px;
    color: var(--cops-muted);
    font-size: 13px;
    line-height: 1.45;
}

.customerops-alert span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.customerops-alert i {
    margin-top: 1px;
    font-size: 16px;
}

.customerops-alert.is-success {
    color: var(--status-success, #22a06b);
    background: color-mix(in srgb, var(--status-success, #22a06b) 9%, var(--cops-surface));
    border-color: color-mix(in srgb, var(--status-success, #22a06b) 24%, transparent);
}

.customerops-alert.is-warning {
    color: var(--warning, #d99a2b);
    background: color-mix(in srgb, var(--warning, #d99a2b) 10%, var(--cops-surface));
    border-color: color-mix(in srgb, var(--warning, #d99a2b) 25%, transparent);
}

.customerops-alert.is-error {
    color: var(--danger, #e05260);
    background: color-mix(in srgb, var(--danger, #e05260) 9%, var(--cops-surface));
    border-color: color-mix(in srgb, var(--danger, #e05260) 24%, transparent);
}

@media (max-width: 1024px) {
    .customerops-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

@media (max-width: 720px) {
    .customerops-hero,
    .customerops-panel-head,
    .customerops-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .customerops-hero-status {
        align-items: flex-start;
    }

    .customerops-metrics,
    .customerops-grid,
    .customerops-two-col,
    .customerops-pull-meta {
        grid-template-columns: 1fr;
    }

    .customerops-actions .btn-primary,
    .customerops-actions .btn-secondary {
        justify-content: center;
        width: 100%;
    }

    .customerops-secret-row {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .customerops-secret-row span {
        grid-column: 1 / -1;
    }
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.setting-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.setting-description {
    font-size: 11px;
    color: var(--text-secondary);
}

.setting-value {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.setting-display-value {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setting-edit-input {
    padding: 6px 10px;
    border: 1px solid var(--accent, #3b82f6);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    width: 220px;
    outline: none;
}

.source-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.source-badge.source-db {
    background: var(--status-info-subtle);
    color: var(--info);
}

.source-badge.source-env {
    background: var(--status-success-subtle);
    color: var(--status-success);
}

.source-badge.source-none {
    background: var(--bg-overlay);
    color: var(--muted-foreground);
}

/* ============================================
   LLM PROVIDER SIMPLIFIED UI
   ============================================ */

.llm-provider-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.provider-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.provider-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.provider-select {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    max-width: 280px;
    outline: none;
    transition: border-color 0.15s ease;
}

.provider-select:focus {
    border-color: var(--accent, #3b82f6);
}

.provider-key-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.provider-key-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-key-input .setting-edit-input {
    flex: 1;
    width: auto;
}

.provider-status {
    margin-top: 2px;
}

.provider-status .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* LLM provider test connection result */
.llm-test-result {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: 1.45;
    border: 1px solid var(--border);
}
.llm-test-result.success {
    background: var(--status-success-subtle);
    color: var(--status-success);
    border-color: oklch(from var(--status-success) l c h / 0.3);
}
.llm-test-result.failure {
    background: var(--status-danger-subtle);
    color: var(--status-danger);
    border-color: oklch(from var(--status-danger) l c h / 0.3);
}
.llm-test-result i {
    flex-shrink: 0;
    font-size: var(--text-base);
}

/* Advanced container settings toggle */
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    user-select: none;
}

.advanced-toggle:hover {
    color: var(--text-secondary);
}

.advanced-toggle i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

/* Count pill on the Advanced Container Settings toggle — tells the user
   there's content inside before they expand it. Sized small so it doesn't
   compete with the toggle label, ``color-mix``'d toward the brand accent
   so it reads as an information badge (not a status badge). */
.advanced-count {
    margin-inline-start: 6px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--signal-500) 14%, transparent);
    color: var(--signal-500);
    letter-spacing: 0.04em;
}

.btn-sm.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-sm.btn-primary:hover {
    filter: brightness(1.15);
}

.btn-sm.btn-sm-danger {
    color: var(--status-danger);
}

.btn-sm.btn-sm-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* ============================================
   APPROVALS PAGE — full width, fill available space like other pages
   ============================================ */
.approvals-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 1.5rem;
    padding: 0;
}
.page-content .approvals-page .subtab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.page-content .approvals-page .empty-state {
    flex: 1;
    min-height: 280px;
    width: 100%;
}
.page-content .approvals-page .alert-list {
    width: 100%;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-default);
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* ── In-App Notification Bell & Panel ── */
.notif-bell-wrapper { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--status-danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 4px;
  border-radius: var(--radius-full); min-width: 16px;
  text-align: center; pointer-events: none;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 480px; background: var(--card);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 1000;
  display: flex; flex-direction: column; overflow: hidden;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.notif-panel-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.notif-mark-all { font-size: var(--text-xs); }
.notif-list { overflow-y: auto; flex: 1; max-height: 400px; }
.notif-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default);
  cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--muted); }
.notif-item-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.notif-item.info .notif-item-icon    { color: var(--info); }
.notif-item.warning .notif-item-icon { color: var(--status-warning); }
.notif-item.error .notif-item-icon   { color: var(--status-danger); }
.notif-item-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-item-title {
  font-size: var(--text-sm); font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-msg {
  font-size: var(--text-xs); color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time { font-size: var(--text-xs); color: var(--text-secondary); }
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: var(--radius-full);
  background: var(--info); flex-shrink: 0; align-self: center;
}
.notif-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-2); padding: var(--space-8);
  color: var(--text-secondary); font-size: var(--text-sm);
}
.notif-empty i { font-size: 32px; }

/* ========================================
   AUTH UI: Login MFA, Setup Wizard, Security Tab
   ======================================== */

/* Login MFA step */
.login-mfa { text-align: center; padding: var(--space-4) 0; }
.mfa-prompt { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6); }
.mfa-prompt h3 { margin: 0; font-size: var(--text-lg); color: var(--text-primary); }
.mfa-prompt p { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.mfa-icon { font-size: 40px; color: var(--primary); }
.mfa-icon--success { color: var(--success); }
.mfa-prompt-meta { color: var(--muted-foreground); font-size: var(--text-sm); }
.mfa-input {
  width: 100%; max-width: 240px; margin: 0 auto; display: block;
  text-align: center; font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xl); letter-spacing: 0.4em; padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--background); color: var(--text-primary);
}
.mfa-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 99, 102, 241), 0.15); }
.mfa-verifying { display: flex; align-items: center; justify-content: center; gap: var(--space-2); color: var(--text-secondary); font-size: var(--text-sm); margin-top: var(--space-3); }
.mfa-back { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-4); font-size: var(--text-sm); color: var(--text-secondary); background: none; border: none; cursor: pointer; padding: 0; }
.mfa-back:hover { color: var(--primary); }

/* Login Reset step */
.login-reset { padding: var(--space-2) 0; }

/* btn-link (inline text button) */
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: var(--text-sm); padding: 0; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* btn-destructive */
.btn-destructive {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-2) var(--space-3);
  background: var(--destructive); color: #fff; border: none; border-radius: var(--radius-md);
  font-size: var(--text-sm); cursor: pointer; font-weight: 500;
}
.btn-destructive:hover { opacity: 0.9; }
.btn-destructive:disabled { opacity: 0.5; cursor: not-allowed; }

/* Setup Wizard */
.setup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--background);
}
.setup-card {
  width: 100%; max-width: 440px; padding: var(--space-8);
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); text-align: center;
}
.setup-progress { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-bottom: var(--space-6); }
.setup-dot {
  width: 10px; height: 10px; border-radius: var(--radius-full);
  border: 2px solid var(--border); background: transparent; transition: all var(--duration-fast) var(--ease-out);
}
.setup-dot.active { border-color: var(--primary); background: var(--primary); }
.setup-dot.done { border-color: var(--success); background: var(--success); }
.setup-icon { font-size: 48px; color: var(--primary); margin-bottom: var(--space-2); }
.setup-step h2 { margin: 0 0 var(--space-2); font-size: var(--text-xl); color: var(--text-primary); }
.setup-subtitle { margin: 0 0 var(--space-6); font-size: var(--text-sm); color: var(--text-secondary); }
.setup-complete { animation: fadeIn 0.3s ease; }
.setup-complete .setup-icon { color: var(--success); }
.char-count { display: block; text-align: right; font-size: var(--text-xs); color: var(--text-secondary); margin-top: var(--space-1); }

/* Security Tab */
.security-section {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-5); margin-bottom: var(--space-4);
  background: var(--card);
}
.security-section-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4);
}
.security-section-info { flex: 1; }
.security-section-info h4 { margin: 0 0 var(--space-1); display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); color: var(--text-primary); }
.security-section-info p { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.security-section-body { padding-top: var(--space-4); }
.security-status-badge {
  display: inline-flex; align-items: center; padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600;
  white-space: nowrap;
}
.security-status-badge.enabled { background: rgba(var(--success-rgb, 34, 197, 94), 0.15); color: var(--success); }
.security-status-badge.disabled { background: var(--accent); color: var(--text-secondary); }

/* MFA Setup Panel */
.mfa-setup-panel { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.mfa-qr-section { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.mfa-qr-target { background: #fff; padding: var(--space-3); border-radius: var(--radius-md); display: inline-block; }
.mfa-instruction { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }
.mfa-manual-key { margin-top: var(--space-2); font-size: var(--text-sm); }
.mfa-manual-key summary { cursor: pointer; color: var(--text-secondary); }
.mfa-manual-key summary:hover { color: var(--primary); }
.mfa-secret-display {
  display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2);
  background: var(--accent); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}
.mfa-secret-display code { font-family: 'JetBrains Mono', monospace; font-size: var(--text-sm); word-break: break-all; color: var(--text-primary); }
.mfa-confirm-section { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: var(--space-2); }
.mfa-confirm-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
.mfa-confirm-row { display: flex; gap: var(--space-2); align-items: center; }
.mfa-input-small {
  width: 120px; text-align: center; font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-base); letter-spacing: 0.3em; padding: var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--background); color: var(--text-primary);
}
.mfa-input-small:focus { border-color: var(--primary); outline: none; }
.mfa-disable-section { display: flex; flex-direction: column; gap: var(--space-3); }
.mfa-disable-form { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.mfa-enabled-note { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }

/* Password Change Form */
.password-change-form { max-width: 400px; display: flex; flex-direction: column; gap: var(--space-3); }
.password-change-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.password-change-form label { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.5px; }
.password-change-form input[type="password"] { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--background); color: var(--foreground); font-size: var(--text-sm); transition: border-color 0.15s; }
.password-change-form input[type="password"]:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px oklch(0.65 0.15 250 / 0.15); }
.password-strength { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.strength-bar { flex: 1; height: 4px; border-radius: var(--radius-full); background: var(--accent); overflow: hidden; }
.strength-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.3s, background 0.3s; }
.strength-fill.weak { background: var(--destructive); }
.strength-fill.fair { background: #f59e0b; }
.strength-fill.good { background: #84cc16; }
.strength-fill.strong { background: var(--success); }
.strength-label { font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.strength-label.weak { color: var(--destructive); }
.strength-label.fair { color: #f59e0b; }
.strength-label.good { color: #84cc16; }
.strength-label.strong { color: var(--success); }
.password-requirements { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.password-requirements span { font-size: var(--text-xs); color: var(--text-secondary); display: inline-flex; align-items: center; gap: 2px; }
.password-requirements span.met { color: var(--success); }
.password-match { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); margin-top: var(--space-1); }
.password-match.match { color: var(--success); }
.password-match.mismatch { color: var(--destructive); }

/* Sessions */
.sessions-list { display: flex; flex-direction: column; }
.session-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
}
.session-row:last-child { border-bottom: none; }
.session-row.current { border-left: 3px solid var(--success); padding-left: calc(var(--space-2) + var(--space-1)); }
.session-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-secondary); border-radius: var(--radius-md); background: var(--accent); flex-shrink: 0; }
.session-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.session-device { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: var(--space-2); }
.session-current-badge {
  display: inline-flex; padding: 1px var(--space-2); border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600;
  background: rgba(var(--success-rgb, 34, 197, 94), 0.15); color: var(--success);
}
.session-meta { font-size: var(--text-xs); color: var(--text-secondary); }

/* Modal Actions */
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border); margin-top: var(--space-4); }

/* Team member admin actions */
.team-member-actions { display: flex; gap: var(--space-1); align-items: center; flex-shrink: 0; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   L-03: TEXT TRUNCATION — prevent overflow on small screens
   ============================================ */
.connector-name,
.team-member-name,
.team-member-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connector-category {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Table cells: prevent long values from blowing out layout */
.alert-table td,
.findings-table td,
.sla-table td,
.network-table td,
.investigations-table td {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar nav labels on small screens */
.sidebar .nav-label,
.sidebar .sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card titles on narrow viewports */
@media (max-width: 640px) {
    .card-title,
    .section-header h3,
    .kpi-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ============================================
   L-05: DARK MODE CONTRAST IMPROVEMENTS
   ============================================ */
/* Ensure muted text has sufficient contrast (4.5:1) in dark mode */
.dark .text-muted-sm,
.dark .cpod-muted {
    color: oklch(0.65 0.01 265);
}

/* Borders more visible in dark mode */
.dark .connector-card,
.dark .history-card,
.dark .task-card,
.dark .team-member-card {
    border-color: oklch(0.26 0.005 285);
}

/* Filter dropdowns: ensure readable text in dark */
.dark select,
.dark .filter-group select {
    color: var(--foreground);
    background: var(--card);
}

/* Empty state text: lift from too-dark tertiary */
.dark .empty-state p,
.dark .empty-state h3 {
    color: oklch(0.72 0.01 265);
}

.dark .configured-empty p {
    color: oklch(0.80 0.005 85);
}

.dark .configured-empty span {
    color: oklch(0.65 0.01 265);
}

/* Connector card descriptions: boost contrast in dark mode */
.dark .connector-card-description,
.dark .connector-desc,
.dark .connector-category {
    color: oklch(0.70 0.01 265);
}

/* Session current badge: ensure green bg works in dark */
.dark .session-current-badge {
    background: oklch(0.65 0.16 145 / 0.18);
    color: var(--success);
}

/* Status badges: ensure readable on dark card backgrounds */
.dark .connector-status.available {
    color: oklch(0.65 0.01 265);
    background: oklch(1 0 0 / 0.06);
    border-color: oklch(1 0 0 / 0.1);
}

/* Dark mode button visibility: ensure primary buttons stand out */
.dark .btn-primary {
    border-color: oklch(1 0 0 / 0.15);
    box-shadow: 0 1px 3px oklch(0 0 0 / 0.3);
}

.dark .btn-primary:hover {
    box-shadow: 0 2px 8px oklch(0 0 0 / 0.4);
}

/* Dark mode secondary buttons — visible border */
.dark .btn-secondary {
    border-color: oklch(1 0 0 / 0.12);
}

/* Table row hover: stronger for clickable rows */
.dark .data-table tbody tr:hover,
.dark .team-table tbody tr:hover {
    background: oklch(1 0 0 / 0.08);
}

/* Dark mode cards: slightly stronger borders for definition */
.dark .card,
.dark .section-card {
    border-color: oklch(1 0 0 / 0.08);
}

/* Dark mode search inputs: better placeholder visibility */
.dark input::placeholder,
.dark .search-input::placeholder {
    color: oklch(0.50 0.01 265);
}

/* Dark mode filter selects: ensure readable */
.dark select {
    border-color: oklch(1 0 0 / 0.10);
}

/* Dark mode sidebar active: stronger glow */
.dark .nav-item.active {
    background: var(--sidebar-accent);
    color: var(--signal-500);
}

.dark .nav-item.active::before {
    background: var(--signal-500);
}

/* Dark mode playbook/task cards: ensure inactive cards are still readable */
.dark .investigations-page .playbooks-grid .apt-card,
.dark .task-card {
    border-color: oklch(1 0 0 / 0.08);
}

.dark .investigations-page .playbooks-grid .apt-card:hover,
.dark .task-card:hover {
    border-color: oklch(1 0 0 / 0.15);
    box-shadow: 0 4px 16px oklch(0 0 0 / 0.3);
}

/* Dark mode alias tags: boost visibility */
.dark .alias-tag {
    color: oklch(0.72 0.01 265);
    border-color: oklch(1 0 0 / 0.10);
}

/* Dark mode tab count badges */
.dark .pref-row input[type="checkbox"]:not(:checked) {
    background: var(--ink-600);
    border-color: var(--ink-500);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
}

.dark .pref-row input[type="checkbox"]:checked {
    background: var(--signal-500);
    border-color: var(--signal-700);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.2);
}

.dark .pref-row input[type="checkbox"]:checked::before {
    background: var(--ink-1000);
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
}

.dark .pref-row input[type="checkbox"]::before {
    background: var(--ink-200);
}

.dark .pref-row input[type="checkbox"]:hover {
    border-color: var(--ink-400);
}

.dark .pref-row input[type="checkbox"]:checked:hover {
    border-color: var(--signal-300);
}

.dark .tab-count {
    background: oklch(1 0 0 / 0.08);
    color: var(--foreground);
}

.dark .tab-meta {
    color: var(--ink-400);
}

.dark .page-subnav .sub-tab.active .tab-meta {
    color: var(--ink-300);
}

/* Dark mode sub-tabs (in-page pill strips, e.g. connector tabs) */
.dark .sub-tabs {
    background: var(--ink-800);
    border-color: var(--ink-700);
}

.dark .page-subnav .sub-tabs {
    background: transparent;
    border: none;
}

.dark .page-subnav .sub-tab.active {
    background: transparent;
    color: var(--foreground);
    border: none;
    border-bottom: 2px solid var(--signal-500);
    box-shadow: none;
}

.dark .page-subnav .sub-tab:hover {
    background: var(--bg-hover);
    border-color: transparent;
}

.dark .sub-tab {
    color: var(--ink-400);
}

.dark .sub-tab:hover {
    color: var(--foreground);
    background: var(--ink-700);
    border-color: var(--ink-600);
}

.dark .sub-tab.active {
    background: var(--ink-900);
    color: var(--signal-500);
    border-color: var(--ink-700);
    box-shadow: 0 0 0 1px var(--ink-600), 0 2px 8px oklch(0 0 0 / 0.3);
}

.dark .sub-tab.active::after {
    background: var(--signal-500);
    box-shadow: 0 0 8px var(--signal-500);
}

.dark .sub-tab i {
    color: inherit;
}

/* Dark mode header: ensure page title is visible */
.dark .page-header h1 {
    color: var(--foreground);
}

.dark .page-header h1 i {
    color: var(--signal-500);
    filter: drop-shadow(0 0 6px oklch(from var(--signal-500) l c h / 0.4));
}

/* Dark mode header buttons */
.dark .header-btn {
    background: var(--ink-800);
    border-color: var(--ink-700);
    color: var(--ink-400);
}

.dark .header-btn:hover {
    background: var(--ink-700);
    color: var(--foreground);
}

.dark .header-btn.active {
    background: var(--ink-700);
    color: var(--signal-500);
}

/* Dark mode page header bottom line */
.dark .page-header::after {
    background: linear-gradient(90deg, transparent 0%, oklch(from var(--signal-500) l c h / 0.3) 50%, transparent 100%);
}

/* Dark mode APT cards: better definition */
.dark .apt-card {
    border-color: oklch(1 0 0 / 0.08);
}

.dark .apt-card:hover {
    border-color: oklch(1 0 0 / 0.15);
    box-shadow: 0 4px 16px oklch(0 0 0 / 0.3);
}

/* Dark mode empty state: more visible icon container */
.dark .empty-state-icon {
    border-color: oklch(1 0 0 / 0.12);
    box-shadow: 0 8px 32px oklch(0 0 0 / 0.3), 0 0 60px oklch(1 0 0 / 0.03);
}

/* Dark mode overlay: centered modal with blur */
.dark .overlay-backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.dark .overlay-panel {
    background: var(--ink-900);
    border: 1px solid var(--ink-700);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dark .overlay-body,
.dark .overlay-content {
    background: var(--bg-surface);
}

.dark .detail-item {
    background: var(--bg-elevated);
    border-color: var(--ink-700);
}

.dark .detail-item .label {
    color: var(--ink-400);
}

.dark .overlay-close {
    background: var(--ink-800);
    border-color: var(--ink-700);
    color: var(--ink-400);
}

.dark .overlay-close:hover {
    background: var(--ink-700);
    color: var(--foreground);
}

.dark .overlay-header h2 {
    color: var(--foreground);
}

.dark .overlay-subtitle {
    color: var(--ink-400);
}

.dark .overlay-header::after {
    background: linear-gradient(90deg, transparent, var(--ink-700) 50%, transparent);
}

.dark .severity-banner {
    border-bottom: 1px solid var(--ink-700);
}

.dark .indicator-chip {
    background: var(--ink-800);
    border-color: var(--ink-700);
    color: var(--ink-300);
}

.dark .indicator-chip:hover {
    background: var(--ink-700);
    border-color: var(--ink-600);
}

/* ============================================
   L-08: STANDARDIZED LOADING SPINNER
   ============================================ */
/* Unified spinner base — all spinners use same style */
.spinner,
.list-loading-spinner {
    width: clamp(24px, 1.5vw, 32px);
    height: clamp(24px, 1.5vw, 32px);
    border: 2.5px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: cpod-spin 0.8s linear infinite;
}

.spinner.small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* Icon-based spinner (ph-spinner) — consistent timing */
.spinning {
    animation: cpod-spin 0.8s linear infinite;
}

/* ============================================
   SPRINT 3 — Quick-Win UI/UX Fixes
   ============================================ */

/* Data table — full styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: var(--space-4);
    background: var(--bg-elevated);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
    padding: var(--space-4);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.data-table tbody tr {
    cursor: pointer;
    transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Status badge variants for org table */
.status-badge.active {
    color: var(--status-success);
    background: var(--status-success-subtle);
    border-color: var(--status-success-subtle);
}
.status-badge.closed,
.status-badge.suspended,
.status-badge.deactivated {
    color: var(--destructive);
    background: oklch(from var(--destructive) l c h / 0.12);
    border-color: oklch(from var(--destructive) l c h / 0.2);
}

/* Required field asterisk */
.required label::after {
    content: " *";
    color: var(--destructive);
}

/* Notification badge z-index fix */
.notif-badge {
    z-index: var(--z-dropdown);
}

/* ============================================================================
   Onboarding Hint (Dashboard empty state)
   ============================================================================ */
.onboarding-hint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated, oklch(0.18 0.01 260));
    border: 1px solid var(--border, oklch(0.25 0.005 260));
    border-radius: var(--radius-lg, 12px);
    margin-top: 1.5rem;
    color: var(--muted-foreground);
}
.onboarding-hint i {
    font-size: 2rem;
    color: var(--primary);
    flex-shrink: 0;
}
.onboarding-hint strong {
    color: var(--foreground);
    display: block;
    margin-bottom: 0.25rem;
}
.onboarding-hint p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* ============================================================================
   Onboarding Card (Dashboard first-run, analyst only)
   ============================================================================ */
.onboarding-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.onboarding-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.onboarding-icon {
    font-size: 2.5rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.onboarding-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-1);
}

.onboarding-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-inset);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: border-color var(--duration-fast) var(--ease-out);
}

.onboarding-step:hover { border-color: var(--border-default); }

.onboarding-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}

.onboarding-step-body {
    flex: 1;
}

.onboarding-step-body strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.onboarding-step-body p {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.btn-danger-hover:hover {
    color: var(--destructive, oklch(0.55 0.22 25)) !important;
}

/* ============================================
   Profile Dropdown Menu
   ============================================ */
.profile-menu-wrapper {
    position: relative;
}
.profile-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
    font-size: var(--text-sm);
}
.profile-trigger:hover {
    background: var(--bg-hover);
    border-color: var(--border-subtle);
}
.profile-trigger-caret {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    transition: transform var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
}
.profile-trigger[aria-expanded="true"] .profile-trigger-caret {
    transform: rotate(180deg);
}
.profile-avatar-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, oklch(0.45 0.15 260));
    color: #fff;
    box-shadow: 0 0 0 2px var(--card), 0 0 0 3px oklch(from var(--chart-1) l c h / 0.3);
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.profile-trigger-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}
.profile-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    background: var(--bg-elevated, oklch(0.16 0.005 260));
    border: 1px solid var(--border, oklch(0.25 0.005 260));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px oklch(0 0 0 / 0.4);
    z-index: 100;
    overflow: hidden;
}
.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}
.profile-avatar-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary, oklch(0.45 0.15 260));
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}
.profile-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.profile-dropdown-info strong {
    color: var(--foreground);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-dropdown-email {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-dropdown-role {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    background: var(--bg-hover, oklch(0.2 0.005 260));
    color: var(--muted-foreground);
    font-size: 0.65rem;
    text-transform: capitalize;
    width: fit-content;
}
.profile-dropdown-divider {
    height: 1px;
    background: var(--border, oklch(0.25 0.005 260));
    margin: 0;
}
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: var(--foreground);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}
.profile-dropdown-item:hover {
    background: var(--bg-hover, oklch(0.2 0.005 260));
}
.profile-dropdown-item i {
    font-size: 1.1rem;
    color: var(--muted-foreground);
}
.profile-dropdown-signout {
    color: var(--destructive, oklch(0.55 0.22 25));
}
.profile-dropdown-signout i {
    color: var(--destructive, oklch(0.55 0.22 25));
}
.profile-dropdown-signout:hover {
    background: oklch(0.55 0.22 25 / 0.1);
}

/* Profile Info Card (Settings > Security) */
.profile-info-grid {
    padding: 0 var(--space-4) var(--space-4);
}
.profile-info-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}
.profile-info-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary, oklch(0.45 0.15 260));
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.profile-info-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
    flex: 1;
    min-width: 0;
}
.profile-info-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.profile-info-field label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    font-weight: 500;
}
.profile-info-field span {
    font-size: var(--text-sm);
    color: var(--foreground);
}
.profile-role-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    background: var(--bg-hover, oklch(0.2 0.005 260));
    font-size: 0.75rem !important;
    text-transform: capitalize;
    width: fit-content;
}
@media (max-width: 640px) {
    .profile-info-details {
        grid-template-columns: 1fr;
    }
    .profile-info-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ============================================
   TEAM TABLE
   ============================================ */
.team-table {
    width: 100%;
}
.team-table tbody tr {
    cursor: default;
}
.team-user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.team-avatar-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary, oklch(0.45 0.15 260));
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.team-user-name {
    font-weight: 500;
    color: var(--foreground);
    font-size: var(--text-sm);
}

.team-user-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.provider-access-badge,
.provider-managed-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.provider-access-badge {
    padding: 1px 6px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-active);
}

.team-user-access-origin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--text-tertiary);
    font-size: 11px;
    line-height: 1.35;
}

.provider-managed-state {
    min-height: 36px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.team-user-email {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}
.role-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    background: var(--bg-hover, oklch(0.2 0.005 260));
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-transform: capitalize;
}
.status-badge.invited {
    background: oklch(0.75 0.15 70 / 0.15);
    color: oklch(0.75 0.15 70);
}
.team-actions-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* Team member editor: compact operational form, with immutable identity and
   access-impact notices separated from the editable profile fields. */
.modal-panel--member-edit {
    width: min(760px, calc(100vw - 32px));
    max-height: min(92vh, 860px);
}
.modal-panel--member-edit .modal-body {
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

.modal-panel--export { width: min(620px, calc(100vw - 32px)); }
.modal-panel--export .modal-title-group { display: flex; align-items: center; gap: 14px; }
.modal-panel--export .modal-title-group h3,
.modal-panel--export .modal-title-group p { margin: 0; }
.modal-panel--export .modal-title-group p { margin-top: 3px; color: var(--text-secondary); font-size: var(--text-sm); }
.export-modal__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 40px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border-default));
    border-radius: var(--radius-md); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
    font-size: 1.25rem;
}
.export-format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; }
.export-format-grid legend { width: 100%; margin-bottom: 12px; font-weight: 600; color: var(--text-primary); }
.export-format-option {
    position: relative; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px;
    min-height: 112px; padding: 16px; border: 1px solid var(--border-default); border-radius: var(--radius-md);
    background: var(--bg-elevated); color: var(--text-primary); cursor: pointer;
    transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}
.export-format-option:hover { border-color: color-mix(in srgb, var(--accent) 48%, var(--border-default)); }
.export-format-option.is-selected {
    border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent);
}
.export-format-option.is-disabled { opacity: .52; cursor: not-allowed; }
.export-format-option.is-disabled:hover { border-color: var(--border-default); }
.export-format-option input { position: absolute; opacity: 0; pointer-events: none; }
.export-format-option > .ph:not(.export-format-option__check) { color: var(--accent); font-size: 1.35rem; }
.export-format-option span { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.export-format-option strong { font-size: var(--text-base); }
.export-format-option small { color: var(--text-secondary); line-height: 1.4; }
.export-format-option__check { position: absolute; right: 10px; top: 10px; color: var(--accent); opacity: 0; }
.export-format-option.is-selected .export-format-option__check { opacity: 1; }
.export-format-option:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.export-privacy-note {
    display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 12px 14px;
    border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    color: var(--text-secondary); background: var(--bg-surface); font-size: var(--text-sm); line-height: 1.45;
}
.export-privacy-note .ph { margin-top: 1px; color: var(--success); font-size: 1.05rem; }
.export-modal__actions { justify-content: flex-end; }
.case-selection-bar { margin-bottom: 12px; }
.cases-table .col-select { width: 46px; min-width: 46px; text-align: center; }
.notify-subject-composer {
    display: grid; grid-template-columns: minmax(180px, auto) minmax(180px, 1fr); align-items: stretch;
    border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-elevated);
}
.notify-subject-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent); }
.notify-subject-composer__locked {
    display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 13px;
    border-right: 1px solid var(--border-default); background: var(--bg-active); color: var(--text-secondary);
    font-family: var(--font-mono); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notify-subject-composer__locked .ph { color: var(--success); flex: 0 0 auto; }
.notify-subject-composer .form-input { border: 0; border-radius: 0; box-shadow: none; min-width: 0; }
.notify-section-list { display: flex; flex-direction: column; gap: 12px; }
.notify-section-panel {
    padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md);
    background: var(--bg-surface); overflow: hidden;
}
.notify-section-panel__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-elevated);
}
.notify-section-panel__head h4 { margin: 3px 0 0; font-size: var(--text-base); color: var(--text-primary); }
.notify-section-panel__eyebrow { display: inline-flex; align-items: center; gap: 5px; color: var(--text-tertiary); font-size: var(--text-xs); text-transform: uppercase; font-weight: 700; }
.notify-section-panel__eyebrow .ph { color: var(--success); }
.notify-section-panel__required {
    padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-default));
    border-radius: var(--radius-sm); color: var(--text-secondary); background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
    font-size: var(--text-xs); font-weight: 700;
}
.notify-fixed-entries { padding: 8px 16px 4px; }
.notify-fixed-entry {
    display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 8px 0;
    color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.45;
}
.notify-fixed-entry + .notify-fixed-entry { border-top: 1px solid var(--border-subtle); }
.notify-fixed-entry > .ph { margin-top: 2px; color: var(--text-tertiary); }
.notify-fixed-entry span { min-width: 0; overflow-wrap: anywhere; }
.notify-fixed-entry strong { margin-right: 8px; color: var(--text-primary); }
.notify-editable-entries { display: flex; flex-direction: column; gap: 9px; padding: 10px 16px 6px; }
.notify-editable-entry {
    display: grid; grid-template-columns: minmax(0, 0.32fr) minmax(0, 1fr) 34px; gap: 8px; align-items: start;
}
.notify-editable-entry:not(:has(.notify-entry-label)) { grid-template-columns: minmax(0, 1fr) 34px; }
.notify-editable-entry textarea { min-height: 64px; resize: vertical; line-height: 1.45; }
.notify-entry-remove {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border: 1px solid var(--border-default); border-radius: var(--radius-md); background: transparent;
    color: var(--text-secondary); cursor: pointer;
}
.notify-entry-remove:hover:not(:disabled) { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border-default)); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.notify-entry-remove:disabled { opacity: .38; cursor: not-allowed; }
.notify-add-entry {
    display: inline-flex; align-items: center; gap: 6px; margin: 7px 16px 14px; padding: 7px 9px;
    border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary);
    font-size: var(--text-sm); font-weight: 600; cursor: pointer;
}
.notify-add-entry .ph { color: var(--success); }
.notify-add-entry:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-default)); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.notify-draft-error { margin-top: 10px; }
@media (max-width: 640px) {
    .export-format-grid { grid-template-columns: 1fr; }
    .export-format-option { min-height: 76px; }
    .export-modal__actions { display: grid; grid-template-columns: 1fr; }
    .export-modal__actions .btn-primary { order: -1; }
    .notify-subject-composer { grid-template-columns: 1fr; }
    .notify-subject-composer__locked { min-height: 42px; border-right: 0; border-bottom: 1px solid var(--border-default); }
    .notify-editable-entry,
    .notify-editable-entry:not(:has(.notify-entry-label)) { grid-template-columns: minmax(0, 1fr) 34px; }
    .notify-entry-label { grid-column: 1 / -1; }
}
.modal-panel--member-edit .modal-title-group {
    align-items: flex-start;
}
.modal-panel--member-edit .modal-title-group h3,
.modal-panel--member-edit .modal-title-group p {
    margin: 0;
}
.modal-panel--member-edit .modal-title-group p {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.modal-title-icon-wrap {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--accent);
    background: var(--bg-active);
    flex: 0 0 auto;
}
.member-edit-form {
    gap: var(--space-4);
}
.modal-panel--member-invite {
    width: min(480px, calc(100vw - 32px));
    max-height: min(92vh, 860px);
}
.modal-panel--member-invite .modal-body { overflow-y: auto; }
.tenant-scope-picker--invite { margin-top: 0; }
.member-edit-identity {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}
.member-edit-identity strong,
.member-edit-identity span {
    display: block;
}
.member-edit-identity span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 2px;
}
.form-grid--two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-4);
}
.form-grid-span-2 {
    grid-column: 1 / -1;
}
.locked-input-wrap {
    position: relative;
}
.locked-input-wrap > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}
.locked-input-wrap input {
    padding-left: 36px;
    color: var(--text-secondary);
    background: var(--bg-active);
    cursor: not-allowed;
}
.member-edit-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--info) 35%, var(--border-subtle));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--info) 8%, var(--bg-surface));
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}
.member-edit-notice > i {
    color: var(--info);
    font-size: 1rem;
    margin-top: 1px;
}
.member-edit-notice--warning {
    border-color: color-mix(in srgb, var(--warning) 42%, var(--border-subtle));
    background: color-mix(in srgb, var(--warning) 9%, var(--bg-surface));
}
.member-edit-notice--warning > i {
    color: var(--warning);
}
.tenant-scope-card {
    padding: 0;
    border: 0;
    background: transparent;
}
.tenant-scope-label {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
}
.tenant-scope-state {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.tenant-scope-state--error { justify-content: space-between; color: var(--danger); }
.tenant-scope-state--error > span { display: flex; gap: 7px; align-items: center; }
.tenant-scope-picker { position: relative; }
.tenant-scope-picker__trigger {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.tenant-scope-picker__trigger > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tenant-scope-picker__trigger > .ph {
    flex: 0 0 auto;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}
.tenant-scope-picker__trigger:hover,
.tenant-scope-picker__trigger[aria-expanded="true"] {
    border-color: var(--ring);
}
.tenant-scope-picker__trigger:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.tenant-scope-picker__menu {
    position: relative;
    z-index: 2;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: 0 10px 28px color-mix(in srgb, black 22%, transparent);
}
.tenant-scope-mode {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin: 0;
}
.tenant-scope-mode__option {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
}
.tenant-scope-mode__option:hover { background: var(--bg-active); }
.tenant-scope-mode__option.is-selected {
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface));
    font-weight: 600;
}
.tenant-scope-mode__option input { position: absolute; opacity: 0; pointer-events: none; }
.tenant-scope-mode__option:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.tenant-scope-picker__search { position: relative; padding: 8px; }
.tenant-scope-picker__search .ph {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}
.tenant-scope-picker__search input {
    width: 100%;
    min-height: 36px;
    padding: 0 10px 0 32px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: var(--bg-surface);
    font-size: var(--text-sm);
}
.tenant-scope-picker__search input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.tenant-scope-picker__options { max-height: 196px; overflow-y: auto; padding: 0 6px 6px; }
.tenant-scope-picker__option {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
}
.tenant-scope-picker__option:hover { background: var(--bg-active); }
.tenant-scope-picker__option.is-selected { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tenant-scope-picker__option input { width: 14px; height: 14px; accent-color: var(--accent); }
.tenant-scope-picker__option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-scope-picker__empty {
    padding: 16px 10px;
    color: var(--text-secondary);
    text-align: center;
    font-size: var(--text-sm);
}
@media (max-width: 600px) {
    .modal-panel--member-edit,
    .modal-panel--member-invite {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }
    .form-grid--two {
        grid-template-columns: 1fr;
    }
    .form-grid-span-2 {
        grid-column: auto;
    }
}

/* Action Menu Dropdown (3-dot menu) */
.action-menu-wrapper {
    position: relative;
    display: inline-block;
}
.action-menu-trigger {
    font-size: 1.2rem;
    padding: 0.35rem 0.5rem;
}
.action-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}
.action-menu-dropdown {
    position: fixed;
    min-width: 180px;
    background: var(--bg-elevated, oklch(0.16 0.005 260));
    border: 1px solid var(--border, oklch(0.25 0.005 260));
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 24px oklch(0 0 0 / 0.4);
    z-index: 100;
    overflow: hidden;
    padding: 0.25rem 0;
}
.action-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--foreground);
    font-size: var(--text-sm);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.action-menu-item:hover {
    background: var(--bg-hover, oklch(0.2 0.005 260));
}
.action-menu-item:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.action-menu-item:disabled:hover {
    background: transparent;
}
.action-menu-item i {
    font-size: 1rem;
    color: var(--muted-foreground);
    width: 1rem;
}
.action-menu-danger {
    color: var(--destructive, oklch(0.55 0.22 25));
}
.action-menu-danger i {
    color: var(--destructive, oklch(0.55 0.22 25));
}
.action-menu-danger:hover {
    background: oklch(0.55 0.22 25 / 0.1);
}

/* Profile Card Layout (Settings > Security) */
.profile-card-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    gap: 2rem;
    flex-wrap: wrap;
}
.profile-card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.profile-card-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary, oklch(0.45 0.15 260));
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.profile-card-identity {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.profile-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}
.profile-card-email {
    font-size: var(--text-sm);
    color: var(--muted-foreground);
    margin: 0;
}
.profile-card-fields {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .profile-card-layout {
        flex-direction: column;
        align-items: flex-start;
    }
}

.profile-edit-btn {
    flex-shrink: 0;
}

.profile-edit-form {
    padding: 1.25rem 1.5rem;
}

.profile-edit-header h4 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-base);
}

.profile-edit-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.profile-edit-fields .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.profile-edit-fields .input-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-default);
}

/* ============================================
   STATS BAR — KPI-style stat cards (AI Decision Log, etc.)
   ============================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--card-grid-gap);
    margin-bottom: var(--space-5);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--card-padding);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.stat-card:hover {
    border-color: var(--border-default);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: clamp(40px, 2.5vw, 48px);
    height: clamp(40px, 2.5vw, 48px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 1.2vw, 22px);
    flex-shrink: 0;
    background: var(--accent-subtle);
    color: var(--primary);
}

.stat-value {
    font-size: clamp(var(--text-xl), 2vw, var(--text-2xl));
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-weight: 500;
    margin-top: 2px;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        var(--bg-hover) 50%,
        var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.8s ease-in-out infinite;
    border-radius: var(--radius-md);
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.skeleton * {
    visibility: hidden;
}

/* Skeleton KPI cards row */
.skeleton-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--card-grid-gap);
    max-width: 100%;
}
@media (min-width: 768px) {
    .skeleton-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (min-width: 1200px) {
    .skeleton-kpi-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.skeleton-kpi {
    height: 88px;
    border-radius: var(--radius-lg);
}

/* Skeleton table rows */
.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.skeleton-row {
    height: 48px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.skeleton-overlay {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-6);
}

.skeleton-overlay .skeleton-line {
    height: 16px;
    border-radius: var(--radius-sm);
}

.skeleton-row-header {
    height: 40px;
    border-radius: var(--radius-md);
    opacity: 0.6;
}

/* Skeleton cards grid */
.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--list-card-width), 1fr));
    gap: var(--card-grid-gap);
    margin-top: var(--space-4);
}

.skeleton-card {
    min-height: var(--list-card-min-height, 220px);
    border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
    .skeleton-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .skeleton-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE: Filter pills + bulk bar
   ============================================ */
@media (max-width: 640px) {
    .filter-pills {
        flex-wrap: wrap;
    }
    .bulk-action-bar {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    .onboarding-steps {
        gap: var(--space-2);
    }
    .onboarding-step {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    .onboarding-step > button {
        width: 100%;
        justify-content: center;
    }
    .findings-table table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   UAE Featured Strip + Chip-Row Filter (Agents)
   ============================================ */
/*
 * NOTE: every brand-accent rule in this block uses ``--signal-500``,
 * not the design-token ``--accent``. ``--accent`` resolves to a near-
 * white neutral surface in light mode (line ~159) and a near-black
 * neutral in dark mode (line ~347), which we found out the hard way:
 * the active chip rendered pale-on-pale in light mode, the strip
 * border vanished against the page background, and the UAE-tagged
 * accent on agent cards was effectively invisible. ``--signal-500``
 * (#E8A23A — the same brand orange used by the active nav stripe on
 * the sidebar) keeps the visual identity consistent across themes.
 */

.uae-featured-strip {
    margin: var(--space-3) 0 var(--space-4);
    padding: var(--space-3) var(--space-3) var(--space-4);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--signal-500) 12%, transparent),
        color-mix(in srgb, var(--signal-500) 3%, transparent)
    );
    border: 1px solid color-mix(in srgb, var(--signal-500) 35%, transparent);
    border-radius: var(--radius-lg);
}

.uae-featured-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.uae-featured-header h4 {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.uae-featured-header > i {
    color: var(--signal-500);
    font-size: var(--text-lg);
}

.uae-featured-show-all {
    margin-inline-start: auto;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--signal-500) 45%, transparent);
    color: var(--signal-500);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.uae-featured-show-all:hover {
    background: color-mix(in srgb, var(--signal-500) 16%, transparent);
}

.uae-featured-scroller {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.uae-featured-card {
    flex: 0 0 280px;
    min-height: 130px;
    text-align: start;
    background: var(--bg-elevated, var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    scroll-snap-align: start;
    transition: border-color 120ms ease, transform 120ms ease;
}

.uae-featured-card:hover {
    border-color: var(--signal-500);
    transform: translateY(-2px);
}

.uae-featured-tag {
    align-self: flex-start;
    background: color-mix(in srgb, var(--signal-500) 20%, transparent);
    color: var(--signal-500);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
    letter-spacing: 0.04em;
}

.uae-featured-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.uae-featured-desc {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.agent-chip {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-pill, 999px);
    font-size: var(--text-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.agent-chip:hover {
    border-color: var(--signal-500);
    color: var(--text-primary);
}

.agent-chip.active {
    /* Pure white text on the brand orange (``--signal-500`` = #E8A23A,
       same colour as the active sidebar stripe) guarantees the
       selected chip is unmistakable across light + dark themes.
       The earlier attempt used ``--accent`` which is a near-white
       neutral in light mode and painted the chip pale-on-pale. */
    background: var(--signal-500);
    color: #fff;
    border-color: var(--signal-500);
}

.agent-chip-uae > i {
    color: inherit;
}

.agent-chip-uae:not(.active) {
    border-color: color-mix(in srgb, var(--signal-500) 45%, transparent);
    color: var(--signal-500);
}

.apt-card.uae-tagged {
    border-left: 3px solid var(--signal-500);
}

/* Mirror the accent border in RTL so it stays on the "leading" edge. */
[dir="rtl"] .apt-card.uae-tagged {
    border-left: none;
    border-right: 3px solid var(--signal-500);
}

@media (max-width: 640px) {
    .uae-featured-card {
        flex-basis: 240px;
    }
    .uae-featured-show-all {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-2);
    }
}

/* ============================================
   Status-badge differentiation (filled vs outline)
   ============================================
   The earlier styling rendered every variant as a soft-coloured pill,
   so CONNECTED, AVAILABLE, DEGRADED and DISCONNECTED all read as the
   same shape at a glance. Re-key the visual hierarchy:
       - CONNECTED / HEALTHY  → filled green, white text (live)
       - DEGRADED / WARNING   → filled amber, dark text  (attention)
       - DISCONNECTED / ERROR → outline red               (broken)
       - AVAILABLE            → outline blue              (not yet)
       - COMING SOON          → outline neutral, italic   (stub)

   Scoped to ``.connector-status`` so the Connectors page and any
   reuse of the class on other surfaces inherits the new look
   without changing the markup. */

.connector-status.connected {
    background: var(--status-success);
    color: #fff;
    border: 1px solid var(--status-success);
}

.connector-status.degraded {
    background: var(--status-warning);
    color: #111;
    border: 1px solid var(--status-warning);
}

.connector-status.disconnected,
.connector-status.error {
    background: transparent;
    color: var(--severity-critical);
    border: 1px solid color-mix(in srgb, var(--severity-critical) 55%, transparent);
}

.connector-status.available {
    background: transparent;
    color: var(--status-info);
    border: 1px solid color-mix(in srgb, var(--status-info) 55%, transparent);
}

.connector-status.coming-soon,
.connector-status.coming_soon,
.connector-status.stub {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
}

/* Agent card ACTIVE / INACTIVE badges (Agents catalog). The status text
   is the same caps-pill shape as connector status, so apply the same
   filled-vs-outline distinction. */
.apt-status.active {
    color: #fff;
    background: var(--status-success);
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
}

.apt-status:not(.active) {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
}

/* The pulsing dot on the active state was the only ::before content
   the original rule shipped; with a filled background it'd disappear
   into the same green, so drop it for the active state and leave the
   text alone. */
.apt-status.active::before {
    display: none;
}

/* ============================================
   RTL polish — Connectors page + global directional bits
   ============================================
   Existing CSS uses physical ``margin-left`` / ``text-align: right``
   in a handful of spots that read "correct" in LTR but mirror weirdly
   in Arabic. Each override below is scoped under ``[dir="rtl"]`` so it
   only fires for Arabic; LTR layout is untouched.

   Directional icons (pagination carets, action arrows) get a
   ``scaleX(-1)`` so a Phosphor caret-right glyph still points "to the
   reading flow" in RTL. The flip is opt-in via the
   ``rtl-flip-icon`` class so we don't auto-flip checkmarks or
   non-directional icons that look the same in either direction. */

[dir="rtl"] .stub-badge {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .status-badge {
    margin-left: 0;
    margin-right: 4px;
}

[dir="rtl"] .connector-stats {
    align-items: flex-start;
    text-align: left;
}

/* Pagination carets used across investigations + connectors are
   physical-direction icons; mirror them so "Previous" still feels
   like Previous in Arabic reading flow. */
[dir="rtl"] .pagination .ph-caret-left,
[dir="rtl"] .pagination .ph-caret-right,
[dir="rtl"] .table-pagination .ph-caret-left,
[dir="rtl"] .table-pagination .ph-caret-right,
[dir="rtl"] .uae-featured-show-all .ph-arrow-right {
    transform: scaleX(-1);
}

/* Filter row + connector tabs: the tab-count pill sits to the right
   of the label in LTR. Replace the physical margin with a logical
   gap so it lands on the trailing side in RTL too. */
[dir="rtl"] .connector-tab .tab-count {
    margin-left: 0;
    margin-inline-start: var(--space-2);
}

/* The "Configured 4 / Catalog 104" tab strip uses an icon followed
   by text followed by a count. Reverse the visual order in RTL so
   the icon stays on the leading side without rewriting the markup. */
[dir="rtl"] .connector-tabs {
    direction: rtl;
}

/* ``.search-box`` is a flex container, so its icon + input reverse
   automatically under ``direction: rtl`` inherited from <html>.
   Nothing to do here. */

/* ============================================
   CASES — list + detail
   ============================================ */

/* Status pills used in both the list table and the detail header. */
/* Quiet outline + state dot, matching .alert-status — case status is a
   secondary signal and must not reuse the severity heat palette (open
   previously rendered Critical-red, investigating High-orange). Dots
   carry the state hue subtly. See frontend/DESIGN.md. */
.case-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    white-space: nowrap;
}
.case-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-quaternary);
    flex-shrink: 0;
}
.case-status--open::before { background: var(--info); }
.case-status--escalated_to_customer::before { background: var(--severity-medium); }
.case-status--escalated_to_customer { color: var(--severity-medium); }
.case-status--in_progress::before,
.case-status--investigating::before { background: var(--warning); }
.case-status--contained::before { background: var(--severity-medium); }
.case-status--suspended::before { background: var(--text-quaternary); }
.case-status--resolved::before { background: var(--status-success); }
.case-status--resolved { color: var(--status-success); }
.case-status--closed::before { background: var(--text-quaternary); }
.case-status--closed,
.case-status--false_positive { color: var(--text-quaternary); }
.case-status--false_positive::before { background: var(--text-quaternary); }

/* Clickable status badge — when the analyst can change it, the badge
   doubles as a button (hover state + caret affordance). Inherits the
   same dot/colour treatment from the base .case-status rule. */
button.case-status--clickable {
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}
button.case-status--clickable:hover {
    background: color-mix(in srgb, var(--text) 5%, transparent);
    border-color: color-mix(in srgb, var(--text) 25%, var(--border-default));
}
button.case-status--clickable .ph-caret-down {
    font-size: 0.7em;
    opacity: 0.6;
}

/* Inline metadata-panel select (SL#9 editable priority/category) — compact
   so it slots into the case-summary definition list without inflating rows. */
.form-input-inline {
    padding: 2px 8px;
    font-size: var(--text-sm);
    height: auto;
    width: auto;
    min-width: 120px;
}

/* Owner edit affordance — text that reveals a pencil on hover, opens the
   shared user picker. */
.case-owner-edit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    border: none;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    padding: 0;
}
.case-owner-edit .ph-pencil-simple {
    font-size: 0.85em;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}
.case-owner-edit:hover { color: var(--accent, var(--info)); }
.case-owner-edit:hover .ph-pencil-simple { opacity: 1; }

/* Narrow modal variant — keeps the status-change form compact. */
.modal-panel--narrow {
    max-width: 480px;
}
.form-static {
    margin: 0;
}

/* List table reuses .findings-table for borders/spacing. The case
   number + title compose a stacked label in the first column. */
.cases-table .case-id {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-quaternary);
    letter-spacing: var(--tracking-wide);
}
.cases-table .case-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}
.cases-table tbody tr {
    cursor: pointer;
}

/* Detail page container. Replaces the page content while a case is
   open; the existing back-out via the "Back" button closes it. */
.case-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.case-detail-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.case-back-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    border: 0;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--text-sm);
    align-self: flex-start;
    transition: background-color var(--duration-fast) var(--ease-out);
}
.case-back-button:hover,
.case-back-button:focus-visible {
    background: var(--bg-overlay);
    color: var(--text-primary);
    outline: none;
}

.case-detail-id-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.case-detail-number {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--text-secondary);
    letter-spacing: var(--tracking-wide);
}

.case-detail-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.case-detail-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.case-detail-meta i {
    margin-inline-end: 4px;
}

/* Sub-sub-nav inside the case detail page. Visually identical to the
   page-level .sub-tabs but scoped so the higher-specificity rules
   for .sub-tabs don't bleed into here and vice versa. */
.case-subnav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 2px;
}
.case-subnav-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: var(--space-3) var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.case-subnav-tab:hover,
.case-subnav-tab:focus-visible {
    color: var(--text-primary);
    outline: none;
}
.case-subnav-tab.active {
    color: var(--signal-500);
    border-bottom-color: var(--signal-500);
}
.case-subnav-count {
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-overlay);
    color: var(--text-quaternary);
    font-size: var(--text-xs);
    font-weight: 500;
    font-family: var(--font-mono);
}
.case-subnav-tab.active .case-subnav-count {
    background: color-mix(in srgb, var(--signal-500) 14%, transparent);
    color: var(--signal-500);
}

/* Detail body. The Summary sub-tab uses a 2-column grid with a
   description on the left and a metadata definition list on the
   right; everything else routes through a placeholder until Phase 4. */
.case-detail-body {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

/* Summary layout keeps investigation context in the wide column and
   metadata plus case actions in the narrow right sidebar. */
.case-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: var(--space-5);
}
.case-summary-intro {
    grid-column: 1 / -1;
    min-width: 0;
}
.case-summary-main,
.case-summary-analysis { min-width: 0; }
.case-summary-analysis { margin-bottom: var(--space-5); }
.case-summary-main > .case-summary-analysis:first-child > .case-summary-card { margin-top: 0; }
.case-summary-analysis .enrich-summary-points { max-width: none; }
@media (max-width: 960px) {
    .case-summary-grid { grid-template-columns: 1fr; }
}

.case-summary-intro h4,
.case-summary-analysis h4,
.case-summary-main h4,
.case-summary-side h4 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}
.case-summary-intro h4:not(:first-child),
.case-summary-analysis h4:not(:first-child),
.case-summary-main h4:not(:first-child),
.case-summary-side h4:not(:first-child) {
    margin-top: var(--space-4);
}

.case-summary-description {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.case-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.case-summary-side {
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.case-summary-dl {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: var(--space-4);
    row-gap: var(--space-2);
}
.case-summary-dl dt {
    font-size: var(--text-xs);
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    align-self: center;
}
.case-summary-dl dd {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.case-summary-counts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.case-summary-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.case-summary-count strong {
    font-size: var(--text-base);
    color: var(--text-primary);
}

/* Generic mono value styling for case-summary-dl. Existing
   .detail-item--id .value--mono is scoped narrowly; this rule covers
   the new Detection / Agent cards where many values (rule IDs,
   decoders, manager names) benefit from the monospaced read. */
.case-summary-dl dd.value--mono {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    word-break: break-all;
}

/* Compact detail cards stacked under CASE METADATA. Subtle top border
   provides visual separation without introducing a heavier surface
   level that would compete with the metadata block above. */
.case-summary-card {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}
.case-summary-card h4 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.case-summary-playbook .btn-primary {
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-2);
}

.case-summary-playbook-picker {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.case-summary-playbook-picker .form-input,
.case-summary-playbook-picker .btn-secondary {
    width: 100%;
    min-width: 0;
}

.case-summary-playbook-picker .btn-secondary {
    justify-content: center;
}

/* Approval-gated Cloudflare containment. Kept deliberately compact because
   this lives in the case metadata rail, while target, evidence and impact
   remain visible before an analyst can approve the external action. */
.case-containment-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.case-containment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
}

.case-containment-card .case-containment-header h4 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.case-containment-card .case-containment-header h4 i {
    color: var(--status-warning);
    font-size: var(--text-base);
}

.case-containment-status {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    background: var(--bg-elevated);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.5;
}

.case-containment-status--pending,
.case-containment-status--executing {
    color: var(--status-warning);
    background: var(--status-warning-subtle);
    border-color: color-mix(in srgb, var(--status-warning) 30%, transparent);
}

.case-containment-status--approved,
.case-containment-status--succeeded {
    color: var(--status-success);
    background: var(--status-success-subtle);
    border-color: color-mix(in srgb, var(--status-success) 30%, transparent);
}

.case-containment-status--failed {
    color: var(--severity-critical);
    background: var(--severity-critical-bg);
    border-color: color-mix(in srgb, var(--severity-critical) 30%, transparent);
}

.case-containment-loading,
.case-containment-approval-note,
.case-containment-readonly,
.case-containment-inline-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-elevated);
    font-size: var(--text-xs);
    line-height: 1.45;
}

.case-containment-approval-note {
    color: var(--status-warning);
    border: 1px solid color-mix(in srgb, var(--status-warning) 24%, transparent);
    background: var(--status-warning-subtle);
}

.case-containment-inline-error {
    flex-wrap: wrap;
    color: var(--severity-critical);
    background: var(--severity-critical-bg);
}

.case-containment-inline-error .btn-secondary {
    width: 100%;
    justify-content: center;
}

.case-containment-target,
.case-containment-evidence,
.case-containment-impact {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}

.case-containment-target strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

.case-containment-eyebrow {
    color: var(--text-quaternary);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.case-containment-evidence-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--text-primary);
    font-size: var(--text-xs);
}

.case-containment-evidence-row > span:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.case-containment-evidence-row small,
.case-containment-impact p,
.case-containment-impact small {
    margin: 0;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    line-height: 1.45;
}

.case-containment-metric {
    display: inline-flex;
    min-width: 112px;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 6px 8px;
    border: 1px solid color-mix(in srgb, var(--status-warning) 26%, transparent);
    border-radius: var(--radius-sm);
    background: var(--status-warning-subtle);
}

.case-containment-metric small {
    color: color-mix(in srgb, var(--status-warning) 72%, var(--text-tertiary));
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.case-containment-metric strong {
    color: var(--status-warning);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
}

.case-containment-impact > strong {
    color: var(--text-primary);
    font-size: var(--text-xs);
}

.case-containment-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-2);
}

.case-containment-actions .btn-primary,
.case-containment-actions .btn-secondary {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: var(--space-2);
}

.case-containment-actions .btn-primary:only-child,
.case-containment-actions .btn-secondary:only-child {
    grid-column: 1 / -1;
}

/* Compliance pills — small chips that group multiple framework hits
   from a single alert. Color variants are intentionally muted: each
   framework gets a recognizable hue but none should dominate the
   sidebar visually. Pattern mirrors .tag with a per-framework wash. */
.case-compliance-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.compliance-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    line-height: 1.4;
}
.compliance-pill strong {
    font-family: var(--font-base, inherit);
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 2px;
}
.compliance-pill--pci {
    background: color-mix(in srgb, var(--severity-high) 10%, transparent);
    border-color: color-mix(in srgb, var(--severity-high) 30%, transparent);
}
.compliance-pill--gdpr {
    background: color-mix(in srgb, var(--signal-500) 12%, transparent);
    border-color: color-mix(in srgb, var(--signal-500) 30%, transparent);
}
.compliance-pill--hipaa {
    background: color-mix(in srgb, var(--severity-medium) 12%, transparent);
    border-color: color-mix(in srgb, var(--severity-medium) 30%, transparent);
}
.compliance-pill--nist {
    background: color-mix(in srgb, var(--severity-low) 12%, transparent);
    border-color: color-mix(in srgb, var(--severity-low) 30%, transparent);
}
.compliance-pill--tsc {
    background: var(--accent-surface);
    border-color: var(--accent-subtle);
}
.compliance-pill--gpg {
    background: color-mix(in srgb, var(--text-tertiary) 10%, transparent);
    border-color: color-mix(in srgb, var(--text-tertiary) 25%, transparent);
}
.compliance-pill--other {
    background: var(--bg-overlay);
    border-color: var(--border-subtle);
}

/* ============================================
   CASE DETAIL — sub-tab bodies (Phase 4)
   ============================================ */
.case-detail-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.case-detail-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
}
.case-detail-section-header h4 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}
.case-detail-section-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}
.case-note-type {
    text-transform: capitalize;
}

/* --- Timeline --- */
.case-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.case-timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    inset-inline-start: 9px;
    width: 2px;
    background: var(--border-subtle);
}
.case-timeline-event {
    position: relative;
    padding-inline-start: 28px;
    padding-block: var(--space-3);
}
.case-timeline-event + .case-timeline-event {
    border-top: 1px dashed var(--border-subtle);
}
.case-timeline-marker {
    position: absolute;
    inset-inline-start: 4px;
    top: var(--space-3);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-quaternary);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 0 2px var(--border-subtle);
}
.case-timeline-color-red    .case-timeline-marker { background: var(--severity-critical); box-shadow: 0 0 0 2px var(--severity-critical-bg); }
.case-timeline-color-orange .case-timeline-marker { background: var(--severity-high);     box-shadow: 0 0 0 2px var(--severity-high-bg); }
.case-timeline-color-yellow .case-timeline-marker { background: var(--severity-medium);   box-shadow: 0 0 0 2px var(--severity-medium-bg); }
.case-timeline-color-blue   .case-timeline-marker { background: var(--signal-500);        box-shadow: 0 0 0 2px color-mix(in srgb, var(--signal-500) 14%, transparent); }
.case-timeline-color-green  .case-timeline-marker { background: var(--status-success);    box-shadow: 0 0 0 2px var(--status-success-subtle); }
.case-timeline-event-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.case-timeline-event-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.case-timeline-event-time {
    font-family: var(--font-mono);
    color: var(--text-quaternary);
    font-size: var(--text-xs);
}
.case-timeline-event-source {
    background: var(--bg-overlay);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.case-timeline-chip {
    color: var(--text-quaternary);
    font-size: 0.85em;
    line-height: 1;
}
.case-timeline-chip.flagged    { color: var(--severity-high); }
.case-timeline-chip.in-summary { color: var(--signal-500); }
.case-timeline-event-title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}
.case-timeline-event-content {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: var(--text-sm);
}

/* --- IOC value cell + TLP pills + asset status pills --- */
.case-ioc-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    word-break: break-all;
    color: var(--text-primary);
}
.case-tlp {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: var(--bg-overlay);
    color: var(--text-secondary);
}
.case-tlp--red    { background: var(--severity-critical-bg); color: var(--severity-critical); }
.case-tlp--amber  { background: var(--severity-high-bg);     color: var(--severity-high); }
.case-tlp--green  { background: var(--status-success-subtle); color: var(--status-success); }
.case-tlp--white  { background: var(--bg-elevated);          color: var(--text-secondary); }

.case-criticality {
    display: inline-flex;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-overlay);
    color: var(--text-secondary);
}
.case-criticality--high   { background: var(--severity-high-bg);   color: var(--severity-high); }
.case-criticality--medium { background: var(--severity-medium-bg); color: var(--severity-medium); }
.case-criticality--low    { background: var(--bg-elevated);         color: var(--text-quaternary); }

.case-compromise {
    display: inline-flex;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--bg-overlay);
    color: var(--text-secondary);
}
.case-compromise--confirmed_compromised      { background: var(--severity-critical-bg); color: var(--severity-critical); }
.case-compromise--suspected                  { background: var(--severity-high-bg);     color: var(--severity-high); }
.case-compromise--no_evidence_of_compromise  { background: var(--status-success-subtle); color: var(--status-success); }
.case-compromise--not_compromised            { background: var(--status-success-subtle); color: var(--status-success); }
.case-compromise--unknown                    { background: var(--bg-elevated);          color: var(--text-quaternary); }

/* --- Notes --- */
.case-notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.case-note {
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}
.case-note-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.case-note-body {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: var(--text-sm);
}
.case-note-body p { margin: 0 0 var(--space-2); }
.case-note-body h4,
.case-note-body h5 { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-sm); color: var(--text-primary); }
.case-note-body ul { margin: 0 0 var(--space-2) var(--space-4); padding: 0; }
.case-note-body li { margin: 2px 0; }
.case-note-body code {
    background: var(--bg-elevated);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.92em;
}

/* --- Tasks (Kanban-lite) --- */
.case-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}
@media (max-width: 960px) {
    .case-kanban { grid-template-columns: 1fr; }
}
.case-kanban-col {
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 120px;
}
.case-kanban-col-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.case-kanban-col-header h5 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}
.case-kanban-col-count {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-quaternary);
}
.case-kanban-col--todo .case-kanban-col-header h5         { color: var(--severity-high); }
.case-kanban-col--in-progress .case-kanban-col-header h5  { color: var(--signal-500); }
.case-kanban-col--done .case-kanban-col-header h5         { color: var(--status-success); }

.case-task-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.case-task-card.is-done {
    opacity: 0.85;
}
.case-task-card.is-done .case-task-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}
.case-task-title {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: 500;
}
.case-task-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--text-xs);
}
.case-kanban-empty {
    padding: var(--space-3);
    color: var(--text-quaternary);
    font-size: var(--text-sm);
    text-align: center;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
}

/* --- IOC enrichment modal --- */
.ioc-enrichment-summary {
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}
.ioc-enrichment-value {
    font-family: var(--font-mono);
    font-size: var(--text-base);
    color: var(--text-primary);
    word-break: break-all;
    margin-bottom: var(--space-2);
}
.ioc-enrichment-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.ioc-enrichment-tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-4);
}
.ioc-enrichment-tabs button {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: var(--space-3) var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: color var(--duration-fast), border-color var(--duration-fast);
}
.ioc-enrichment-tabs button:hover,
.ioc-enrichment-tabs button:focus-visible {
    color: var(--text-primary);
    outline: none;
}
.ioc-enrichment-tabs button.active {
    color: var(--signal-500);
    border-bottom-color: var(--signal-500);
}
.ioc-enrichment-stub {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    color: var(--text-primary);
    font-size: var(--text-sm);
}
.ioc-enrichment-stub-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) 0;
    border-bottom: 1px dashed var(--border-subtle);
}
.ioc-enrichment-stub-row:last-of-type { border-bottom: 0; }
.ioc-enrichment-stub-row strong {
    color: var(--text-secondary);
    font-weight: 500;
}
.ioc-enrichment-stub-footnote {
    margin: var(--space-3) 0 0;
    color: var(--text-quaternary);
    font-size: var(--text-xs);
    font-style: italic;
}

/* ============================================
   CASE DETAIL — Artifacts sub-tab
   (case-hierarchical evidence tree)
   ============================================ */
/* Two-pane layout: tree LEFT (wide, fluid), preview RIGHT (capped width).
   Below 960px the panes stack so the tree gets the full width and the
   preview drops underneath. */
.case-artifacts-section {
    /* Override .case-detail-section's column flex — the artifacts pane
       is a grid layout, not a vertical stack. */
    display: block;
}
.case-artifacts-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
    gap: var(--space-5);
    align-items: start;
}
@media (max-width: 960px) {
    .case-artifacts-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* TREE column ---------------------------------------------------------- */
.case-artifacts-tree {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-height: 70vh;
    overflow-y: auto;
    /* Custom scrollbar gutter so files don't shift left when the
       scrollbar appears/disappears on tree expansion. */
    scrollbar-gutter: stable;
    padding-inline-end: var(--space-2);
}

.case-artifacts-playbook,
.case-artifacts-run {
    /* <details> resets — kill the default disclosure triangle so our
       phosphor chevron is the single visual cue. */
    border-radius: var(--radius-md, 8px);
}
.case-artifacts-playbook > summary,
.case-artifacts-run > summary {
    list-style: none;
    cursor: pointer;
}
.case-artifacts-playbook > summary::-webkit-details-marker,
.case-artifacts-run > summary::-webkit-details-marker {
    display: none;
}

.case-artifacts-playbook {
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}
.case-artifacts-playbook + .case-artifacts-playbook {
    margin-top: var(--space-2);
}

.case-artifacts-playbook-summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
}
.case-artifacts-playbook-summary:hover {
    background: var(--bg-elevated);
}
.case-artifacts-playbook-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.case-artifacts-meta {
    flex-shrink: 0;
    color: var(--text-secondary);
}
.case-artifacts-folder {
    color: var(--signal-500);
    font-size: 1.05em;
}

/* Run group (one playbook execution) ---------------------------------- */
.case-artifacts-run {
    margin: 0 var(--space-3) var(--space-2) var(--space-5);
    /* No top-border: the indent + chevron + smaller summary font already
       group runs; a dashed top-border read as a legacy Win32 separator. */
}
.case-artifacts-run-summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.case-artifacts-run-summary .text-muted-sm,
.case-artifacts-manual-heading .text-muted-sm {
    color: var(--text-secondary);
}
.case-artifacts-run-summary:hover {
    color: var(--text-primary);
}

/* Chevron rotates when <details> opens. ``transition`` keeps it smooth
   without animating the disclosure widget itself. */
.case-artifacts-chevron {
    transition: transform 120ms ease;
    color: var(--text-quaternary);
    font-size: 0.85em;
}
details[open] > summary > .case-artifacts-chevron {
    transform: rotate(90deg);
}

/* File list (leaf nodes) ---------------------------------------------- */
.case-artifacts-files {
    list-style: none;
    margin: 0;
    padding: 0 0 var(--space-2) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.case-artifact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-1);
    padding: 0 var(--space-2) 0 0;
    border-radius: var(--radius-sm, 4px);
    /* Inset rail (3px) drawn on selection — same idiom severity rails
       use elsewhere to mark active rows without shifting layout. */
    box-shadow: inset 3px 0 0 transparent;
    transition: background-color 80ms ease, box-shadow 80ms ease;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.case-artifact-row:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.case-artifact-row.is-selected {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 var(--signal-500);
}
.case-artifact-select:focus-visible {
    outline: 2px solid var(--signal-500);
    outline-offset: 1px;
}
.case-artifact-select {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.case-artifact-icon {
    /* Tertiary (not quaternary) + a 5% bump so the file-type icon column
       is scannable at rest. Selection / hover promote to --signal-500. */
    color: var(--text-tertiary);
    font-size: 1.05em;
    flex-shrink: 0;
}
.case-artifact-row.is-selected .case-artifact-icon,
.case-artifact-row:hover .case-artifact-icon {
    color: var(--signal-500);
}
.case-artifact-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.case-artifact-size {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 56px;
}
.case-artifact-download {
    /* 26px bordered icon button — quietly visible at rest so the
       affordance is discoverable for touch + keyboard, brightens on
       row/icon hover. Mirrors .row-action-btn / .task-run-actions
       .btn-icon. */
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-quaternary);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.case-artifact-row:hover .case-artifact-download {
    color: var(--text-secondary);
    border-color: var(--border-subtle);
    background: var(--bg-surface);
}
.case-artifact-download:hover,
.case-artifact-download:focus-visible {
    color: var(--signal-500);
    border-color: color-mix(in srgb, var(--signal-500) 30%, transparent);
    background: color-mix(in srgb, var(--signal-500) 10%, transparent);
    outline: none;
}

/* PREVIEW column ------------------------------------------------------ */
.case-artifacts-preview {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    min-height: 320px;
    max-height: 70vh;
    overflow: hidden;
    position: sticky;
    top: var(--space-3);
}
.case-artifacts-preview-empty,
.case-artifacts-preview-loading {
    /* The empty-state class already centers content; just make sure it
       fills the preview pane regardless of which branch (no selection,
       not previewable, error) we landed on. */
    flex: 1 1 auto;
    margin: 0;
}

.case-artifacts-load-error {
    gap: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--status-error-text, #ef7d6a) 35%, var(--border-subtle));
    border-radius: var(--radius-md);
}

.case-artifact-preview-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    flex-shrink: 0;
}
.case-artifact-preview-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}
.case-artifact-preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.case-artifact-preview-download {
    flex-shrink: 0;
}

/* Reuses ``.alert-codeblock--wrap`` for monospace + soft-wrap + overflow.
   We override max-height because the preview pane handles its own scroll
   instead of capping at 240px. */
.case-artifact-preview-body {
    margin: 0;
    flex: 1 1 auto;
    padding: var(--space-3) var(--space-4);
    max-height: none;
    overflow-y: auto;
    background: var(--bg-surface);
    font-size: var(--text-xs);
    line-height: 1.55;
    color: var(--text-primary);
}

.case-artifact-preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(70vh - 72px);
    margin: auto;
    padding: var(--space-4);
    object-fit: contain;
}

.case-artifacts-header {
    margin-bottom: var(--space-3);
}
.case-artifacts-header h4,
.case-artifacts-header p {
    margin: 0;
}
.case-artifacts-readonly {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.case-artifacts-manual {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}
.case-artifacts-manual-heading {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}
.case-artifacts-manual-heading strong {
    flex: 1;
}
.case-artifacts-manual > .case-artifacts-files {
    padding-inline-start: var(--space-4);
}

.artifact-upload-queue {
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    overflow: hidden;
}
.artifact-upload-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}
.artifact-upload-list,
.evidence-selected-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.artifact-upload-row,
.evidence-selected-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    min-height: 48px;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}
.artifact-upload-row:last-child,
.evidence-selected-row:last-child {
    border-bottom: 0;
}
.artifact-upload-row > i,
.evidence-selected-row > i {
    color: var(--text-tertiary);
    font-size: 1.1rem;
}
.artifact-upload-copy,
.evidence-selected-row > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.artifact-upload-copy strong,
.evidence-selected-row strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: var(--text-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.artifact-upload-copy span,
.evidence-selected-row small {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}
.artifact-upload-error,
.evidence-selected-row .artifact-upload-error {
    color: var(--status-error-text, #ef7d6a);
}
.artifact-upload-row-actions,
.evidence-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* Note/finding evidence field — the same queue language as Artifacts. */
.evidence-fieldset {
    min-width: 0;
    margin: var(--space-2) 0 0;
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
}
.evidence-fieldset legend {
    padding: 0 var(--space-2);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
}
.evidence-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.evidence-upload-label {
    cursor: pointer;
}
.evidence-chooser {
    margin-top: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}
.evidence-chooser-list {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    margin-top: var(--space-2);
    overflow-y: auto;
}
.evidence-choice {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
    min-height: 44px;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.evidence-choice:hover,
.evidence-choice:focus-within {
    background: var(--bg-elevated);
}
.evidence-choice > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.evidence-choice strong,
.evidence-choice small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.evidence-choice small {
    color: var(--text-tertiary);
}
.evidence-empty {
    margin: var(--space-3);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    text-align: center;
}
.evidence-selected-list {
    margin-top: var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    overflow: hidden;
}
.evidence-submit-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    color: var(--status-error-text, #ef7d6a);
    font-size: var(--text-sm);
}

.artifact-reference-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.artifact-reference-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    max-width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
}
.artifact-reference-chip:hover,
.artifact-reference-chip:focus-visible {
    border-color: var(--signal-500);
    color: var(--text-primary);
    outline: none;
}
.artifact-reference-chip span {
    overflow: hidden;
    max-width: 240px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.artifact-reference-chip small {
    color: var(--text-tertiary);
}

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

@media (max-width: 960px) {
    .case-artifacts-tree {
        max-height: 44vh;
    }
    .case-artifacts-preview {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .case-artifacts-header,
    .artifact-upload-queue-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .case-artifacts-upload-actions,
    .case-artifacts-upload-actions .btn-primary {
        width: 100%;
    }
    .case-artifact-select,
    .case-artifact-download,
    .artifact-upload-row-actions .btn-icon,
    .evidence-row-actions .btn-icon,
    .modal-panel--form .modal-close,
    .evidence-actions .btn-secondary,
    .evidence-upload-label {
        min-width: 44px;
        min-height: 44px;
    }
    .case-artifacts-preview:not(.has-selection) {
        display: none;
    }
    .artifact-upload-row,
    .evidence-selected-row {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .artifact-upload-row-actions,
    .evidence-row-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
    .evidence-actions {
        flex-direction: column;
    }
    .evidence-actions > *,
    .evidence-upload-label {
        justify-content: center;
        width: 100%;
    }
    .artifact-reference-chip {
        width: 100%;
        border-radius: var(--radius-md);
    }
}

/* ============================================
   ALERTS ROW ACTION + PROMOTE MODAL (Phase 5)
   ============================================ */
.col-row-actions {
    width: 1%;
    white-space: nowrap;
    text-align: end;
}
.row-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 500;
    transition: background-color var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
    /* Stay visible (not hover-only) — a hover-gated action is undiscoverable
       on touch and skips keyboard users. Quietly visible at rest via a
       subtle border, brightening on hover/focus below. */
    opacity: 1;
    border-color: var(--border-subtle);
}
.row-action-btn-label {
    /* Hide on narrower viewports; the icon still communicates. */
}
.alert-row:hover .row-action-btn,
.alert-row:focus-within .row-action-btn,
.row-action-btn:hover,
.row-action-btn:focus-visible {
    opacity: 1;
    color: var(--signal-500);
    border-color: color-mix(in srgb, var(--signal-500) 30%, transparent);
    background: color-mix(in srgb, var(--signal-500) 10%, transparent);
    outline: none;
}
@media (max-width: 720px) {
    .row-action-btn-label { display: none; }
}

/* Promote modal */
.promote-alert-context {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.promote-alert-context-title {
    color: var(--text-primary);
    font-size: var(--text-sm);
}
.promote-alert-mode {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.promote-alert-mode button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}
.promote-alert-mode button:hover,
.promote-alert-mode button:focus-visible {
    color: var(--text-primary);
    border-color: var(--border-default);
    outline: none;
}
.promote-alert-mode button.active {
    color: var(--signal-500);
    border-color: var(--signal-500);
    background: color-mix(in srgb, var(--signal-500) 10%, transparent);
}
.promote-alert-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}
@media (max-width: 640px) {
    .promote-alert-row { grid-template-columns: 1fr; }
}
.promote-alert-form .form-group { margin-bottom: var(--space-3); }
.promote-ioc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-2);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    max-height: 180px;
    overflow-y: auto;
}
.promote-ioc-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
}
.promote-ioc-row:hover { background: var(--bg-elevated); }
.promote-ioc-value {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: var(--text-xs);
    word-break: break-all;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

/* ============================================
   PLAYBOOK LIBRARY + NIST DETAIL (Phase 6)
   ============================================ */
.playbook-skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--signal-500) 14%, transparent);
    color: var(--signal-500);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    margin: var(--space-2) 0;
    align-self: flex-start;
}

/* "System" provenance pill — built-in catalog playbooks. Reuses the same
   pill geometry as ``.playbook-skill-badge`` but in the warning hue so it
   reads as "owned by us, not by you". Paired with hidden edit/delete
   actions and a visible Clone button. */
.playbook-system-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--warning) 14%, transparent);
    color: var(--warning);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    align-self: flex-start;
}

/* Container for the source-provenance pills above the playbook card
   title (system + .skill backed). Keeps them on one line, vertical
   spacing matches the original skill-badge margin. */
.playbook-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-2) 0;
}
.playbook-badge-row:empty {
    display: none;
}

.playbook-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.playbook-detail-icon {
    font-size: var(--text-xl);
    color: var(--signal-500);
}
.playbook-detail-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}
.playbook-detail-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-2);
}

.playbook-prep-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
}
.playbook-prep-card h4 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-secondary);
    font-weight: 600;
}
.playbook-prep-card p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.55;
    font-size: var(--text-sm);
}
.playbook-triggers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-primary);
}
.playbook-triggers code {
    background: var(--bg-overlay);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.92em;
}

.playbook-phase {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
}
.playbook-phase--empty {
    opacity: 0.65;
}
.playbook-phase-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}
.playbook-phase-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.playbook-phase-header h4 i {
    color: var(--signal-500);
}

.playbook-step-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.playbook-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-overlay);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}
.playbook-step:hover {
    border-color: var(--border-subtle);
}
.playbook-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}
.playbook-step-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.playbook-step-title {
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
}
.playbook-step-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.playbook-step-action {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--text-primary);
}
.playbook-step-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
}
.playbook-step-flag.approval {
    background: var(--severity-high-bg);
    color: var(--severity-high);
}
.playbook-step-flag.auto {
    background: var(--status-success-subtle);
    color: var(--status-success);
}
.playbook-phase-empty-msg {
    margin: 0;
    color: var(--text-quaternary);
    font-size: var(--text-sm);
    font-style: italic;
}

/* Import .skill modal */
.import-skill-dropzone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    text-align: center;
    margin: var(--space-3) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}
.import-skill-dropzone-icon {
    font-size: 2rem;
    color: var(--text-quaternary);
}
.import-skill-dropzone p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.import-skill-filename {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-primary);
    font-size: var(--text-sm);
    background: var(--bg-overlay);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.import-skill-preview {
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-3);
}
.import-skill-preview h4 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}
.import-skill-preview dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-1) var(--space-3);
    margin: 0;
}
.import-skill-preview dt {
    color: var(--text-quaternary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}
.import-skill-preview dd {
    color: var(--text-primary);
    margin: 0;
    font-size: var(--text-sm);
}

/* ============================================
   FINDINGS POLISH (Phase 7)
   ============================================ */
.case-link {
    cursor: pointer;
    color: var(--signal-500);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-decoration: none;
}
.case-link:hover,
.case-link:focus-visible {
    text-decoration: underline;
    outline: none;
}
.type-badge.ioc            { background: color-mix(in srgb, var(--signal-500) 14%, transparent); color: var(--signal-500); }
.type-badge.vulnerability  { background: var(--severity-high-bg);   color: var(--severity-high); }
.type-badge.misconfiguration { background: var(--severity-medium-bg); color: var(--severity-medium); }
.type-badge.breach         { background: var(--severity-critical-bg); color: var(--severity-critical); }

/* ------------------------------------------------------------------ */
/* Investigation workspace: overlay header actions + assignee cell    */
/* + UserPicker popover                                                */
/* ------------------------------------------------------------------ */
.overlay-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    z-index: 30;
    flex-shrink: 0;
}

.col-assignee {
    min-width: 140px;
}
.assignee-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.assignee-cell:hover {
    background: var(--bg-2, rgba(255, 255, 255, 0.04));
    border-color: var(--border);
}
.assignee-cell--empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Picker shell — a click-shielded backdrop with a small centered popover.
   Not a full modal: the surface is small and the action is single-step. */
/* UI polish 2026-05-28 — investigations + assign picker + nav coming-soon */

/* --- Assign picker (Area 3): fixed transparency + two-stage UX --- */
.user-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-picker-popover {
    width: 340px;
    max-width: 90vw;
    max-height: 60vh;
    background: var(--bg-overlay);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}
.user-picker-header {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.user-picker-search {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.user-picker-list {
    overflow-y: auto;
    padding: 4px;
}
.user-picker-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}
.user-picker-row:hover {
    background: var(--bg-hover);
}
.user-picker-row-action {
    color: var(--text-secondary);
    font-style: normal;
    font-weight: 500;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2px;
}
.user-picker-row-action:hover {
    background: var(--bg-hover);
}
.user-picker-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--duration-fast), color var(--duration-fast);
}
.user-picker-back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.user-picker-chevron {
    margin-left: auto;
    color: var(--text-quaternary);
    font-size: 0.75rem;
}
.user-picker-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-picker-email {
    flex: 0 0 auto;
    color: var(--text-quaternary);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
}
.user-picker-empty {
    padding: 16px 12px;
    color: var(--text-quaternary);
    font-size: 0.85rem;
    text-align: center;
}
.user-avatar {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: var(--primary);
    color: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Case task Kanban — CRUD affordances */
.case-kanban-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.case-kanban-col-add {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
}
.case-kanban-col-add:hover {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}
.case-task-card {
    cursor: pointer;
    position: relative;
}
.case-task-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 4px 0 6px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.case-task-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.case-task-status-select {
    flex: 1 1 auto;
    font-size: 0.78rem;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}
.case-task-delete {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
}
.case-task-delete:hover {
    color: var(--severity-critical, #dc2626);
    border-color: var(--severity-critical, #dc2626);
}
.case-task-priority {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.case-task-priority.priority-low {
    background: color-mix(in srgb, var(--info, #2563eb) 14%, transparent);
    color: var(--info, #2563eb);
}
.case-task-priority.priority-medium {
    background: color-mix(in srgb, var(--warning, #d97706) 14%, transparent);
    color: var(--warning, #d97706);
}
.case-task-priority.priority-high {
    background: color-mix(in srgb, var(--severity-critical, #dc2626) 14%, transparent);
    color: var(--severity-critical, #dc2626);
}

/* Playbook run banner inside the case detail. ``--running`` is the default
   look (blue, primary tint); ``--stuck`` warns the user the run has been
   running too long; ``--failed`` is the red error state; ``--completed`` is
   a brief green confirmation. Failed/stuck were added because a
   playbook-run timezone bug left the banner spinning forever with no way
   for the user to recover. */
.case-playbook-run-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--text);
    font-size: 0.85rem;
}
.case-playbook-run-banner--completed {
    background: color-mix(in srgb, var(--success, #10b981) 12%, transparent);
    color: var(--success, #10b981);
}
.case-playbook-run-banner--stuck {
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
}
.case-playbook-run-banner--failed {
    background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent);
    color: var(--danger, #ef4444);
}

/* "From CASE-..." chip on the global Findings table */
.finding-from-case {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* Case detail header — back button + Notify customer button on the same row */
.case-detail-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.case-notify-customer-btn {
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Wazuh inbound-webhook setup: Add modal + Setup Wizard + Detail panel */
/* ------------------------------------------------------------------ */
.wazuh-wizard-panel,
.wazuh-detail-panel {
    width: 100%;
    max-width: 720px;
}
.wazuh-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.field-hint {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.wazuh-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.wazuh-step {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}
.wazuh-step-num {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background: var(--primary);
    color: var(--bg);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.wazuh-step-body {
    flex: 1 1 auto;
    min-width: 0;
}
.wazuh-step-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wazuh-step-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wazuh-step-badge-warn {
    background: var(--severity-high-bg, rgba(255, 165, 0, 0.15));
    color: var(--severity-high, #d97706);
}
.wazuh-step-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    line-height: 1.45;
}
.wazuh-step-help code {
    background: var(--bg-2, rgba(255, 255, 255, 0.04));
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85em;
}
/* Grafana wizard: contact-point field table (key/value pairs the operator
   pastes into the Grafana webhook contact point). */
.wazuh-kv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 0.25rem 0;
    font-size: 0.85rem;
}
.wazuh-kv-table td {
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.wazuh-kv-table tr:last-child td {
    border-bottom: none;
}
.wazuh-kv-table td:first-child {
    color: var(--text-muted);
    white-space: nowrap;
    width: 1%;
    font-weight: 500;
}
.wazuh-kv-table td:last-child code {
    background: var(--bg-2, rgba(255, 255, 255, 0.04));
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    color: var(--text);
}
.splunk-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0.75rem 0;
}
.splunk-config-card {
    position: relative;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-2, #151b26) 88%, var(--primary) 12%);
}
.splunk-config-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.splunk-config-card__heading code {
    color: var(--primary);
    font-weight: 650;
}
.splunk-config-card .wazuh-step-badge {
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--text-muted);
}
.splunk-config-card__value {
    overflow: hidden;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.splunk-config-card p {
    min-height: 2.3em;
    margin: 0.4rem 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}
.splunk-inline-copy {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-1, rgba(255, 255, 255, 0.04));
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
}
.splunk-inline-copy:hover,
.splunk-inline-copy:focus-visible {
    border-color: var(--primary);
    color: var(--text);
}
.splunk-secure-credential {
    margin-top: 0.8rem;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--success, #48c78e) 45%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--success, #48c78e) 7%, transparent);
}
.splunk-secure-credential__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 650;
}
.splunk-advanced-details {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
}
.splunk-advanced-details summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
}
.splunk-advanced-details summary:focus-visible {
    border-radius: 6px;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.splunk-saved-search-example {
    margin: 0.65rem 0 0.8rem;
}
.splunk-projection-heading {
    margin: 0.85rem 0 0.35rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
@media (max-width: 620px) {
    .splunk-config-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .splunk-config-card p {
        min-height: 0;
    }
}
.wazuh-code-block {
    position: relative;
    background: var(--bg-code, var(--bg-2, rgba(0, 0, 0, 0.25)));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem 2.25rem 0.625rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    overflow: auto;
    max-height: 320px;
}
.wazuh-code-block code,
.wazuh-code-block pre {
    background: transparent;
    padding: 0;
    margin: 0;
    color: var(--text);
    white-space: pre-wrap;
}
.wazuh-code-block-secret {
    border-color: var(--severity-high, #d97706);
    background: color-mix(in srgb, var(--severity-high, #d97706) 6%, transparent);
}
.wazuh-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--bg-1, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    font-size: 0.9rem;
}
.wazuh-copy-btn:hover {
    background: var(--primary);
    color: var(--bg);
}
.wazuh-warning {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--severity-high, #d97706);
    margin-top: 0.5rem;
}
.wazuh-confirm-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 0.5rem;
    cursor: pointer;
}
.wazuh-token-btn {
    margin-top: 0.25rem;
}
.wazuh-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.wazuh-verify {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.wazuh-verify-waiting {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    color: var(--text);
}
.wazuh-verify-ok {
    background: var(--status-success-subtle, color-mix(in srgb, var(--status-success, #16a34a) 12%, transparent));
    color: var(--status-success, #16a34a);
    font-weight: 600;
}

/* Detail panel */
.wazuh-detail-section {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
}
.wazuh-detail-section:last-child {
    border-bottom: none;
}
.wazuh-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.wazuh-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}
.wazuh-stat {
    background: var(--bg-2, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
}
.wazuh-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.wazuh-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

/* Coming Soon Overlay */
.coming-soon-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
}

.coming-soon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-4);
    padding: var(--space-8);
}

.coming-soon-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-surface);
    border: 1px solid var(--border-subtle);
}

.coming-soon-icon i {
    font-size: 36px;
    color: var(--text-secondary);
}

.coming-soon-container h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.coming-soon-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================================================== */
/* AI Enrichment — alert/case render blocks, pills, notify-customer draft */
/* ===================================================================== */
.enrich-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}
.notify-subject {
    padding: 8px 12px;
    background: var(--surface-2, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}
.enrich-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
}
/* Engine pills are theme-split: the saturated pale text below only reads
   on dark surfaces, so light mode gets deeper ink on the same tint. Used
   in the AI Analysis card header AND the Findings table "From run" cell. */
.enrich-pill--ai { background: rgba(124, 92, 246, 0.12); color: #6244cf; }
.enrich-pill--det { background: rgba(100, 116, 139, 0.14); color: #475569; }
.enrich-pill--warn { background: rgba(217, 119, 6, 0.14); color: #92600c; }
.dark .enrich-pill--ai { background: rgba(124, 92, 246, 0.16); color: #b9a4fb; }
.dark .enrich-pill--det { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
.dark .enrich-pill--warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.enrich-pill i { font-size: 12px; }

/* Alert/case enrichment block */
.enrich-block { margin-top: 8px; }
/* Summary prose stays calm even when an old stored enrichment dumps a long
   stats paragraph: muted ink, readable measure, roomier leading — the
   structured "Why this priority" rows below carry the scannable signal. */
.enrich-summary {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 6px 0 12px;
    max-width: 70ch;
    overflow-wrap: anywhere;
}
.enrich-summary__headline {
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
    color: var(--text-primary);
}

/* "Why this priority" — AiStrike-style explainability rows. Each row is
   icon chip · italic muted label · value text with bold key tokens. Grid
   keeps a hanging indent when the value wraps; rows collapse to two
   columns (text under label) on narrow overlays. */
.enrich-factors {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 14px;
}
.enrich-factors__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.enrich-factor {
    display: grid;
    grid-template-columns: 22px 92px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    padding: 3px 0;
}
.enrich-factor__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(124, 92, 246, 0.09);
    color: #6244cf;
}
.enrich-factor__icon i { font-size: 12px; }
.dark .enrich-factor__icon {
    background: rgba(124, 92, 246, 0.15);
    color: #b9a4fb;
}
.enrich-factor__label {
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 22px;  /* optically centers single-line labels on the chip */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.enrich-factor__text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 2px;   /* first line sits level with chip + label */
    overflow-wrap: anywhere;
}
.enrich-factor__text strong {
    font-weight: 600;
    color: var(--text-primary);
}
/* Clickable recurrence row → opens the host+type+window-filtered alerts list
   in a new tab. Uses the theme-flipped --info-color so it reads in both modes. */
.enrich-factor--link {
    cursor: pointer;
    text-decoration: none;
    border-radius: 6px;
    margin: 0 -6px;
    padding-left: 6px;
    padding-right: 6px;
    transition: background 0.12s ease;
}
.enrich-factor--link:hover,
.enrich-factor--link:focus-visible {
    background: color-mix(in srgb, var(--info-color) 10%, transparent);
    outline: none;
}
.enrich-factor--link:hover .enrich-factor__text,
.enrich-factor--link:hover .enrich-factor__text strong {
    color: var(--info-color);
}
.enrich-factor__link-icon {
    font-size: 11px;
    margin-left: 6px;
    color: var(--info-color);
    opacity: 0.9;
}
/* Narrow overlay / phone: drop the dedicated label column so long value
   text wraps under the label instead of squeezing into a sliver. */
@media (max-width: 520px) {
    .enrich-factor { grid-template-columns: 22px minmax(0, 1fr); }
    .enrich-factor__text { grid-column: 2; padding-top: 0; }
}
.enrich-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.enrich-card {
    background: var(--surface-2, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 10px 12px;
}
.enrich-card__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.enrich-card__value { font-size: 13px; color: var(--text-primary); font-weight: 600; }
.enrich-card__sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.enrich-risk { display: flex; align-items: baseline; gap: 6px; }
.enrich-risk__score { font-size: 18px; font-weight: 700; }
.impact-Critical { color: #f87171; }
.impact-High { color: #fb923c; }
.impact-Medium { color: #fbbf24; }
.impact-Low { color: #4ade80; }
/* Jump row from the Summary AI card to the Findings tab — replaces the old
   inline "Key findings" list now that AI findings live in the Findings tab
   (persisted rows + virtual rows for legacy embedded-only enrichment).
   Quiet tinted pill, full-width click target, arrow nudges on hover. */
.enrich-findings-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 2px 0 12px;
    padding: 8px 12px;
    background: rgba(124, 92, 246, 0.06);
    border: 1px solid rgba(124, 92, 246, 0.22);
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    text-align: start;
    cursor: pointer;
    transition: background var(--duration-fast, 0.15s) var(--ease-out, ease),
                border-color var(--duration-fast, 0.15s) var(--ease-out, ease);
}
.enrich-findings-jump > i { font-size: 15px; flex: 0 0 auto; color: #6244cf; }
.enrich-findings-jump__text { min-width: 0; }
.enrich-findings-jump__text strong { font-weight: 600; }
.enrich-findings-jump__arrow {
    margin-inline-start: auto;
    transition: transform var(--duration-fast, 0.15s) var(--ease-out, ease);
}
.enrich-findings-jump:hover,
.enrich-findings-jump:focus-visible {
    background: rgba(124, 92, 246, 0.11);
    border-color: rgba(124, 92, 246, 0.4);
}
.enrich-findings-jump:hover .enrich-findings-jump__arrow,
.enrich-findings-jump:focus-visible .enrich-findings-jump__arrow { transform: translateX(3px); }
.dark .enrich-findings-jump {
    background: rgba(124, 92, 246, 0.1);
    border-color: rgba(124, 92, 246, 0.28);
}
.dark .enrich-findings-jump > i { color: #b9a4fb; }
.dark .enrich-findings-jump:hover,
.dark .enrich-findings-jump:focus-visible {
    background: rgba(124, 92, 246, 0.16);
    border-color: rgba(124, 92, 246, 0.45);
}
/* Recommended actions (case AI Analysis card) — checklist-style rows:
   check icon + comfortable padding + quiet accent left border. */
.enrich-recs {
    list-style: none;
    margin: 6px 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.enrich-recs li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-primary);
    background: rgba(124, 92, 246, 0.04);
    border-inline-start: 2px solid rgba(124, 92, 246, 0.45);
    border-radius: 0 8px 8px 0;
}
.enrich-recs li > i {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 19px;  /* centers on the first text line */
    color: #6244cf;
}
.dark .enrich-recs li {
    background: rgba(124, 92, 246, 0.08);
    border-inline-start-color: rgba(124, 92, 246, 0.5);
}
.dark .enrich-recs li > i { color: #b9a4fb; }

/* AI Enrichment — LLM provider toggle (master switch) */
.enrich-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 0 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.15));
}
.enrich-toggle { position: relative; display: inline-flex; flex: 0 0 auto; }
.enrich-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--border, rgba(128, 128, 128, 0.3));
    cursor: pointer;
    transition: background 0.18s ease;
    position: relative;
    margin: 0;
}
.enrich-toggle input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.enrich-toggle input[type="checkbox"]:checked { background: var(--primary, #7c5cf6); }
.enrich-toggle input[type="checkbox"]:checked::before { transform: translateX(18px); }
.enrich-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.enrich-toggle-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.enrich-toggle-sub { font-size: 11px; color: var(--text-secondary); }

/* AI Enrichment — asset inventory editor */
.cmdb-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}
.cmdb-section-heading .category-title { margin-bottom: 8px; }
.cmdb-section-heading .section-description { margin: 0; max-width: 980px; }
.cmdb-import-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.cmdb-file-input { display: none; }
.cmdb-import-guidance {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--border, rgba(128, 128, 128, 0.15));
    border-radius: 8px;
    color: var(--text-secondary);
    background: var(--surface-2, rgba(128, 128, 128, 0.04));
    font-size: 12px;
    line-height: 1.55;
}
.cmdb-import-guidance > i { margin-top: 2px; flex: none; font-size: 15px; }
.enrich-asset-card {
    background: var(--surface-2, rgba(128, 128, 128, 0.04));
    border: 1px solid var(--border, rgba(128, 128, 128, 0.15));
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.enrich-asset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.enrich-field { display: flex; flex-direction: column; gap: 6px; }
.enrich-field .provider-label { margin: 0; }
.enrich-field .setting-edit-input { width: 100%; }
.enrich-req { color: var(--danger, #f87171); }
.enrich-hint { color: var(--text-secondary); font-weight: 400; opacity: 0.7; }
.enrich-asset-actions-row { display: flex; gap: 8px; margin-top: 16px; }

.cmdb-import-feedback:empty { display: none; }
.cmdb-import-feedback { margin: 0 0 16px; }
.cmdb-import-message,
.cmdb-import-result {
    border: 1px solid;
    border-radius: 9px;
    padding: 12px 14px;
}
.cmdb-import-message {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}
.cmdb-import-message > i { margin-top: 1px; font-size: 17px; }
.cmdb-import-message > div,
.cmdb-import-result__header > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cmdb-import-message strong,
.cmdb-import-result__header strong { color: var(--text-primary); font-size: 13px; }
.cmdb-import-message span,
.cmdb-import-result__header span { color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.cmdb-import-message--error {
    border-color: var(--danger, #ef4444);
    background: var(--status-error-subtle, rgba(239, 68, 68, 0.08));
    color: var(--danger, #ef4444);
}
.cmdb-import-result--success {
    border-color: var(--success, #22c55e);
    background: var(--status-success-subtle, rgba(34, 197, 94, 0.07));
}
.cmdb-import-result--warning {
    border-color: var(--warning, #f59e0b);
    background: var(--status-warning-subtle, rgba(245, 158, 11, 0.07));
}
.cmdb-import-result__header {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}
.cmdb-import-result__header > i { margin-top: 1px; font-size: 18px; }
.cmdb-import-result--success .cmdb-import-result__header > i { color: var(--success, #22c55e); }
.cmdb-import-result--warning .cmdb-import-result__header > i { color: var(--warning, #f59e0b); }
.cmdb-import-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.cmdb-import-stats span {
    padding: 5px 9px;
    border: 1px solid var(--border, rgba(128, 128, 128, 0.15));
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--surface-1, rgba(0, 0, 0, 0.08));
    font-size: 11px;
}
.cmdb-import-stats strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cmdb-import-stats .cmdb-import-stat--warning,
.cmdb-import-stats .cmdb-import-stat--warning strong { color: var(--warning, #f59e0b); }
.cmdb-import-errors { margin-top: 12px; }
.cmdb-import-errors summary {
    width: max-content;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.cmdb-import-errors__scroll {
    max-height: 240px;
    overflow: auto;
    margin-top: 8px;
    border: 1px solid var(--border, rgba(128, 128, 128, 0.15));
    border-radius: 7px;
    background: var(--surface-1, rgba(0, 0, 0, 0.08));
}
.cmdb-import-errors__scroll:focus-visible {
    outline: 2px solid var(--border-focus, var(--primary));
    outline-offset: 2px;
}
.cmdb-import-errors table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cmdb-import-errors th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 7px 10px;
    text-align: left;
    color: var(--text-secondary);
    background: var(--surface-2, #1f2937);
    border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.15));
}
.cmdb-import-errors td {
    padding: 7px 10px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.1));
    vertical-align: top;
}
.cmdb-import-errors tbody tr:last-child td { border-bottom: 0; }
.cmdb-import-error-value { max-width: 260px; overflow-wrap: anywhere; }

/* muted placeholders so hints don't read as prefilled values (both themes) */
.enrich-asset-card .setting-edit-input::placeholder,
.llm-provider-card .setting-edit-input::placeholder {
    color: var(--text-secondary, #9ca3af);
    opacity: 0.55;
}

.enrich-asset-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.enrich-asset-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.15));
}
.enrich-asset-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.1));
    color: var(--text-primary);
}
.enrich-asset-table tr:hover td { background: var(--surface-2, rgba(128, 128, 128, 0.04)); }
.enrich-asset-actions { text-align: right; white-space: nowrap; }
.enrich-crit-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface-2, rgba(128, 128, 128, 0.12));
    text-transform: capitalize;
}
.enrich-asset-empty { padding: 14px 4px; color: var(--text-secondary); font-size: 13px; }
@media (max-width: 1100px) {
    .enrich-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cmdb-section-heading { flex-direction: column; }
    .cmdb-import-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .enrich-asset-grid { grid-template-columns: 1fr; }
    .cmdb-import-actions { width: 100%; flex-direction: column; align-items: stretch; }
    .cmdb-import-actions .btn-sm { justify-content: center; }
    .cmdb-import-errors__scroll { max-height: 320px; }
}

/* === Lists + dashboard polish (batch 3) === */

/* ---- KPI hierarchy: numbers lead, labels recede ------------------------ */
.page-content .kpi-value {
    font-size: clamp(2rem, 2.4vw, var(--text-3xl));
    line-height: 1.05;
}
.page-content .kpi-label {
    font-size: 0.6875rem;
    opacity: 0.92;
}
/* Stronger hover affordance on clickable KPI cards (lift + primary ring). */
.page-content .kpi-card--clickable:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
    transform: translateY(-2px);
}

/* ---- Dashboard "Queue health" card ------------------------------------- */
.queue-health-col { display: flex; flex-direction: column; gap: 2px; }
.queue-health-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3); width: 100%; padding: 7px 10px;
    border: 0; border-radius: var(--radius-md, 8px);
    background: transparent; color: var(--text-primary);
    font: inherit; text-align: start; cursor: pointer;
    transition: background var(--duration-fast, 0.12s) ease;
}
button.queue-health-row:hover { background: var(--bg-hover); }
button.queue-health-row:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.queue-health-row--static { cursor: default; }
.queue-health-row .severity-badge { text-transform: capitalize; }
.queue-health-label {
    display: inline-flex; align-items: center; gap: 6px; min-width: 0;
    font-size: var(--text-sm); color: var(--text-secondary);
}
.queue-health-count {
    font-family: var(--font-display);
    font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.queue-health-count.qh-critical { color: var(--severity-critical); }
.queue-health-count.qh-high { color: var(--severity-high); }
.queue-health-count.qh-medium { color: var(--severity-medium); }
.queue-health-count.qh-low { color: var(--severity-low); }
.queue-health-count.qh-warn { color: var(--warning); }
.queue-health-count.qh-zero, .queue-health-age.qh-zero { color: var(--text-secondary); opacity: 0.55; font-weight: 600; }
.queue-health-age { font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.queue-health-divider { height: 1px; margin: 4px 2px; background: var(--border-subtle); }

/* ---- Alerts queue -------------------------------------------------------- */
/* Merged ATT&CK column stays one line; the reclaimed width flows to the
   title, which may now wrap to two lines instead of truncating. */
.alerts-table .col-attack { white-space: nowrap; }
.alerts-table td.finding-title {
    white-space: normal; overflow-wrap: anywhere;
    min-width: 220px; max-width: 460px; line-height: 1.4;
    padding-top: 8px; padding-bottom: 8px;
}
.alerts-table .col-timestamp,
.cases-table .col-timestamp {
    min-width: 178px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.alerts-table td.col-timestamp,
.cases-table td.col-timestamp {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* Live count badge on the "Unassigned" filter pill. */
.filter-pill .pill-count {
    margin-inline-start: 6px; padding: 0 7px; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 16px; display: inline-block;
    background: var(--status-warning-subtle); color: var(--warning);
}

/* Amber triage chips: unattended alerts + unowned cases. */
.chip-unattended, .chip-unowned {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px; white-space: nowrap;
    font-size: var(--text-xs); font-weight: 600; font-style: normal;
    color: var(--warning); background: var(--status-warning-subtle);
    border: 1px solid var(--status-warning-subtle);
}
.assignee-cell--unattended:hover .chip-unattended { border-color: var(--warning); }

/* Pulsing dot — only on critical + open + unassigned rows. */
.unattended-dot {
    width: 6px; height: 6px; border-radius: 50%; flex: none;
    background: var(--severity-critical);
    animation: c3-unattended-pulse 1.6s ease-in-out infinite;
}
@keyframes c3-unattended-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--severity-critical-bg, rgba(224, 106, 82, 0.4)); }
    50% { opacity: 0.55; box-shadow: 0 0 0 4px transparent; }
}
@media (prefers-reduced-motion: reduce) { .unattended-dot { animation: none; } }

/* ---- Cases list ----------------------------------------------------------- */

/* ---- Dashboard empty states (threat groups / recent alerts) ------------- */
.dashboard-section .empty-state.small {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; text-align: center; min-height: 150px; margin: 4px 2px;
    border: 1px dashed var(--border-subtle); border-radius: var(--radius-md, 10px);
}
.dashboard-section .empty-state.small i { font-size: 26px; opacity: 0.4; }
.dashboard-section .empty-state.small p { margin: 0; font-weight: 600; color: var(--text-primary); }
.dashboard-section .empty-state.small .text-muted-sm { color: var(--text-secondary); }

/* === Triage flow + live refresh (batch 3) === */

/* ---- Alert overlay: prev/next chevrons (also bound to j / k) ------------- */
.overlay-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md, 8px);
    flex: none;
}
.overlay-nav-btn i { font-size: 15px; }
.overlay-nav-btn:disabled,
.overlay-nav-btn[disabled] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ---- Disposition modal: inline "note required" helper -------------------- */
.form-helper--required {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: var(--text-xs, 12px);
    color: var(--warning);
}
.form-helper--required i { font-size: 13px; flex: none; }

/* ---- AI summary as accented point rows (multi-line tier-2 summaries) -----
   Marker + spacing mirror the "Why this priority" factor rows so the whole
   AI Analysis block reads as one designed unit. Accent colors match
   .enrich-factor__icon (light/dark pair). */
.enrich-summary-points {
    list-style: none;
    margin: 6px 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 70ch;
}
.enrich-summary-points li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}
.enrich-summary-points li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 0.58em;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    transform: rotate(45deg);
    background: #6244cf;
}
.dark .enrich-summary-points li::before { background: #b9a4fb; }
/* Nested inside the alert overlay's .enrich-summary wrapper (headline +
   points) — the wrapper already carries the outer margins. */
.enrich-summary .enrich-summary-points { margin: 4px 0 0; }

/* ---- Case timeline: multiline notes + human vs automated actors ---------- */
/* Notes keep their line breaks (backend stores raw \n in description). */
.case-timeline-event-content { white-space: pre-line; }

/* Human actors: filled marker (default) + emphasized name. */
.case-timeline-actor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
}
.case-timeline-actor i { color: var(--text-secondary); }

/* System actors (system / *-webhook / actor-less): hollow marker. The
   border carries the event color; the fill drops out. Compound selectors
   outrank the .case-timeline-color-* background rules. */
.case-timeline-event--system .case-timeline-marker {
    background: var(--bg-surface);
    border-color: var(--text-quaternary);
}
.case-timeline-event--system.case-timeline-color-red    .case-timeline-marker { background: var(--bg-surface); border-color: var(--severity-critical); }
.case-timeline-event--system.case-timeline-color-orange .case-timeline-marker { background: var(--bg-surface); border-color: var(--severity-high); }
.case-timeline-event--system.case-timeline-color-yellow .case-timeline-marker { background: var(--bg-surface); border-color: var(--severity-medium); }
.case-timeline-event--system.case-timeline-color-blue   .case-timeline-marker { background: var(--bg-surface); border-color: var(--signal-500); }
.case-timeline-event--system.case-timeline-color-green  .case-timeline-marker { background: var(--bg-surface); border-color: var(--status-success); }

/* Small "auto" chip marking machine-generated events. */
.case-timeline-auto-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-default);
    background: var(--bg-overlay);
    color: var(--text-quaternary);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* === Modern controls (batch 4) === */

/* ---- Overlay header: cohesive 36px ghost control cluster -----------------
   Prev/next ‹ › live in a joined segmented pair; the Actions trigger and
   the existing 36px .overlay-close share the same ghost recipe (subtle
   border, soft --radius-md, quiet hover) so the whole header reads as one
   aligned control group across every overlay type. */
.overlay-nav-group {
    display: inline-flex;
    align-items: stretch;
    height: 36px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    overflow: hidden;
    flex: none;
}
.overlay-nav-group .overlay-nav-btn {
    width: 35px;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}
.overlay-nav-group .overlay-nav-btn + .overlay-nav-btn {
    border-left: 1px solid var(--border-subtle);
}
.overlay-nav-group .overlay-nav-btn i { font-size: 15px; }
.overlay-nav-group .overlay-nav-btn:hover:not(:disabled) {
    background: var(--bg-active);
    color: var(--text-primary);
}
/* Disabled end-of-list chevron stays visible but clearly muted. */
.overlay-nav-group .overlay-nav-btn:disabled,
.overlay-nav-group .overlay-nav-btn[disabled] {
    opacity: 1;
    color: var(--text-quaternary);
    background: transparent;
    cursor: default;
    pointer-events: none;
}

/* Actions trigger: same 36px ghost treatment (overrides .btn-secondary.small). */
.overlay-header-actions .overlay-actions-trigger {
    height: 36px;
    padding: 0 var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    box-shadow: none;
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}
.overlay-header-actions .overlay-actions-trigger:hover {
    background: var(--bg-active);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.overlay-header-actions .overlay-actions-trigger i { font-size: 14px; }
.overlay-header-actions .overlay-actions-trigger .ph-caret-down {
    font-size: 11px;
    color: var(--text-quaternary);
}

/* Close button joins the cluster rhythm (recipe already 36px ghost);
   keep the rotate hover but soften the border like its siblings. */
.overlay-header-actions .overlay-close { box-shadow: none; }

/* Dark theme: mirror the .dark .overlay-close ink tones so the cluster
   stays uniform in both themes. */
.dark .overlay-nav-group {
    background: var(--ink-800);
    border-color: var(--ink-700);
}
.dark .overlay-nav-group .overlay-nav-btn { color: var(--ink-400); }
.dark .overlay-nav-group .overlay-nav-btn + .overlay-nav-btn {
    border-left-color: var(--ink-700);
}
.dark .overlay-nav-group .overlay-nav-btn:hover:not(:disabled) {
    background: var(--ink-700);
    color: var(--foreground);
}
.dark .overlay-nav-group .overlay-nav-btn:disabled,
.dark .overlay-nav-group .overlay-nav-btn[disabled] {
    color: var(--ink-600);
    background: transparent;
}
.dark .overlay-header-actions .overlay-actions-trigger {
    background: var(--ink-800);
    border-color: var(--ink-700);
    color: var(--ink-400);
}
.dark .overlay-header-actions .overlay-actions-trigger:hover {
    background: var(--ink-700);
    color: var(--foreground);
}

/* ---- Case summary sidebar: canonical uppercase priority ------------------
   Belt-and-braces with formatPriority(): even if a raw value slips
   through, "p1" still renders as "P1". */
.case-priority-value { text-transform: uppercase; }

/* ---- AI Analysis prose ----------------------------------------------------
   Keep narrative text naturally left-aligned. The analysis now uses the
   complete primary column without stretching words across the viewport. */
p.enrich-summary {
    text-align: start;
    -webkit-hyphens: none;
    hyphens: none;
}
/* Alert overlay variant uses the same readable alignment. */
.enrich-block p.enrich-summary {
    text-align: start;
    -webkit-hyphens: none;
    hyphens: none;
}
p.enrich-summary .enrich-summary__headline {
    text-align: start;
    -webkit-hyphens: none;
    hyphens: none;
}

/* === Legacy sweep (batch 4) === */
/* Modernizes controls that still rendered native/dated against the app's
   card + pill design language. CSS-only: no markup or behavior changes.
   Scope guard: overlay-header controls, priority formatting and
   .enrich-summary are owned by a concurrent pass — not touched here. */

/* ---- 1. Page-size selects (all paginated lists) ---------------------------
   Markup puts .page-size-select ON the <select> itself, so the legacy
   ".page-size-select select" descendant rules never matched and the
   control rendered as a bare native select. Style the element directly:
   a 32px pill that matches the circular pagination .btn-icon next to it.
   The .page-content twin outranks the legacy display:flex container rule. */
select.page-size-select,
.page-content .pagination-controls select.page-size-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: inline-flex;
    align-items: center;
    height: 32px;
    min-width: 0;
    padding: 0 var(--space-6) 0 var(--space-4);
    background-color: var(--bg-elevated);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out);
}
select.page-size-select:hover,
.page-content .pagination-controls select.page-size-select:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}
select.page-size-select:focus-visible,
.page-content .pagination-controls select.page-size-select:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}
.dark select.page-size-select {
    background-color: var(--card);
}

/* Keyboard parity for the pagination arrows beside the select. */
.page-content .pagination-controls .btn-icon:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* ---- 2. Approvals status filter -------------------------------------------
   <select class="filter-select"> had no matching rule anywhere — pure
   native rendering. Give it the exact .filter-group select treatment so
   every list-page filter dropdown reads identically. */
.filter-bar select.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 36px;
    min-width: 0;
    padding: var(--space-2) var(--space-6) var(--space-2) var(--space-4);
    background-color: var(--bg-elevated);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
}
.filter-bar select.filter-select:hover,
.filter-bar select.filter-select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.dark .filter-bar select.filter-select {
    background-color: var(--card);
}

/* ---- 3. Orphan select.form-input fallback ----------------------------------
   The case-detail playbook picker and the connector scope select carry
   class="form-input" but sit OUTSIDE .modal-form / .reporting-settings,
   so no select skin ever applied. :where() keeps this at zero specificity:
   every existing scoped skin still wins, only truly unstyled selects
   pick up the standard look. */
:where(select.form-input) {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: var(--space-2) var(--space-6) var(--space-2) var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
:where(select.form-input):focus {
    outline: none;
    border-color: var(--ring);
}

/* ---- 4. Status badges → pill geometry --------------------------------------
   .status-badge (alert overlay "OPEN" chip, platform alert table, org
   tier/status, team status, enrichment toggle) kept a boxy radius-md
   uppercase-button look while every modern chip in the app is a pill
   (.severity-badge, .enrich-pill, filter pills). Align the geometry —
   colors and semantics untouched. */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    line-height: 1.7;
    white-space: nowrap;
}
/* Variants used by orgs + team tables that previously fell through to the
   plain grey default; mirrors .status-badge.resolved's success treatment
   and keeps light-mode contrast via tokens rather than hardcoded paint. */
.status-badge.active {
    color: var(--status-success);
    background: var(--status-success-subtle);
    border-color: color-mix(in srgb, var(--status-success) 25%, transparent);
}
.status-badge.inactive,
.status-badge.closed {
    color: var(--text-tertiary);
    background: var(--bg-active);
    border-color: var(--border-subtle);
}

/* ---- 5. "View raw … log" / expandable details affordance -------------------
   The <details><summary> rows in the alert overlay read as plain body
   text — zero affordance that they are interactive. Promote them to the
   quiet chip pattern used app-wide; caret flip on [open] gives state. */
.alert-raw-details > summary,
.alert-expand-details > summary {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 500;
    width: fit-content;
    user-select: none;
    list-style: none;
    transition: border-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out);
}
.alert-raw-details > summary::-webkit-details-marker,
.alert-expand-details > summary::-webkit-details-marker {
    display: none;
}
.alert-raw-details > summary::after,
.alert-expand-details > summary::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
    transition: transform var(--duration-fast) var(--ease-out);
}
.alert-raw-details[open] > summary::after,
.alert-expand-details[open] > summary::after {
    transform: rotate(180deg);
}
.alert-raw-details > summary:hover,
.alert-expand-details > summary:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-hover);
}
.alert-raw-details > summary:focus-visible,
.alert-expand-details > summary:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* ---- 6. Bulk-action bar select — consolidated in main bulk-action-bar block ---- */

/* ---- 7. Case task status select ---------------------------------------------
   Tiny native dropdown inside the case Tasks tab; align with the select
   family (custom caret, md radius, themed hover/focus). */
select.case-task-status-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 3px var(--space-5) 3px var(--space-2);
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23717b8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-2) center;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out);
}
select.case-task-status-select:hover {
    border-color: var(--border-strong);
}
select.case-task-status-select:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

/* ---- 8. Alert severity strip: card-family radius ----------------------------
   The strip framing the big status chip used radius-md while sibling
   summary cards sit on the lg step; one notch up removes the boxy read. */
.alert-severity-strip {
    border-radius: var(--radius-lg);
}

/* ---- 9. Bulk-selected rows: dark-mode legibility ---- */
.dark .findings-table tr.row-selected td {
    background: color-mix(in srgb, var(--info) 14%, transparent);
}

/* === Notify customer channels (batch) === */
/* Channel + view segmented controls, email preview iframe wrapper, and the
   Microsoft Teams Adaptive-Card approximation. Tokens only → both themes. */

/* ── Segmented controls (channel selector + email Edit|Preview) ───────────── */
.notify-channel-seg,
.notify-view-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-tertiary, var(--bg-secondary));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.notify-channel-seg {
    display: flex;
    width: 100%;
    margin-bottom: var(--space-4);
}
.notify-channel-seg__btn,
.notify-view-seg__btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 8px 14px;
    border: 0;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm, 13px);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--duration-fast, 120ms) var(--ease-out, ease),
                color var(--duration-fast, 120ms) var(--ease-out, ease),
                box-shadow var(--duration-fast, 120ms) var(--ease-out, ease);
}
.notify-channel-seg__btn i,
.notify-view-seg__btn i {
    font-size: 1.05em;
}
.notify-channel-seg__btn:hover,
.notify-view-seg__btn:hover {
    color: var(--text-primary);
}
.notify-channel-seg__btn.active,
.notify-view-seg__btn.active {
    background: var(--card, var(--bg-elevated));
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--border-subtle);
}
.notify-channel-seg__btn:focus-visible,
.notify-view-seg__btn:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}
.notify-view-seg {
    padding: 2px;
    gap: 2px;
}
.notify-view-seg__btn {
    padding: 5px 12px;
    flex: 0 0 auto;
    font-size: 12.5px;
}

/* Body header row: label on the left, Edit|Preview toggle on the right. */
.notify-email-bodyhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.notify-email-bodyhead .form-label {
    margin-bottom: 0;
}

/* ── Email preview — sandboxed iframe wrapper ─────────────────────────────── */
.notify-email-preview {
    position: relative;
    min-height: 520px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    /* Email supplies its own background; a neutral matte avoids flashing. */
    background: var(--bg-secondary);
}
.notify-email-preview__frame {
    display: block;
    width: 100%;
    min-height: 520px;
    height: 60vh;
    max-height: 640px;
    border: 0;
    background: #ffffff;
}
.notify-email-preview__overlay,
.notify-email-preview__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 520px;
    padding: var(--space-6, 24px);
    color: var(--text-secondary);
    font-size: var(--text-sm, 13px);
    text-align: center;
}
.notify-email-preview__empty {
    flex-direction: column;
}
.notify-email-preview__empty i {
    font-size: 2rem;
    color: var(--text-tertiary, var(--text-secondary));
    opacity: 0.7;
}
.notify-email-preview__empty p {
    margin: 0;
    max-width: 38ch;
}
.notify-email-preview__note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-2);
}
.notify-email-preview__note i {
    color: var(--accent-secondary, var(--text-tertiary));
}

/* ── Microsoft Teams — not-configured empty state ─────────────────────────── */
.notify-teams-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-8, 32px) var(--space-6, 24px);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}
.notify-teams-empty__icon {
    font-size: 2.4rem;
    color: var(--text-tertiary, var(--text-secondary));
    opacity: 0.6;
}
.notify-teams-empty h4 {
    margin: 0;
    font-size: var(--text-base, 14px);
    font-weight: 600;
    color: var(--text-primary);
}
.notify-teams-empty p {
    margin: 0;
    max-width: 46ch;
    color: var(--text-secondary);
    font-size: var(--text-sm, 13px);
    line-height: 1.55;
}

.notify-teams-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--space-2);
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-subtle);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: middle;
}
.notify-teams-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-2);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--severity-critical-bg);
    color: var(--severity-critical);
    font-size: 12.5px;
}
.notify-teams-bodyarea {
    min-height: 120px;
    resize: vertical;
}

/* ── Teams Adaptive Card approximation ────────────────────────────────────── */
.teams-card {
    position: relative;
    display: flex;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card, var(--bg-elevated));
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px -16px rgba(0, 0, 0, 0.25);
}
.teams-card__accent {
    flex: 0 0 4px;
    background: var(--severity-medium);
}
.teams-card--critical .teams-card__accent { background: var(--severity-critical); }
.teams-card--high     .teams-card__accent { background: var(--severity-high); }
.teams-card--medium   .teams-card__accent { background: var(--severity-medium); }
.teams-card--low      .teams-card__accent { background: var(--severity-low); }
.teams-card__inner {
    flex: 1 1 auto;
    padding: 14px 16px 16px;
    min-width: 0;
}
.teams-card__brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--accent-secondary, var(--text-secondary));
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide, 0.04em);
}
.teams-card__brand i {
    font-size: 1.15em;
    color: #5b5fc7; /* Teams brand purple — consistent across themes */
}
.teams-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    word-break: break-word;
}
.teams-card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: 10px 0;
}
.teams-card__fact {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-subtle);
    border: 1px solid var(--border-subtle);
    font-size: 11.5px;
}
.teams-card__fact-label {
    color: var(--text-tertiary, var(--text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    font-size: 10px;
}
.teams-card__fact-value {
    color: var(--text-primary);
    font-weight: 600;
}
.teams-card__body {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* MSSP provider-org toggle in the platform org-management table. */
.provider-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.provider-toggle input { cursor: pointer; }

/* Customer recipient chips (Settings tab + notify-customer multiselect) */
.recipient-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.recipient-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 14px;
    background: var(--bg-primary); border: 1px solid var(--border-color, #2a2a3a);
    font-size: 0.8rem; color: var(--text-primary); line-height: 1.2;
}
.recipient-chip__x {
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; padding: 0;
    color: var(--text-secondary); font-size: 0.85rem;
}
.recipient-chip__x:hover { color: var(--danger, #e05260); }
.recipient-chip--toggle { cursor: pointer; }
.recipient-chip--toggle:hover { border-color: var(--accent, #5b8def); }
.recipient-chip--selected { border-color: var(--accent, #5b8def); color: var(--text-primary); }
.recipient-chips--summary { margin-top: 10px; }
.recipient-chips--summary .recipient-chip {
    background: color-mix(in srgb, var(--accent, #5b8def) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent, #5b8def) 35%, transparent);
}

/* Notify-customer recipients: multiselect dropdown */
.recipient-select { position: relative; }
.recipient-select__trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 10px 12px;
    background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid var(--border-color, #2a2a3a); border-radius: var(--radius-md, 10px);
    font-size: 0.9rem; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.recipient-select__trigger:hover { border-color: var(--accent, #5b8def); }
.recipient-select__trigger.is-open {
    border-color: var(--accent, #5b8def);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #5b8def) 18%, transparent);
}
.recipient-select__summary { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.recipient-select__placeholder { color: var(--text-secondary); }
.recipient-select__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--accent, #5b8def); color: #fff;
    border-radius: 10px; font-size: 0.72rem; font-weight: 700;
}
.recipient-select__caret { transition: transform .18s ease; color: var(--text-secondary); }
.recipient-select__trigger.is-open .recipient-select__caret { transform: rotate(180deg); }
.recipient-select__scrim { position: fixed; inset: 0; z-index: 40; }
.recipient-select__menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    background: var(--bg-surface, var(--card)); border: 1px solid var(--border-subtle, #2a2a3a);
    border-radius: var(--radius-md, 10px); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.4));
    padding: 6px; max-height: 320px; overflow-y: auto;
}
.recipient-select__option {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; background: none; border: none; border-radius: 8px;
    color: var(--text-primary); font-size: 0.86rem; text-align: left; cursor: pointer;
    transition: background .12s;
}
.recipient-select__option:hover { background: var(--bg-hover, rgba(255,255,255,.05)); }
/* Checkbox icons must read clearly in BOTH themes (were faint on
   --text-secondary). Unchecked square = primary text colour; checked /
   partial = accent. */
.recipient-select__option .ph { font-size: 1.15rem; color: var(--text-primary); flex-shrink: 0; }
/* Checked checkbox = vivid blue (``--accent`` is a neutral surface colour —
   near-white in light theme — so it was invisible). ``> .ph:first-child``
   scopes this to the checkbox only, NOT the custom-row remove (X) icon. */
.recipient-select__option.is-selected > .ph:first-child { color: var(--info, #5b8def); }
.recipient-select__option--all { font-weight: 600; }
.recipient-select__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.recipient-select__counthint { margin-left: auto; font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; }
.recipient-select__divider { height: 1px; background: var(--border-subtle, #2a2a3a); margin: 5px 4px; }
.recipient-select__section {
    padding: 4px 10px; font-size: 0.68rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-secondary);
}
.recipient-select__option.is-custom { cursor: default; }
.recipient-select__remove {
    margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; color: var(--text-primary);
    padding: 3px; border-radius: 6px;
}
/* Remove icon overrides the generic option-icon colour so it's clearly
   visible by default and turns red on hover. */
.recipient-select__remove .ph { color: inherit; font-size: 1rem; }
.recipient-select__remove:hover,
.recipient-select__remove:hover .ph { color: var(--danger, #e05260); }
.recipient-select__remove:hover { background: color-mix(in srgb, var(--danger, #e05260) 12%, transparent); }
.recipient-select__empty { padding: 10px; font-size: 0.82rem; color: var(--text-secondary); text-align: center; }
.recipient-select__add { display: flex; gap: 8px; padding: 6px 4px 4px; }
.recipient-select__add-input { flex: 1; }

/* Cross-tenant tenant filter dropdown (alert/case triage).
   z-index lifts the whole control's stacking context above the table's
   sticky <thead> so the open menu is never painted over by header cells. */
.tenant-filter { position: relative; display: inline-flex; z-index: 1200; }
.filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    border-color: var(--border-default);
    background: transparent;
}
.filter-reset:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-strong);
}
.filter-reset .ph { font-size: 0.95rem; }
@media (max-width: 1180px) and (min-width: 641px) {
    .filter-reset {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        min-width: 32px;
        height: 32px;
        padding: 0;
        border-radius: var(--radius-md);
    }
    .filter-reset-label { display: none; }
}
.tenant-filter__trigger { display: inline-flex; align-items: center; gap: 6px; }
.tenant-filter__caret { transition: transform .18s ease; font-size: 0.8rem; opacity: .8; }
.tenant-filter__trigger.is-open .tenant-filter__caret { transform: rotate(180deg); }
.tenant-filter__scrim { position: fixed; inset: 0; z-index: 8000; }
.tenant-filter__menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 8001;
    min-width: 240px; max-height: 320px; overflow-y: auto;
    background: var(--bg-surface, var(--card)); border: 1px solid var(--border-subtle, #2a2a3a);
    border-radius: var(--radius-md, 10px); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.45));
    padding: 6px;
    animation: colFilterMenuIn var(--duration-fast) var(--ease-out);
}
@keyframes colFilterMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Fixed variant: anchored to the trigger via JS (tenantMenuRect) so it
   escapes the table's stacking context — never painted over by the
   sticky <thead>. */
.tenant-filter__menu--fixed { position: fixed; top: 0; left: 0; right: auto; }
.tenant-filter__option {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; background: none; border: none; border-radius: var(--radius-md, 8px);
    color: var(--text-primary); font-size: var(--text-sm); text-align: left; cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}
.tenant-filter__option:hover { background: var(--bg-hover, rgba(255,255,255,.05)); }
.tenant-filter__option.is-selected {
    background: color-mix(in srgb, var(--info) 12%, var(--bg-surface));
    font-weight: 600;
}
.tenant-filter__option .ph { font-size: 1.05rem; color: var(--text-secondary); flex-shrink: 0; }
.tenant-filter__option.is-selected .ph { color: var(--info, #5b8def); }
.tenant-filter__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-filter__divider { height: 1px; background: var(--border-subtle, #2a2a3a); margin: 5px 4px; }
.tenant-filter__empty { padding: 10px; font-size: 0.82rem; color: var(--text-secondary); text-align: center; }
/* Inline search box inside the assignee/owner dropdown — filters the member
   list below it (which scrolls independently). */
.tenant-filter__search {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; margin: 2px 2px 6px;
    border: 1px solid var(--border-subtle, #2a2a3a); border-radius: var(--radius-md, 8px);
    background: var(--bg-elevated, var(--bg-surface));
    transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.tenant-filter__search:focus-within {
    border-color: color-mix(in srgb, var(--info) 40%, var(--border-subtle));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--info) 14%, transparent);
}
.tenant-filter__search .ph { font-size: 0.95rem; color: var(--text-secondary); flex-shrink: 0; }
.tenant-filter__search input {
    flex: 1; min-width: 0; border: none; background: transparent; outline: none;
    color: var(--text-primary); font-size: 0.85rem; padding: 2px 0;
}
.tenant-filter__search input::placeholder { color: var(--text-secondary); }
.tenant-filter__scrolllist { max-height: 200px; overflow-y: auto; }

/* Customer Recipients settings — card */
.recipients-card {
    max-width: 640px; margin-top: 16px; padding: 18px;
    background: var(--bg-surface, var(--card)); border: 1px solid var(--border-subtle, #2a2a3a);
    border-radius: var(--radius-lg, 14px);
}
.recipients-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.recipients-card__label { font-size: 0.78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.recipients-card__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 7px;
    background: color-mix(in srgb, var(--accent, #5b8def) 16%, transparent);
    color: var(--accent, #5b8def); border-radius: 11px; font-size: 0.74rem; font-weight: 700;
}
.recipients-card__add { display: flex; gap: 8px; }
.recipients-card__input { flex: 1; }
.recipients-card__list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.recipients-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--bg-primary); border: 1px solid var(--border-subtle, #2a2a3a);
    border-radius: var(--radius-md, 10px); font-size: 0.88rem; color: var(--text-primary);
    transition: border-color .12s;
}
.recipients-row:hover { border-color: color-mix(in srgb, var(--accent, #5b8def) 40%, transparent); }
.recipients-row__icon { color: var(--text-secondary); font-size: 1rem; }
.recipients-row__email { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipients-row__remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; background: none; border: none; border-radius: 7px;
    color: var(--text-secondary); cursor: pointer; transition: background .12s, color .12s;
}
.recipients-row__remove:hover { color: var(--danger, #e05260); background: color-mix(in srgb, var(--danger, #e05260) 12%, transparent); }
.recipients-card__empty {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 28px 16px; margin-top: 14px; text-align: center; color: var(--text-secondary);
    border: 1px dashed var(--border-subtle, #2a2a3a); border-radius: var(--radius-md, 10px);
}
.recipients-card__empty .ph { font-size: 1.6rem; opacity: .7; }
.recipients-card__empty p { margin: 0; font-size: 0.85rem; }

/* Tenant response-commitment policy */
.sla-policy-settings { max-width: 1480px; margin-inline: auto; }
.sla-policy-header { align-items: flex-start; gap: 24px; margin-bottom: 22px; }
.sla-policy-header .settings-description { margin: 9px 0 0; max-width: 760px; }
.sla-policy-title-line, .soc-dashboard-heading-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sla-policy-title-line h3 { margin: 0; }
.sla-source-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--text-muted) 30%, transparent); border-radius: 999px; color: var(--text-secondary); background: var(--bg-tertiary); font-size: .68rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.sla-source-badge.tenant_override { color: var(--accent-primary); border-color: color-mix(in srgb, var(--accent-primary) 40%, transparent); background: color-mix(in srgb, var(--accent-primary) 12%, transparent); }
.sla-source-badge.shared { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 10%, transparent); }
.sla-policy-callout { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, var(--border-color)); border-radius: 10px; color: var(--text-secondary); background: color-mix(in srgb, var(--accent-primary) 6%, var(--bg-secondary)); }
.sla-policy-callout i { margin-top: 2px; color: var(--accent-primary); }
.sla-policy-callout p { margin: 0; font-size: .8rem; line-height: 1.5; }
.sla-policy-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 13px; background: var(--bg-secondary); }
.sla-policy-table { width: 100%; min-width: 880px; border-collapse: collapse; }
.sla-policy-table th, .sla-policy-table td { padding: 16px 18px; border-bottom: 1px solid var(--border-color); text-align: start; vertical-align: middle; }
.sla-policy-table thead th { color: var(--text-muted); background: color-mix(in srgb, var(--accent-primary) 7%, var(--bg-tertiary)); font-size: .69rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.sla-policy-table tbody th { min-width: 150px; color: var(--text-primary); font-size: .82rem; font-weight: 650; }
.sla-policy-table tbody th .soc-dashboard-priority { margin-inline-end: 10px; }
.sla-policy-table tr:last-child > * { border-bottom: 0; }
.sla-duration-control { display: grid; grid-template-columns: minmax(76px, 1fr) minmax(105px, auto); gap: 7px; }
.sla-duration-control input, .sla-duration-control select { min-width: 0; height: 39px; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); background: var(--bg-primary); font: inherit; font-size: .78rem; }
.sla-duration-control input { padding: 0 10px; }
.sla-duration-control select { padding: 0 28px 0 10px; }
.sla-duration-control input:focus, .sla-duration-control select:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 16%, transparent); outline: none; }
.sla-contain-cell { min-width: 265px; }
.sla-na-toggle { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--text-secondary); font-size: .72rem; cursor: pointer; }
.sla-na-toggle input { accent-color: var(--accent-primary); }
.sla-policy-error { display: flex; align-items: center; gap: 9px; margin-top: 13px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent); border-radius: 9px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); font-size: .78rem; }
.sla-policy-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: .75rem; }
.sla-policy-actions strong { color: var(--warning); }
.sla-policy-action-buttons { display: flex; gap: 10px; }
.danger-quiet { color: var(--danger) !important; }
.sla-policy-state { display: flex; min-height: 280px; align-items: center; justify-content: center; flex-direction: column; gap: 9px; padding: 38px; border: 1px dashed var(--border-color); border-radius: 13px; text-align: center; color: var(--text-secondary); background: var(--bg-secondary); }
.sla-policy-state.error { border-color: color-mix(in srgb, var(--danger) 34%, var(--border-color)); }
.sla-policy-state p { max-width: 520px; margin: 0 0 7px; color: var(--text-muted); font-size: .8rem; }
.sla-policy-state-icon, .soc-dashboard-sla-mixed-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-tertiary)); font-size: 1.2rem; }
.soc-dashboard-sla-mixed { display: flex; align-items: center; gap: 15px; padding: 20px; border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border-color)); border-radius: 12px; background: color-mix(in srgb, var(--warning) 6%, var(--bg-secondary)); }
.soc-dashboard-sla-mixed strong { color: var(--text-primary); font-size: .84rem; }
.soc-dashboard-sla-mixed p { margin: 5px 0 0; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
@media (max-width: 760px) {
    .sla-policy-header, .sla-policy-actions { align-items: stretch; flex-direction: column; }
    .sla-policy-action-buttons { display: grid; grid-template-columns: 1fr; }
    .sla-policy-action-buttons button { justify-content: center; width: 100%; }
}

/* SOC Manager lifecycle dashboard --------------------------------------- */
.soc-dashboard-page {
    --soc-total: var(--text-primary);
    --soc-critical: var(--error);
    --soc-high: var(--warning);
    --soc-medium: #2ec4b6;
    --soc-low: var(--success);
    --soc-classification-pending: var(--warning);
    --soc-classification-false-positive: #f59e4c;
    --soc-classification-benign: var(--success);
    --soc-classification-suspicious: #5b8def;
    --soc-classification-malicious: var(--error);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    max-width: 1440px;
    gap: 16px;
    margin-inline: auto;
    padding-bottom: 36px;
}
.soc-dashboard-toolbar,
.soc-dashboard-performance,
.soc-dashboard-sla,
.soc-dashboard-category,
.soc-dashboard-breaches,
.soc-dashboard-trend,
.soc-dashboard-triggered-panel,
.soc-dashboard-classification-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
}
.soc-dashboard-hero {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 28px;
    padding: 6px 2px 0;
}
.soc-dashboard-hero-copy,
.soc-dashboard-hero-controls { min-width: 0; }
.soc-dashboard-hero-controls {
    display: grid;
    justify-items: end;
    gap: 8px;
}
.soc-dashboard-hero h2 {
    max-width: 100%;
    margin: 4px 0 8px;
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    font-weight: 750;
    letter-spacing: -.035em;
}
.soc-dashboard-hero p {
    max-width: 720px;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-secondary);
    line-height: 1.5;
}
.soc-dashboard-eyebrow {
    margin: 0 !important;
    color: var(--text-tertiary) !important;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.soc-dashboard-reporting-window {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    color: var(--text-secondary);
    font-size: .78rem;
}
.soc-dashboard-reporting-window-copy strong {
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font: 600 .8rem/1.4 var(--font-mono);
}
.soc-dashboard-reporting-window-range,
.soc-dashboard-reporting-window-zone,
.soc-dashboard-reporting-window-scope,
.soc-dashboard-freshness span,
.soc-dashboard-sample-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    color: var(--text-tertiary);
    font-size: .72rem;
    white-space: nowrap;
}
.soc-dashboard-reporting-window-range::before,
.soc-dashboard-reporting-window-zone::before,
.soc-dashboard-reporting-window-scope::before {
    color: var(--text-tertiary);
    content: '•';
}
.soc-dashboard-freshness { display: flex; justify-content: flex-end; }
.soc-dashboard-live {
    color: var(--text-secondary) !important;
    font-weight: 600;
}
.soc-dashboard-live-dot {
    position: relative;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--success);
}
.soc-dashboard-live-dot::after {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--success) 45%, transparent);
    animation: soc-live-pulse 2s ease-out infinite;
    content: '';
}
@keyframes soc-live-pulse { 0% { opacity: .9; transform: scale(.55); } 70% { opacity: 0; transform: scale(1.25); } 100% { opacity: 0; transform: scale(1.25); } }
.soc-dashboard-live-sep { color: var(--text-tertiary); }
.soc-dashboard-toolbar {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 12px 14px;
}
.soc-dashboard-scope-control { position: relative; min-width: min(320px, 100%); }
.soc-dashboard-control-label,
.soc-dashboard-range-control legend {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    color: var(--text-tertiary);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.soc-dashboard-scope-button,
.soc-dashboard-fixed-scope {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 7px 11px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: start;
}
.soc-dashboard-scope-button { cursor: pointer; }
.soc-dashboard-scope-button:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--accent-primary) 55%, var(--border-color));
    background: var(--bg-hover);
}
.soc-dashboard-scope-button:focus-visible,
.soc-dashboard-range-buttons button:focus-visible,
.soc-dashboard-scope-option:focus-visible,
.soc-dashboard-trend-values button:focus-visible,
.soc-dashboard-action:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.soc-dashboard-scope-button > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-dashboard-fixed-scope { width: auto; color: var(--text-secondary); }
.soc-dashboard-scope-retry { margin-top: 5px; }
.soc-dashboard-menu-scrim { position: fixed; z-index: 40; inset: 0; background: transparent; }
.soc-dashboard-scope-menu {
    position: absolute;
    z-index: 41;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    width: min(390px, calc(100vw - 36px));
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.soc-dashboard-scope-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-primary);
}
.soc-dashboard-scope-search:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 18%, transparent); }
.soc-dashboard-scope-search input { width: 100%; min-height: 38px; border: 0; outline: 0; background: transparent; color: var(--text-primary); }
.soc-dashboard-scope-options { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; }
.soc-dashboard-scope-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    text-align: start;
    cursor: pointer;
}
.soc-dashboard-scope-option:hover,
.soc-dashboard-scope-option.is-selected { background: color-mix(in srgb, var(--accent-primary) 10%, transparent); }
.soc-dashboard-scope-option > i { color: var(--accent-primary); font-size: 1.1rem; }
.soc-dashboard-scope-option > span { display: grid; min-width: 0; gap: 2px; }
.soc-dashboard-scope-option strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.soc-dashboard-scope-option small { overflow: hidden; color: var(--text-tertiary); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.soc-dashboard-scope-empty { margin: 14px 8px; color: var(--text-tertiary); font-size: .78rem; text-align: center; }
.soc-dashboard-scope-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.soc-dashboard-range-control { min-width: 0; margin: 0; padding: 0; border: 0; }
.soc-dashboard-range-buttons {
    display: flex;
    min-width: 0;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
}
.soc-dashboard-range-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: .74rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}
.soc-dashboard-range-buttons button:hover { color: var(--text-primary); background: var(--bg-hover); }
.soc-dashboard-range-buttons button.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .16);
}
.soc-dashboard-actions-rail { display: flex; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.soc-dashboard-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 650;
    cursor: pointer;
}
.soc-dashboard-action:hover { border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-color)); color: var(--text-primary); background: color-mix(in srgb, var(--accent-primary) 7%, var(--bg-primary)); }
.soc-dashboard-overview,
.soc-dashboard-insights,
.soc-dashboard-grid { width: 100%; min-width: 0; max-width: 100%; }
.soc-dashboard-overview { display: grid; gap: 12px; }
.soc-dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.soc-dashboard-kpi-card {
    --soc-kpi: var(--accent-primary);
    display: grid;
    min-width: 0;
    min-height: 124px;
    align-content: start;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
}
.soc-dashboard-kpi-card.is-total { --soc-kpi: var(--soc-total); }
.soc-dashboard-kpi-card.is-critical { --soc-kpi: var(--soc-critical); }
.soc-dashboard-kpi-card.is-acknowledged { --soc-kpi: var(--success); }
.soc-dashboard-kpi-card.is-attention { --soc-kpi: var(--error); }
.soc-dashboard-kpi-card.is-clear { --soc-kpi: var(--success); }
.soc-dashboard-kpi-head { display: flex; min-width: 0; align-items: center; }
.soc-dashboard-kpi-label {
    min-width: 0;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.soc-dashboard-kpi-body { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 12px; }
.soc-dashboard-kpi-value {
    display: block;
    color: var(--text-primary);
    font: 750 clamp(1.85rem, 2.5vw, 2.35rem)/1 var(--font-mono);
    letter-spacing: -.05em;
}
.soc-dashboard-kpi-spark { width: 88px; height: 28px; flex: 0 0 88px; overflow: visible; }
.soc-dashboard-kpi-spark path { fill: none; stroke: var(--success); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.soc-dashboard-kpi-spark.is-critical path { stroke: var(--soc-critical); }
.soc-dashboard-kpi-delta {
    display: inline-flex;
    width: fit-content;
    min-height: 22px;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: .66rem;
    font-weight: 700;
}
.soc-dashboard-kpi-delta.is-up,
.soc-dashboard-kpi-card.is-attention .soc-dashboard-kpi-delta {
    background: color-mix(in srgb, var(--error) 12%, transparent);
    color: var(--error);
}
.soc-dashboard-kpi-delta.is-down { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.soc-dashboard-kpi-delta.is-new { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); }
.soc-dashboard-kpi-delta.is-coverage { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.soc-dashboard-kpi-hint { margin: 0; color: var(--text-tertiary); font-size: .68rem; }
.soc-dashboard-kpi-card.soc-dashboard-metric-card--skeleton { align-content: center; }
.soc-dashboard-skeleton-line { display: block; width: 100%; height: 12px; margin-bottom: 16px; border-radius: 5px; }
.soc-dashboard-skeleton-line.short { width: 42%; }
.soc-dashboard-skeleton-line.medium { width: 68%; margin-top: auto; }
.soc-dashboard-skeleton-value { display: block; width: 54%; height: 38px; margin: 8px 0 24px; border-radius: 6px; }
.soc-dashboard-state { display: flex; align-items: center; gap: 13px; min-height: 100px; padding: 18px; border: 1px dashed var(--border-color); border-radius: 12px; color: var(--text-secondary); }
.soc-dashboard-state > i { color: var(--text-tertiary); font-size: 1.6rem; }
.soc-dashboard-state > div { min-width: 0; flex: 1; }
.soc-dashboard-state strong { color: var(--text-primary); }
.soc-dashboard-state p { margin: 4px 0 0; font-size: .76rem; }
.soc-dashboard-state--error { border-style: solid; border-color: color-mix(in srgb, var(--danger) 32%, var(--border-color)); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.soc-dashboard-state--error > i { color: var(--danger); }
.soc-dashboard-empty-banner { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 11px 13px; border-radius: 9px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: .76rem; }
.soc-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.soc-dashboard-panel-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.soc-dashboard-panel-title { min-width: 0; }
.soc-dashboard-panel-title h3 { margin: 0; color: var(--text-primary); font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
.soc-dashboard-panel-title p { margin: 4px 0 0; color: var(--text-tertiary); font-size: .72rem; line-height: 1.4; }
.soc-dashboard-live-chip { padding: 4px 8px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-primary); }
.soc-dashboard-live-chip i { position: relative; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--success); }
.soc-dashboard-live-chip i::after { position: absolute; inset: -3px; border-radius: 50%; background: color-mix(in srgb, var(--success) 45%, transparent); animation: soc-live-pulse 2s ease-out infinite; content: ''; }
.soc-dashboard-trend { padding: 20px 22px 16px; }
.soc-dashboard-trend-values { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.soc-dashboard-trend-values button {
    --soc-series: var(--text-primary);
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: inherit;
    text-align: start;
    cursor: pointer;
}
.soc-dashboard-trend-values button.is-critical { --soc-series: var(--soc-critical); }
.soc-dashboard-trend-values button.is-high { --soc-series: var(--soc-high); }
.soc-dashboard-trend-values button.is-medium { --soc-series: var(--soc-medium); }
.soc-dashboard-trend-values button.is-low { --soc-series: var(--soc-low); }
.soc-dashboard-trend-values button.is-active { border-color: color-mix(in srgb, var(--soc-series) 42%, var(--border-color)); box-shadow: inset 0 -2px 0 var(--soc-series); }
.soc-dashboard-trend-values button.is-dimmed { opacity: .55; }
.soc-dashboard-trend-values span { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: .66rem; }
.soc-dashboard-trend-values span i,
.soc-dashboard-trend-legend i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--soc-series); }
.soc-dashboard-trend-values strong { display: inline-block; margin-top: 4px; color: var(--text-primary); font: 700 1.15rem/1 var(--font-mono); }
.soc-dashboard-trend-values small { margin-inline-start: 6px; color: var(--text-tertiary); font-size: .61rem; font-weight: 700; }
.soc-dashboard-trend-values small.is-up { color: var(--error); }
.soc-dashboard-trend-values small.is-down { color: var(--success); }
.soc-dashboard-trend-values small.is-new { color: var(--warning); }
.soc-dashboard-trend-chart { position: relative; width: 100%; min-height: 270px; overflow: hidden; }
.soc-dashboard-trend-chart svg { display: block; width: 100%; height: auto; min-height: 270px; overflow: visible; }
.soc-dashboard-trend-grid line { stroke: color-mix(in srgb, var(--border-color) 80%, transparent); stroke-width: 1; }
.soc-dashboard-trend-grid text,
.soc-dashboard-trend-labels text { fill: var(--text-tertiary); font-size: 10px; }
.soc-dashboard-trend-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: opacity .16s ease; }
.soc-dashboard-trend-line.is-total { stroke: var(--soc-total); stroke-width: 2.8; }
.soc-dashboard-trend-line.is-critical { stroke: var(--soc-critical); }
.soc-dashboard-trend-line.is-high { stroke: var(--soc-high); }
.soc-dashboard-trend-line.is-medium { stroke: var(--soc-medium); }
.soc-dashboard-trend-line.is-low { stroke: var(--soc-low); }
.soc-dashboard-trend-area { stroke: none; transition: opacity .16s ease; }
.soc-dashboard-trend-line.is-dimmed,
.soc-dashboard-trend-area.is-dimmed,
.soc-dashboard-trend-endpoint.is-dimmed { opacity: .18; }
.soc-trend-stop { stop-opacity: .18; }
.soc-trend-stop.is-total { stop-color: var(--soc-total); }
.soc-trend-stop.is-critical { stop-color: var(--soc-critical); }
.soc-trend-stop.is-high { stop-color: var(--soc-high); stop-opacity: .14; }
.soc-trend-stop.is-medium { stop-color: var(--soc-medium); stop-opacity: .12; }
.soc-trend-stop.is-low { stop-color: var(--soc-low); stop-opacity: .1; }
.soc-trend-stop-end { stop-color: var(--bg-secondary); stop-opacity: 0; }
.soc-dashboard-trend-endpoint { stroke: var(--bg-secondary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.soc-dashboard-trend-endpoint.is-total { fill: var(--soc-total); }
.soc-dashboard-trend-endpoint.is-critical { fill: var(--soc-critical); }
.soc-dashboard-trend-endpoint.is-high { fill: var(--soc-high); }
.soc-dashboard-trend-endpoint.is-medium { fill: var(--soc-medium); }
.soc-dashboard-trend-endpoint.is-low { fill: var(--soc-low); }
.soc-dashboard-trend-crosshair line { stroke: var(--text-primary); stroke-width: 1; stroke-dasharray: 3 4; opacity: .45; }
.soc-dashboard-trend-hit { fill: transparent; cursor: crosshair; }
.soc-dashboard-trend-tooltip {
    position: absolute;
    top: 12px;
    inset-inline-end: 16px;
    z-index: 2;
    display: grid;
    gap: 2px;
    min-width: 170px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    pointer-events: none;
}
.soc-dashboard-trend-tooltip strong { color: var(--text-primary); font-size: .78rem; }
.soc-dashboard-trend-tooltip span { color: var(--text-tertiary); font-size: .66rem; }
.soc-dashboard-trend-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-secondary); font-size: .65rem; }
.soc-dashboard-trend-legend span { --soc-series: var(--soc-total); display: inline-flex; align-items: center; gap: 6px; }
.soc-dashboard-trend-legend .is-critical { --soc-series: var(--soc-critical); }
.soc-dashboard-trend-legend .is-high { --soc-series: var(--soc-high); }
.soc-dashboard-trend-legend .is-medium { --soc-series: var(--soc-medium); }
.soc-dashboard-trend-legend .is-low { --soc-series: var(--soc-low); }
.soc-dashboard-insights {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
}
.soc-dashboard-triggered-panel,
.soc-dashboard-classification-panel {
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    padding: 20px;
}
.soc-dashboard-activity-rank-label {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-tertiary);
    background: var(--bg-primary);
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.soc-dashboard-triggered-list { display: grid; margin: 0; padding: 0; list-style: none; }
.soc-dashboard-triggered-list li {
    display: grid;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--border-color);
}
.soc-dashboard-triggered-list li:first-child { border-top: 0; padding-top: 0; }
.soc-dashboard-triggered-rank {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font: 700 .72rem/1 var(--font-mono);
}
.soc-dashboard-triggered-copy { display: grid; min-width: 0; gap: 5px; }
.soc-dashboard-triggered-copy > strong { overflow: hidden; color: var(--text-primary); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.soc-dashboard-triggered-meta { display: flex; min-width: 0; flex-wrap: wrap; gap: 4px 10px; color: var(--text-tertiary); font-size: .64rem; }
.soc-dashboard-triggered-meta > span,
.soc-dashboard-triggered-meta > time { display: inline-flex; min-width: 0; max-width: 100%; align-items: center; overflow-wrap: anywhere; }
.soc-dashboard-triggered-meta > span:nth-child(2),
.soc-dashboard-triggered-meta > span:nth-child(3) { direction: ltr; overflow: hidden; text-overflow: ellipsis; unicode-bidi: isolate; white-space: nowrap; }
.soc-dashboard-triggered-bar { display: block; height: 4px; overflow: hidden; border-radius: 999px; background: var(--bg-tertiary); }
.soc-dashboard-triggered-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--soc-high), color-mix(in srgb, var(--soc-high) 55%, white)); }
.soc-dashboard-triggered-count {
    display: inline-grid;
    min-width: 36px;
    min-height: 28px;
    padding: 4px 8px;
    place-items: center;
    color: var(--text-primary);
    font: 700 .82rem/1 var(--font-mono);
}
.soc-dashboard-activity-empty { display: flex; min-height: 126px; align-items: center; justify-content: center; gap: 8px; color: var(--text-tertiary); font-size: .75rem; text-align: center; }
.soc-dashboard-classification-layout {
    display: grid;
    flex: 1;
    min-height: 210px;
    grid-template-columns: 168px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}
.soc-dashboard-classification-donut {
    position: relative;
    width: 162px;
    height: 162px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border-color);
}
.soc-dashboard-classification-donut::after {
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    content: '';
}
.soc-dashboard-classification-donut > span {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 2px;
    padding: 28px;
    color: var(--text-tertiary);
    font-size: .56rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-align: center;
    text-transform: uppercase;
}
.soc-dashboard-classification-donut strong { display: block; color: var(--text-primary); font: 750 1.75rem/1 var(--font-mono); letter-spacing: -.04em; }
.soc-dashboard-distribution-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.soc-dashboard-distribution-list li { --soc-distribution-color: var(--accent-primary); display: grid; gap: 5px; }
.soc-dashboard-distribution-list li > div { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 12px; }
.soc-dashboard-distribution-list li > div span { min-width: 0; overflow: hidden; color: var(--text-secondary); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.soc-dashboard-distribution-list li > div strong { color: var(--text-primary); font: 700 .72rem/1 var(--font-mono); }
.soc-dashboard-distribution-track { display: block; height: 4px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--border-color) 62%, var(--bg-tertiary)); }
.soc-dashboard-distribution-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--soc-distribution-color); }
.soc-dashboard-classification-panel .is-pending { --soc-distribution-color: var(--soc-classification-pending); }
.soc-dashboard-classification-panel .is-false_positive { --soc-distribution-color: var(--soc-classification-false-positive); }
.soc-dashboard-classification-panel .is-true_positive_benign { --soc-distribution-color: var(--soc-classification-benign); }
.soc-dashboard-classification-panel .is-true_positive_suspicious { --soc-distribution-color: var(--soc-classification-suspicious); }
.soc-dashboard-classification-panel .is-true_positive_malicious { --soc-distribution-color: var(--soc-classification-malicious); }
.soc-dashboard-classification-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 14px; }
.soc-dashboard-classification-insights > div { min-width: 0; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--bg-primary); }
.soc-dashboard-classification-insights span { display: block; overflow: hidden; color: var(--text-tertiary); font-size: .58rem; letter-spacing: .04em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.soc-dashboard-classification-insights strong { display: block; margin-top: 3px; color: var(--text-primary); font: 700 .85rem/1 var(--font-mono); }
.soc-dashboard-classification-insights > div:last-child strong { color: var(--error); }
.soc-dashboard-performance,
.soc-dashboard-sla,
.soc-dashboard-category,
.soc-dashboard-breaches { padding: 20px 22px; }
.soc-dashboard-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.soc-dashboard-section-heading h3 { margin: 3px 0 0; color: var(--text-primary); font-size: 1.05rem; }
.soc-dashboard-section-heading > p,
.soc-dashboard-section-heading > div > p:not(.soc-dashboard-eyebrow) { max-width: 620px; margin: 5px 0 0; color: var(--text-secondary); font-size: .78rem; line-height: 1.5; }
.soc-dashboard-section-heading > p { text-align: end; }
.soc-dashboard-health-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; color: var(--text-tertiary); font-size: .63rem; }
.soc-dashboard-health-legend span { display: inline-flex; align-items: center; gap: 5px; }
.soc-dashboard-health-legend i { width: 7px; height: 7px; border-radius: 50%; }
.soc-dashboard-health-legend .is-within i { background: var(--success); }
.soc-dashboard-health-legend .is-near i { background: var(--warning); }
.soc-dashboard-health-legend .is-breached i { background: var(--error); }
.soc-dashboard-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.soc-dashboard-metric-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 196px;
    flex-direction: column;
    padding: 18px 18px 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--bg-primary);
}
.soc-dashboard-metric-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.soc-dashboard-metric-card h4 { margin: 0; color: var(--text-secondary); font-size: .78rem; font-weight: 650; line-height: 1.35; }
.soc-dashboard-metric-value { margin: 12px 0 0; color: var(--text-primary); font: 750 clamp(1.7rem, 2.8vw, 2.2rem)/1.1 var(--font-mono); letter-spacing: -.04em; }
.soc-dashboard-metric-definition { margin: 8px 0 14px; color: var(--text-tertiary); font-size: .73rem; line-height: 1.45; }
.soc-dashboard-metric-footer { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: auto; color: var(--text-tertiary); font-size: .7rem; }
.soc-dashboard-metric-track { display: block; height: 5px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: var(--bg-tertiary); }
.soc-dashboard-metric-track > i { display: block; height: 100%; border-radius: inherit; background: var(--text-tertiary); }
.soc-dashboard-metric-card.is-within { border-color: color-mix(in srgb, var(--success) 32%, var(--border-color)); }
.soc-dashboard-metric-card.is-near { border-color: color-mix(in srgb, var(--warning) 34%, var(--border-color)); }
.soc-dashboard-metric-card.is-breached { border-color: color-mix(in srgb, var(--error) 36%, var(--border-color)); }
.soc-dashboard-metric-card.is-within .soc-dashboard-metric-track > i { background: var(--success); }
.soc-dashboard-metric-card.is-near .soc-dashboard-metric-track > i { background: var(--warning); }
.soc-dashboard-metric-card.is-breached .soc-dashboard-metric-track > i { background: var(--error); }
.soc-dashboard-state-chip {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.soc-dashboard-metric-card.is-within .soc-dashboard-state-chip { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.soc-dashboard-metric-card.is-near .soc-dashboard-state-chip { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.soc-dashboard-metric-card.is-breached .soc-dashboard-state-chip { color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); }
.soc-dashboard-table-scroll { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 12px; }
.soc-dashboard-table-scroll:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.soc-dashboard-sla-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.soc-dashboard-sla-table th,
.soc-dashboard-sla-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); font-size: .78rem; text-align: start; }
.soc-dashboard-sla-table thead th { background: var(--bg-tertiary); color: var(--text-primary); font-size: .68rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.soc-dashboard-sla-table tbody th { color: var(--text-primary); font-weight: 600; }
.soc-dashboard-sla-table tr:last-child > * { border-bottom: 0; }
.soc-dashboard-category-table,
.soc-dashboard-breach-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.soc-dashboard-category-table th,
.soc-dashboard-category-table td,
.soc-dashboard-breach-table th,
.soc-dashboard-breach-table td { padding: 13px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); font-size: .76rem; text-align: start; vertical-align: middle; }
.soc-dashboard-category-table thead th,
.soc-dashboard-breach-table thead th { background: var(--bg-tertiary); color: var(--text-primary); font-size: .66rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.soc-dashboard-category-table tbody th,
.soc-dashboard-breach-table tbody th { color: var(--text-primary); font-weight: 600; }
.soc-dashboard-category-table tr:last-child > *,
.soc-dashboard-breach-table tr:last-child > * { border-bottom: 0; }
.soc-dashboard-compliance-counts { display: grid; gap: 3px; min-width: 190px; font-size: .68rem; }
.soc-dashboard-compliance-row { display: inline-flex; align-items: center; gap: 7px; }
.soc-dashboard-compliance-row > strong { min-width: 42px; color: var(--text-secondary); font-size: .65rem; }
.soc-dashboard-compliance-counts span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.soc-dashboard-compliance-counts .is-compliant { color: var(--success); }
.soc-dashboard-compliance-counts .is-breached { color: var(--danger); }
.soc-dashboard-compliance-counts .is-pending { color: var(--warning); }
.soc-dashboard-compliance-counts .is-na { color: var(--text-muted, #8b95a7); font-size: .72rem; }
.soc-dashboard-health-table { min-width: 980px; border-collapse: separate; border-spacing: 6px; padding: 6px; }
.soc-dashboard-health-table th,
.soc-dashboard-health-table td { border: 0; border-radius: 8px; }
.soc-dashboard-health-table thead th { background: transparent; }
.soc-dashboard-health-cell { min-width: 124px; background: var(--bg-tertiary); text-align: center !important; }
.soc-dashboard-health-cell strong { display: block; color: var(--text-primary); font: 700 .78rem/1.2 var(--font-mono); }
.soc-dashboard-health-cell small { display: block; margin-top: 4px; color: var(--text-tertiary); font-size: .57rem; letter-spacing: .04em; text-transform: uppercase; }
.soc-dashboard-health-cell.is-volume { background: var(--bg-primary); }
.soc-dashboard-health-cell.is-within { background: color-mix(in srgb, var(--success) 16%, var(--bg-primary)); }
.soc-dashboard-health-cell.is-within strong,
.soc-dashboard-health-cell.is-within small { color: var(--success); }
.soc-dashboard-health-cell.is-near { background: color-mix(in srgb, var(--warning) 16%, var(--bg-primary)); }
.soc-dashboard-health-cell.is-near strong,
.soc-dashboard-health-cell.is-near small { color: var(--warning); }
.soc-dashboard-health-cell.is-breached { background: color-mix(in srgb, var(--error) 16%, var(--bg-primary)); }
.soc-dashboard-health-cell.is-breached strong,
.soc-dashboard-health-cell.is-breached small { color: var(--error); }
.soc-dashboard-health-cell.is-unavailable { background: var(--bg-tertiary); }
.soc-dashboard-health-table .soc-dashboard-compliance-counts { min-width: 175px; }
.soc-dashboard-breach-title { display: block; max-width: 310px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-dashboard-breach-table small { display: block; margin-top: 4px; color: var(--text-tertiary); font-size: .66rem; font-weight: 400; }
.soc-dashboard-breach-duration { color: var(--danger); font: 650 .77rem/1.2 var(--font-mono); white-space: nowrap; }
.soc-dashboard-breaches-heading { align-items: center; }
.soc-dashboard-breaches-heading-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 10px; }
.soc-dashboard-breaches-heading-actions > p { max-width: 620px; margin: 0; color: var(--text-secondary); font-size: .8rem; line-height: 1.5; text-align: end; }
.soc-dashboard-breach-count {
    display: inline-grid;
    min-width: 30px;
    min-height: 30px;
    padding: 4px 8px;
    place-items: center;
    border-radius: 999px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--bg-tertiary));
    font: 700 .7rem/1 var(--font-mono);
}
.soc-dashboard-collapse-button { width: 38px !important; min-width: 38px; height: 38px !important; border: 1px solid var(--border-color) !important; border-radius: 9px !important; }
.soc-dashboard-collapse-button:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.soc-dashboard-breaches-content { display: grid; min-width: 0; gap: 0; }
.soc-dashboard-breach-table .th-sortable-label { appearance: none; cursor: pointer; }
.soc-dashboard-breach-table .th-header-actions { white-space: nowrap; }
.soc-dashboard-breach-filter-empty { display: flex; min-height: 92px; align-items: center; justify-content: center; gap: 9px; color: var(--text-secondary); text-align: center; }
.soc-dashboard-breach-filter-empty > i { color: var(--text-tertiary); font-size: 1.1rem; }
.soc-dashboard-breach-pagination { margin-top: 0; border: 1px solid var(--border-color); border-top: 0; border-radius: 0 0 12px 12px; background: color-mix(in srgb, var(--bg-tertiary) 72%, var(--bg-secondary)); }
.soc-dashboard-breaches-content .soc-dashboard-table-scroll:has(+ .soc-dashboard-breach-pagination) { border-radius: 12px 12px 0 0; }
.soc-dashboard-priority { display: inline-grid; min-width: 29px; min-height: 25px; margin-inline-end: 9px; place-items: center; border-radius: 6px; font: 700 .68rem/1 var(--font-mono); }
.soc-dashboard-priority.critical { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.soc-dashboard-priority.high { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.soc-dashboard-priority.medium { background: color-mix(in srgb, var(--accent-primary) 14%, transparent); color: var(--accent-primary); }
.soc-dashboard-priority.low { background: var(--bg-tertiary); color: var(--text-tertiary); }
.soc-dashboard-heading-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.soc-dashboard-sla-mixed { display: flex; align-items: center; gap: 15px; padding: 20px; border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border-color)); border-radius: 12px; background: color-mix(in srgb, var(--warning) 6%, var(--bg-secondary)); }
.soc-dashboard-sla-mixed-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-tertiary)); font-size: 1.2rem; }
.soc-dashboard-sla-mixed strong { color: var(--text-primary); font-size: .84rem; }
.soc-dashboard-sla-mixed p { margin: 5px 0 0; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
.soc-dashboard-custom-modal { width: min(620px, calc(100vw - 24px)); }
.soc-dashboard-custom-modal .modal-header > div > p { margin: 4px 0 0; color: var(--text-secondary); font-size: .75rem; }
.soc-dashboard-custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.soc-dashboard-custom-grid fieldset { display: grid; gap: 7px; margin: 0; padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; }
.soc-dashboard-custom-grid legend { padding: 0 5px; color: var(--text-primary); font-size: .78rem; font-weight: 700; }
.soc-dashboard-custom-grid label { color: var(--text-secondary); font-size: .7rem; font-weight: 600; }
.soc-dashboard-custom-grid input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); color-scheme: dark; }
html:not(.dark) .soc-dashboard-custom-grid input { color-scheme: light; }
.soc-dashboard-custom-error { display: flex; align-items: center; gap: 7px; margin: 13px 0 0; color: var(--error); font-size: .75rem; }

@media (max-width: 1100px) {
    .soc-dashboard-insights { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .soc-dashboard-hero { align-items: flex-start; flex-direction: column; }
    .soc-dashboard-hero-controls,
    .soc-dashboard-freshness { width: 100%; justify-items: start; justify-content: flex-start; }
    .soc-dashboard-toolbar { align-items: stretch; flex-direction: column; }
    .soc-dashboard-scope-control,
    .soc-dashboard-actions-rail { width: 100%; }
    .soc-dashboard-actions-rail { justify-content: flex-start; }
    .soc-dashboard-metric-grid { grid-template-columns: 1fr; }
    .soc-dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .soc-dashboard-trend-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .soc-dashboard-page { gap: 12px; }
    .soc-dashboard-hero { padding: 4px 2px 0; }
    .soc-dashboard-performance,
    .soc-dashboard-sla,
    .soc-dashboard-category,
    .soc-dashboard-breaches,
    .soc-dashboard-trend,
    .soc-dashboard-triggered-panel,
    .soc-dashboard-classification-panel { padding: 16px; border-radius: 12px; }
    .soc-dashboard-kpi-grid { gap: 8px; }
    .soc-dashboard-kpi-card { min-height: 108px; padding: 13px; }
    .soc-dashboard-kpi-value { font-size: 1.55rem; }
    .soc-dashboard-kpi-spark { display: none; }
    .soc-dashboard-trend-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .soc-dashboard-trend-values button:first-child { grid-column: 1 / -1; }
    .soc-dashboard-trend-chart,
    .soc-dashboard-trend-chart svg { min-height: 205px; }
    .soc-dashboard-classification-layout { min-height: 0; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; }
    .soc-dashboard-classification-donut { width: 148px; height: 148px; }
    .soc-dashboard-classification-donut::after { inset: 24px; }
    .soc-dashboard-classification-donut strong { font-size: 1.5rem; }
    .soc-dashboard-classification-insights { grid-template-columns: minmax(0, 1fr); }
    .soc-dashboard-health-legend { width: 100%; justify-content: flex-start; }
    .soc-dashboard-toolbar { padding: 12px; border-radius: 12px; }
    .soc-dashboard-freshness { width: 100%; }
    .soc-dashboard-freshness span { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    .soc-dashboard-range-control { width: 100%; }
    .soc-dashboard-range-buttons { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 12px; }
    .soc-dashboard-range-buttons button { padding-inline: 7px; border-radius: 8px; }
    .soc-dashboard-section-heading { align-items: flex-start; flex-direction: column; }
    .soc-dashboard-section-heading > p { text-align: start; }
    .soc-dashboard-breaches-heading-actions { width: 100%; align-items: flex-start; }
    .soc-dashboard-breaches-heading-actions > p { flex: 1; text-align: start; }
    .soc-dashboard-breach-pagination { align-items: stretch; flex-direction: column; }
    .soc-dashboard-breach-pagination .pagination-buttons { justify-content: space-between; }
    .soc-dashboard-breach-pagination select.page-size-select { width: 100%; }
    .soc-dashboard-state { align-items: flex-start; flex-wrap: wrap; }
    .soc-dashboard-state button { width: 100%; justify-content: center; }
    .soc-dashboard-metric-footer > span { min-width: 0; overflow-wrap: anywhere; }
    .soc-dashboard-triggered-list li { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; }
    .soc-dashboard-triggered-meta > time { flex-basis: 100%; }
    .soc-dashboard-activity-rank-label { display: none; }
    .soc-dashboard-custom-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .soc-dashboard-page .spinning,
    .soc-dashboard-live-dot::after,
    .soc-dashboard-live-chip i::after,
    .soc-dashboard-trend-line,
    .soc-dashboard-trend-area { animation: none; transition: none; }
}

/* Alert investigation workspace ------------------------------------------ */
.alert-detail-page {
    --accent-primary: var(--signal-500);
    --alert-surface: color-mix(in srgb, var(--bg-secondary) 94%, #15243b 6%);
    --alert-line: color-mix(in srgb, var(--border-color) 86%, #6ea8ff 14%);
    min-width: 0;
    animation: alert-page-enter .2s ease-out;
}
@keyframes alert-page-enter { from { opacity: 0; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) {
    .alert-detail-page { animation: none; }
    .alert-analysis-card__status.is-progress .ph { animation: none; }
}
.alert-detail-page__header {
    margin: -2px 0 0;
    padding: 22px 24px 20px;
    border: 1px solid var(--alert-line);
    border-radius: 16px 16px 0 0;
    background:
        radial-gradient(circle at 88% -25%, rgba(88, 150, 255, .17), transparent 38%),
        linear-gradient(135deg, var(--alert-surface), var(--bg-secondary));
}
.alert-detail-page__header-top,
.alert-detail-page__headline,
.alert-detail-page__byline,
.alert-detail-page__actions,
.alert-detail-page__neighbors,
.alert-detail-card__heading,
.alert-analysis-card__head,
.alert-finding-card__header,
.alert-findings-page__heading,
.alert-findings-group__title,
.alert-findings-group__actions,
.alert-notes-page__heading,
.alert-note-card__meta,
.alert-linked-case-notice { display: flex; align-items: center; }
.alert-detail-page__header-top,
.alert-detail-page__headline,
.alert-analysis-card__head,
.alert-findings-page__heading,
.alert-findings-group__title,
.alert-notes-page__heading,
.alert-note-card__meta { justify-content: space-between; }
.alert-detail-page__header-top { margin-bottom: 22px; }
.alert-detail-page__neighbors { gap: 8px; color: var(--text-secondary); font-size: .78rem; }
.alert-detail-back,
.alert-detail-neighbor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.alert-detail-back { gap: 8px; padding: 0 10px; font-weight: 600; }
.alert-detail-neighbor-button { padding: 0; font-size: 1rem; }
.alert-detail-back:hover,
.alert-detail-neighbor-button:hover:not(:disabled) {
    border-color: var(--alert-line);
    background: var(--bg-hover);
    color: var(--text-primary);
}
.alert-detail-neighbor-button:disabled { opacity: .38; cursor: not-allowed; }
.alert-detail-neighbor-count { min-width: 48px; text-align: center; font-family: var(--font-mono); }
.alert-detail-page__headline { gap: 24px; align-items: flex-end; }
.alert-detail-page__identity { min-width: 0; }
.alert-detail-page__identity h1 { margin: 8px 0; max-width: 1050px; font-size: clamp(1.45rem, 2.2vw, 2.05rem); line-height: 1.18; }
.alert-detail-page__eyebrow,
.alert-detail-page__byline { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.alert-detail-page__byline { color: var(--text-secondary); font-size: .82rem; }
.alert-detail-page__byline span { display: inline-flex; align-items: center; gap: 5px; }
.alert-detail-page__actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.alert-detail-page__actions > button,
.alert-detail-page__actions .alert-detail-action-menu > button { min-height: 44px; }
.alert-detail-page__tabs {
    display: flex; gap: 4px; padding: 7px 24px 0;
    border: 1px solid var(--alert-line); border-top: 0;
    background: var(--bg-secondary); position: sticky; top: 0; z-index: 5;
    overflow-x: auto; scrollbar-width: thin;
}
.alert-detail-tab {
    display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
    color: var(--text-secondary); border: 0; border-bottom: 2px solid transparent;
    background: transparent; cursor: pointer; white-space: nowrap;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.alert-detail-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.alert-detail-page .alert-detail-page__tabs .alert-detail-tab[aria-selected="true"] {
    color: var(--accent-primary) !important;
    border-bottom-color: var(--accent-primary) !important;
    background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}
.alert-detail-tab__count {
    min-width: 22px; padding: 2px 7px; border-radius: 999px;
    background: var(--bg-primary); color: var(--text-secondary); font: 600 .72rem/1.4 var(--font-mono);
}
.alert-detail-page .alert-detail-tab[aria-selected="true"] .alert-detail-tab__count {
    background: color-mix(in srgb, var(--accent-primary) 16%, transparent);
    color: var(--accent-primary);
}
.alert-detail-page__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); gap: 18px; padding: 20px 0; }
.alert-detail-page__main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.alert-detail-page__rail { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.alert-analysis-card,
.alert-detail-card,
.alert-detail-rail-card,
.alert-findings-group {
    border: 1px solid var(--alert-line); border-radius: 14px; background: var(--alert-surface);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .08);
}
.alert-analysis-card { overflow: hidden; padding: 22px; }
.alert-analysis-card.is-progress { border-color: color-mix(in srgb, #63a4ff 58%, var(--alert-line)); }
.alert-analysis-card.is-success { border-color: color-mix(in srgb, #55c995 42%, var(--alert-line)); }
.alert-analysis-card.is-warning { border-color: color-mix(in srgb, #efb94e 48%, var(--alert-line)); }
.alert-analysis-card.is-danger { border-color: color-mix(in srgb, #f06f78 52%, var(--alert-line)); }
.alert-analysis-card__head { gap: 20px; }
.alert-analysis-card__head h2,
.alert-detail-card h2,
.alert-detail-rail-card h2,
.alert-findings-page h2,
.alert-findings-group h3 { margin: 0; }
.alert-detail-page__section-kicker { display: block; margin-bottom: 5px; color: var(--text-secondary); font: 700 .68rem/1.2 var(--font-mono); letter-spacing: .13em; }
.alert-analysis-card__status { display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize; color: var(--text-secondary); font-size: .75rem; }
.alert-analysis-card__status.is-progress .ph { animation: spin 1s linear infinite; }
.alert-analysis-card__state { color: var(--text-secondary); }
.alert-analysis-card__summary { margin: 16px 0; padding: 16px; border-left: 3px solid var(--accent-primary); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--accent-primary) 7%, transparent); line-height: 1.65; white-space: pre-line; }
.alert-analysis-card__recommendations { margin-top: 20px; }
.alert-analysis-card__recommendations h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.alert-analysis-card__recommendations ol { display: grid; gap: 9px; padding: 0; list-style: none; }
.alert-analysis-card__recommendations li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 9px; background: var(--bg-primary); }
.alert-analysis-card__recommendations li > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 15%, transparent); font-weight: 700; }
.alert-analysis-card__footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.alert-detail-card,
.alert-detail-rail-card { padding: 18px; }
.alert-analysis-card.alert-collapsible-card,
.alert-detail-card.alert-collapsible-card { padding: 0; }
.alert-collapsible-card { overflow: hidden; }
.alert-collapsible-card__summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 58px; padding: 16px 18px; cursor: pointer; list-style: none;
    transition: background-color .15s ease;
}
.alert-analysis-card .alert-collapsible-card__summary { padding: 20px 22px; }
.alert-collapsible-card__summary::-webkit-details-marker { display: none; }
.alert-collapsible-card__summary::marker { content: ""; }
.alert-collapsible-card__summary:hover { background: color-mix(in srgb, var(--bg-hover) 74%, transparent); }
.alert-collapsible-card__summary:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -3px; }
.alert-collapsible-card__summary .alert-detail-card__heading { margin: 0; }
.alert-collapsible-card__summary-end,
.alert-collapsible-card__title-row { display: flex; align-items: center; gap: 10px; }
.alert-collapsible-card__caret { flex: 0 0 auto; color: var(--text-secondary); transition: transform .16s ease; }
.alert-collapsible-card:not([open]) .alert-collapsible-card__caret { transform: rotate(-90deg); }
.alert-collapsible-card__content { padding: 0 18px 18px; }
.alert-analysis-card .alert-collapsible-card__content { padding: 0 22px 22px; }
.alert-ai-label { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-primary); }
.alert-detail-definition-grid__wide { grid-column: 1 / -1; }
.alert-process-context,
.alert-technique-intel,
.alert-analysis-card__triage { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.alert-process-context h3,
.alert-technique-intel h3 { margin: 0 0 12px; font-size: .85rem; }
.alert-technique-intel h3 { display: flex; align-items: center; gap: 8px; }
.alert-recommendations-card .alert-analysis-card__recommendations { margin-top: 0; }
.alert-detail-card__heading { gap: 9px; margin-bottom: 14px; }
.alert-detail-card__heading > .ph { color: var(--accent-primary); font-size: 1.15rem; }
.alert-detail-card__heading > .tag { margin-left: auto; }
.alert-detail-card p { color: var(--text-secondary); line-height: 1.62; }
.alert-detail-definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.alert-detail-definition-grid > div { min-width: 0; }
.alert-detail-definition-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.alert-detail-definition-column { display: grid; align-content: start; gap: 16px; min-width: 0; margin: 0; }
.alert-detail-definition-column > div { min-width: 0; }
.alert-detail-definition-columns__wide { grid-column: 1 / -1; }
.alert-detail-definition-grid dt,
.alert-detail-definition-column dt,
.alert-detail-rail-card dt { margin-bottom: 3px; color: var(--text-secondary); font-size: .69rem; text-transform: uppercase; letter-spacing: .06em; }
.alert-detail-definition-grid dd,
.alert-detail-definition-column dd,
.alert-detail-rail-card dd { margin: 0; overflow-wrap: anywhere; }
.alert-detail-rail-card dl { display: grid; gap: 13px; margin: 14px 0 0; }
.alert-metadata-action {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
    max-width: 100%; min-height: 38px; margin: -7px -9px; padding: 7px 9px;
    border: 1px solid transparent; border-radius: 8px; background: transparent;
    color: var(--text-primary); text-align: left; cursor: pointer;
}
.alert-metadata-action span { overflow-wrap: anywhere; }
.alert-metadata-action .ph { flex: 0 0 auto; color: var(--text-secondary); }
.alert-metadata-action:hover { border-color: var(--border-color); background: var(--bg-hover); }
.alert-metadata-action:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
.assignee-cell--readonly { cursor: default; }
.alert-origin-label {
    display: inline-flex; align-items: center; gap: 4px; width: max-content; max-width: 100%;
    color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 11%, transparent);
}
.alert-origin-label .ph { flex: 0 0 auto; }
.alert-command { min-width: 0; margin-top: 12px; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-primary); }
.alert-command > span { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--text-secondary); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.alert-command > span > span { display: flex; align-items: center; gap: 6px; }
.alert-command code { display: block; max-height: 220px; overflow: auto; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.alert-technique-content { display: grid; gap: 16px; }
.alert-technique-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.alert-technique-section {
    min-width: 0; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent-primary) 5%, var(--bg-primary)), var(--bg-primary));
}
.alert-technique-section__heading,
.alert-technique-intel__heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.alert-technique-section__heading > div,
.alert-technique-intel__heading > div { min-width: 0; }
.alert-technique-section__heading span:not(.alert-technique-section__icon),
.alert-technique-intel__heading > div > span {
    display: block; color: var(--text-quaternary); font-size: .64rem; font-weight: 700;
    letter-spacing: .065em; text-transform: uppercase;
}
.alert-technique-section__heading h3,
.alert-technique-intel__heading h3 { margin: 2px 0 0; color: var(--text-primary); font-size: .84rem; }
.alert-technique-section__icon {
    display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
    border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, var(--border-color)); border-radius: 10px;
    background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-secondary)); color: var(--accent-primary); font-size: 1.05rem;
}
.alert-technique-section__count { margin-left: auto; color: var(--text-secondary); font: 700 .72rem var(--font-mono); }
.alert-attack-mapping { display: grid; gap: 8px; margin-top: 13px; }
.alert-attack-mapping__fact { display: grid; grid-template-columns: minmax(88px, .72fr) minmax(0, 1.28fr); align-items: baseline; gap: 10px; }
.alert-attack-mapping__fact small { color: var(--text-quaternary); font-size: .63rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.alert-attack-mapping__fact strong { color: var(--text-primary); font-size: .75rem; font-weight: 650; overflow-wrap: anywhere; text-align: right; }
.alert-observable-list { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.alert-observable-list li { display: flex; align-items: center; min-width: 0; gap: 9px; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--alert-surface) 78%, transparent); }
.alert-observable-list li > span:last-child { display: grid; min-width: 0; gap: 2px; }
.alert-observable-list small { color: var(--text-quaternary); font-size: .6rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.alert-observable-list strong { overflow: hidden; color: var(--text-primary); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.alert-observable-list__icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-secondary)); color: var(--accent-primary); }
.alert-evidence-list-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; margin: 9px 0 -5px; padding: 7px 11px;
    border: 1px solid transparent; border-radius: 9px; background: transparent;
    color: var(--accent-primary); font-size: .72rem; font-weight: 700; cursor: pointer;
}
.alert-evidence-list-action:hover { border-color: var(--border-color); background: var(--bg-hover); }
.alert-evidence-list-action:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.alert-evidence-list-action--intel { margin-left: 46px; }
.alert-technique-intel { margin-top: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, var(--border-color)); border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent-primary) 8%, var(--bg-primary)), var(--bg-primary)); }
.alert-technique-intel__heading { margin-bottom: 12px; }
.alert-technique-intel__heading > .tag { margin-left: auto; }
.alert-intel-match-list { display: grid; gap: 9px; }
.alert-intel-match-list article { min-width: 0; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; background: color-mix(in srgb, var(--alert-surface) 82%, transparent); }
.alert-intel-match-card__identity { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; }
.alert-intel-match-card__identity > div { min-width: 0; display: grid; gap: 3px; }
.alert-intel-match-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-intel-match-list small { color: var(--text-secondary); font-size: .68rem; text-transform: capitalize; }
.alert-intel-match-card__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 11px 0 0 46px; }
.alert-intel-match-card__facts > div { min-width: 0; padding-top: 9px; border-top: 1px solid var(--border-subtle); }
.alert-intel-match-card__facts dt { margin-bottom: 3px; color: var(--text-quaternary); font-size: .63rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.alert-intel-match-card__facts dd { margin: 0; overflow-wrap: anywhere; color: var(--text-primary); font-size: .76rem; font-weight: 650; }
.alert-intel-confidence { color: var(--text-primary); }
@media (max-width: 720px) {
    .alert-technique-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .alert-intel-match-card__identity { grid-template-columns: auto minmax(0, 1fr); }
    .alert-intel-match-card__identity > .tag { grid-column: 2; justify-self: start; }
    .alert-intel-match-card__facts { grid-template-columns: 1fr; }
    .alert-intel-match-card__facts { margin-left: 0; }
    .alert-evidence-list-action--intel { margin-left: 0; }
}
.alert-workflow-stepper {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0; margin: 14px 0 0; padding: 0; list-style: none;
}
.alert-workflow-step {
    position: relative; display: grid; justify-items: center; gap: 7px;
    min-width: 0; color: var(--text-secondary); text-align: center;
}
.alert-workflow-step:not(:last-child)::after {
    content: ""; position: absolute; z-index: 0; top: 13px; left: calc(50% + 14px);
    width: calc(100% - 28px); height: 2px; background: var(--border-color);
}
.alert-workflow-step.is-complete:not(:last-child)::after { background: color-mix(in srgb, var(--accent-primary) 72%, var(--border-color)); }
.alert-workflow-step__marker {
    position: relative; z-index: 1; display: grid; place-items: center;
    width: 28px; height: 28px; border: 2px solid var(--border-color); border-radius: 50%;
    background: var(--alert-surface); color: var(--text-secondary); font-size: .76rem;
}
.alert-workflow-step.is-complete .alert-workflow-step__marker {
    border-color: color-mix(in srgb, var(--accent-primary) 76%, var(--border-color));
    background: color-mix(in srgb, var(--accent-primary) 18%, var(--alert-surface)); color: var(--accent-primary);
}
.alert-workflow-step.is-current .alert-workflow-step__marker {
    border-color: var(--accent-primary); background: var(--accent-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-primary) 15%, transparent), 0 0 18px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}
.alert-workflow-step.is-current .alert-workflow-step__marker::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bg-primary); }
.alert-workflow-step__content { min-width: 0; }
.alert-workflow-step__label { display: block; overflow-wrap: anywhere; font-size: .66rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.alert-workflow-step.is-current .alert-workflow-step__label { color: var(--accent-primary); }
.alert-workflow-context {
    margin-top: 16px; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--bg-primary); color: var(--text-secondary); font-size: .8rem; line-height: 1.5;
}
.alert-workflow-context p { margin: 0; }
.alert-workflow-context strong { display: block; margin-bottom: 3px; color: var(--text-primary); }
.alert-detail-page__error {
    display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 190px; padding: 26px;
    text-align: center; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border-color));
    border-radius: 14px; background: color-mix(in srgb, var(--danger) 5%, var(--bg-secondary));
}
.alert-detail-page__error > .ph { color: var(--danger); font-size: 1.6rem; }
.alert-context-page { display: grid; gap: 0; padding: 20px 0; }
.alert-context-toolbar {
    display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px;
    border: 1px solid var(--border-color); border-radius: 14px 14px 0 0;
    background: linear-gradient(115deg, color-mix(in srgb, var(--accent-primary) 5%, var(--alert-surface)), var(--alert-surface) 42%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .07);
}
.alert-context-search {
    display: flex; align-items: center; flex: 0 1 260px; gap: 9px; min-width: 180px; min-height: 40px; padding: 0 11px;
    border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-primary); color: var(--text-secondary);
}
.alert-context-search:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 13%, transparent); }
.alert-context-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; }
.alert-context-filters { display: flex; align-items: center; flex: 1; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.alert-context-filter {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 9px; border: 1px solid var(--border-color);
    border-radius: 999px; background: transparent; color: var(--text-secondary); font-size: .72rem; font-weight: 650; white-space: nowrap; cursor: pointer;
}
.alert-context-filter.active { border-color: color-mix(in srgb, var(--context-color, var(--accent-primary)) 46%, var(--border-color)); background: color-mix(in srgb, var(--context-color, var(--accent-primary)) 11%, var(--bg-secondary)); color: var(--text-primary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--context-color, var(--accent-primary)) 8%, transparent); }
.alert-context-filter:disabled { opacity: .36; cursor: not-allowed; }
.alert-context-filter__count { display: grid; place-items: center; min-width: 17px; height: 17px; padding-inline: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text-secondary) 12%, transparent); color: var(--text-secondary); font: 650 .58rem var(--font-mono); }
.alert-context-filter__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--context-other); }
.alert-context-filter__dot[data-type="identity"], .alert-context-node[data-type="identity"], .alert-context-node-icon[data-type="identity"] { --context-color: #63d7a7; }
.alert-context-filter__dot[data-type="asset"], .alert-context-node[data-type="asset"], .alert-context-node-icon[data-type="asset"] { --context-color: #5fc7e8; }
.alert-context-filter__dot[data-type="network"], .alert-context-node[data-type="network"], .alert-context-node-icon[data-type="network"] { --context-color: #a77be9; }
.alert-context-filter__dot[data-type="process"], .alert-context-node[data-type="process"], .alert-context-node-icon[data-type="process"] { --context-color: #b291f0; }
.alert-context-filter__dot[data-type="file"], .alert-context-node[data-type="file"], .alert-context-node-icon[data-type="file"] { --context-color: #df6899; }
.alert-context-filter__dot[data-type="detection"], .alert-context-node[data-type="detection"], .alert-context-node-icon[data-type="detection"] { --context-color: #ef7254; }
.alert-context-filter__dot[data-type="source"], .alert-context-node[data-type="source"], .alert-context-node-icon[data-type="source"] { --context-color: #e7bd54; }
.alert-context-filter__dot[data-type="other"], .alert-context-node[data-type="other"], .alert-context-node-icon[data-type="other"] { --context-color: #9aa8ba; }
.alert-context-filter__dot { background: var(--context-color, var(--text-secondary)); }
.alert-context-view-actions { display: flex; align-items: center; gap: 5px; }
.alert-context-view-actions button {
    display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border-color); border-radius: 9px;
    background: var(--bg-primary); color: var(--text-secondary); cursor: pointer;
}
.alert-context-view-actions button:hover { border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-color)); color: var(--text-primary); }
.alert-context-zoom { min-width: 38px; color: var(--text-secondary); font: 600 .62rem var(--font-mono); text-align: right; }
.alert-context-state {
    display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 460px; padding: 30px; border: 1px solid var(--border-color);
    border-top: 0; border-radius: 0 0 14px 14px; background: var(--alert-surface); color: var(--text-secondary); text-align: left;
}
.alert-context-state > .ph { color: var(--accent-primary); font-size: 1.8rem; animation: spin 1s linear infinite; }
.alert-context-state h3, .alert-context-state p { margin: 0; }.alert-context-state p { margin-top: 4px; }
.alert-context-state.is-error > .ph { color: var(--danger); animation: none; }.alert-context-state.is-error .btn-secondary { margin-top: 13px; }
.alert-context-partial { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-inline: 1px solid var(--border-color); background: color-mix(in srgb, var(--warning) 8%, var(--alert-surface)); color: var(--text-secondary); font-size: .75rem; }
.alert-context-workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 380px); height: clamp(560px, calc(100dvh - 260px), 700px); min-height: 0; border: 1px solid var(--border-color); border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; background: var(--bg-primary); }
.alert-context-canvas-wrap {
    position: relative; min-width: 0; min-height: 0; overflow: hidden;
    background:
        radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--accent-primary) 8%, transparent) 0, transparent 36%),
        radial-gradient(ellipse at center, transparent 48%, color-mix(in srgb, #02070d 24%, transparent) 100%),
        color-mix(in srgb, var(--bg-primary) 94%, #06111d);
}
.alert-context-canvas { display: block; width: 100%; height: 100%; min-height: 0; }
.alert-context-grid-dot { fill: color-mix(in srgb, var(--text-secondary) 18%, transparent); }
.alert-context-edge { transition: opacity .16s ease; }.alert-context-edge > path { fill: none; stroke: color-mix(in srgb, var(--text-secondary) 56%, transparent); stroke-width: 1.7; }.alert-context-edge__label rect { fill: color-mix(in srgb, var(--alert-surface) 96%, transparent); stroke: color-mix(in srgb, var(--border-color) 90%, transparent); stroke-width: 1; }.alert-context-edge__label text { fill: var(--text-secondary); font-size: 10px; font-weight: 650; text-anchor: middle; letter-spacing: .015em; }.alert-context-edge.muted { opacity: .09; }
.alert-context-node { --context-color: var(--text-secondary); cursor: pointer; outline: none; transition: opacity .16s ease; }
.alert-context-node circle { fill: color-mix(in srgb, var(--context-color) 74%, var(--bg-primary)); stroke: color-mix(in srgb, var(--context-color) 82%, white); stroke-width: 2; filter: drop-shadow(0 7px 11px rgba(0, 0, 0, .32)); }
.alert-context-node foreignObject { color: #081117; font-size: 27px; text-align: center; }.alert-context-node foreignObject i { display: grid; place-items: center; width: 100%; height: 100%; }
.alert-context-node > text { fill: var(--text-primary); font-size: 12px; font-weight: 680; text-anchor: middle; paint-order: stroke; stroke: var(--bg-primary); stroke-width: 5px; stroke-linejoin: round; }
.alert-context-node.selected circle, .alert-context-node:focus-visible circle { stroke: white; stroke-width: 4; filter: drop-shadow(0 0 17px color-mix(in srgb, var(--context-color) 74%, transparent)); }.alert-context-node.muted { opacity: .19; }
.alert-context-canvas-hint { position: absolute; bottom: 8px; left: 10px; margin: 0; padding: 6px 9px; border-radius: 8px; background: color-mix(in srgb, var(--bg-primary) 82%, transparent); color: var(--text-secondary); font-size: .68rem; backdrop-filter: blur(8px); }
.alert-context-no-results { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--text-secondary); text-align: center; pointer-events: none; }.alert-context-no-results .ph { font-size: 1.7rem; }.alert-context-no-results strong { color: var(--text-primary); }
.alert-context-inspector { min-width: 0; min-height: 0; height: 100%; padding: 16px; border-left: 1px solid var(--border-color); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-primary) 3%, var(--alert-surface)), var(--alert-surface) 28%); overflow: auto; scrollbar-width: thin; }
.alert-context-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 13px; }.alert-context-summary div { min-width: 0; padding: 9px 4px; border: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--bg-primary) 88%, transparent); text-align: center; }.alert-context-summary dt { color: var(--text-primary); font: 750 .88rem var(--font-mono); }.alert-context-summary dd { margin: 3px 0 0; color: var(--text-secondary); font-size: .55rem; letter-spacing: .04em; text-transform: uppercase; }
.alert-context-inspector__heading { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }.alert-context-inspector__heading > div { min-width: 0; }.alert-context-inspector__heading span:not(.alert-context-node-icon) { display: block; color: var(--text-secondary); font-size: .65rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }.alert-context-inspector__heading h2 { margin: 3px 0 0; font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere; }
.alert-context-node-icon { --context-color: var(--accent-primary); display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid color-mix(in srgb, var(--context-color) 24%, var(--border-color)); border-radius: 10px; background: color-mix(in srgb, var(--context-color) 12%, var(--bg-primary)); color: var(--context-color); font-size: 1.2rem; }
.alert-context-inspector__subtitle, .alert-context-overview p { margin: 10px 0 0; color: var(--text-secondary); font-size: .76rem; line-height: 1.5; }.alert-context-overview h2 { margin: 8px 0 0; font-size: 1rem; }
.alert-context-facts { display: grid; gap: 8px; margin: 13px 0 0; }.alert-context-facts div { display: grid; grid-template-columns: minmax(92px, .82fr) minmax(0, 1.18fr); gap: 10px; align-items: start; }.alert-context-facts dt { color: var(--text-secondary); font-size: .68rem; text-transform: capitalize; }.alert-context-facts dd { min-width: 0; margin: 0; color: var(--text-primary); font-size: .72rem; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.alert-context-evidence-count { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin-top: 12px; padding: 4px 8px; border: 1px solid var(--border-color); border-radius: 999px; color: var(--text-secondary); font-size: .64rem; }
.alert-context-ioc-activity { margin-top: 15px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, var(--border-color)); border-radius: 11px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent-primary) 9%, var(--bg-primary)), var(--bg-primary)); }
.alert-context-ioc-activity > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.alert-context-ioc-activity h3 { display: flex; align-items: center; gap: 7px; margin: 4px 0 0; font-size: .78rem; }
.alert-context-ioc-activity h3 i { color: var(--accent-primary); }
.alert-context-ioc-activity > header > strong { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--accent-primary) 14%, var(--bg-secondary)); color: var(--text-primary); font: 700 .76rem var(--font-mono); }
.alert-context-ioc-activity > p { margin: 9px 0 0; color: var(--text-secondary); font-size: .68rem; line-height: 1.45; }
.alert-context-ioc-activity ol { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.alert-context-ioc-activity li button { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 48px; gap: 8px; padding: 7px 8px; border: 1px solid var(--border-color); border-radius: 8px; background: color-mix(in srgb, var(--alert-surface) 86%, transparent); color: var(--text-primary); text-align: left; cursor: pointer; }
.alert-context-ioc-activity .severity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-secondary); }.alert-context-ioc-activity .severity-dot.critical { background: var(--danger); }.alert-context-ioc-activity .severity-dot.high { background: var(--warning); }.alert-context-ioc-activity .severity-dot.medium { background: #eab308; }.alert-context-ioc-activity .severity-dot.low { background: var(--success); }
.alert-context-ioc-activity li button:hover { border-color: color-mix(in srgb, var(--accent-primary) 46%, var(--border-color)); background: var(--bg-hover); }
.alert-context-ioc-activity li button > span:nth-child(2) { min-width: 0; }
.alert-context-ioc-activity li strong, .alert-context-ioc-activity li small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-context-ioc-activity li strong { font-size: .68rem; }.alert-context-ioc-activity li small { margin-top: 2px; color: var(--text-secondary); font-size: .58rem; text-transform: capitalize; }
.alert-context-ioc-activity time { color: var(--text-secondary); font: .57rem var(--font-mono); white-space: nowrap; }
.alert-context-ioc-state { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; margin-top: 8px; color: var(--text-secondary); font-size: .68rem; }
.alert-context-ioc-state .ph { color: var(--accent-primary); animation: spin 1s linear infinite; }.alert-context-ioc-state button { min-height: 36px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--alert-surface); color: var(--text-primary); cursor: pointer; }
.alert-context-intelligence { margin-top: 15px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, var(--border-color)); border-radius: 10px; background: color-mix(in srgb, var(--accent-primary) 6%, var(--bg-primary)); }.alert-context-intelligence h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; color: var(--text-primary); font-size: .7rem; letter-spacing: .035em; text-transform: uppercase; }.alert-context-intelligence h3 i { color: var(--accent-primary); }.alert-context-intelligence dl { display: grid; gap: 8px; margin: 0; }.alert-context-intelligence dl div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 9px; }.alert-context-intelligence dt { color: var(--text-secondary); font-size: .66rem; }.alert-context-intelligence dd { margin: 0; color: var(--text-primary); font-size: .7rem; font-weight: 650; overflow-wrap: anywhere; text-align: right; }
.alert-context-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 0; padding: 0; list-style: none; }.alert-context-tags li { padding: 4px 7px; border: 1px solid var(--border-color); border-radius: 999px; color: var(--text-secondary); font-size: .62rem; }
.alert-context-connections { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }.alert-context-connections h3, .alert-context-evidence h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: .7rem; letter-spacing: .03em; text-transform: uppercase; }.alert-context-connections h3 span { margin-left: auto; color: var(--text-secondary); font: 600 .65rem var(--font-mono); }.alert-context-connections ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }.alert-context-connections button { display: grid; width: 100%; min-height: 44px; gap: 3px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); text-align: left; cursor: pointer; }.alert-context-connections button:hover { border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-color)); }.alert-context-connections button > span { color: var(--accent-primary); font-size: .6rem; font-weight: 650; text-transform: capitalize; }.alert-context-connections button > strong { overflow: hidden; font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }.alert-context-evidence { margin-top: 14px; }.alert-context-evidence ul { margin: 0; padding-left: 18px; color: var(--text-secondary); font: .65rem/1.55 var(--font-mono); overflow-wrap: anywhere; }
.alert-context-disclosure { margin-top: 14px; border-top: 1px solid var(--border-color); }.alert-context-disclosure > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 10px; color: var(--text-secondary); font-size: .7rem; font-weight: 650; letter-spacing: .025em; text-transform: uppercase; cursor: pointer; list-style: none; }.alert-context-disclosure > summary::-webkit-details-marker { display: none; }.alert-context-disclosure > summary > span { display: inline-flex; align-items: center; gap: 7px; }.alert-context-disclosure > summary > span:last-child { min-width: 22px; justify-content: center; font: 600 .62rem var(--font-mono); }.alert-context-disclosure > summary::after { content: '+'; margin-left: 2px; font: 700 .88rem/1 var(--font-mono); }.alert-context-disclosure[open] > summary::after { content: '\2212'; }.alert-context-disclosure__body { padding-bottom: 4px; }.alert-context-technical .alert-context-facts { margin-top: 4px; }
.alert-context-timeline ol, .alert-context-previous ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }.alert-context-timeline li { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 9px; }.alert-context-timeline__dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--accent-primary); }.alert-context-timeline strong { display: block; font-size: .73rem; }.alert-context-timeline p { margin: 3px 0; color: var(--text-secondary); font-size: .69rem; line-height: 1.45; }.alert-context-timeline time, .alert-context-previous time { color: var(--text-secondary); font: .64rem var(--font-mono); }
.alert-context-previous button { display: grid; width: 100%; gap: 3px; padding: 9px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); text-align: left; cursor: pointer; }.alert-context-previous button:hover { border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-color)); }.alert-context-previous button span { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.alert-context-accessible-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }.alert-context-entity-list, .alert-context-relationship-list { padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 11px; background: var(--alert-surface); }.alert-context-entity-list summary, .alert-context-relationship-list summary { color: var(--text-secondary); font-size: .76rem; font-weight: 650; cursor: pointer; }.alert-context-entity-list ul, .alert-context-relationship-list ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }.alert-context-entity-list button, .alert-context-relationship-list button { display: flex; align-items: center; width: 100%; min-height: 44px; gap: 9px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); text-align: left; cursor: pointer; }.alert-context-entity-list button > span, .alert-context-relationship-list button > span { min-width: 0; }.alert-context-entity-list strong, .alert-context-entity-list small, .alert-context-relationship-list strong, .alert-context-relationship-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.alert-context-entity-list strong, .alert-context-relationship-list strong { font-size: .72rem; }.alert-context-entity-list small, .alert-context-relationship-list small { margin: 2px 0; color: var(--text-secondary); font-size: .65rem; text-transform: capitalize; }
.alert-context-page button:focus-visible, .alert-context-search input:focus-visible, .alert-context-entity-list summary:focus-visible, .alert-context-relationship-list summary:focus-visible, .alert-context-disclosure > summary:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.alert-findings-page { display: grid; gap: 16px; padding: 20px 0; }
.alert-findings-page__heading { padding: 0 4px; }
.alert-findings-page__heading p { margin: 5px 0 0; color: var(--text-secondary); }
.alert-findings-group { padding: 18px; }
.alert-findings-group__title { margin-bottom: 14px; }
.alert-findings-group__title > div,
.alert-findings-group__actions { display: flex; align-items: center; gap: 8px; }
.alert-findings-group__actions > span { min-width: 24px; color: var(--text-secondary); text-align: center; font-family: var(--font-mono); }
.alert-finding-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.alert-finding-card {
    min-width: 0; padding: 18px; border: 1px solid var(--border-color); border-radius: 12px;
    background: var(--bg-primary); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.alert-finding-card:hover { border-color: color-mix(in srgb, var(--accent-primary) 32%, var(--border-color)); box-shadow: 0 10px 24px rgba(0, 0, 0, .09); }
.alert-finding-card__header { justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: .74rem; }
.alert-finding-card__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.alert-finding-card__title { margin: 13px 0 7px; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.alert-finding-card__summary { margin: 0; color: var(--text-secondary); line-height: 1.62; white-space: pre-line; overflow-wrap: anywhere; }
.alert-finding-card__facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--border-color); }
.alert-finding-card__facts div { min-width: 120px; }
.alert-finding-card__facts dt { color: var(--text-secondary); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.alert-finding-card__facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.alert-finding-card__reasoning-trigger {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 0 10px;
    border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-secondary); cursor: pointer;
}
.alert-finding-card__reasoning-trigger:hover { border-color: var(--border-color); background: var(--bg-hover); color: var(--text-primary); }
.alert-finding-card__reasoning-trigger .ph:last-child { margin-left: 2px; }
.alert-finding-card__details { margin-top: 4px; padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--alert-surface); }
.alert-finding-card__reasoning { display: grid; gap: 9px; margin: 0; padding-inline-start: 1.35rem; }
.alert-finding-card__reasoning li { padding-inline-start: 4px; color: var(--text-secondary); line-height: 1.58; overflow-wrap: anywhere; }
.alert-finding-card__reasoning li::marker { color: var(--accent-primary); font-weight: 700; }
.alert-finding-card__iocs { margin-top: 12px; }
.alert-finding-card__footer { display: flex; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.alert-finding-card__provenance { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: .74rem; }
.alert-finding-card .indicator-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.alert-finding-card .indicator-chip small { color: var(--text-secondary); }
.alert-findings-state,
.alert-notes-empty,
.alert-notes-error {
    display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 116px; padding: 22px;
    border: 1px dashed var(--border-color); border-radius: 12px; background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
    color: var(--text-secondary); text-align: left;
}
.alert-findings-state h4,
.alert-findings-state p,
.alert-notes-empty h3,
.alert-notes-empty p,
.alert-notes-error h3,
.alert-notes-error p { margin: 0; }
.alert-findings-state p,
.alert-notes-empty p,
.alert-notes-error p { margin-top: 4px; line-height: 1.5; }
.alert-findings-state > .ph,
.alert-notes-empty > .ph,
.alert-notes-error > .ph { flex: 0 0 auto; color: var(--text-secondary); font-size: 1.55rem; }
.alert-findings-state.is-loading > .ph,
.alert-notes-empty.is-loading > .ph { color: var(--accent-primary); animation: spin 1s linear infinite; }
.alert-findings-state.is-error,
.alert-notes-error { border-style: solid; border-color: color-mix(in srgb, var(--danger) 45%, var(--border-color)); background: color-mix(in srgb, var(--danger) 5%, var(--bg-secondary)); }
.alert-findings-state.is-error > .ph,
.alert-notes-error > .ph { color: var(--danger); }
.alert-findings-load-more { display: block; margin: 16px auto 0; }
.alert-linked-case-notice {
    justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent-primary) 34%, var(--border-color));
    border-radius: 11px; background: color-mix(in srgb, var(--accent-primary) 7%, var(--bg-secondary)); color: var(--text-secondary);
}
.alert-linked-case-notice > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.alert-linked-case-notice > .ph,
.alert-linked-case-notice > div > .ph { flex: 0 0 auto; color: var(--accent-primary); font-size: 1.1rem; }
.alert-linked-case-notice .btn-link { flex: 0 0 auto; min-height: 44px; }
.alert-detail-actions-menu {
    box-sizing: border-box; position: absolute; top: calc(100% + 8px); right: 0; left: auto;
    width: min(280px, calc(100vw - 24px)); min-width: 230px;
    max-height: min(420px, calc(100dvh - 24px)); overflow-y: auto; overscroll-behavior: contain; z-index: 100;
}
.alert-detail-actions-menu .action-menu-item { min-height: 44px; white-space: normal; }
.alert-detail-actions-menu .action-menu-item.is-danger { color: var(--danger); }
.alert-detail-page__tabs .alert-detail-tab:focus-visible,
.alert-detail-back:focus-visible,
.alert-detail-neighbor-button:focus-visible,
.alert-detail-page__actions button:focus-visible,
.alert-detail-actions-menu [role="menuitem"]:focus-visible,
.alert-finding-card button:focus-visible,
.alert-linked-case-notice button:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

.alert-notes-page { display: grid; gap: 16px; padding: 20px 0; }
.alert-notes-page__heading { gap: 18px; padding: 0 4px; }
.alert-notes-page__heading h2 { margin: 0; }
.alert-notes-page__heading p { margin: 5px 0 0; color: var(--text-secondary); }
.alert-notes-page__heading > .btn-primary { flex: 0 0 auto; min-height: 44px; }
.alert-note-list { display: grid; gap: 12px; margin: 0; padding: 0; }
.alert-note-card {
    min-width: 0; padding: 18px; border: 1px solid var(--alert-line); border-radius: 12px;
    background: var(--alert-surface); box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
}
.alert-note-card--legacy { border-style: dashed; background: color-mix(in srgb, var(--alert-surface) 84%, var(--warning) 3%); }
.alert-note-card__meta { gap: 12px; color: var(--text-secondary); font-size: .75rem; }
.alert-note-card__meta > div { display: flex; flex-wrap: wrap; gap: 7px; }
.alert-note-card__time { white-space: nowrap; }
.alert-note-card__legacy-label { margin: 13px 0 0; color: var(--text-secondary); font-size: .78rem; line-height: 1.5; }
.alert-note-card__content { margin-top: 13px; color: var(--text-primary); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.alert-note-card__author { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: .78rem; }
.alert-notes-load-more { justify-self: center; }

.alert-artifacts-page { display: grid; gap: 16px; padding: 20px 0; }
.alert-artifacts-page__heading { align-items: flex-end; }
.alert-artifacts-page__actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.alert-artifacts-layout { min-height: 300px; padding: 18px; border: 1px solid var(--alert-line); border-radius: 14px; background: var(--alert-surface); box-shadow: 0 12px 28px rgba(0, 0, 0, .08); }
.alert-artifacts-page .case-artifacts-files { padding-inline-start: 0; }
.alert-artifacts-page .case-artifacts-manual { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: var(--bg-primary); }
.alert-artifacts-page .case-artifacts-manual-heading { padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.alert-artifacts-page .case-artifact-row { border-radius: 0; }
.alert-artifacts-page .case-artifact-row + .case-artifact-row { border-top: 1px solid color-mix(in srgb, var(--border-color) 64%, transparent); }
.alert-artifact-producer { min-width: 0; overflow: hidden; color: var(--text-secondary); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.alert-artifact-file-copy { display: grid; min-width: 0; gap: 2px; }
.alert-evidence-references { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.alert-evidence-reference { display: inline-flex; align-items: center; gap: 7px; min-width: 0; min-height: 36px; max-width: 100%; padding: 6px 9px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--alert-surface); color: var(--text-secondary); cursor: pointer; }
.alert-evidence-reference:hover { border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-color)); color: var(--text-primary); background: var(--bg-hover); }
.alert-evidence-reference > span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-evidence-reference > small { flex: 0 0 auto; color: var(--text-tertiary); }

.alert-composer-modal { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.alert-composer-modal .modal-title-group > div { min-width: 0; }
.alert-composer-modal .modal-title-group h3,
.alert-composer-modal .modal-title-group p { margin: 0; }
.alert-composer-modal .modal-title-group p { margin-top: 3px; overflow: hidden; color: var(--text-secondary); font: .75rem/1.35 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.alert-composer-modal .form-textarea { min-height: 150px; resize: vertical; }
.alert-composer-modal .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.alert-form-error { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--danger); line-height: 1.5; }

@media (max-width: 1080px) {
    .alert-detail-page__layout { grid-template-columns: 1fr; }
    .alert-detail-page__rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .alert-detail-page__rail > :first-child { grid-column: 1 / -1; }
    .alert-detail-page__headline { align-items: flex-start; flex-wrap: wrap; }
    .alert-detail-page__actions { margin-left: auto; }
    .alert-context-toolbar { flex-wrap: wrap; }.alert-context-search { flex-basis: 100%; }.alert-context-filters { order: 2; }.alert-context-view-actions { margin-left: auto; }
    .alert-context-accessible-lists { grid-template-columns: 1fr; }.alert-context-entity-list ul, .alert-context-relationship-list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
    .alert-context-workspace { grid-template-columns: 1fr; grid-template-rows: clamp(440px, 56dvh, 540px) minmax(0, 360px); height: auto; }
    .alert-context-inspector { height: 360px; border-top: 1px solid var(--border-color); border-left: 0; }
}
@media (max-width: 720px) {
    .alert-detail-page { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
    .alert-detail-page__header { padding: 16px; border-radius: 12px 12px 0 0; }
    .alert-detail-page__header-top { align-items: flex-start; gap: 8px; }
    .alert-detail-page__headline { align-items: stretch; flex-direction: column; }
    .alert-detail-page__actions {
        position: fixed; z-index: 30; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: calc(var(--sidebar-width) + 10px);
        flex-wrap: nowrap; justify-content: stretch; padding: 10px; border: 1px solid var(--border-color); border-radius: 13px;
        background: color-mix(in srgb, var(--bg-secondary) 94%, transparent); box-shadow: 0 16px 38px rgba(0, 0, 0, .34); backdrop-filter: blur(14px);
    }
    .alert-detail-page__actions > button,
    .alert-detail-page__actions > .alert-detail-action-menu { flex: 1 1 0; min-width: 0; }
    .alert-detail-page__actions > button,
    .alert-detail-page__actions > .alert-detail-action-menu > button { width: 100%; padding-inline: 9px; white-space: nowrap; }
    .alert-detail-page__tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding-inline: 4px;
        overflow-x: hidden;
    }
    .alert-detail-tab { min-width: 0; justify-content: center; gap: 4px; padding-inline: 2px; font-size: .72rem; }
    .alert-detail-tab > i { display: none; }
    .alert-detail-tab__count { min-width: 18px; padding-inline: 4px; }
    .alert-detail-page__rail,
    .alert-detail-definition-grid,
    .alert-detail-definition-columns { grid-template-columns: 1fr; }
    .alert-detail-page__rail > :first-child { grid-column: auto; }
    .alert-workflow-stepper { grid-template-columns: 1fr; gap: 0; }
    .alert-workflow-step { grid-template-columns: 30px minmax(0, 1fr); justify-items: start; gap: 10px; min-height: 50px; text-align: left; }
    .alert-workflow-step:not(:last-child)::after { top: 28px; left: 13px; width: 2px; height: 22px; }
    .alert-workflow-step__content { padding-top: 5px; }
    .alert-workflow-step__label { font-size: .72rem; }
    .alert-findings-page__heading,
    .alert-findings-group__title,
    .alert-notes-page__heading { align-items: flex-start; flex-direction: column; }
    .alert-artifacts-page__actions { width: 100%; justify-content: space-between; }
    .alert-artifacts-layout { padding: 12px; }
    .alert-findings-group__actions,
    .alert-notes-page__heading > .btn-primary { width: 100%; }
    .alert-findings-group__actions .btn-secondary,
    .alert-notes-page__heading > .btn-primary { justify-content: center; }
    .alert-linked-case-notice { align-items: flex-start; flex-direction: column; }
    .alert-linked-case-notice .btn-link { width: 100%; text-align: left; }
    .alert-composer-modal .modal-footer { display: grid; grid-template-columns: 1fr 1fr; }
    .alert-composer-modal .modal-footer button { min-height: 44px; }
    .alert-composer-modal .form-row { grid-template-columns: 1fr; gap: 16px; }
    .alert-context-page { padding-top: 12px; }.alert-context-toolbar { padding: 8px; border-radius: 11px 11px 0 0; }.alert-context-filters { width: 100%; }.alert-context-view-actions button { width: 44px; height: 44px; }.alert-context-workspace { grid-template-rows: clamp(360px, 58dvh, 500px) minmax(0, 420px); }.alert-context-inspector { height: 420px; }.alert-context-canvas-hint { display: none; }.alert-context-entity-list ul, .alert-context-relationship-list ul { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .alert-detail-page__header { padding: 14px 12px; }
    .alert-detail-page__header-top { flex-wrap: wrap; }
    .alert-detail-page__neighbors { margin-left: auto; }
    .alert-detail-back { padding-inline: 6px 10px; }
    .alert-detail-page__identity h1 { font-size: 1.35rem; overflow-wrap: anywhere; }
    .alert-detail-page__actions { right: 8px; left: calc(var(--sidebar-width) + 8px); padding: 8px; }
    .alert-detail-actions-menu { top: auto; right: 0; bottom: calc(100% + 8px); }
    .alert-finding-card,
    .alert-note-card,
    .alert-findings-group { padding: 14px; }
    .alert-finding-card__header,
    .alert-note-card__meta { align-items: flex-start; flex-direction: column; }
    .alert-composer-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
    .alert-composer-modal .modal-header,
    .alert-composer-modal .modal-body,
    .alert-composer-modal .modal-footer { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .alert-detail-back,
    .alert-detail-neighbor-button,
    .alert-detail-tab,
    .alert-finding-card { transition: none; }
    .alert-findings-state.is-loading > .ph,
    .alert-notes-empty.is-loading > .ph { animation: none; }
    .alert-context-node, .alert-context-edge, .alert-context-disclosure > summary::after { transition: none; }.alert-context-state > .ph { animation: none; }
}

.recipients-card__empty p { margin: 0; font-size: 0.85rem; }
