/* Bimora Foundry — tokens en layout uit het goedgekeurde ontwerp (sectie 7). */

:root {
  --bg: #F7F8F8;
  --panel: #FFFFFF;
  --ink: #161918;
  --muted: #6B716E;
  --border: #E5E8E7;
  --primary: #123C33;
  --accent: #146854;
  --accent-soft: #CDE4DC;
  --warn: #B4671B;
  --danger: #A6392B;
  --sidebar: 240px;
  --topbar: 52px;
  --radius-panel: 8px;
  --radius-control: 6px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #0d3f33; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
input::placeholder { color: #9AA09D; }
::selection { background: var(--accent-soft); }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.muted-value { color: #9AA09D; font-style: normal; }

/* ---------- shell ---------- */

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

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  border-right: 1px solid var(--border); background: var(--panel);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand {
  height: var(--topbar); display: flex; align-items: center; gap: 9px;
  padding: 0 16px; border-bottom: 1px solid var(--border); flex: 0 0 var(--topbar);
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 5px; background: var(--primary);
  color: #fff; font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 600; letter-spacing: -0.01em; }
.brand-name span { color: var(--muted); font-weight: 400; }

.nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.nav-group {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--muted); padding: 14px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: var(--radius-control);
  color: var(--ink); margin-bottom: 1px;
}
.nav-item:hover { background: #F0F2F1; color: var(--ink); }
.nav-item.on { background: #ECF1EF; color: var(--primary); font-weight: 500; }
.nav-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.sidebar-foot {
  border-top: 1px solid var(--border); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: 0 0 26px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar); flex: 0 0 var(--topbar);
  border-bottom: 1px solid var(--border); background: var(--panel);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.search-wrap { position: relative; flex: 0 1 420px; }
.search-input {
  width: 100%; height: 32px; padding: 0 62px 0 32px;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--bg); color: var(--ink);
}
.search-input:focus { outline: none; border-color: #C3CCC8; background: #fff; }
.search-icon { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.kbd {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; background: #fff;
}
.search-wrap .kbd { position: absolute; right: 8px; top: 7px; }

.content { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }

/* ---------- typografie ---------- */

h1.page { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
h2.section { font-size: 14px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); margin: 0 0 20px; max-width: 62ch; line-height: 1.55; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); }

/* ---------- panels ---------- */

.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-panel); margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

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

/* ---------- statistieken ---------- */

.stats { display: flex; gap: 34px; align-items: flex-end; }
.stat-n { font-family: var(--mono); font-size: 19px; font-weight: 500; }
.stat-l { font-size: 11.5px; color: var(--muted); }

/* ---------- lijstrijen ---------- */

.row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #FAFBFB; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; }
.row-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted); background: #fff;
}
.badge.ok { color: var(--accent); border-color: var(--accent-soft); background: #F2F8F6; }
.badge.warn { color: var(--warn); border-color: #EDD9BF; background: #FDF7EF; }
.badge.bad { color: var(--danger); border-color: #EFD0CB; background: #FDF4F2; }
.badge.plain { text-transform: none; letter-spacing: 0; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: 0 0 6px; }
.dot.ok { background: var(--accent); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }

/* ---------- knoppen ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px;
  padding: 0 13px; border-radius: var(--radius-control);
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #FAFBFB; color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #0d2e27; color: #fff; }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- tabellen ---------- */

table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-weight: 500; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 9px 16px; border-bottom: 1px solid var(--border); background: #FCFCFC;
}
table.data td { padding: 9px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.mono { font-family: var(--mono); font-size: 11.5px; }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 9px 13px; color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ---------- lege staten ---------- */

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty-title { color: var(--ink); font-weight: 500; margin-bottom: 5px; }
.empty-hint { font-size: 12px; max-width: 46ch; margin: 0 auto; line-height: 1.55; }

/* ---------- herkomst ---------- */

.origin {
  font-family: var(--mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 5px; border-radius: 3px;
  border: 1px solid var(--border); color: var(--muted);
}
.origin.observed { color: var(--accent); border-color: var(--accent-soft); }
.origin.ai { color: var(--warn); border-color: #EDD9BF; }
.origin.human { color: var(--primary); }

/* ---------- code ---------- */

pre.code {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  background: #FAFBFB; border: 1px solid var(--border); border-radius: var(--radius-control);
  padding: 13px 15px; margin: 0; overflow-x: auto; white-space: pre;
}
.copybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

/* ---------- login ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; }
.login-card .brand { border: 0; height: auto; padding: 0 0 18px; justify-content: center; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%; height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--radius-control); background: #fff;
}
.field input:focus { outline: none; border-color: var(--accent); }
.alert {
  padding: 9px 12px; border-radius: var(--radius-control); font-size: 12.5px;
  border: 1px solid #EFD0CB; background: #FDF4F2; color: var(--danger); margin-bottom: 12px;
}
.notice {
  padding: 9px 12px; border-radius: var(--radius-control); font-size: 12.5px;
  border: 1px solid var(--accent-soft); background: #F2F8F6; color: var(--primary); margin-bottom: 12px;
}

/* ---------- commandopalet ---------- */

.palette-backdrop {
  position: fixed; inset: 0; background: rgba(22,25,24,.28);
  display: none; align-items: flex-start; justify-content: center; z-index: 60;
}
.palette-backdrop.on { display: flex; }
.palette {
  margin-top: 12vh; width: 560px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 18px 50px rgba(22,25,24,.18); overflow: hidden;
}
.palette input {
  width: 100%; height: 46px; border: 0; border-bottom: 1px solid var(--border);
  padding: 0 16px; font-size: 14px;
}
.palette input:focus { outline: none; }
.palette-list { max-height: 340px; overflow-y: auto; }
.palette-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; color: var(--ink);
}
.palette-item.sel, .palette-item:hover { background: #F2F5F4; }
.palette-kind {
  font-family: var(--mono); font-size: 9.5px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px;
}
.palette-empty { padding: 22px 16px; color: var(--muted); text-align: center; font-size: 12.5px; }
