:root {
  --smet-red: #e2001a;
  --smet-red-dark: #b40015;
  --sidebar-bg: #1b2027;
  --sidebar-fg: #aeb6c2;
  --sidebar-active: #ffffff;
  --content-bg: #f4f6f9;
  --border: #e4e7ec;
}

body {
  background: var(--content-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
}

.app-shell { display: flex; min-height: 100vh; }

/* ---- Zijbalk ---- */
.sidebar {
  width: 250px;
  flex: 0 0 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  line-height: 1.1;
}
.brand-mark {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
}
.brand-mark::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 4px;
  background: var(--smet-red);
  margin-left: 6px;
  vertical-align: middle;
}
.brand-sub { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-group { margin-bottom: 14px; }
.nav-group-title {
  padding: 8px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6c7686;
}
.nav-group-title .bi { margin-right: 6px; }
.sidebar .nav-item {
  display: block;
  padding: 7px 20px 7px 40px;
  color: var(--sidebar-fg);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar .nav-single { padding-left: 20px; }
.sidebar .nav-item:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.sidebar .nav-item.active {
  color: var(--sidebar-active);
  background: rgba(226, 0, 26, .14);
  border-left-color: var(--smet-red);
  font-weight: 600;
}
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .08); padding: 8px 0; }

/* ---- Hoofdgebied ---- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 22px 24px 60px; }

/* ---- Kaarten en tabellen ---- */
.card { border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  padding: 12px 16px;
}
.table { font-size: 13.5px; }
.table > thead > tr > th {
  background: #fafbfc;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #667085;
  white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { background: #fdf3f4; }

.kpi-card { border-left: 4px solid var(--smet-red); }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1; }
.kpi-label { color: #667085; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }

.badge-status { font-weight: 600; padding: .35em .7em; }

/* ---- Risicomatrix ---- */
.risk-matrix { border-collapse: separate; border-spacing: 3px; width: 100%; }
.risk-matrix th {
  background: #f3f4f6;
  font-size: 12px;
  padding: 8px;
  vertical-align: middle;
  font-weight: 600;
}
.risk-matrix th.axis-y { text-align: left; width: 210px; }
.risk-matrix td.cell {
  height: 46px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.risk-matrix td.cell.selected { outline: 3px solid #111; outline-offset: -3px; }
.risk-matrix td.cell.selected::after {
  content: "\F26E";
  font-family: "bootstrap-icons";
  font-size: 18px;
}
.matrix-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.matrix-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.matrix-legend i { width: 16px; height: 16px; border-radius: 3px; display: inline-block; }

/* ---- Piramide en balken ---- */
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pyramid-row {
  color: #fff;
  text-align: center;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.bar-label { width: 170px; font-size: 12.5px; color: #475467; text-align: right; }
.bar-track { flex: 1; background: #eef0f3; border-radius: 3px; height: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--smet-red); border-radius: 3px; }
.bar-value { width: 42px; font-weight: 600; font-size: 12.5px; }

/* ---- Formulieren ---- */
.form-section { margin-bottom: 22px; }
.form-section > h6 {
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: #667085;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 14px;
}
.required-star { color: var(--smet-red); }
.formset-row { border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fff; }

.nav-tabs .nav-link { color: #475467; }
.nav-tabs .nav-link.active { color: var(--smet-red); font-weight: 600; border-bottom-color: transparent; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); }
.login-card { background: #fff; border-radius: 10px; padding: 34px; width: 100%; max-width: 400px; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; z-index: 1040; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
}

@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .content { padding: 0; }
  .card { border: none; box-shadow: none; }
}
