/* ═══════════════════════════════════════════════════════════════════════════
   NUMB3RS theme-2026 — moderne overlay op app.css + brand.css.
   Laadt na beide CSS-files. Doel: rustigere borders, soft pills, betere shadows,
   focus-rings, micro-transitions. Behoudt alle bestaande class-names.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Surface */
  --bg:           #FAF7F2;
  --bg-elevated:  #FFFFFF;
  --bg-sunken:    #F3EDE3;
  --bg-overlay:   rgba(15, 23, 42, 0.45);

  /* Brand + accent */
  --brand:        var(--brand);
  --brand-50:     var(--brand-bg);
  --brand-100:    #D2E2D8;
  --brand-700:    #1F3A2E;
  --brand-on:     #FFFFFF;

  --accent:       #C67B5C;
  --accent-50:    #FAEEE5;
  --accent-100:   #F2D9C8;
  --accent-700:   #A85E3E;

  /* Sidebar */
  --sb-bg:        #1A2D25;
  --sb-bg-hover:  #243F33;
  --sb-bg-active: var(--brand);
  --sb-text:      #DDE8E1;
  --sb-text-muted:#8FA396;
  --sb-rail:      #C67B5C;

  /* State (soft + dark-text) */
  --red-50:    #FAE8E8;  --red-100:    #F5D2D2;  --red-700:    #8B1414;
  --orange-50: #FBEEDE;  --orange-100: #F4D8B0;  --orange-700: #7A4612;
  --amber-50:  #FBF4DE;  --amber-100:  #F1E4AC;  --amber-700:  #7A5E12;
  --green-50:  var(--brand-bg);  --green-100:  #D2E2D8;  --green-700:  #1F3A2E;
  --blue-50:   #E5EDF5;  --blue-100:   #C9D8E9;  --blue-700:   #1A3B6B;

  /* Type */
  --font-display: var(--font-sans);
  --font-body:    var(--font-sans);
  --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;

  /* Radius */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 2px 4px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-lg: 0 8px 24px rgba(15,23,42,0.10);
  --ring:       0 0 0 3px rgba(44,74,62,0.18);
  --ring-accent:0 0 0 3px rgba(198,123,92,0.22);

  /* Motion */
  --ease:    cubic-bezier(.2,.6,.2,1);
  --t-fast:  120ms var(--ease);
  --t:       160ms var(--ease);
}

/* ── Body / surface ────────────────────────────────────────────────────────── */
html, body { background: var(--bg); }
#main      { background: var(--bg); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--ink-200);
  box-shadow: var(--shadow-sm);
}
#topbar-search {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--bg-sunken);
  transition: var(--t);
}
#topbar-search:focus {
  border-color: var(--brand);
  background: var(--bg-elevated);
  box-shadow: var(--ring);
  outline: none;
}

/* ── Sidebar — donkere modern dashboard-look ─────────────────────────────── */
#sidebar {
  background: var(--sb-bg);
  color: var(--sb-text);
  border-right: 1px solid #0F1C17;
}

.sb-brand {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sb-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.005em;
  color: #FAF7F2;
}
.sb-brand-tag {
  color: var(--sb-text-muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sb-section { padding: 14px 0 4px; }
.sb-section-title {
  padding: 0 20px 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sb-text-muted);
  font-weight: 600;
}

.sb-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 20px;
  margin: 1px 8px;
  border-radius: 6px;
  color: var(--sb-text);
  font-size: 13px;
  border-left: 0;            /* rail moet niet uit indent springen — we gebruiken absolute element */
  cursor: pointer;
  transition: var(--t-fast);
}
.sb-link:hover {
  background: var(--sb-bg-hover);
  color: #fff;
}
.sb-link.active {
  background: var(--sb-bg-active);
  color: #fff;
  font-weight: 600;
}
.sb-link.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--sb-rail);
}
.sb-link .sb-badge {
  background: rgba(255,255,255,0.10);
  color: var(--sb-text);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 500;
  min-width: 22px;
  text-align: center;
}
.sb-link.active .sb-badge {
  background: var(--sb-rail);
  color: #fff;
}

.sb-status {
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--sb-text-muted);
  padding: 12px 20px;
}

/* ── Content padding & max-width ─────────────────────────────────────────── */
#content { padding: 26px 28px 80px; max-width: 1320px; }

/* ── Page-titles ─────────────────────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.018em;
  color: var(--ink-900);
  line-height: 1.15;
}
.page-sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 20px;
  margin-top: 2px;
}
.section-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-700);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--t);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  background: var(--bg-sunken);
  border-bottom: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-600);
}
.card-body { padding: 16px; }

/* ── KPI-grid ────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--t);
  position: relative;
}
.kpi[onclick] { cursor: pointer; }
.kpi[onclick]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
}
.kpi-sub {
  font-size: 12px;
  color: var(--ink-500);
}

/* Color-staten — subtiele dot links, geen harde border-rail */
.kpi.red,
.kpi.orange,
.kpi.amber,
.kpi.green,
.kpi.brand { border-left: 0; }
.kpi.red::before,
.kpi.orange::before,
.kpi.amber::before,
.kpi.green::before,
.kpi.brand::before {
  content: '';
  position: absolute;
  top: 14px; left: 0;
  width: 3px; height: 22px;
  border-radius: 0 2px 2px 0;
}
.kpi.red::before    { background: var(--red); }
.kpi.orange::before { background: var(--orange); }
.kpi.amber::before  { background: var(--amber); }
.kpi.green::before  { background: var(--brand); }
.kpi.brand::before  { background: var(--accent); }

.kpi.red    .kpi-value { color: var(--red-700); }
.kpi.orange .kpi-value { color: var(--orange-700); }
.kpi.amber  .kpi-value { color: var(--amber-700); }
.kpi.green  .kpi-value { color: var(--brand); }
.kpi.brand  .kpi-value { color: var(--accent-700); }

/* ── Pills ───────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--ink-100);
  color: var(--ink-700);
  border: 0;
  white-space: nowrap;
  line-height: 1.5;
}
.pill.red    { background: var(--red-50);    color: var(--red-700); }
.pill.orange { background: var(--orange-50); color: var(--orange-700); }
.pill.amber  { background: var(--amber-50);  color: var(--amber-700); }
.pill.green  { background: var(--green-50);  color: var(--green-700); }
.pill.brand  { background: var(--brand-50);  color: var(--brand-700); }
.pill.clay,
.pill.accent { background: var(--accent-50); color: var(--accent-700); }
.pill.solid-red    { background: var(--red);    color: #fff; }
.pill.solid-brand  { background: var(--brand);  color: #fff; }
.pill.solid-accent { background: var(--accent); color: #fff; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.tbl th {
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--ink-200);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-600);
  padding: 9px 14px;
}
.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
}
.tbl tr:hover td { background: var(--bg-sunken); }
.tbl tr.clickable { cursor: pointer; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--ink-200);
  background: var(--bg-elevated);
  color: var(--ink-800);
  cursor: pointer;
  transition: var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover  { background: var(--bg-sunken); border-color: var(--ink-300); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--brand); }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-on);
}
.btn.primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn.primary:focus-visible { box-shadow: var(--ring); }

.btn.clay,
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.clay:hover,
.btn.accent:hover { background: var(--accent-700); border-color: var(--accent-700); }
.btn.clay:focus-visible,
.btn.accent:focus-visible { box-shadow: var(--ring-accent); }

.btn.danger {
  background: var(--bg-elevated);
  border-color: var(--red);
  color: var(--red-700);
}
.btn.danger:hover { background: var(--red-50); }

.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-sunken); border-color: transparent; }

.btn.sm { height: 26px; padding: 0 10px; font-size: 11.5px; }
.btn.xs { height: 22px; padding: 0 8px; font-size: 11px; border-radius: 6px; }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.input, .select, select.tb-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--bg-elevated);
  color: var(--ink-900);
  font-family: inherit;
  transition: var(--t-fast);
}
.input:focus, .select:focus, select.tb-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

/* ── Alert ───────────────────────────────────────────────────────────────── */
.alert {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
}
.alert.red    { background: var(--red-50);    color: var(--red-700); }
.alert.orange { background: var(--orange-50); color: var(--orange-700); }
.alert.amber  { background: var(--amber-50);  color: var(--amber-700); }
.alert.green  { background: var(--green-50);  color: var(--green-700); }
.alert.brand  { background: var(--brand-50);  color: var(--brand-700); }
.alert a { color: inherit; text-decoration: underline; }

/* ── Drawer ──────────────────────────────────────────────────────────────── */
.drawer-overlay { background: var(--bg-overlay); }
.drawer {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.drawer-header,
.drawer-footer {
  background: var(--bg-sunken);
  border: 0;
}

/* ── Kanban ──────────────────────────────────────────────────────────────── */
.kanban-col {
  background: var(--bg-sunken);
  border-radius: var(--radius);
  border: 0;
}
.kanban-card {
  background: var(--bg-elevated);
  border: 0;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transition: var(--t-fast);
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border: 0;
}

/* ── Definition list ─────────────────────────────────────────────────────── */
.dl dt {
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ── Wizard cards (overlay) ──────────────────────────────────────────────── */
.wiz-card {
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.wiz-input:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
  outline: none;
}

/* ── Source-badges ───────────────────────────────────────────────────────── */
.src {
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 600;
}

/* ── Skeleton ────────────────────────────────────────────────────────────── */
.skeleton { border-radius: var(--radius-sm); }

/* ── Bar ─────────────────────────────────────────────────────────────────── */
.bar { background: var(--ink-100); border-radius: var(--radius-pill); }
.bar > div { background: var(--brand); }

/* ── Tablet+desktop polish ───────────────────────────────────────────────── */
@media (min-width: 1025px) {
  :root { --sidebar-width: 240px; }
}

/* ── Focus-visible ALWAYS visible — a11y ─────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.sb-link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* ── UBO-view specifieke utilities ───────────────────────────────────────── */
.ubo-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ubo-mode-select {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  background: var(--bg-elevated);
  font-size: 11.5px;
  color: var(--ink-800);
}
.ubo-status-actueel    { color: var(--brand);      font-weight: 500; }
.ubo-status-verouderd  { color: var(--orange-700); font-weight: 500; }
.ubo-status-ontbrekend { color: var(--red-700);    font-weight: 600; }

.ubo-instance-step {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-sunken);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-700);
}

/* ── Mobile drawer (sidebar) — match nieuwe forest bg ────────────────────── */
@media (max-width: 600px) {
  .sb-link {
    margin: 1px 6px;
    padding: 10px 18px;
    font-size: 14px;
  }
}
