/* ── Reset & base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #dee2e6;
  --text: #212529;
  --text-muted: #6c757d;
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --danger: #dc3545;
  --danger-light: #f8d7da;
  --warn-light: #fff3cd;
  --high: #dc3545;
  --medium: #fd7e14;
  --low: #198754;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ──────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.5rem;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-links a {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.1s;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--bg);
  color: var(--text);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Layout ───────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Auth pages ───────────────────────────────── */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.auth-footer { margin-top: 1.25rem; font-size: 0.875rem; text-align: center; color: var(--text-muted); }

/* ── Forms ────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-wide { max-width: 720px; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

label { font-size: 0.875rem; font-weight: 500; color: var(--text); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.form-actions { margin-top: 0.5rem; display: flex; gap: 0.75rem; }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn-reviewed { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.btn-reviewed:hover { background: #dcfce7; border-color: #4ade80; text-decoration: none; color: #15803d; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #bb2d3b; text-decoration: none; color: #fff; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* ── Alerts ───────────────────────────────────── */
.alert {
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error   { background: var(--danger-light); color: #842029; border: 1px solid #f5c2c7; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ── Page headers ─────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-header h2 { font-size: 1.4rem; font-weight: 600; }
.page-actions { display: flex; gap: 0.5rem; align-items: center; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }
.org-name { font-size: 0.875rem; color: var(--text-muted); }

/* ── Dashboard hero ───────────────────────────── */
.dash-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

/* Gauge panel */
.dash-gauge-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dash-gauge-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
  margin-bottom: 0.25rem;
}

.dash-gauge-svg {
  width: 100%;
  max-width: 300px;
}

/* Distribution panel */
.dash-dist-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dash-dist-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1rem 0;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.dist-label {
  width: 54px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.dist-track {
  flex: 1;
  height: 18px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.dist-bar {
  height: 100%;
  border-radius: 3px;
  min-width: 2px;
  transition: width 0.4s ease;
}

.dist-high   { background: #fca5a5; }
.dist-medium { background: #fde68a; }
.dist-low    { background: #86efac; }

.dist-count {
  width: 28px;
  text-align: right;
  font-weight: 700;
  color: var(--text);
}

.dist-pct {
  width: 36px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dash-dist-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Stat row ─────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s;
}

.dash-stat-card:hover { border-color: #adb5bd; text-decoration: none; }

.dash-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.dash-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.dash-stat-danger .dash-stat-value { color: var(--danger); }
.dash-stat-danger { border-color: #fecaca; }
.dash-stat-warn   .dash-stat-value { color: var(--medium); }
.dash-stat-warn   { border-color: #fde68a; }
.dash-stat-high   .dash-stat-value { color: var(--high); }
.dash-stat-high   { border-color: #fca5a5; }

/* ── Sections ─────────────────────────────────── */
.section { margin-top: 2rem; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.section h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.75rem; }
.section-title-danger { color: var(--danger); }
.section-title-warn { color: var(--medium); }

/* ── Table ────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}

.table th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f9fafb; }
.table-sm td, .table-sm th { padding: 0.45rem 0.7rem; }
.row-danger td { background: #fff5f5; }
.cell-overdue { color: var(--danger); font-weight: 600; }

/* ── Badges ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-high { background: #fde8e8; color: #9b1c1c; }
.badge-medium { background: #fef3cd; color: #92400e; }
.badge-low { background: #d1fae5; color: #065f46; }
.badge-status { background: #e9ecef; color: #495057; }
.badge-plan { background: #dbeafe; color: #1e40af; }
.badge-action { background: #f3f4f6; color: #374151; font-weight: 500; }

/* ── Risk detail ──────────────────────────────── */
.risk-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.risk-score { font-size: 0.85rem; color: var(--text-muted); margin-left: 0.25rem; }

.narrative-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.narrative-block p + p { margin-top: 0.5rem; }

/* detail-body: metadata list on left, matrix on right */
.detail-body {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}

.detail-grid {
  display: grid;
  gap: 0;
  flex: 1;
  max-width: 380px;
}

.detail-row {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-label {
  width: 110px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 500;
}

/* matrix inside detail-body: remove its own bottom margin */
.detail-body .matrix-wrap {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* ── Billing ──────────────────────────────────── */
.billing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 480px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.billing-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.billing-row:last-child { border-bottom: none; }
.billing-label { width: 160px; color: var(--text-muted); font-weight: 500; }
.billing-actions { display: flex; flex-direction: column; gap: 0.5rem; max-width: 240px; }

/* ── Risk matrix ──────────────────────────────── */
:root { --cell: 36px; }

.matrix-wrap {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0;   /* kill inline-block gaps */
}

/* Each horizontal strip is a flex row */
.matrix-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* Rotated "Likelihood" label — spans the grid height */
.matrix-ylabel {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: 14px;
  height: calc(4 * var(--cell));
  flex-shrink: 0;
}

/* Y-tick labels column — one div per row */
.matrix-yticks {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.matrix-yticks .matrix-tick {
  height: var(--cell);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.68rem;
  color: var(--text-muted);
  padding-right: 6px;
  white-space: nowrap;
  width: 54px;
}

/* The 4×4 coloured grid */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, var(--cell));
  grid-template-rows:    repeat(4, var(--cell));
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.matrix-cell {
  width: var(--cell);
  height: var(--cell);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.matrix-green  { background: #dcfce7; border-color: #bbf7d0; }
.matrix-yellow { background: #fef9c3; border-color: #fde68a; }
.matrix-red    { background: #fee2e2; border-color: #fecaca; }

.matrix-active {
  filter: brightness(0.84);
  border-color: #374151 !important;
  box-shadow: inset 0 0 0 2px #374151;
  position: relative;
  z-index: 1;
}

.matrix-x {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  user-select: none;
}

/* Second row: spacer + x-tick labels */
.matrix-bottom-row {
  align-items: flex-start;
}

/* Spacer must match ylabel width + yticks width */
.matrix-axis-spacer {
  width: calc(14px + 54px);
  flex-shrink: 0;
}

.matrix-xticks {
  display: flex;
  flex-direction: row;
  margin-top: 3px;
}

.matrix-xticks .matrix-tick {
  width: var(--cell);
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* "Impact" label centred under the grid */
.matrix-xlabel {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  /* indent by the combined width of ylabel + yticks columns */
  padding-left: calc(14px + 54px);
  margin-top: 1px;
  display: block;
}

/* Form: side-by-side layout */
.form-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.form-layout .form-wide {
  flex: 1;
  min-width: 0;
}

.form-matrix-panel {
  flex-shrink: 0;
  padding-top: 0.25rem;
}

.form-matrix-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.form-matrix-score {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ── Settings ─────────────────────────────────── */
.settings-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.settings-nav {
  flex-shrink: 0;
  width: 148px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  position: sticky;
  top: 1.5rem;
}

.settings-nav-link {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.settings-nav-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.settings-sections {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-section {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.settings-section-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 520px;
}

.settings-form { max-width: 420px; }

/* Toggle switch */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  max-width: 480px;
}

.settings-toggle-info { flex: 1; }

.settings-toggle-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.settings-toggle-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* The actual toggle */
.toggle { display: flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  width: 42px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle input:checked + .toggle-track { background: var(--primary); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }

/* Billing sub-section */
.settings-billing-grid {
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-billing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.settings-billing-row:last-child { border-bottom: none; }

.settings-billing-label { color: var(--text-muted); font-weight: 500; }

.settings-billing-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.75rem;
}

/* ── BAU ──────────────────────────────────────── */
.page-intro { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.bau-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.bau-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 820px; }

.bau-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow);
}
.bau-card:hover { border-color: #adb5bd; }
.bau-card-body { flex: 1; min-width: 0; }
.bau-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  display: block;
}
.bau-card-title:hover { text-decoration: underline; }
.bau-card-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

.bau-card-meta { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }
.bau-stat {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.5em;
}
.bau-stat-high { color: var(--high); border-color: #fca5a5; background: #fff5f5; }
.bau-stat-open { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }

.bau-link-form { display: flex; gap: 0.5rem; align-items: center; }
.bau-link-select { flex: 1; max-width: 480px; }

.btn-unlink {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  line-height: 1;
}
.btn-unlink:hover { background: var(--danger-light); color: var(--danger); }

/* ── BIA ──────────────────────────────────────── */
.bia-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.45em;
}
.bia-card-tags { display: flex; gap: 0.35rem; margin-top: 0.3rem; flex-wrap: wrap; }
.bia-detail-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.form-label-hint { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }

/* ── Reports ──────────────────────────────────── */
.reports-intro { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

.reports-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  width: fit-content;
}

.report-stat { color: var(--text); }
.report-stat-sep { color: var(--border); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--medium); }

.report-cards { display: flex; flex-direction: column; gap: 0.75rem; max-width: 780px; }

.report-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.report-card:hover { border-color: #adb5bd; }
.report-card-icon { font-size: 1.6rem; width: 2.5rem; flex-shrink: 0; text-align: center; }
.report-card-body { flex: 1; }
.report-card-title { font-size: 0.975rem; font-weight: 600; margin-bottom: 0.2rem; }
.report-card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.report-card-meta {
  font-size: 0.75rem; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 3px; padding: 0.1em 0.4em;
}
.report-card-action { flex-shrink: 0; }

/* ── Dashboard vendor cards ───────────────────────── */
.dash-vendor-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 700px) { .dash-vendor-cards { grid-template-columns: 1fr; } }

.dash-vendor-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s;
}
.dash-vendor-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); text-decoration: none; }

.dvc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.dvc-name { font-weight: 600; font-size: .95rem; }
.dvc-score { font-size: 1.35rem; font-weight: 700; line-height: 1; flex-shrink: 0; }
.dvc-score-max { font-size: .75rem; font-weight: 400; opacity: .7; }
.dvc-category { font-size: .78rem; color: var(--text-muted); }
.dvc-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.dvc-footer {
  display: flex; gap: .75rem; font-size: .8rem; color: var(--text-muted);
  padding-top: .45rem; border-top: 1px solid var(--border); margin-top: auto;
}
.dvc-footer strong { color: var(--text); }

/* ── Vendors ──────────────────────────────────── */
.page-intro { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.empty-state-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem; text-align: center;
  color: var(--text-muted);
}

/* View toggle */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.vt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .6rem;
  background: var(--surface);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .1s, color .1s;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.vt-btn:hover { background: var(--bg); color: var(--text); }
.vt-btn.vt-active { background: var(--primary); color: #fff; }

/* Vendor grid */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.vendor-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s;
}
.vendor-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); text-decoration: none; }
.vendor-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.vendor-card-name { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.vendor-card-scores { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.vendor-card-meta { font-size: .82rem; color: var(--text-muted); display: flex; gap: .75rem; flex-wrap: wrap; }
.vendor-card-foot {
  font-size: .82rem; color: var(--text-muted);
  display: flex; gap: .75rem; align-items: center;
  padding-top: .5rem; border-top: 1px solid var(--border); margin-top: auto;
}
.vendor-stat strong { color: var(--text); }
.vendor-scan-age { margin-left: auto; font-size: .78rem; }

/* Vendor list — stacked row cards */
.vendor-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.vendor-row-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.25rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, background 0.1s;
}
.vendor-row-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); background: #fafbfc; text-decoration: none; }

.vrc-main { flex: 1; min-width: 0; }

.vrc-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .2rem;
}

.vrc-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}
.vrc-domain { font-family: monospace; font-size: 0.8rem; }
.vrc-sep { color: var(--border); }

.vrc-notes {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 600px;
}

/* NotaGRC vendor score — detail hero */
.notagrc-score-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .35rem .9rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  min-width: 80px;
}
.nsh-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.nsh-num   { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.nsh-max   { font-size: .85rem; font-weight: 400; opacity: .7; }
.nsh-level { font-size: .75rem; font-weight: 600; }

/* Score breakdown card */
.notagrc-breakdown-card { border-top: 3px solid var(--primary); }
.notagrc-breakdown-body {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nb-score-col { text-align: center; flex-shrink: 0; width: 90px; }
.nb-score { display: flex; align-items: baseline; justify-content: center; gap: .1rem; }
.nb-num   { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.nb-denom { font-size: 1rem; color: var(--text-muted); }
.nb-level-label { font-size: .8rem; font-weight: 600; margin-top: .2rem; }
.nb-sublabel { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }

.nb-bar-col { flex: 1; display: flex; flex-direction: column; gap: .85rem; }
.nb-component { display: flex; flex-direction: column; gap: .25rem; }
.nb-comp-label {
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nb-comp-val { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
.nb-bar-wrap { height: 8px; background: var(--bg); border-radius: 4px; border: 1px solid var(--border); overflow: hidden; }
.nb-bar { height: 100%; border-radius: 4px; }
.nb-bar-risk  { background: var(--primary); }
.nb-bar-osint { background: #6f42c1; }
.nb-comp-hint { font-size: .75rem; color: var(--text-muted); }

.vrc-sub-scores { display: flex; align-items: center; gap: .35rem; }
.vendor-card-sub-scores { display: flex; align-items: center; gap: .35rem; }

.vrc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  flex-shrink: 0;
}
.vrc-badges { display: flex; align-items: center; gap: .35rem; }
.vrc-stats {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.vrc-stat strong { color: var(--text); }
.vrc-scan-age { font-size: 0.78rem; color: var(--text-muted); }
.vendor-unscan { color: #fd7e14; }

.vendor-cat-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .1em .45em;
  font-weight: 400;
}
.vendor-osint-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: .15em .5em;
  border-radius: 3px;
}
.osint-low      { background: #d1e7dd; color: #0f5132; }
.osint-medium   { background: #fff3cd; color: #664d03; }
.osint-high     { background: #f8d7da; color: #842029; }
.osint-critical { background: #842029; color: #fff; }
.osint-none     { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* Vendor detail layout */
.vendor-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) {
  .vendor-detail-layout { grid-template-columns: 1fr; }
}

.vendor-detail-main { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.1rem 1.25rem; }

.vendor-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem 1.5rem;
  margin-bottom: .75rem;
}
.vendor-meta-item { display: flex; flex-direction: column; gap: .15rem; }
.vendor-meta-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.vendor-meta-val { font-size: .9rem; }
.vendor-notes {
  font-size: .88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: .65rem;
  margin-top: .65rem;
  white-space: pre-wrap;
}

/* OSINT card */
.osint-card { overflow: hidden; }
.osint-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.osint-card-header h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.osint-header-left { display: flex; flex-direction: column; gap: .2rem; }
.osint-age { font-size: .75rem; color: var(--text-muted); }

.osint-score-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.osint-score-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.osint-score-num span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.osint-low  { color: #198754; }
.osint-medium { color: #fd7e14; }
.osint-high   { color: #dc3545; }
.osint-critical { color: #842029; }

.osint-score-detail { flex: 1; min-width: 0; }
.osint-score-bar-wrap {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: .3rem;
  border: 1px solid var(--border);
}
.osint-score-bar { height: 100%; border-radius: 4px; transition: width .4s; }
.osint-score-label { font-size: .8rem; color: var(--text-muted); }

.osint-signals {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex-shrink: 0;
  font-size: .82rem;
}
.osint-signal-item { display: flex; align-items: center; gap: .4rem; }
.osint-signal-icon { font-size: 1rem; width: 1.3em; text-align: center; }
.sig-ok   { filter: none; }
.sig-warn { /* orange tint */ }
.sig-risk { /* red tint */ }

.osint-findings {
  padding: .9rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.osint-finding {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .85rem;
  padding: .3rem .5rem;
  border-radius: 4px;
}
.finding-ok   { background: #d1e7dd1a; }
.finding-risk { background: #f8d7da44; }
.finding-warn { background: #fff3cd44; }
.finding-info { background: transparent; }
.finding-icon {
  font-size: .75rem;
  font-weight: 700;
  width: 1.2em;
  text-align: center;
  flex-shrink: 0;
  margin-top: .1em;
}
.finding-ok   .finding-icon { color: #198754; }
.finding-risk .finding-icon { color: #dc3545; }
.finding-warn .finding-icon { color: #856404; }
.finding-info .finding-icon { color: var(--text-muted); }

.osint-empty {
  padding: 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
}

/* Vendor risk list (in detail sidebar) */
.vendor-risk-list { display: flex; flex-direction: column; gap: .6rem; }
.vendor-risk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.vendor-risk-info { flex: 1; min-width: 0; }
.vendor-risk-title { font-size: .88rem; font-weight: 500; }
.vendor-risk-meta { display: flex; align-items: center; gap: .5rem; font-size: .78rem; margin-top: .15rem; }

/* Form helpers */
.form-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Misc ─────────────────────────────────────── */
.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 1.5rem 0; }
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h2 { margin-bottom: 1rem; }
