/* ===== AI COMPLIANCE LEDGER — STYLES ===== */

:root {
  --bg: #0B0F19;
  --surface: #111827;
  --surface-2: #1A2234;
  --border: #1F2937;
  --border-light: #374151;
  --text: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --accent: #3B82F6;
  --accent-dim: #1E3A5F;
  --verified: #10B981;
  --verified-dim: #064E3B;
  --warning: #F59E0B;
  --warning-dim: #78350F;
  --error: #EF4444;
  --error-dim: #7F1D1D;
  --chain: #6366F1;
  --chain-dim: #2D2A5E;
  --sidebar-w: 240px;
  --sidebar-collapsed: 64px;
  --topbar-h: 56px;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
}

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

html { font-size: 14px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ===== APP SHELL ===== */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 250ms ease, min-width 250ms ease;
  overflow: hidden;
  position: relative;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .chain-status-text,
.sidebar.collapsed .cs-label { display: none; }

.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .chain-status-badge { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .verify-btn { display: none; }

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.logo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 2px;
  white-space: nowrap;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  transition: color 150ms, background 150ms;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover { color: var(--text); background: var(--surface-2); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 150ms, color 150ms;
  position: relative;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.chain-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

.chain-dot.verified { background: var(--verified); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.chain-dot.pending { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.chain-dot.error { background: var(--error); box-shadow: 0 0 6px rgba(239,68,68,0.5); animation: pulse 2s infinite; }

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

.chain-status-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cs-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; white-space: nowrap; }
.cs-value { font-size: 11px; font-weight: 600; color: var(--verified); white-space: nowrap; }

.verify-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  flex-shrink: 0;
  transition: all 150ms;
}

.verify-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== TOP BAR ===== */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
}

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

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.bc-item { color: var(--text-muted); }
.bc-item:hover { color: var(--text); cursor: pointer; }
.bc-sep { color: var(--border-light); }
.bc-current { color: var(--text); font-weight: 600; }

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-muted);
  transition: border-color 150ms;
}

.search-box:focus-within { border-color: var(--accent); color: var(--accent); }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  width: 220px;
}

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

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  transition: all 150ms;
}

.icon-btn:hover { border-color: var(--border-light); color: var(--text); }

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--surface);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color 150ms;
  font-family: var(--font-mono);
}

.user-avatar:hover { border-color: var(--accent); }

/* ===== PAGE SYSTEM ===== */
.page {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  gap: 20px;
}

.page.active { display: flex; }

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

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

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

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 150ms;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover { background: #2563EB; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-light); }

.btn-danger {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-danger:hover { background: #DC2626; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-blue { background: var(--accent-dim); color: var(--accent); }
.badge-green { background: var(--verified-dim); color: var(--verified); }
.badge-amber { background: var(--warning-dim); color: var(--warning); }
.badge-red { background: var(--error-dim); color: var(--error); }
.badge-indigo { background: var(--chain-dim); color: var(--chain); }
.badge-gray { background: #1F2937; color: var(--text-muted); }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 150ms;
}

.kpi-card:hover { border-color: var(--border-light); }

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px; }

.kpi-value { font-size: 28px; font-weight: 800; font-family: var(--font-mono); color: var(--text); line-height: 1.1; }

.kpi-change { font-size: 11px; color: var(--text-secondary); }
.kpi-change.positive { color: var(--verified); }
.kpi-change.negative { color: var(--error); }

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== CHAIN VISUALIZATION ===== */
.chain-viz {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 12px 0;
  min-height: 60px;
}

.chain-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chain-node-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  border: 2px solid;
  cursor: pointer;
  transition: transform 150ms;
}

.chain-node-circle:hover { transform: scale(1.1); }
.chain-node-circle.verified { background: var(--verified-dim); border-color: var(--verified); color: var(--verified); }
.chain-node-circle.pending { background: var(--warning-dim); border-color: var(--warning); color: var(--warning); }
.chain-node-circle.error { background: var(--error-dim); border-color: var(--error); color: var(--error); }

.chain-node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

.chain-connector {
  width: 24px;
  height: 2px;
  background: var(--border-light);
  flex-shrink: 0;
  position: relative;
  margin-bottom: 22px;
}

.chain-connector::after {
  content: '';
  position: absolute;
  right: -3px;
  top: -2px;
  width: 0;
  height: 0;
  border-left: 5px solid var(--border-light);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.chain-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.chain-stat { display: flex; flex-direction: column; gap: 2px; }
.chain-stat .cs-label { font-size: 10px; color: var(--text-muted); }
.chain-stat .cs-value { font-size: 12px; color: var(--text); font-weight: 500; }

/* ===== FRAMEWORK CHART ===== */
.framework-chart {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}

.framework-donut {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.framework-donut svg {
  transform: rotate(-90deg);
  width: 100px;
  height: 100px;
}

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

.donut-center-value { font-size: 18px; font-weight: 800; font-family: var(--font-mono); color: var(--text); }
.donut-center-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.framework-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-label { color: var(--text-secondary); flex: 1; }
.legend-count { font-family: var(--font-mono); font-weight: 600; color: var(--text); }

/* ===== COMPLIANCE SCORES ===== */
.compliance-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.compliance-score-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
  letter-spacing: 0.5px;
}

.cs-badge.gdpr { background: #1E3A5F; color: #60A5FA; }
.cs-badge.cfpb { background: #1F3A3A; color: #34D399; }
.cs-badge.eeoc { background: #3D2A1A; color: #FCD34D; }
.cs-badge.eu_ai_act { background: #2D2A5E; color: #A5B4FC; }

.cs-title { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 4px; }

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 600ms ease;
}

.progress-fill.gdpr { background: #3B82F6; }
.progress-fill.cfpb { background: #10B981; }
.progress-fill.eeoc { background: #F59E0B; }
.progress-fill.eu_ai_act { background: #6366F1; }

.cs-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.cs-meta strong { color: var(--text); font-family: var(--font-mono); }

/* ===== MINI TABLE ===== */
.mini-table { overflow-x: auto; }

.mini-table table { width: 100%; border-collapse: collapse; }

.mini-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mini-table td {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.mini-table tr:last-child td { border-bottom: none; }
.mini-table tr:hover td { background: var(--surface-2); color: var(--text); cursor: pointer; }

/* ===== AGENT STATUS LIST ===== */
.agent-status-list { display: flex; flex-direction: column; gap: 8px; }

.agent-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

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

.agent-dot.active { background: var(--verified); }
.agent-dot.inactive { background: var(--text-muted); }

.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-meta { font-size: 10px; color: var(--text-muted); }
.agent-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }

/* ===== AGENTS GRID ===== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 150ms;
}

.agent-card:hover { border-color: var(--border-light); }

.agent-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-card-name { font-size: 15px; font-weight: 600; color: var(--text); }
.agent-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.agent-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.agent-stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.agent-stat-value { font-size: 16px; font-weight: 700; font-family: var(--font-mono); color: var(--text); }
.agent-stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.agent-card-actions { display: flex; gap: 8px; }
.agent-card-actions .btn { flex: 1; justify-content: center; font-size: 12px; }

/* ===== DATA TABLE ===== */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text); }

.sort-icon { opacity: 0.4; font-size: 10px; }

.data-table td {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr { transition: background 150ms; cursor: pointer; }
.data-table tbody tr:hover td { background: #1a2233; color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.table-count { font-size: 12px; color: var(--text-muted); }

.pagination { display: flex; align-items: center; gap: 4px; }

.page-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 150ms;
}

.page-btn:hover { background: var(--surface-2); color: var(--text); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }

/* ===== INPUTS ===== */
.input, .input-sm, select.input, select.select-sm {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 150ms;
}

.input:focus, .input-sm:focus, select.input:focus, select.select-sm:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }
.input[readonly] { opacity: 0.6; cursor: not-allowed; }
.input-sm, select.select-sm { font-size: 12px; padding: 5px 8px; }

select.input, select.select-sm {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

select.input option, select.select-sm option { background: var(--surface); color: var(--text); }

textarea.input { resize: vertical; min-height: 60px; }

.input-with-action { display: flex; align-items: center; gap: 8px; }
.input-with-action .input { flex: 1; }
.input-with-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.input-sm { max-width: 160px; }

/* ===== CODE BLOCKS ===== */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.code-lang { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.code-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 150ms;
}

.code-copy:hover { color: var(--text); background: var(--surface-2); }

.code-content, pre {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #A5B4FC;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.sdk-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.sdk-note svg { color: var(--chain); flex-shrink: 0; margin-top: 1px; }

/* ===== FRAMEWORK CARDS ===== */
.framework-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.framework-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 150ms;
}

.framework-card:hover { border-color: var(--border-light); background: var(--surface-2); transform: translateY(-1px); }

.fw-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.fw-badge.gdpr { background: #1E3A5F; color: #60A5FA; }
.fw-badge.cfpb { background: #1F3A3A; color: #34D399; }
.fw-badge.eeoc { background: #3D2A1A; color: #FCD34D; }
.fw-badge.eu_ai_act { background: #2D2A5E; color: #A5B4FC; }

.framework-card h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.framework-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }

.fw-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ===== REPORTS LIST ===== */
.reports-list { display: flex; flex-direction: column; gap: 8px; }

.report-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.report-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-icon.gdpr { background: #1E3A5F; color: #60A5FA; }
.report-icon.cfpb { background: #1F3A3A; color: #34D399; }
.report-icon.eeoc { background: #3D2A1A; color: #FCD34D; }
.report-icon.eu_ai_act { background: #2D2A5E; color: #A5B4FC; }

.report-info { flex: 1; min-width: 0; }
.report-title { font-size: 13px; font-weight: 500; color: var(--text); }
.report-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 12px; }
.report-actions { display: flex; gap: 8px; align-items: center; }

/* ===== DECISION DETAIL ===== */
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 150ms;
}

.detail-section-header:hover { background: #1F2A3D; }

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-body { padding: 16px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.detail-field { display: flex; flex-direction: column; gap: 2px; }
.detail-field-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; }
.detail-field-value { font-size: 13px; color: var(--text); word-break: break-all; }

.hash-display {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--chain);
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid var(--chain-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 150ms;
}

.hash-display:hover { background: var(--chain-dim); }

.copy-icon { opacity: 0.5; }
.hash-display:hover .copy-icon { opacity: 1; }

.json-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #A5B4FC;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}

.tool-call-list { display: flex; flex-direction: column; gap: 12px; }

.tool-call-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tool-call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
}

.tool-call-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.tool-call-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.tool-call-body { padding: 10px 12px; }

.tool-call-body-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.tool-call-body-row:last-child { margin-bottom: 0; }
.tool-call-body-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }

.decision-chain-display {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}

.dchain-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.dchain-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--chain-dim);
  border: 2px solid var(--chain);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--chain);
  font-weight: 600;
}

.dchain-label {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
  max-width: 60px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dchain-connector {
  width: 20px;
  height: 2px;
  background: var(--border-light);
  margin-bottom: 22px;
  flex-shrink: 0;
}

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.settings-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-hint { font-size: 11px; color: var(--text-muted); }

.checkbox-group { display: flex; flex-direction: column; gap: 6px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.checkbox-label input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }

.checkbox-column { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; border: 1px solid var(--border); padding: 8px; border-radius: var(--radius-sm); }

.toggle-wrapper { display: flex; align-items: center; gap: 10px; }

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 10px;
  transition: background 200ms;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 200ms;
}

.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.toggle-label { font-size: 13px; color: var(--text-secondary); }

.danger-zone { display: flex; flex-direction: column; gap: 0; }

.danger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.danger-item:last-child { border-bottom: none; }
.danger-item strong { font-size: 13px; color: var(--text); display: block; margin-bottom: 2px; }
.danger-desc { font-size: 12px; color: var(--text-muted); }

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal.open { display: flex; }

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: all 150ms;
}

.modal-close:hover { color: var(--text); background: var(--surface-2); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  font-size: 13px;
  color: var(--text);
  max-width: 360px;
  pointer-events: auto;
  animation: slideIn 250ms ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--verified); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.warning { border-left: 3px solid var(--warning); }

.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--verified); }
.toast.error .toast-icon { color: var(--error); }
.toast.info .toast-icon { color: var(--accent); }
.toast.warning .toast-icon { color: var(--warning); }

/* ===== VERIFICATION PROGRESS ===== */
.verify-progress { display: flex; flex-direction: column; gap: 8px; }

.vp-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.vp-fill {
  height: 100%;
  background: var(--verified);
  border-radius: 4px;
  transition: width 300ms ease;
  width: 0%;
}

.vp-label { font-size: 12px; color: var(--text-secondary); text-align: center; font-family: var(--font-mono); }

.verify-result {
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.verify-result.success { background: var(--verified-dim); border: 1px solid var(--verified); }
.verify-result.error { background: var(--error-dim); border: 1px solid var(--error); }

/* ===== MISC ===== */
.mono { font-family: var(--font-mono); }
.hash-short { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.link-sm { font-size: 12px; color: var(--accent); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }

/* ===== SKELETON ===== */
.skeleton-block {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.verified { background: var(--verified-dim); color: var(--verified); }
.status-badge.pending { background: var(--warning-dim); color: var(--warning); }
.status-badge.error { background: var(--error-dim); color: var(--error); }
.status-badge.inactive { background: var(--surface-2); color: var(--text-muted); }
.status-badge.active { background: var(--verified-dim); color: var(--verified); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .framework-info-grid { grid-template-columns: repeat(2, 1fr); }
  .compliance-scores { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .framework-info-grid { grid-template-columns: 1fr; }
  .compliance-scores { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .page-header { flex-direction: column; }
}
