/* LiveHelfi PIM — beheeromgeving. Geen externe lettertypen of bibliotheken (CSP: alleen 'self'). */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --fg: #17211d;
  --muted: #5b6862;
  --line: #d9e0dc;
  --accent: #1f6b58;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ec;
  --good: #2e7d4f;
  --warn: #9a6a12;
  --bad: #b23a3a;
  --bad-soft: #f8e6e6;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715; --surface: #18201d; --fg: #e3ebe7; --muted: #9aa8a1; --line: #2c3833;
    --accent: #5fb89c; --accent-ink: #0d1412; --accent-soft: #1d2f29;
    --good: #6cc28f; --warn: #e0ad5c; --bad: #ec8a8a; --bad-soft: #3a2222;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .88em; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
p { margin: 0 0 8px; }

/* Indeling */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brand span { color: var(--accent); }
.brand-center { text-align: center; margin-bottom: 16px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--fg); text-decoration: none; padding: 7px 10px; border-radius: var(--radius); }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.who { margin-top: auto; font-size: 13px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.who-name { font-weight: 600; }
.who-role { color: var(--muted); }
.main { padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 1240px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head.row { flex-direction: row; justify-content: space-between; align-items: center; }
.crumb { font-size: 13px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.narrow { max-width: 480px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }

/* Inloggen */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.card-narrow { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.secret { font-family: var(--mono); font-size: 17px; letter-spacing: .08em; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 6px 0; user-select: all; word-break: break-all; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .2em; text-align: center; }
.wrap { word-break: break-all; }

/* Formulieren */
.form { display: flex; flex-direction: column; gap: 4px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; border: 0; padding: 0; min-width: 0; }
fieldset.field { margin-inline: 0; }
legend, label { font-weight: 600; font-size: 14px; }
.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.err { color: var(--bad); font-size: 13px; margin: 0; }
.req { color: var(--bad); }
.actions { display: flex; gap: 8px; margin-top: 8px; }
.btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius); padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 6px 12px; }
.btn-danger { background: var(--bad); color: #fff; }
.danger { border-color: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.filters input, .filters select { width: auto; min-width: 180px; }

/* Meldingen */
.flash { border-radius: var(--radius); padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); }
.flash-success { border-color: var(--good); }
.flash-info { border-color: var(--accent); }
.flash-error { border-color: var(--bad); background: var(--bad-soft); }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.panel .tbl { border: 0; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.kv th { width: 220px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.clip { max-width: 360px; overflow-wrap: anywhere; color: var(--muted); }
.nowrap { white-space: nowrap; }
.diff { max-width: 420px; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.diff .old { color: var(--bad); }
.diff .new { color: var(--good); }
.pager { display: flex; gap: 16px; }

/* Kleine elementen */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.chip { display: inline-block; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; margin: 0 4px 2px 0; }
.chip-main { border-color: var(--accent); color: var(--accent); }
.pill { display: inline-block; font-size: 12px; border-radius: 999px; padding: 1px 9px; border: 1px solid currentColor; white-space: nowrap; }
.pill-active, .pill-job-done { color: var(--good); }
.pill-setup, .pill-job-pending, .pill-job-running { color: var(--warn); }
.pill-paused, .pill-job-failed { color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat-n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 13px; }
.stat-bad .stat-n { color: var(--bad); }
.feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.checks { list-style: none; padding: 0; margin: 0; columns: 2; }
.checks .ok::before { content: "✓ "; color: var(--good); }
.checks .bad::before { content: "✕ "; color: var(--bad); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin-top: 0; }
  .main { padding: 20px 16px 48px; }
  .tbl { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Catalogus */
.thumb-cell { width: 56px; }
.thumb { width: 48px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; display: block; }
.gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery figure { margin: 0; flex: 0 0 auto; }
.gallery img { width: 160px; height: 160px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.prose { max-width: 75ch; line-height: 1.55; }
.code { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: 420px; overflow: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill-draft { color: var(--warn); }
.pill-archived { color: var(--muted); }
@media (max-width: 720px) { .shell { grid-template-columns: 1fr; } .main { padding: 20px 16px 48px; } .tbl { display: block; overflow-x: auto; } }
.mono { font-family: var(--mono); font-size: 12.5px; }
.layer { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.layer:first-of-type { border-top: 0; }
.layer p { margin: 0; }
.layer-review { background: var(--bad-soft); margin: 0 -20px; padding: 12px 20px; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 0; }
.money { width: 90px !important; }
.ref pre { max-height: 200px; }
.layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.layer-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.pill-tr-nagekeken { color: var(--good); }
.pill-tr-concept { color: var(--warn); }
.pill-tr-verouderd, .pill-tr-ontbreekt { color: var(--bad); }
.chip-missing { opacity: .35; text-decoration: line-through; }
.pill-f-active { color: var(--good); }
.pill-f-approved, .pill-f-draft { color: var(--warn); }
.pill-f-retired { color: var(--muted); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.lines select { max-width: 280px; }
.composition table { border-collapse: collapse; margin: 8px 0; }
.composition th, .composition td { border-bottom: 1px solid var(--line); padding: 4px 12px 4px 0; text-align: left; }
.composition .pim-note, .composition .pim-source { color: var(--muted); font-size: 13px; }
.pill-c-allowed { color: var(--good); }
.pill-c-proposed, .pill-c-on_hold { color: var(--warn); }
.pill-c-forbidden, .pill-sev-error { color: var(--bad); }
.pill-sev-warning { color: var(--warn); }
.pill-sev-info { color: var(--muted); }
