/* AD Posture - consolidated dashboard design system */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #0b1020;
  --bg-elevated: #111827;
  --surface: #172033;
  --surface-2: #202b43;
  --surface-3: #2e3b59;
  --surface-soft: rgba(32, 43, 67, 0.72);
  --border: #33435f;
  --border-soft: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --risk: #fb7185;
  --danger: #fb7185;
  --risk-strong: #f43f5e;
  --risk-bg: rgba(251, 113, 133, 0.15);
  --risk-br: rgba(251, 113, 133, 0.42);
  --warn: #facc15;
  --warn-bg: rgba(250, 204, 21, 0.13);
  --warn-br: rgba(250, 204, 21, 0.36);
  --trust: #38bdf8;
  --trust-bg: rgba(56, 189, 248, 0.13);
  --trust-br: rgba(56, 189, 248, 0.36);
  --remediation: #34d399;
  --ok: #34d399;
  --remediation-bg: rgba(52, 211, 153, 0.13);
  --remediation-br: rgba(52, 211, 153, 0.34);
  --evidence: #a78bfa;
  --evidence-bg: rgba(167, 139, 250, 0.14);
  --evidence-br: rgba(167, 139, 250, 0.36);
  --accent: #8b5cf6;
  --accent-bg: rgba(139, 92, 246, 0.16);
  --accent-br: rgba(139, 92, 246, 0.42);
  --accent-str: #7c3aed;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  --shadow-soft: 0 1px 0 rgba(248, 250, 252, 0.05) inset, 0 10px 24px rgba(0, 0, 0, 0.12);
  --font-sans: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", ui-monospace, SFMono-Regular, monospace;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef4fb;
  --bg-elevated: #f8fbff;
  --surface: #ffffff;
  --surface-2: #f2f6fb;
  --surface-3: #dbe5f0;
  --surface-soft: rgba(255, 255, 255, 0.82);
  --border: #c4d2e2;
  --border-soft: rgba(71, 85, 105, 0.22);
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --risk: #be123c;
  --danger: #be123c;
  --risk-strong: #9f1239;
  --risk-bg: rgba(225, 29, 72, 0.10);
  --risk-br: rgba(190, 18, 60, 0.28);
  --warn: #a16207;
  --warn-bg: rgba(217, 119, 6, 0.10);
  --warn-br: rgba(161, 98, 7, 0.27);
  --trust: #0369a1;
  --trust-bg: rgba(14, 116, 144, 0.10);
  --trust-br: rgba(3, 105, 161, 0.24);
  --remediation: #047857;
  --ok: #047857;
  --remediation-bg: rgba(5, 150, 105, 0.10);
  --remediation-br: rgba(4, 120, 87, 0.24);
  --evidence: #6d28d9;
  --evidence-bg: rgba(109, 40, 217, 0.10);
  --evidence-br: rgba(109, 40, 217, 0.25);
  --accent: #5b21b6;
  --accent-bg: rgba(91, 33, 182, 0.10);
  --accent-br: rgba(91, 33, 182, 0.24);
  --accent-str: #4c1d95;
  --shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.74) inset, 0 10px 24px rgba(15, 23, 42, 0.07);
  color-scheme: light;
}

html {
  height: 100%;
  font-size: 15px;
  line-height: 1.55;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.09), transparent 34rem),
    linear-gradient(180deg, var(--bg-elevated), var(--bg) 24rem);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.sidebar-toggle {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 70px minmax(0, 1fr);
}

body.sidebar-collapsed .sb-logo > div:not(.sb-logo-icon),
body.sidebar-collapsed .sb-domain,
body.sidebar-collapsed .sb-footer,
body.sidebar-collapsed .sb-section-label,
body.sidebar-collapsed .sb-item span:not(.sb-icon) {
  display: none;
}

body.sidebar-collapsed .sb-logo,
body.sidebar-collapsed .sb-item {
  justify-content: center;
}

body.sidebar-collapsed .sb-nav,
body.sidebar-collapsed .sb-header {
  padding-left: 7px;
  padding-right: 7px;
}

.mini-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.sb-header {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.sb-logo,
.sb-domain,
.sb-item,
.topbar,
.topbar-left,
.topbar-right,
.search-box,
.btn-icon,
.theme-toggle,
.security-banner,
.alert,
.filter-summary,
.filter-chip,
.filter-clear,
.bar-label,
.legend-item,
.trend-meta,
.score-progress-wrap,
.panel-title-row,
.scorecard-head,
.script-actions {
  display: flex;
  align-items: center;
}

.sb-logo {
  gap: 10px;
}

.sb-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--trust));
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.sb-logo-text {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.15;
}

.sb-logo-ver,
.sb-domain-sub,
.sb-footer-label,
.sub,
.panel-sub,
.kpi-sub,
.score-kpi-sub,
.scorecard-desc,
.scorecard-count,
.next-action-meta,
.next-action-accounts,
.chain {
  color: var(--muted);
}

.sb-logo-ver,
.sb-domain-sub,
.sb-footer-label {
  font-size: 11px;
}

.sb-domain {
  gap: 9px;
  margin-top: 16px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.sb-domain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--remediation);
  box-shadow: 0 0 0 3px var(--remediation-bg);
  flex: 0 0 auto;
}

.sb-domain-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sb-nav {
  flex: 1;
  padding: 12px 10px;
}

.sb-section-label {
  padding: 16px 10px 7px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.sb-item {
  gap: 10px;
  min-height: 40px;
  margin-bottom: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  overflow: hidden;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.sb-item:hover,
.sb-item.active {
  background: var(--accent-bg);
  border-color: var(--accent-br);
  color: var(--text);
}

.sb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 26px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--subtle);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.sb-item:hover .sb-icon,
.sb-item.active .sb-icon {
  background: var(--accent);
  color: #fff;
}

.sb-badge {
  display: none !important;
}

.sb-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border-soft);
}

.sb-footer-val {
  margin: 2px 0 9px;
  color: var(--remediation);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 760;
}

.sb-footer-val.ok {
  color: var(--ok);
}

.sb-progress-bar {
  height: 6px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.sb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--remediation), var(--trust));
  border-radius: inherit;
  transition: width 0.55s ease;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(16px);
}

.topbar-left {
  gap: 10px;
  min-width: 0;
}

.page-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 780;
  white-space: nowrap;
}

.topbar-sep {
  color: var(--surface-3);
  font-size: 18px;
}

.topbar-sub {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topbar-tab {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.topbar-tab:hover,
.topbar-tab.active {
  background: var(--accent-bg);
  border-color: var(--accent-br);
  color: var(--text);
}

.topbar-right {
  justify-content: flex-end;
  gap: 9px;
  flex: 0 0 auto;
}

.search-box,
.btn-icon,
.theme-toggle,
.toolbar input[type="search"],
.toolbar select,
.scope-option,
.filter-clear,
.btn-clear-filters,
button.secondary,
button.action-script,
.next-action-button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.search-box {
  gap: 8px;
  width: 250px;
  padding: 0 12px;
}

.search-box input,
.toolbar input[type="search"] {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.search-box input::placeholder,
.toolbar input[type="search"]::placeholder {
  color: var(--subtle);
}

.kbd {
  display: none;
}

.btn-icon,
.theme-toggle,
button.secondary,
button.action-script,
.next-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.btn-icon:hover,
.theme-toggle:hover,
button.secondary:hover,
button.action-script:hover,
.next-action-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent-br);
  background: var(--accent-bg);
}

.content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 26px 30px 34px;
}

.alert,
.security-banner {
  gap: 10px;
  min-height: 42px;
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.45;
}

.alert {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.alert::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--trust);
  box-shadow: 0 0 0 3px var(--trust-bg);
  flex: 0 0 auto;
}

.alert.success {
  border-color: var(--remediation-br);
  background: var(--remediation-bg);
  color: var(--text);
}

.alert.error {
  border-color: var(--risk-br);
  background: var(--risk-bg);
  color: var(--text);
}

.alert.error::before {
  background: var(--risk);
  box-shadow: 0 0 0 3px var(--risk-bg);
}

.security-banner {
  position: relative;
  padding-left: 48px;
  padding-right: 48px;
  border: 1px solid var(--trust-br);
  background: linear-gradient(135deg, var(--trust-bg), var(--surface));
  color: var(--text);
}

.security-banner::before {
  content: "i";
  position: absolute;
  left: 14px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--trust);
  color: var(--bg);
  font-weight: 850;
  transform: translateY(-50%);
}

.security-banner-close {
  position: absolute;
  right: 10px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
}

.security-banner-close:hover {
  border-color: var(--trust-br);
  color: var(--text);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.toolbar input[type="search"],
.toolbar select {
  min-width: 0;
  padding: 8px 11px;
  font-size: 14px;
  outline: 0;
}

.toolbar select {
  background: var(--surface);
}

.toolbar input[type="search"]:focus,
.toolbar select:focus,
.search-box:focus-within {
  border-color: var(--accent-br);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.scope-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.scope-option {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.scope-option:last-child {
  border-right: 0;
}

.scope-option:hover,
.scope-option.active {
  background: var(--accent-bg);
  color: var(--text);
}

.btn-clear-filters {
  display: none;
  justify-content: center;
  padding: 8px 12px;
  border-color: var(--risk-br);
  background: var(--risk-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.btn-clear-filters.visible {
  display: inline-flex;
}

.filter-summary {
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.filter-count,
.filter-chip,
.filter-clear {
  min-height: 30px;
  font-size: 13px;
}

.filter-count {
  color: var(--muted);
}

.filter-chip {
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--accent-br);
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--text);
}

.filter-chip strong {
  color: var(--muted);
  font-weight: 700;
}

.filter-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.filter-clear {
  padding: 4px 11px;
  border-radius: 999px;
}

.score-hero,
.panel,
.kpi-card,
.card,
.chart-tile,
.scorecard-item,
.profile-block,
.empty-state {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.score-hero {
  display: grid;
  grid-template-columns: auto minmax(300px, 1fr) minmax(360px, 0.9fr);
  gap: 28px;
  align-items: center;
  min-height: 166px;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
}

.ring-wrap,
.ring-wrap svg {
  position: relative;
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-num {
  color: var(--risk);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.ring-lbl {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.score-info {
  min-width: 0;
}

.score-kpi-label,
.kpi-label,
.card h3,
.chart-tile h3,
th,
.next-action-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.score-kpi-val {
  margin-top: 5px;
  color: var(--risk);
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 850;
  line-height: 1.05;
}

.score-kpi-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
}

.score-context {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-2);
}

.score-context em,
.metric-pair em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.score-context strong {
  color: var(--remediation);
  font-weight: 750;
}

.score-progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 16px;
}

.score-progress-bar,
.bar-track,
.sb-progress-bar {
  background: color-mix(in srgb, var(--surface-3) 58%, transparent);
}

.score-progress-bar {
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
}

.score-progress-fill,
.bar-track span,
.bar-track .bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--remediation), var(--trust));
}

.score-progress-pct {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.next-action {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--accent-br);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, var(--accent-bg), transparent 72%),
    var(--surface-2);
}

.next-action-title {
  margin-top: 7px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.next-action-meta,
.next-action-accounts {
  margin-top: 7px;
  font-size: 13px;
}

.next-action-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.next-action-stats span {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.next-action-stats strong {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
}

.next-action-button {
  width: 100%;
  margin-top: 14px;
  border-color: var(--accent-str);
  background: var(--accent);
  color: #fff;
}

.kpi-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card,
.card {
  grid-column: span 3;
  min-height: 126px;
  min-width: 0;
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.kpi-grid > .kpi-card:nth-child(-n+2),
.grid > .card:nth-child(-n+3) {
  grid-column: span 4;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-bg) 72%, transparent), transparent 76%),
    var(--surface);
}

.kpi-val,
.value {
  margin-top: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(24px, 1.8vw, 32px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.metric-number {
  display: inline-block;
  min-width: 1.8ch;
}

.metric-unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.66em;
  font-weight: 760;
}

.metric-composite {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1;
}

.metric-pair {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  min-width: max-content;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.metric-pair strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 20px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  margin: 8px 6px 0 0;
  padding: 4px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.metric-chip strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.metric-chip.danger {
  border-color: var(--risk-br);
  background: var(--risk-bg);
}

.metric-chip.warn {
  border-color: var(--warn-br);
  background: var(--warn-bg);
}

.metric-chip.ok {
  border-color: var(--remediation-br);
  background: var(--remediation-bg);
}

.score-high {
  color: var(--risk);
}

.kpi-val.ok,
.value.ok {
  color: var(--ok);
}

.kpi-val.warn,
.value.warn {
  color: var(--warn);
}

.kpi-val.danger,
.value.danger {
  color: var(--danger);
}

.score-mid {
  color: var(--warn);
}

.score-low,
.score-0 {
  color: var(--remediation);
}

.kpi-sub,
.sub {
  font-size: 13px;
  line-height: 1.45;
}

.value-sm { font-size: 20px; line-height: 1.25; }
.value-xs { font-size: 14px; line-height: 1.35; }
.value-md { font-size: 17px; line-height: 1.3; }
.value-lg { font-size: 34px; line-height: 1.1; }

.panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel-hidden,
.script-panel[hidden] {
  display: none !important;
}

.panel-head,
.panel-title-row {
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 15px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--surface-2), transparent);
}

.panel-title,
.panel-title-row h2,
.panel > h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.25;
}

.panel-sub,
.panel-title-row .sub,
.panel > h2 + .sub {
  max-width: 78ch;
}

.panel > h2 {
  padding: 18px 18px 0;
}

.panel > h2 + .sub {
  display: block;
  margin: 0 !important;
  padding: 7px 18px 15px;
}

.panel-body,
.chart-grid,
.scorecard-grid,
.rank-list,
.trend-bars {
  padding: 18px;
}

.panel-link {
  color: var(--trust);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.insight-summary,
.readiness-meter {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 850;
}

.readiness-meter {
  font-size: 28px;
}

.object-profile .panel-title-row > div:first-child {
  min-width: 0;
}

.object-profile .panel-title-row h2 {
  max-width: 78ch;
  overflow-wrap: anywhere;
}

.object-profile .readiness-meter {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "label label"
    "score severity";
  align-items: baseline;
  justify-content: end;
  gap: 3px 12px;
  min-width: 148px;
  padding: 9px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: right;
}

.profile-score-label {
  grid-area: label;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.object-profile .readiness-meter strong {
  grid-area: score;
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1;
}

.profile-severity {
  grid-area: severity;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

.chart-grid,
.scorecard-grid {
  display: grid;
  gap: 16px;
}

.chart-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.scorecard-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.chart-tile,
.scorecard-item,
.profile-block,
.empty-state {
  border-radius: var(--radius-lg);
}

.scorecard-item {
  display: grid;
  gap: 14px;
  min-height: 136px;
  padding: 18px 20px;
  background: var(--surface-2);
}

.scorecard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: start;
}

.scorecard-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 820;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.scorecard-head .badge {
  margin: 0;
  justify-self: end;
  white-space: nowrap;
}

.scorecard-count {
  display: inline-flex;
  align-items: baseline;
  width: fit-content;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 820;
}

.scorecard-item .sub {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.chart-tile {
  padding: 16px;
  background: var(--surface-2);
}

.chart-wide {
  grid-column: span 2;
}

.chart-tile h3 {
  margin: 0 0 13px;
  color: var(--text);
}

.bar-list,
.legend,
.trend-bars,
.rank-list {
  display: grid;
  gap: 10px;
}

.bar-row,
.legend-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 34px;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.bar-label {
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
}

.bar-label strong,
.legend-item strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.bar-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
}

.swatch,
.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.donut-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  width: 136px;
  height: 136px;
  border-radius: 50%;
}

.table-scroll {
  overflow: auto;
  border-top: 1px solid var(--border-soft);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  scrollbar-color: var(--accent-str) var(--surface-2);
}

.compact-table-scroll {
  max-height: 500px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 14px;
  table-layout: auto;
}

.actions-table,
#findings-table,
.objects-table,
.acl-table,
.gpo-table,
.adcs-table,
.auth-table,
.timeline-table,
.profile-table {
  min-width: 980px;
}

#findings-table,
.gpo-table,
.adcs-table {
  min-width: 1280px;
}

.objects-table,
.acl-table {
  min-width: 1180px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  white-space: nowrap;
}

td {
  color: var(--text);
}

tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

tbody tr:hover td,
.selected-row td {
  background: var(--accent-bg);
}

.enhanced-table th {
  position: sticky;
}

.enhanced-table td,
.enhanced-table th {
  border-right: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.enhanced-table td:last-child,
.enhanced-table th:last-child {
  border-right: 0;
}

.sortable {
  cursor: pointer;
}

.sortable:hover {
  color: var(--text);
}

.sorted-asc::after {
  content: " â†‘";
  color: var(--trust);
}

.sorted-desc::after {
  content: " â†“";
  color: var(--trust);
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -7px;
  z-index: 4;
  width: 14px;
  height: 100%;
  cursor: col-resize;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 24%;
  right: 6px;
  width: 2px;
  height: 52%;
  border-radius: 999px;
  background: var(--border);
  opacity: 0.8;
}

body.resizing-column {
  cursor: col-resize;
}

.wrap,
.chain,
td small,
.profile-list dd,
.rank-main strong,
.rank-main span {
  overflow-wrap: anywhere;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--trust);
  font: inherit;
  font-weight: 780;
}

.link-button:hover {
  color: var(--text);
  text-decoration: underline;
}

.badge,
.uac-pill,
.attack-pill,
.tier-badge,
.score-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 5px 5px 0;
  padding: 3px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.badge-high,
.badge-fail,
.badge-tier0,
.pill-high,
.tier-0 {
  border-color: var(--risk-br);
  background: var(--risk-bg);
  color: var(--risk);
}

.badge-med,
.badge-review,
.badge-tier1,
.pill-medium,
.tier-1 {
  border-color: var(--warn-br);
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-low,
.badge-pass,
.badge-tier2,
.pill-low,
.tier-2 {
  border-color: var(--remediation-br);
  background: var(--remediation-bg);
  color: var(--remediation);
}

.badge-excluded,
.pill-info {
  border-color: var(--trust-br);
  background: var(--trust-bg);
  color: var(--trust);
}

.uac-pill,
.attack-pill {
  border-color: var(--evidence-br);
  background: var(--evidence-bg);
  color: color-mix(in srgb, var(--evidence) 78%, var(--text));
}

.object-profile-grid,
.finding-detail-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(18rem, 1.1fr);
  gap: 16px;
  padding: 18px;
}

.finding-detail-grid {
  grid-template-columns: minmax(0, 1fr);
}

.profile-block,
.finding-detail-grid > div {
  min-width: 0;
  padding: 16px;
  background: var(--surface-2);
}

.profile-block > strong,
.finding-detail-grid strong {
  display: block;
  margin-bottom: 11px;
  color: var(--text);
  font-size: 15px;
  font-weight: 820;
}

.profile-wide {
  grid-column: 1 / -1;
}

.profile-list {
  display: grid;
  grid-template-columns: minmax(8rem, 0.25fr) minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
}

.profile-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.profile-list dd {
  margin: 0;
  color: var(--text);
  min-width: 0;
}

.adcs-attack-path {
  margin-top: 10px;
  padding-left: 20px;
}

.adcs-attack-path li {
  margin-bottom: 6px;
}

.profile-table {
  table-layout: fixed;
}

.empty-state,
.table-empty {
  padding: 18px;
  border-style: dashed;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.rank-list {
  display: grid;
}

.rank-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 850;
}

.rank-main {
  min-width: 0;
}

.rank-main strong,
.rank-main span {
  display: block;
}

.rank-main strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.rank-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rank-score {
  color: var(--risk);
  font-family: var(--font-mono);
  font-weight: 850;
}

.trend-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.38fr) minmax(180px, 1fr) minmax(170px, 0.35fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.trend-meta {
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.trend-meta strong {
  white-space: nowrap;
}

.trend-meta span,
.rank-score {
  color: var(--risk);
}

.trend-item small {
  justify-self: end;
}

.script-panel {
  overflow: hidden;
}

.script-actions {
  gap: 8px;
}

.script-output {
  margin: 0;
  padding: 18px;
  overflow: auto;
  background: #020617;
  color: #dbeafe;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.scope-toggle,
.topbar-tabs,
.toolbar,
.chart-grid,
.scorecard-grid,
.kpi-grid,
.grid,
.object-profile-grid,
.finding-detail-grid,
.rank-item,
.trend-item,
.next-action-stats {
  min-width: 0;
}

#os-table.os-action-table {
  min-width: 1180px;
  table-layout: fixed;
}

#os-table.os-action-table th,
#os-table.os-action-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

#os-table .os-col-status {
  width: 132px;
}

#os-table .os-col-category {
  width: 150px;
}

#os-table .os-col-control {
  width: 340px;
}

#os-table .os-col-computer {
  width: 210px;
}

#os-table .os-col-values {
  width: 220px;
}

#os-table .os-status-cell,
#os-table .os-category-cell,
#os-table .os-computer-cell,
#os-table .os-values-cell,
#os-table .os-evidence-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

#os-table .os-category-cell,
#os-table .os-computer-cell {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

#os-table .os-control-cell .link-button {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#os-table .os-control-cell small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#os-table .os-values-cell {
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 70px minmax(0, 1fr);
  line-height: 1.25;
}

#os-table .os-values-cell span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

#os-table .os-values-cell strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#os-table .os-evidence-cell {
  display: -webkit-box;
  line-height: 1.35;
  max-height: 2.8em;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 1240px) {
  .score-hero {
    grid-template-columns: auto minmax(280px, 1fr);
  }

  .next-action {
    grid-column: 1 / -1;
  }

  .kpi-card,
  .card,
  .kpi-grid > .kpi-card:nth-child(-n+2),
  .grid > .card:nth-child(-n+3) {
    grid-column: span 6;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar input[type="search"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sb-logo > div:not(.sb-logo-icon),
  .sb-domain,
  .sb-footer,
  .sb-section-label,
  .sb-item span:not(.sb-icon) {
    display: none;
  }

  .sb-header {
    padding: 14px 10px;
  }

  .sb-logo {
    justify-content: center;
  }

  .score-hero {
    grid-template-columns: 1fr;
  }

  .ring-wrap {
    justify-self: start;
  }

  .score-progress-wrap {
    grid-template-columns: 1fr;
  }

  .object-profile .panel-title-row {
    align-items: stretch;
  }

  .object-profile .readiness-meter {
    justify-content: start;
    text-align: left;
  }

  .sb-nav {
    padding: 10px;
  }

  .sb-item {
    justify-content: center;
    padding: 9px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-box {
    width: min(100%, 360px);
  }

  .chart-wide {
    grid-column: span 1;
  }

  .object-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 14px;
  }

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

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  .sb-header,
  .sb-footer {
    display: none;
  }

  .sb-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
  }

  .sb-item {
    min-width: 54px;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    position: static;
    padding: 14px 18px;
  }

  .topbar-sub,
  .topbar-sep {
    display: none;
  }

  .score-hero,
  .toolbar,
  .trend-item,
  .donut-row {
    grid-template-columns: 1fr;
  }

  .kpi-card,
  .card,
  .kpi-grid > .kpi-card:nth-child(-n+2),
  .grid > .card:nth-child(-n+3) {
    grid-column: 1 / -1;
  }

  .scope-toggle {
    grid-template-columns: 1fr 1fr;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .next-action-stats {
    grid-template-columns: 1fr;
  }

  .profile-list {
    grid-template-columns: 1fr;
  }

  .trend-item small {
    justify-self: start;
  }
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 0 0;
}

.table-pagination button:disabled {
  cursor: default;
  opacity: .45;
}

@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .theme-toggle,
  .btn-icon,
  .security-banner-close,
  button,
  input,
  select {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111827;
  }

  .shell,
  .content {
    display: block;
    width: 100%;
    padding: 0;
  }

  .panel,
  .card,
  .kpi-card,
  .chart-tile {
    break-inside: avoid;
    box-shadow: none;
  }

  body[data-page="executive.html"] .content {
    font-size: 10pt;
  }

  body[data-page="executive.html"] .security-banner,
  body[data-page="executive.html"] #exec-hint {
    display: none !important;
  }

  body[data-page="executive.html"] .score-hero,
  body[data-page="executive.html"] .panel,
  body[data-page="executive.html"] .kpi-grid {
    margin-bottom: 12px;
    break-inside: avoid;
  }

  body[data-page="executive.html"] .executive-methodology {
    border-top: 2px solid #111827;
  }
}

/* Operational polish: alert hierarchy, KPI rhythm, table scanning, and active tabs. */
.content > .alert {
  min-height: 44px;
  border-color: color-mix(in srgb, var(--accent-br) 64%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-bg) 72%, transparent), transparent 82%),
    var(--surface);
  color: var(--text);
  font-weight: 650;
}

.content > .alert.error {
  border-color: color-mix(in srgb, var(--risk-br) 78%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--risk-bg) 84%, transparent), transparent 82%),
    var(--surface);
}

.content > .security-banner {
  min-height: 30px;
  padding: 7px 12px 7px 36px;
  border-color: var(--border-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.content > .security-banner::before {
  left: 11px;
  width: 17px;
  height: 17px;
  background: color-mix(in srgb, var(--muted) 72%, var(--surface-2));
  color: var(--surface);
  font-size: 11px;
  font-weight: 850;
}

.content > .security-banner .security-banner-close,
.content > .security-banner-close {
  width: 22px;
  height: 22px;
  font-size: 15px;
}

.topbar-tab {
  position: relative;
}

.topbar-tab.active {
  border-color: color-mix(in srgb, var(--accent-br) 74%, var(--border));
  border-bottom-color: var(--accent-str);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-bg) 82%, transparent), var(--surface));
  color: var(--text);
  font-weight: 820;
  box-shadow: inset 0 -3px 0 var(--accent-str);
}

.topbar-tab.active:hover {
  border-bottom-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.kpi-card,
.card {
  border-left: 3px solid transparent;
}

.kpi-card .kpi-label,
.card h3 {
  min-height: 1.3em;
}

.kpi-card .kpi-val,
.card .value {
  margin-top: 10px;
}

.kpi-card:nth-child(1),
.grid > .card:nth-child(1) {
  border-left-color: var(--risk);
}

.kpi-card:nth-child(2),
.grid > .card:nth-child(2) {
  border-left-color: var(--accent);
}

.kpi-card:nth-child(n+3),
.grid > .card:nth-child(n+3) {
  border-left-color: color-mix(in srgb, var(--muted) 46%, transparent);
}

.kpi-card:nth-child(2) .kpi-val,
.grid > .card:nth-child(2) .value {
  color: var(--accent);
}

.kpi-card:nth-child(n+3) .kpi-val,
.grid > .card:nth-child(n+3) .value {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.kpi-sub {
  margin-top: 8px;
  color: var(--muted);
}

th,
td {
  padding-top: 13px;
  padding-bottom: 13px;
}

tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}

tbody tr:hover td,
.selected-row td {
  background: color-mix(in srgb, var(--accent-bg) 82%, var(--surface));
}

.enhanced-table td,
.enhanced-table th {
  border-right-color: color-mix(in srgb, var(--border) 56%, transparent);
}

@media (max-width: 720px) {
  .content > .security-banner {
    padding-right: 12px;
  }

  .topbar-tab {
    min-height: 34px;
  }

  th,
  td {
    padding: 11px 12px;
  }
}

/* Compact operational density
   Keep the audit queue visible above the fold and reserve large surfaces for
   tables, profiles, and evidence instead of summary chrome. */
.shell {
  grid-template-columns: 212px minmax(0, 1fr);
}

.sb-header {
  padding: 12px 11px 10px;
}

.sb-logo {
  gap: 8px;
}

.sb-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 10px;
}

.sb-logo-text {
  font-size: 12px;
}

.sb-domain {
  gap: 7px;
  margin-top: 10px;
  padding: 8px 9px;
  border-radius: var(--radius);
}

.sb-domain-name {
  font-size: 11px;
}

.sb-logo-ver,
.sb-domain-sub,
.sb-footer-label {
  font-size: 9px;
}

.sb-nav {
  padding: 7px 6px;
}

.sb-section-label {
  padding: 9px 7px 4px;
  font-size: 9px;
}

.sb-item {
  gap: 7px;
  min-height: 31px;
  margin-bottom: 1px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 12px;
}

.sb-icon {
  width: 29px;
  height: 21px;
  border-radius: 6px;
  font-size: 8px;
}

.sb-footer {
  padding: 9px 11px 11px;
}

.sb-footer-val {
  margin: 1px 0 6px;
  font-size: 12px;
}

.sb-progress-bar {
  height: 4px;
}

.topbar {
  gap: 10px;
  min-height: 50px;
  padding: 7px 16px;
}

.topbar-left {
  gap: 7px;
}

.page-title {
  font-size: 14px;
}

.topbar-sep {
  font-size: 14px;
}

.topbar-sub {
  font-size: 11px;
}

.topbar-tabs {
  gap: 3px;
}

.topbar-tab {
  min-height: 29px;
  padding: 4px 7px;
  font-size: 11px;
}

.search-box,
.btn-icon,
.theme-toggle,
.toolbar input[type="search"],
.toolbar select,
.scope-option,
.filter-clear,
.btn-clear-filters,
button.secondary,
button.action-script,
.next-action-button {
  min-height: 32px;
}

.btn-icon,
.theme-toggle,
button.secondary,
button.action-script,
.next-action-button {
  gap: 5px;
  padding: 5px 9px;
  font-size: 11px;
}

.search-box {
  width: 220px;
  padding: 0 9px;
}

.content {
  gap: 10px;
  width: 100%;
  max-width: none;
  padding: 14px 16px 22px;
}

.content > .alert,
.content > .security-banner {
  min-height: 28px;
  border-radius: var(--radius);
  font-size: 11px;
  line-height: 1.3;
}

.content > .alert {
  padding: 6px 10px;
}

.content > .security-banner {
  padding: 6px 34px;
}

.toolbar {
  grid-template-columns: minmax(220px, 1.5fr) repeat(auto-fit, minmax(125px, 1fr));
  gap: 7px;
  padding: 8px;
  border-radius: var(--radius-lg);
}

.toolbar input[type="search"],
.toolbar select {
  padding: 5px 8px;
  font-size: 12px;
}

.scope-option,
.btn-clear-filters {
  font-size: 11px;
}

.filter-summary {
  min-height: 24px;
}

.filter-count,
.filter-chip,
.filter-clear {
  min-height: 24px;
  font-size: 11px;
}

.score-hero {
  grid-template-columns: auto minmax(240px, 1fr) minmax(280px, 0.72fr);
  gap: 16px;
  min-height: 0;
  padding: 13px 15px;
  border-radius: var(--radius-lg);
}

.ring-wrap,
.ring-wrap svg {
  width: 80px;
  height: 80px;
}

.ring-num {
  font-size: 17px;
}

.score-kpi-label,
.kpi-label,
.card h3,
.chart-tile h3,
th,
.next-action-label {
  font-size: 10px;
}

.score-kpi-val {
  margin-top: 2px;
  font-size: 27px;
}

.score-kpi-sub {
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
}

.score-context {
  min-height: 23px;
  padding: 2px 7px;
}

.score-progress-wrap {
  gap: 8px;
  margin-top: 9px;
}

.score-progress-pct {
  font-size: 10px;
}

.next-action {
  padding: 10px 11px;
  border-radius: var(--radius);
}

.next-action-title {
  margin-top: 3px;
  font-size: 13px;
}

.next-action-meta,
.next-action-accounts {
  margin-top: 4px;
  font-size: 10px;
}

.next-action-stats {
  gap: 5px;
  margin-top: 7px;
}

.next-action-stats span {
  padding: 4px 6px;
  font-size: 9px;
}

.next-action-stats strong {
  font-size: 12px;
}

.next-action-button {
  margin-top: 7px;
}

.kpi-grid,
.grid {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.grid:has(> .card:nth-child(6):last-child) {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid:has(> .card:nth-child(7):last-child) {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.grid:has(> .card:nth-child(8):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid:has(> .card:nth-child(9):last-child),
.grid:has(> .card:nth-child(10):last-child) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-card,
.card,
.kpi-grid > .kpi-card:nth-child(-n+2),
.grid > .card:nth-child(-n+3) {
  grid-column: auto;
  min-height: 74px;
  padding: 10px 11px;
  border-radius: var(--radius);
  background: var(--surface);
}

.kpi-card,
.card,
.kpi-card:nth-child(1),
.kpi-card:nth-child(2),
.kpi-card:nth-child(n+3),
.grid > .card:nth-child(1),
.grid > .card:nth-child(2),
.grid > .card:nth-child(n+3) {
  border-left-color: var(--border-soft);
}

.kpi-card:has(.score-high),
.kpi-card:has(.danger),
.card:has(.score-high),
.card:has(.danger) {
  border-left-color: var(--risk);
}

.kpi-card:has(.score-mid),
.kpi-card:has(.warn),
.card:has(.score-mid),
.card:has(.warn) {
  border-left-color: var(--warn);
}

.kpi-card:has(.score-low),
.kpi-card:has(.score-0),
.kpi-card:has(.ok),
.card:has(.score-low),
.card:has(.score-0),
.card:has(.ok) {
  border-left-color: var(--ok);
}

.kpi-card .kpi-label,
.card h3 {
  min-height: 0;
  margin: 0;
}

.kpi-card .kpi-val,
.card .value,
.kpi-card:nth-child(2) .kpi-val,
.kpi-card:nth-child(n+3) .kpi-val,
.grid > .card:nth-child(2) .value,
.grid > .card:nth-child(n+3) .value {
  margin-top: 4px;
  color: var(--text);
  font-size: clamp(18px, 1.45vw, 24px);
}

.kpi-card .score-high,
.card .score-high,
.kpi-card .danger,
.card .danger {
  color: var(--risk);
}

.kpi-card .score-mid,
.card .score-mid,
.kpi-card .warn,
.card .warn {
  color: var(--warn);
}

.kpi-card .score-low,
.kpi-card .score-0,
.card .score-low,
.card .score-0,
.kpi-card .ok,
.card .ok {
  color: var(--ok);
}

.kpi-sub {
  margin-top: 3px;
  font-size: 10px;
}

.metric-composite {
  gap: 5px;
  margin-top: 5px;
  font-size: 11px;
}

.metric-pair {
  gap: 4px;
  padding: 4px 6px;
}

.metric-pair strong {
  font-size: 14px;
}

.metric-chip {
  min-height: 22px;
  margin: 4px 3px 0 0;
  padding: 2px 6px;
  font-size: 10px;
}

.panel {
  border-radius: var(--radius-lg);
}

.panel-head,
.panel-title-row {
  gap: 10px;
  padding: 9px 12px 8px;
}

.panel-title,
.panel-title-row h2,
.panel > h2 {
  font-size: 14px;
}

.panel > h2 {
  padding: 11px 12px 0;
}

.panel > h2 + .sub {
  padding: 4px 12px 9px;
}

.panel-body,
.chart-grid,
.scorecard-grid,
.rank-list,
.trend-bars {
  padding: 11px 12px;
}

.insight-summary,
.readiness-meter {
  font-size: 13px;
}

.object-profile .readiness-meter {
  min-width: 126px;
  padding: 6px 8px;
}

.object-profile .readiness-meter strong {
  font-size: 18px;
}

.chart-grid,
.scorecard-grid {
  gap: 9px;
}

.chart-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.scorecard-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.scorecard-item {
  gap: 7px;
  min-height: 0;
  padding: 10px 11px;
}

.scorecard-count {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 12px;
}

.scorecard-item .sub {
  font-size: 11px;
  line-height: 1.4;
}

.chart-tile {
  padding: 10px;
}

.chart-tile h3 {
  margin-bottom: 8px;
}

.bar-list,
.legend,
.trend-bars,
.rank-list {
  gap: 6px;
}

.bar-row,
.legend-item {
  gap: 6px;
  min-height: 28px;
  padding: 5px 7px;
}

.bar-label,
.bar-label strong,
.legend-item strong {
  font-size: 11px;
}

.donut-row {
  grid-template-columns: minmax(92px, 112px) minmax(0, 1fr);
  gap: 10px;
}

.donut {
  width: 104px;
  height: 104px;
}

.compact-table-scroll {
  max-height: 420px;
}

table {
  font-size: 12px;
}

th,
td {
  padding: 8px 9px;
}

.table-pagination {
  gap: 8px;
  padding: 7px 10px;
}

.empty-state {
  padding: 12px;
}

.executive-brief {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.executive-brief .panel-sub {
  display: block;
  color: var(--text);
  font-weight: 750;
}

.executive-brief .chart-bar {
  height: 7px !important;
  margin-top: 7px;
}

.executive-brief .sub {
  margin: 6px 0 0 !important;
  font-size: 10px;
}

.executive-remediation .metric-composite {
  flex-wrap: nowrap;
}

.timeline-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
}

.timeline-overview > .panel {
  min-width: 0;
}

.timeline-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .sb-logo > div:not(.sb-logo-icon),
  .sb-domain,
  .sb-footer,
  .sb-section-label,
  .sb-item span:not(.sb-icon) {
    display: none;
  }

  .sb-header {
    padding: 10px;
  }

  .sb-logo,
  .sb-item {
    justify-content: center;
  }

  .sb-nav {
    padding: 7px;
  }

  .sb-item {
    padding: 5px 0;
  }

  .score-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .next-action,
  .executive-brief {
    grid-column: 1 / -1;
  }
}

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

  .content {
    padding: 10px;
  }

  .score-hero,
  .timeline-overview {
    grid-template-columns: 1fr;
  }

  .ring-wrap {
    justify-self: start;
  }

  .kpi-grid,
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .toolbar input[type="search"] {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .grid:has(> .card:nth-child(6):last-child),
  .grid:has(> .card:nth-child(7):last-child),
  .grid:has(> .card:nth-child(8):last-child),
  .grid:has(> .card:nth-child(9):last-child),
  .grid:has(> .card:nth-child(10):last-child) {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}
