/* ================================================================
   QCrypton — Dashboard Styles
   ================================================================ */

:root {
  --bg: #0a0e1a;
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --card-bg: #1a2035;
  --bg-card-hover: #1f2847;
  --bg-input: #0f1525;
  --border: #2a3555;
  --border-light: #354170;
  --text-primary: #e8ecf4;
  --text-secondary: #8b95b0;
  --text-muted: #5a6580;
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);
  --accent-green: #10b981;
  --accent-green-dim: rgba(16, 185, 129, 0.15);
  --accent-orange: #f59e0b;
  --accent-orange-dim: rgba(245, 158, 11, 0.15);
  --accent-red: #ef4444;
  --accent-red-dim: rgba(239, 68, 68, 0.15);
  --accent-purple: #8b5cf6;
  --accent-purple-dim: rgba(139, 92, 246, 0.15);
  --sidebar-width: 300px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
  /* Spacing tokens for consistency */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

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

/* ======================== ACCESSIBILITY ======================== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-to-content {
  position: absolute; top: -40px; left: 0;
  background: var(--accent-blue); color: #fff;
  padding: 8px 16px; z-index: 10010;
  font-size: 14px; text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus { top: 0; }
*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ======================== TABLE OVERFLOW ======================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table { min-width: 600px; }
.comparison-table { min-width: 500px; width: 100%; border-collapse: collapse; font-size: 13px; }
.comparison-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.comparison-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.comparison-table tr:hover td {
  background: rgba(59, 130, 246, 0.05);
}
.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ======================== SIDEBAR ======================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

.sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
  color: var(--accent-blue);
  filter: drop-shadow(0 0 8px rgba(59,130,246,0.4));
}

.logo h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.logo-sub {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.3;
}

.nav-links {
  list-style: none;
  padding: 6px 10px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 1px;
}

.nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-group {
  list-style: none;
  position: relative;
}

.nav-group-toggle {
  justify-content: flex-start;
}

.nav-chevron {
  margin-left: auto;
  font-size: 12px;
  transition: transform var(--transition);
  cursor: pointer;
  padding: 4px 8px;
}

.nav-group.open > .nav-group-toggle .nav-chevron {
  transform: rotate(90deg);
}

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 20px;
  display: none;
}

.nav-group.open > .nav-submenu {
  display: block;
}

.nav-submenu li {
  list-style: none;
}

.nav-submenu .nav-link {
  padding: 5px 14px;
  font-size: 12px;
}

.sidebar-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.upgrade-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.25s ease;
}
.upgrade-banner:hover {
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.18));
  transform: translateY(-1px);
}
.upgrade-icon { font-size: 18px; flex-shrink: 0; }
.upgrade-text { display: flex; flex-direction: column; line-height: 1.3; }
.upgrade-text strong {
  font-size: 13px; font-weight: 700;
  color: var(--accent-blue);
}
.upgrade-text small {
  font-size: 11px; color: var(--text-muted);
}

.threat-level {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  justify-content: center;
  padding: 4px 16px 0 40px;
}

.threat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.threat-dot.green { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.threat-dot.orange { background: var(--accent-orange); box-shadow: 0 0 8px var(--accent-orange); }
.threat-dot.red { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ======================== MAIN CONTENT ======================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 40px;
  max-width: 1200px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 28px;
}

.page-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  width: 100%;
}

.page-header > .subtitle,
.page-header > .text-muted {
  width: 100%;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  padding-top: 4px;
}

.header-actions .btn {
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ======================== TAB SYSTEM ======================== */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* ======================== SUB-TABS (generic) ======================== */
.subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}
.subtab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.subtab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.subtab.active {
  background: var(--accent-blue);
  color: #fff;
}
.subtab-content {
  display: none;
}
.subtab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* ======================== STAT CARDS ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--accent-blue-dim); color: var(--accent-blue); }
.stat-icon.orange { background: var(--accent-orange-dim); color: var(--accent-orange); }
.stat-icon.red { background: var(--accent-red-dim); color: var(--accent-red); }
.stat-icon.green { background: var(--accent-green-dim); color: var(--accent-green); }
.stat-icon.purple { background: var(--accent-purple-dim); color: var(--accent-purple); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ======================== CARDS ======================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  gap: 10px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ======================== CHARTS ======================== */
.chart-container {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  width: 100%;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  width: 100%;
  padding: 0 4px;
}

.bar-group {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
  position: relative;
}

.bar:hover {
  filter: brightness(1.2);
}

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.bar.users-bar {
  background: #3b82f6;
}

.bar.tenants-bar {
  background: #8b5cf6;
}

.bar-group.grouped .bar-pair {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.donut-chart {
  position: relative;
  width: 160px;
  height: 160px;
}

.donut-chart svg {
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .value {
  font-size: 28px;
  font-weight: 700;
  display: block;
}

.donut-center .label {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ======================== QUANTUM THREAT FUNNEL ======================== */
.funnel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 20px 0;
}

.funnel-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s ease;
  border: none;
  cursor: default;
}

.funnel-stage:hover {
  filter: brightness(1.15);
}

.funnel-stage .funnel-label {
  position: relative;
  z-index: 1;
  line-height: 1.3;
}

.funnel-stage .funnel-count {
  font-size: 22px;
  font-weight: 700;
  display: block;
}

.funnel-stage .funnel-subtitle {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}

.funnel-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  height: 28px;
  position: relative;
}

.funnel-arrow .funnel-arrow-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.funnel-sidebar {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  width: 100%;
}

.funnel-sidebar-section {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.funnel-sidebar-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.funnel-source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg);
}

.funnel-source-item .source-name {
  color: var(--text-secondary);
}

.funnel-source-item .source-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
}

.source-badge.correctable {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}

.source-badge.reachable {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

.source-badge.partial {
  background: var(--accent-orange-dim);
  color: var(--accent-orange);
}

.funnel-summary-row {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  width: 100%;
}

.funnel-summary-stat {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.funnel-summary-stat .fs-value {
  font-size: 24px;
  font-weight: 700;
  display: block;
}

.funnel-summary-stat .fs-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ======================== CROSS-DOMAIN TAXONOMY ======================== */
.cd-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}

.cd-column { display: flex; flex-direction: column; gap: 12px; }

.cd-arrow-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 20px;
}

.cd-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--card-bg);
}

.cd-card h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
}

.cd-card .cd-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cd-card .cd-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cd-type-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.cd-type-tag.reachable {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.cd-type-tag.corrected {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.cd-contrib-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bg);
  margin-top: 8px;
  overflow: hidden;
}

.cd-contrib-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.cd-bias-box {
  margin-top: 16px;
  display: flex;
  gap: 16px;
}

.cd-bias-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.cd-bias-item .bi-value {
  font-size: 18px;
  font-weight: 700;
  display: block;
}

.cd-bias-item .bi-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ======================== QEC HEATMAP ======================== */
.hm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}

.hm-table th, .hm-table td {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--border);
}

.hm-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
}

.hm-table th:first-child, .hm-table td:first-child {
  text-align: left;
  font-weight: 500;
  min-width: 120px;
}

.hm-cell {
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
}

.hm-cell.corrected { background: var(--accent-green-dim); color: var(--accent-green); }
.hm-cell.partial { background: var(--accent-orange-dim); color: var(--accent-orange); }
.hm-cell.exceeded { background: var(--accent-red-dim); color: var(--accent-red); }
.hm-cell.negligible { background: var(--bg); color: var(--text-muted); }
.hm-cell.best { outline: 2px solid var(--accent-green); outline-offset: -1px; }

.hm-gauge {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.hm-gauge-bar {
  flex: 1;
  height: 28px;
  border-radius: 14px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
}

.hm-gauge-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  transition: width 0.5s ease;
}

.hm-gauge-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ======================== PROPAGATION PATH ======================== */
.pp-container { display: flex; flex-direction: column; gap: 16px; }

.pp-path {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--card-bg);
}

.pp-path-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.pp-stages {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}

.pp-stage {
  flex-shrink: 0;
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 110px;
}

.pp-stage .pp-rate {
  font-size: 15px;
  font-weight: 700;
  display: block;
}

.pp-stage .pp-label {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.pp-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 4px;
}

.pp-suppression {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pp-sup-bar {
  flex: 1;
  max-width: 200px;
  height: 8px;
  border-radius: 4px;
  background: var(--bg);
  overflow: hidden;
}

.pp-sup-fill { height: 100%; border-radius: 4px; }

/* ======================== BB84 PANEL ======================== */
.bb84-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.bb84-method {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  position: relative;
}

.bb84-method h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
}

.bb84-method .bb84-verdict-box {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-weight: 700;
  font-size: 14px;
}

.bb84-meter {
  height: 24px;
  border-radius: 12px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  margin: 8px 0;
}

.bb84-meter-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease;
}

.bb84-meter-threshold {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--text-primary);
}

.bb84-meter-label {
  position: absolute;
  top: -16px;
  font-size: 10px;
  color: var(--text-muted);
  transform: translateX(-50%);
}

.bb84-decomp {
  margin-top: 12px;
}

.bb84-decomp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-secondary);
}

.bb84-decomp-row .decomp-bar {
  width: 60px;
  height: 5px;
  border-radius: 3px;
  background: var(--bg);
  overflow: hidden;
}

.bb84-decomp-row .decomp-fill {
  height: 100%;
  border-radius: 3px;
}

.bb84-sigma {
  text-align: center;
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.bb84-sigma .sigma-value {
  font-size: 36px;
  font-weight: 700;
  display: block;
}

.bb84-sigma .sigma-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* BB84 & Noise Results side-by-side layout */
.bb84-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .bb84-results-grid { grid-template-columns: 1fr; }
}


.chart-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ======================== BUTTONS ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--border-light); }

.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}
.btn-primary:hover { background: #2563eb; }

/* Only add top margin for standalone form-level primary buttons */
.card-body > .btn-primary,
.form-grid + .btn-primary { margin-top: 12px; }

/* Reset margins for buttons inside inline containers */
.data-table .btn,
.stats-grid .btn,
.noise-pattern .btn,
.workflow-rule .btn,
.intel-stats-row .btn,
.unified-toolbar .btn,
.asset-discovery-bar .btn { margin-top: 0; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-danger { background: var(--accent-red-dim); border-color: var(--accent-red); color: var(--accent-red); }
.btn-danger:hover { background: var(--accent-red); color: #fff; }

.demo-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ======================== INPUTS ======================== */
.input-area {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.input-area:focus { border-color: var(--accent-blue); }

.input-area.code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.5;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="url"]:focus, select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
input[type="text"].code { font-family: 'SF Mono', 'Fira Code', monospace; }

select {
  cursor: pointer;
  appearance: auto;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

/* ======================== BADGES ======================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-clean, .badge-info { background: var(--accent-green-dim); color: var(--accent-green); }
.badge-low_risk { background: var(--accent-blue-dim); color: var(--accent-blue); }
.badge-suspicious { background: var(--accent-orange-dim); color: var(--accent-orange); }
.badge-critical { background: var(--accent-red-dim); color: var(--accent-red); }
.badge-high { background: var(--accent-orange-dim); color: var(--accent-orange); }
.badge-medium { background: var(--accent-blue-dim); color: var(--accent-blue); }
.badge-low { background: var(--accent-green-dim); color: var(--accent-green); }

/* ======================== RESULTS ======================== */
.result-summary {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.result-stat {
  text-align: center;
}

.result-stat .value {
  font-size: 24px;
  font-weight: 700;
  display: block;
}

.result-stat .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finding-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all var(--transition);
}

.finding-item:hover {
  border-color: var(--border-light);
}

.finding-severity {
  width: 4px;
  min-height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

.finding-severity.critical { background: var(--accent-red); }
.finding-severity.high { background: var(--accent-orange); }
.finding-severity.medium { background: var(--accent-blue); }
.finding-severity.low { background: var(--accent-green); }

.finding-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.finding-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.finding-match {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 4px;
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  color: var(--accent-red);
  word-break: break-all;
}

.no-findings {
  text-align: center;
  padding: 32px;
  color: var(--accent-green);
  font-size: 15px;
  font-weight: 600;
}

/* ======================== RISK METER ======================== */
.risk-meter {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.risk-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.3s ease;
}

/* ======================== ACTIVITY FEED ======================== */
.activity-feed {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-dot.info { background: var(--accent-blue); }
.activity-dot.low_risk { background: var(--accent-green); }
.activity-dot.suspicious { background: var(--accent-orange); }
.activity-dot.critical { background: var(--accent-red); }

.activity-time {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  font-size: 14px;
}

/* ======================== ATTACK GRID ======================== */
.attack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.attack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.attack-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.15);
}

.attack-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px;
}

.attack-icon.red { background: var(--accent-red-dim); color: var(--accent-red); }
.attack-icon.orange { background: var(--accent-orange-dim); color: var(--accent-orange); }
.attack-icon.purple { background: var(--accent-purple-dim); color: var(--accent-purple); }

.attack-card h4 {
  font-size: 14px;
  margin-bottom: 6px;
}

.attack-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* ======================== SIMULATION REPORT ======================== */
.sim-section {
  margin-bottom: 20px;
}

.sim-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sim-payload {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent-red);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.sim-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sim-meta-item {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.sim-meta-item .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sim-meta-item .value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.mitigation-list {
  list-style: none;
}

.mitigation-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mitigation-list li:last-child { border-bottom: none; }

.mitigation-list li::before {
  content: '\2713';
  color: var(--accent-green);
  font-weight: 700;
  flex-shrink: 0;
}

/* ======================== POLICIES ======================== */
.policy-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.policy-item:hover { border-color: var(--border-light); }

.policy-info { flex: 1; }

.policy-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.policy-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.policy-pattern {
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  color: var(--accent-purple);
  background: var(--accent-purple-dim);
  padding: 2px 8px;
  border-radius: 3px;
  margin-top: 4px;
  display: inline-block;
}

.policy-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 11px;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  left: 3px;
  top: 3px;
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ======================== RECOMMENDATIONS ======================== */
.recommendations {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.recommendations h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-green);
  margin-bottom: 10px;
}

.rec-list {
  list-style: none;
}

.rec-list li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rec-list li::before {
  content: '\2794';
  color: var(--accent-blue);
  flex-shrink: 0;
}

/* ======================== QUANTUM ======================== */
.quantum-info-banner {
  border-left: 4px solid var(--accent-purple);
}

.quantum-info-banner strong {
  color: var(--accent-purple);
}

.quantum-readiness-panel {
  margin-bottom: 20px;
}

.readiness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.readiness-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.readiness-card .value {
  font-size: 28px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.readiness-card .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.readiness-bar {
  height: 12px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}

.readiness-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-orange), var(--accent-green));
}

.readiness-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.algo-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.algo-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.algo-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.algo-table tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

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

/* ======================== DATA TABLE ======================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(59, 130, 246, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ======================== FILTER GROUP ======================== */
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ======================== SCROLLBAR ======================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ======================== UTILITIES ======================== */
.hidden { display: none !important; }

.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .sim-meta { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .attack-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .attack-grid { grid-template-columns: 1fr; }
}

/* ======================== FORM FIELDS (shared) ======================== */
.calc-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.calc-field select,
.calc-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}
.calc-field select:focus,
.calc-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ======================== ENTERPRISE ======================== */
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: var(--transition);
}
.onboarding-step:hover { border-color: var(--accent-blue); }
.onboarding-step .step-check {
  font-size: 24px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.onboarding-step .step-info { flex: 1; }
.onboarding-step .step-info h4 { font-size: 14px; margin-bottom: 2px; }
.onboarding-step .step-info p { font-size: 12px; color: var(--text-muted); }
.onboarding-step.completed { opacity: 0.6; border-color: var(--accent-green); }
.onboarding-step.completed .step-check { color: var(--accent-green); }

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 600px) {
  .onboarding-steps { grid-template-columns: 1fr; }
}

.onboarding-step .step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-step .step-content { flex: 1; min-width: 0; }
.onboarding-step .step-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.onboarding-step .step-content p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.4; }
.onboarding-lang.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

.sso-provider-card {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
}
.sso-provider-card:hover { border-color: var(--accent-blue); }
.sso-provider-card h4 { font-size: 14px; margin-bottom: 8px; }

.attack-category-title {
  font-size: 15px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ======================== TOAST NOTIFICATIONS ======================== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 420px;
  word-break: break-word;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-message { color: var(--text-secondary); }
.toast-close {
  flex-shrink: 0; background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 16px; padding: 0; line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }
.toast.toast-success { border-left: 3px solid var(--accent-green); }
.toast.toast-error { border-left: 3px solid var(--accent-red); }
.toast.toast-warning { border-left: 3px solid var(--accent-orange); }
.toast.toast-info { border-left: 3px solid var(--accent-blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ======================== SIDEBAR SEARCH & FAVORITES ======================== */
.sidebar-search {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.sidebar-search input:focus { border-color: var(--accent-blue); }
.sidebar-search-wrap {
  position: relative;
}
.sidebar-search-wrap::before {
  content: "\1F50D";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
}
.nav-link .pin-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-link:hover .pin-btn { display: inline-block; }
.nav-link .pin-btn.pinned { display: inline-block; color: var(--accent-orange); }
.nav-favorites {
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.nav-favorites-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-left: 8px;
}
.nav-link.hidden-by-search { display: none !important; }
.nav-group.hidden-by-search { display: none !important; }

/* ======================== ONBOARDING ENHANCEMENTS ======================== */
.onboarding-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.onboarding-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.onboarding-progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.onboarding-tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-tour-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  text-align: center;
  box-shadow: var(--shadow);
}
.onboarding-tour-card h3 { font-size: 20px; margin-bottom: 12px; }
.onboarding-tour-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.onboarding-tour-card .btn { margin: 0 6px; }

/* ======================== UNIFIED FINDINGS ======================== */
.unified-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.unified-toolbar input,
.unified-toolbar select {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
}
.unified-toolbar input { flex: 1; min-width: 200px; }
.unified-count { font-size: 12px; color: var(--text-muted); }
.dedup-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  font-size: 11px;
  font-weight: 600;
}

/* ======================== JIRA INTEGRATION ======================== */
.jira-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.jira-status-dot.connected { background: var(--accent-green); }
.jira-status-dot.disconnected { background: var(--accent-red); }

/* ======================== COMPLIANCE DASHBOARDS ======================== */
.mttr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.mttr-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.mttr-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.mttr-label { font-size: 12px; color: var(--text-muted); }
.trend-chart {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 0;
}
.trend-bar {
  flex: 1;
  background: var(--accent-blue);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
  position: relative;
}
.trend-bar:hover { opacity: 0.8; }
.trend-bar .trend-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.trend-bar:hover .trend-tooltip { display: block; }
.compliance-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.compliance-framework {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.compliance-framework h4 { font-size: 14px; margin-bottom: 8px; }
.compliance-score-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  margin: 0 auto 8px;
}
.compliance-controls-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.compliance-controls-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ======================== ASSET INVENTORY ENHANCEMENTS ======================== */
.asset-discovery-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.asset-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.asset-source-badge.github { background: rgba(110,84,148,0.2); color: #c9a0dc; }
.asset-source-badge.manual { background: var(--accent-blue-dim); color: var(--accent-blue); }
.asset-dep-count {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-input);
}

/* ======================== WORKFLOW AUTOMATION ======================== */
.workflow-rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.workflow-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.workflow-rule-icon { font-size: 20px; flex-shrink: 0; }
.workflow-rule-info { flex: 1; }
.workflow-rule-info h4 { font-size: 13px; margin-bottom: 2px; }
.workflow-rule-info p { font-size: 12px; color: var(--text-muted); }
.workflow-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.workflow-toggle input { opacity: 0; width: 0; height: 0; }
.workflow-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.workflow-toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.workflow-toggle input:checked + .workflow-toggle-slider { background: var(--accent-green); }
.workflow-toggle input:checked + .workflow-toggle-slider::before { transform: translateX(16px); }

/* ======================== INTELLIGENCE GRAPH ======================== */
.intel-graph-container {
  width: 100%;
  height: 500px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.intel-graph-canvas {
  width: 100%;
  height: 100%;
}
.intel-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.intel-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.intel-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.intel-node-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  display: none;
}
.intel-node-panel.visible { display: block; }
.intel-stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.intel-stat {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.intel-stat-value { font-size: 24px; font-weight: 700; }
.intel-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ======================== EMPTY STATES ======================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc { font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.empty-state .btn { font-size: 13px; }

/* ======================== LOADING SKELETON ======================== */
.skeleton-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-cell {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-loading { position: relative; min-height: 100px; }

/* ======================== NOTIFICATION BELL ======================== */
.notif-bell {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 10px;
  transition: var(--transition);
}
.notif-bell:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 440px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.notif-header button { background: none; border: none; color: var(--accent-blue); cursor: pointer; font-size: 12px; }
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
  font-size: 12px;
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { border-left: 3px solid var(--accent-blue); }
.notif-item-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.notif-item-body { flex: 1; }
.notif-item-title { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-item-desc { color: var(--text-muted); line-height: 1.4; }
.notif-item-time { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

/* ======================== KEYBOARD SHORTCUTS MODAL ======================== */
.kbd-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10001;
  display: flex; align-items: center; justify-content: center;
}
.kbd-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  max-width: 520px; width: 90%;
  box-shadow: var(--shadow);
  max-height: 80vh; overflow-y: auto;
}
.kbd-modal h3 { font-size: 16px; margin-bottom: 16px; }
.kbd-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.kbd-row:last-child { border-bottom: none; }
kbd {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
}

/* ======================== THEME TOGGLE ======================== */
.theme-toggle-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px;
  font-size: 12px; color: var(--text-muted);
  justify-content: center;
  padding-left: 40px;
}
.theme-toggle-wrap label { cursor: pointer; }

/* Light theme overrides */
body.light-theme {
  --bg: #f5f7fa;
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --card-bg: #ffffff;
  --bg-card-hover: #f0f2f5;
  --bg-input: #f0f2f5;
  --border: #d1d9e6;
  --border-light: #c0c9db;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* ======================== MOBILE HAMBURGER ======================== */
.mobile-hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 20px;
  box-shadow: var(--shadow);
}

/* ======================== ROLE SELECTOR ======================== */
.role-selector {
  display: flex; gap: 6px;
  padding: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.role-btn {
  padding: 5px 12px;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.role-btn.active {
  background: var(--accent-blue);
  color: #fff;
}
.role-btn:hover:not(.active) { color: var(--text-primary); }

/* ======================== AI TRIAGE ======================== */
.triage-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.triage-verdict {
  flex-shrink: 0;
  width: 72px; text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
}
.triage-verdict.true-positive { background: var(--accent-red-dim); color: var(--accent-red); }
.triage-verdict.false-positive { background: var(--accent-green-dim); color: var(--accent-green); }
.triage-verdict.needs-review { background: var(--accent-orange-dim); color: var(--accent-orange); }
.triage-body { flex: 1; }
.triage-body h4 { font-size: 14px; margin-bottom: 4px; }
.triage-body p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.triage-reasoning {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-left: 3px solid var(--accent-purple);
}
.triage-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.triage-actions .btn {
  margin-top: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
}
.triage-actions .btn-primary {
  margin-top: 0;
  background: var(--accent-blue);
  color: #fff;
}
.triage-actions .btn-outline {
  margin-top: 0;
}
.triage-actions .btn-danger {
  margin-top: 0;
  background: var(--accent-red-dim);
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.triage-confidence {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted);
}
.confidence-bar {
  width: 60px; height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  border-radius: 2px;
}

/* ======================== SBOM DEP GRAPH ======================== */
.dep-graph-container {
  width: 100%; height: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.dep-graph-canvas { width: 100%; height: 100%; }

/* ======================== NOISE COLLAPSE ======================== */
.noise-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.noise-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.noise-stat-value { font-size: 22px; font-weight: 700; }
.noise-stat-label { font-size: 11px; color: var(--text-muted); }
.noise-pattern {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}

/* ======================== AUDIT DIFF ======================== */
.diff-block {
  font-family: monospace;
  font-size: 12px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-top: 6px;
}
.diff-add { color: var(--accent-green); }
.diff-remove { color: var(--accent-red); }
.audit-entry {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.audit-entry:hover { background: var(--bg-card-hover); }
.audit-entry-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.audit-entry-user { font-weight: 600; font-size: 13px; }
.audit-entry-time { font-size: 11px; color: var(--text-muted); }
.audit-entry-action { font-size: 12px; color: var(--text-secondary); }

/* ======================== CHARTS (canvas-rendered) ======================== */
.chart-canvas { width: 100%; height: 220px; }
.donut-chart { width: 180px; height: 180px; margin: 0 auto; }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  margin-top: 12px;
}
.chart-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
}
.chart-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ======================== EXPORT TOOLBAR ======================== */
.export-toolbar {
  display: flex; gap: 8px;
  margin-bottom: 12px;
}
.export-toolbar .btn { font-size: 12px; padding: 5px 12px; margin-top: 0; }
.share-link-box {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.share-link-box input {
  flex: 1; background: none; border: none;
  color: var(--text-primary); font-size: 12px;
  outline: none;
}

/* ======================== IDE EXTENSIONS ======================== */
.ide-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ide-card {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}
.ide-card:hover { border-color: var(--accent-blue); }
.ide-card-icon { font-size: 36px; margin-bottom: 12px; }
.ide-card h4 { font-size: 14px; margin-bottom: 6px; }
.ide-card p { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ======================== COMMAND PALETTE (Cmd+K) ======================== */
.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10002;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
}
.cmdk-container {
  width: 560px;
  max-width: 92vw;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.cmdk-input-wrap {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-wrap span { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
.cmdk-input {
  flex: 1;
  padding: 14px 12px;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
}
.cmdk-input::placeholder { color: var(--text-muted); }
.cmdk-results {
  max-height: 360px;
  overflow-y: auto;
}
.cmdk-group-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.1s;
}
.cmdk-item:hover,
.cmdk-item.selected { background: var(--accent-blue-dim); }
.cmdk-item-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.cmdk-item-label { flex: 1; }
.cmdk-item-hint { font-size: 11px; color: var(--text-muted); }
.cmdk-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}
.cmdk-footer kbd { margin: 0 2px; }

/* ======================== AGENTIC REMEDIATION ======================== */
.agent-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.agent-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: agentPulse 2s infinite;
}
.agent-pulse.idle { background: var(--text-muted); animation: none; }
.agent-pulse.error { background: var(--accent-red); animation: none; }
@keyframes agentPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.agent-log {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.7;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 320px;
  overflow-y: auto;
  color: var(--text-secondary);
}
.agent-log-entry { padding: 2px 0; }
.agent-log-entry .timestamp { color: var(--text-muted); }
.agent-log-entry .action { color: var(--accent-blue); }
.agent-log-entry .success { color: var(--accent-green); }
.agent-log-entry .reasoning { color: var(--accent-purple); }
.agent-log-entry .error { color: var(--accent-red); }

/* ======================== SECURITY POSTURE GAUGE ======================== */
.posture-gauge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.posture-gauge {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.posture-gauge svg { transform: rotate(-90deg); }
.posture-gauge-bg {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 12;
}
.posture-gauge-fill {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}
.posture-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.posture-score-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.posture-score-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.posture-score-grade {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 10px;
}
.posture-details {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.posture-detail {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.posture-detail-value {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}
.posture-detail-label {
  font-size: 11px;
  color: var(--text-muted);
}
.posture-detail-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.posture-detail-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
@media (max-width: 768px) {
  .posture-gauge-card { flex-direction: column; text-align: center; }
  .posture-details { grid-template-columns: 1fr; }
}

/* ======================== ERROR RETRY ======================== */
.error-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--accent-red);
}
.error-state-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.6; }
.error-state-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.error-state-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.error-state .btn { margin-top: 0; }

/* ======================== AUTH SUBTABS ======================== */
.auth-subtab {
  padding: 10px 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.auth-subtab:hover { color: var(--text-primary); }
.auth-subtab.active {
  color: var(--accent-blue);
}
.auth-subtab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px 2px 0 0;
}

/* ======================== FINDING DETAIL DRAWER ======================== */
.finding-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9500;
}
.finding-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 520px;
  max-width: 92vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  z-index: 9501;
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 0.25s ease;
}
@keyframes drawerSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.finding-drawer.closing { animation: drawerSlideOut 0.2s ease forwards; }
@keyframes drawerSlideOut { from { transform: translateX(0); } to { transform: translateX(100%); } }
.drawer-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3 { font-size: 16px; margin-bottom: 4px; }
.drawer-header-sub { font-size: 12px; color: var(--text-muted); }
.drawer-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 0;
}
.drawer-close:hover { color: var(--text-primary); }
.drawer-body {
  flex: 1; overflow-y: auto; padding: 20px 24px;
}
.drawer-section { margin-bottom: 20px; }
.drawer-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); margin-bottom: 8px;
}
.drawer-field {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.drawer-field:last-child { border-bottom: none; }
.drawer-field-label { color: var(--text-muted); }
.drawer-field-value { color: var(--text-primary); font-weight: 500; text-align: right; }
.drawer-timeline { position: relative; padding-left: 20px; }
.drawer-timeline::before {
  content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.drawer-timeline-item {
  position: relative; margin-bottom: 12px; font-size: 12px;
}
.drawer-timeline-item::before {
  content: ''; position: absolute; left: -19px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-blue); border: 2px solid var(--bg-card);
}
.drawer-timeline-item .time { color: var(--text-muted); font-size: 11px; }
.drawer-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
  flex-wrap: wrap;
}
.drawer-actions .btn { margin-top: 0; }

/* ======================== SAVED FILTERS ======================== */
.saved-filters-bar {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 10px; flex-wrap: wrap;
}
.saved-filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}
.saved-filter-chip:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.saved-filter-chip.active { background: var(--accent-blue-dim); border-color: var(--accent-blue); color: var(--accent-blue); }
.saved-filter-chip .remove-filter {
  margin-left: 2px; font-size: 14px; color: var(--text-muted);
  cursor: pointer; line-height: 1;
}
.saved-filter-chip .remove-filter:hover { color: var(--accent-red); }
.save-filter-btn {
  background: none; border: 1px dashed var(--border);
  border-radius: 12px; padding: 4px 10px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
}
.save-filter-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

/* ======================== CUSTOMIZATION FEATURES ======================== */

/* Posture weight config */
.weight-config {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-top: 12px;
}
.weight-row {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
}
.weight-row label { flex: 1; color: var(--text-secondary); }
.weight-row input[type="range"] { flex: 2; accent-color: var(--accent-blue); }
.weight-row .weight-val { width: 36px; text-align: right; font-weight: 600; color: var(--text-primary); }

/* Alert thresholds */
.alert-config {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.alert-config-item { display: flex; flex-direction: column; gap: 4px; }
.alert-config-item label { font-size: 11px; color: var(--text-muted); }
.alert-config-item input {
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-primary); font-size: 13px;
}

/* Burn-down chart */
.burndown-chart {
  width: 100%; height: 200px; position: relative;
  border-left: 2px solid var(--border); border-bottom: 2px solid var(--border);
  margin: 12px 0;
}
.burndown-line {
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 100%;
}
.burndown-area {
  fill: rgba(59,130,246,0.1);
  stroke: var(--accent-blue);
  stroke-width: 2;
}
.burndown-target {
  stroke: var(--accent-green);
  stroke-width: 1;
  stroke-dasharray: 6 4;
}

/* Dashboard snapshot */
.snapshot-toolbar {
  display: flex; gap: 8px; margin-bottom: 12px;
}

/* Custom KPIs */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.kpi-card {
  padding: 14px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: center;
}
.kpi-value { font-size: 24px; font-weight: 700; margin-bottom: 2px; }
.kpi-label { font-size: 11px; color: var(--text-muted); }
.kpi-trend { font-size: 11px; margin-top: 4px; }
.kpi-trend.up { color: var(--accent-green); }
.kpi-trend.down { color: var(--accent-red); }

/* Drag-and-drop widget reorder */
.widget-draggable { cursor: grab; position: relative; }
.widget-draggable.dragging { opacity: 0.5; cursor: grabbing; }
.widget-drag-handle {
  position: absolute; top: 8px; right: 8px;
  color: var(--text-muted); font-size: 14px;
  cursor: grab; padding: 4px; z-index: 2;
  opacity: 0; transition: opacity 0.2s;
}
.widget-draggable:hover .widget-drag-handle { opacity: 1; }
.widget-drop-zone {
  border: 2px dashed var(--accent-blue); border-radius: var(--radius);
  min-height: 60px; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 13px;
}

/* Sub-tab navigation */
.subtab-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Custom compliance */
.compliance-add-form {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px; align-items: end; margin-top: 12px;
}
.compliance-add-form input, .compliance-add-form select {
  padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-primary); font-size: 13px;
}

/* ======================== GDPR / DATA EXPORT ======================== */
.gdpr-export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.btn-danger-outline {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: transparent;
}
.btn-danger-outline:hover {
  background: var(--accent-red-dim);
}

/* ======================== REPORT GENERATOR ======================== */
.report-generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.digest-config {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.digest-config .calc-field { flex: 1; min-width: 200px; }

/* ======================== RESPONSIVE — ALL FEATURES ======================== */
@media (max-width: 1024px) {
  .ide-grid { grid-template-columns: repeat(2, 1fr); }
  .noise-stats { grid-template-columns: repeat(2, 1fr); }
  .compliance-map { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .mttr-grid { grid-template-columns: repeat(2, 1fr); }
  .compliance-map { grid-template-columns: 1fr; }
  .compliance-add-form { grid-template-columns: 1fr; }
  .report-generator-grid { grid-template-columns: 1fr; }
  .gdpr-export-grid { grid-template-columns: 1fr; }
  .digest-config { flex-direction: column; }
  .digest-config .calc-field { min-width: 0; width: 100%; }
  .intel-graph-container { height: 350px; }
  .intel-node-panel { width: 100%; position: relative; top: auto; right: auto; margin-top: 12px; }
  .mobile-hamburger { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding-top: 48px; }
  .ide-grid { grid-template-columns: 1fr; }
  .notif-dropdown { width: 300px; right: -60px; }
  .kbd-modal { padding: 16px 20px; }
  .noise-stats { grid-template-columns: 1fr 1fr; }
}
