@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap");

/* Lelibyte-huisstijl: kleuren uit het logo */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #0b1530;
  --muted: #475569;
  --line: #dbe2ec;
  --accent: #1d4ed8;          /* lelie-blauw */
  --accent-ink: #ffffff;
  --btn: #1d4ed8; --btn-hover: #1e40af;
  --cyan: #0891b2;            /* "byte"-cyaan */
  --cyan-soft: #e0f6fa;
  --side: #0b1530;            /* navy uit het woordmerk */
  --side-ink: #c3cde0;
  --side-hover: rgba(34, 211, 238, .08);
  --side-active: rgba(34, 211, 238, .16);
  --label-bg: #ffffff;
  --label-ink: #0b1530;
  --p-kritiek: #b42318;
  --p-hoog: #c2570c;
  --p-normaal: #0e7490;
  --p-laag: #64748b;
  --ok-bg: #e2f5ea; --ok-ink: #17603a;
  --err-bg: #fde6e3; --err-ink: #8a1f14;
  --warn-bg: #fdf1dc; --warn-ink: #7a4a05;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
/* Donker: automatisch volgens het apparaat, tenzij de gebruiker licht koos; of altijd bij data-theme="dark" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070e22; --surface: #0f1a36; --ink: #e6ecf7; --muted: #94a3b8; --line: #22304f;
    --accent: #60a5fa; --accent-ink: #0b1530; --btn: #2563eb; --btn-hover: #1d4ed8; --cyan: #22d3ee; --cyan-soft: #0b2b3a;
    --side: #050b1c; --side-ink: #b6c2d9;
    --label-bg: #f1f5f9; --label-ink: #0b1530;
    --p-kritiek: #f87171; --p-hoog: #fb923c; --p-normaal: #22d3ee; --p-laag: #94a3b8;
    --ok-bg: #0f3324; --ok-ink: #9fe3bd; --err-bg: #43191a; --err-ink: #fbb4aa; --warn-bg: #3a2a10; --warn-ink: #f6d18e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #070e22; --surface: #0f1a36; --ink: #e6ecf7; --muted: #94a3b8; --line: #22304f;
    --accent: #60a5fa; --accent-ink: #0b1530; --btn: #2563eb; --btn-hover: #1d4ed8; --cyan: #22d3ee; --cyan-soft: #0b2b3a;
    --side: #050b1c; --side-ink: #b6c2d9;
    --label-bg: #f1f5f9; --label-ink: #0b1530;
    --p-kritiek: #f87171; --p-hoog: #fb923c; --p-normaal: #22d3ee; --p-laag: #94a3b8;
    --ok-bg: #0f3324; --ok-ink: #9fe3bd; --err-bg: #43191a; --err-ink: #fbb4aa; --warn-bg: #3a2a10; --warn-ink: #f6d18e;
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-family: var(--display); font-size: 1.75rem; line-height: 1.2; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-family: var(--display); font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; letter-spacing: .005em; }
small, .sub { color: var(--muted); font-size: .85rem; font-weight: 400; }
.mono, .num { font-family: var(--mono); font-size: .88rem; }
td.num, .rows .num, .crumbs .num { white-space: nowrap; }
.muted { color: var(--muted); }
.strong { font-weight: 500; color: var(--ink); text-decoration: none; }
.strong:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent; }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .35rem; color: inherit; text-decoration: none; }
.brand img { display: block; height: 38px; width: auto; }
.brand-sub { font-family: var(--mono); font-size: .78rem; color: var(--cyan); letter-spacing: .02em; padding-left: 3px; }
.side .brand-sub, .ptop .brand-sub { color: #22d3ee; }
.brand.dark { margin-bottom: 1.5rem; }
.brand.dark img { height: 40px; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none !important; } :root:not([data-theme="light"]) .logo-dark { display: block !important; } }
:root[data-theme="dark"] .logo-light { display: none !important; } :root[data-theme="dark"] .logo-dark { display: block !important; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--side-ink); text-decoration: none; padding: .45rem .7rem; border-radius: 6px; }
.side nav a:hover { background: var(--side-hover); color: #fff; }
.side nav a[aria-current="page"] { background: var(--side-active); color: #fff; font-weight: 500; box-shadow: inset 3px 0 0 #22d3ee; }
.side-actions { display: flex; flex-direction: column; gap: .5rem; }
.me { margin-top: auto; display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; border-top: 1px solid rgba(148,163,184,.2); padding-top: 1rem; }
.me a { color: #fff; text-decoration: none; font-weight: 500; }
.me span { opacity: .7; }
.me .linkish { color: var(--side-ink); padding: 0; margin-top: .4rem; align-self: flex-start; }
.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1280px; width: 100%; min-width: 0; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }
.meta { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; flex-wrap: wrap; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; margin-bottom: 1.25rem; }
.narrow { max-width: 560px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.grid2 .panel { margin-bottom: 0; }
.grid2 + .panel { margin-top: 1.25rem; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.facts-panel { position: sticky; top: 1rem; }

/* ---------- counters ---------- */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.counter { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; border-left-width: 4px; }
.counter strong { font-family: var(--display); font-size: 1.9rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.counter span { color: var(--muted); font-size: .9rem; }
.counter:hover { border-color: var(--accent); }
.st-line-nieuw { border-left-color: var(--accent); }
.st-line-in_behandeling { border-left-color: var(--p-hoog); }
.st-line-wacht { border-left-color: var(--p-laag); }

/* ---------- the label: asset tags look like printed inventory stickers ---------- */
.tag, .label-big {
  display: inline-flex; align-items: center; gap: .45rem; font-family: var(--mono); font-weight: 500;
  font-size: .8rem; color: var(--label-ink); background: var(--label-bg); text-decoration: none;
  border: 1px solid #94a3b8; border-radius: 3px; padding: .1rem .45rem .1rem .35rem; white-space: nowrap;
  box-shadow: 0 1px 0 #cbd5e1;
}
.tag::before, .label-big .bars {
  content: ""; width: 14px; height: 11px; flex: none;
  background: repeating-linear-gradient(90deg, var(--label-ink) 0 1px, transparent 1px 2px, var(--label-ink) 2px 4px, transparent 4px 5px, var(--label-ink) 5px 6px, transparent 6px 8px);
}
.tag:hover { border-color: var(--label-ink); }
.label-big { font-size: 1rem; padding: .35rem .7rem .35rem .55rem; gap: .6rem; border-radius: 4px; }
.label-big .bars { width: 26px; height: 20px; }
.asset-title { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: .8rem; font-weight: 500; padding: .08rem .55rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.st-nieuw { color: var(--accent); }
.st-in_behandeling { color: var(--p-hoog); }
.st-wacht { color: var(--muted); border-style: dashed; }
.st-opgelost, .as-in_gebruik { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.st-gesloten, .as-afgeschreven { color: var(--muted); background: var(--bg); border-color: transparent; }
.as-voorraad { color: var(--p-normaal); }
.as-reparatie { color: var(--p-hoog); }
.prio { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; white-space: nowrap; }
.prio i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.p-kritiek { color: var(--p-kritiek); font-weight: 600; }
.p-kritiek i { width: 10px; height: 10px; }
.p-hoog { color: var(--p-hoog); font-weight: 500; }
.p-normaal { color: var(--p-normaal); }
.p-laag { color: var(--p-laag); }

/* ---------- tables & lists ---------- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel .tablewrap { border: 0; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
tr.done td { opacity: .6; }
td.num a { text-decoration: none; }
.late { color: var(--p-kritiek); font-weight: 500; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; gap: .75rem; align-items: center; padding: .55rem 0; text-decoration: none; color: var(--ink); }
.rows a:hover .row-title { text-decoration: underline; }
.rows .num { color: var(--muted); flex: none; }
.row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); margin: 0; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0 0 1rem; font-size: .93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.facts-panel .facts { grid-template-columns: 1fr; gap: .1rem; }
.facts-panel .facts dd { margin-bottom: .6rem; }

.prose { white-space: pre-wrap; max-width: 75ch; }
.timeline { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.timeline li { padding: .7rem 0 .7rem 1rem; border-left: 2px solid var(--line); }
.timeline li.msg { border-left-color: var(--cyan); }
.timeline li.sys .prose { color: var(--muted); font-size: .9rem; }
.who { margin-bottom: .15rem; font-size: .93rem; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; font-size: .9rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .65rem; width: 100%; }
input.mono { font-family: var(--mono); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
label.check { flex-direction: row; align-items: center; gap: .5rem; }
label.check input { width: auto; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.25rem; }
.form .wide { grid-column: 1 / -1; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; margin: 0; }
legend { font-weight: 600; padding-right: .5rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.actions { display: flex; gap: .6rem; }
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input[type="search"] { flex: 1 1 280px; width: auto; }
.filters select { width: auto; }
.reply { border-top: 1px solid var(--line); padding-top: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.reply-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.reply-row label { flex: 1 1 150px; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 500; background: var(--btn); color: #fff; border: 1px solid var(--btn); border-radius: 6px; padding: .5rem 1rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--muted); background: var(--surface); }
.btn-light { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.btn-light:hover { background: #2563eb; }
.btn-ghost-light { background: transparent; color: var(--side-ink); border-color: rgba(255,255,255,.3); }
.linkish { background: none; border: 0; font: inherit; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.danger { color: var(--p-kritiek); font-size: .9rem; }

.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; background: var(--ok-bg); color: var(--ok-ink); }
.flash-err { background: var(--err-bg); color: var(--err-ink); }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2rem; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.auth-card { border-top: 4px solid var(--accent); }
.auth-card .stack { margin-top: 1.25rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .detail { grid-template-columns: 1fr; }
  .facts-panel { position: static; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; }
  .side nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .side-actions { flex-direction: row; margin-left: auto; }
  .side-actions .btn-ghost-light { display: none; }
  .me { flex-direction: row; align-items: center; gap: .75rem; border: 0; padding: 0; margin: 0; order: 4; width: 100%; }
  .me .linkish { margin: 0; }
  .main { padding-top: 1.25rem; }
}
@media print {
  .side, .filters, .reply, .head-actions, .btn { display: none !important; }
  .shell { display: block; }
}

/* ---------- pills (staff) ---------- */
.pill { display: inline-block; font-size: .75rem; font-weight: 500; padding: 0 .45rem; border-radius: 4px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; white-space: nowrap; }
.pill-int { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.pill-attn { background: var(--btn); color: #fff; border-color: transparent; }
.timeline li.internal { background: var(--warn-bg); border-left-color: var(--warn-ink); border-radius: 0 6px 6px 0; padding-right: .75rem; margin: .25rem 0; }
.timeline li.from-req { border-left-color: var(--p-hoog); }
.attn-panel { border-left: 4px solid var(--accent); }
.attn-panel .rows .sub { flex: none; }
form .check { font-weight: 400; }

/* ---------- self-service portal ---------- */
.ptop { background: var(--side); color: var(--side-ink); }
.ptop-in { max-width: 820px; margin: 0 auto; padding: .9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ptop nav { display: flex; align-items: center; gap: 1.1rem; }
.ptop nav a { color: var(--side-ink); text-decoration: none; }
.ptop nav a[aria-current] { color: #fff; font-weight: 500; text-decoration: underline; text-decoration-color: #22d3ee; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.ptop .linkish { color: var(--side-ink); }
.pmain { max-width: 820px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.phero { padding: 1.5rem 0 2.25rem; }
.phero h1 { font-size: 2.2rem; margin-bottom: .4rem; }
.phero .prompt { font-family: var(--mono); color: var(--cyan); font-size: .95rem; margin: 0 0 .6rem; }
.prompt .cursor { display: inline-block; width: .6em; border-bottom: 2px solid currentColor; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .prompt .cursor { animation: none; } }
.phero p { color: var(--muted); margin: 0 0 1.25rem; font-size: 1.07rem; max-width: 52ch; }
.btn-big { padding: .7rem 1.35rem; font-size: 1.02rem; }
.phead { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.phead h2 { margin: 0; font-size: 1.15rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg a { padding: .3rem .8rem; text-decoration: none; color: var(--muted); font-size: .9rem; }
.seg a[aria-current] { background: var(--btn); color: #fff; }
.pcards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.pcards a { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .9rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1.1rem; text-decoration: none; color: var(--ink); }
.pcards a:hover { border-color: var(--accent); }
.pcards .num { color: var(--muted); }
.pc-title { font-weight: 500; }
.pc-meta { grid-column: 2 / -1; }
.pcards li.attn a { border-left: 4px solid var(--p-hoog); }
.pdevices { margin-top: 2.5rem; }
.pdevices h2 { font-size: 1.15rem; }
.pdevices ul { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .45rem; }
.pdevices li { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }

.ptitle { font-family: var(--display); font-size: 1.85rem; margin: .2rem 0 1.25rem; }
.pform { display: flex; flex-direction: column; gap: 1.15rem; }
.pform label { font-size: .97rem; }
.pform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.urgency { border: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.urgency legend { font-weight: 500; font-size: .97rem; margin-bottom: .45rem; }
.radio { flex-direction: row; align-items: center; gap: .6rem; font-weight: 400; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; cursor: pointer; }
.radio input { width: auto; accent-color: var(--accent); }
.radio:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Voortgang: echte volgorde, dus genummerd */
.steps { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-top: 2.1rem; font-size: .92rem; color: var(--muted); text-align: center; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.65rem; height: 1.65rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-size: .82rem; font-weight: 600; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: .78rem; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--btn); border-color: var(--btn); color: #fff; }
.steps li.done::after { background: var(--accent); }
.steps li.now { font-weight: 600; }

.callout { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: .85rem 1.1rem; margin-bottom: 1.25rem; }
.callout.ok { background: var(--ok-bg); color: var(--ok-ink); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.callout p { margin: 0; font-weight: 500; }
.pfacts { display: flex; flex-wrap: wrap; gap: .75rem 2.25rem; margin: 0 0 1.5rem; }
.pfacts dt { color: var(--muted); font-size: .85rem; }
.pfacts dd { margin: 0; }
.pblock { margin-bottom: 2rem; }
.pblock h2 { font-size: 1.1rem; }
.chat { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-direction: column; gap: .7rem; }
.chat li { max-width: 88%; padding: .7rem .95rem; border-radius: 10px; }
.chat-it { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.chat-me { background: var(--cyan-soft); align-self: flex-end; border-bottom-right-radius: 3px; }
.chat-sys { align-self: center; max-width: 100%; color: var(--muted); font-size: .87rem; text-align: center; padding: .1rem .5rem !important; white-space: pre-line; }
.reopen summary { cursor: pointer; color: var(--accent); font-weight: 500; margin-bottom: 1rem; }
@media (max-width: 600px) {
  .pform .two { grid-template-columns: 1fr; }
  .phero h1 { font-size: 1.65rem; }
  .pcards a { grid-template-columns: 1fr auto; }
  .pcards .num { grid-column: 1 / -1; }
  .pc-meta { grid-column: 1 / -1; }
  .chat li { max-width: 100%; }
}

/* ---------- e-mail ---------- */
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.hint { margin: -.3rem 0 0; }
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.inline-form label { flex: 1 1 260px; }
.mailbody { white-space: pre-wrap; font-family: var(--sans); font-size: .9rem; background: var(--bg); border-radius: 6px; padding: .75rem; margin: .5rem 0 0; max-width: 70ch; }
details summary { cursor: pointer; }
.mail-verzonden { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.mail-mislukt { color: var(--err-ink); background: var(--err-bg); border-color: transparent; }
.mail-wachtrij { color: var(--p-normaal); }
.mail-niet_ingesteld { color: var(--muted); border-style: dashed; }
.spaced { margin-top: 1.5rem; }
.spaced-b { margin-bottom: 1.5rem; }
.in-reactie, .in-nieuw { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.in-notitie { color: var(--warn-ink); background: var(--warn-bg); border-color: transparent; }
.in-geweigerd, .in-fout { color: var(--err-ink); background: var(--err-bg); border-color: transparent; }
.in-genegeerd { color: var(--muted); border-style: dashed; }

/* ---------- wachtstatussen ---------- */
.st-leverancier { color: #7c3aed; border-style: dashed; }
.st-levering { color: var(--cyan); border-style: dashed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-leverancier { color: #c4b5fd; } }
:root[data-theme="dark"] .st-leverancier { color: #c4b5fd; }
.st-line-leverancier { border-left-color: #7c3aed; }
.st-line-levering { border-left-color: var(--cyan); }
.wait-field[hidden] { display: none; }
.rows .wait-date { flex: none; min-width: 6.5rem; text-align: right; }
.callout.info { background: var(--cyan-soft); color: var(--ink); }
.st-wacht2 { color: var(--p-hoog); border-style: dashed; }
.st-wacht3 { color: var(--p-kritiek); border-style: dashed; }
.counter-split { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.callout.urgent { background: var(--err-bg); color: var(--err-ink); font-weight: 500; }

/* ---------- tickettypes ---------- */
.tbadge { display: inline-block; font-family: var(--mono); font-size: .7rem; font-weight: 500; padding: .05rem .35rem; border-radius: 3px; vertical-align: 1px; letter-spacing: .02em; }
.ty-incident { background: var(--err-bg); color: var(--err-ink); }
.ty-verzoek { background: var(--cyan-soft); color: var(--p-normaal); }
.ty-wijziging { background: #ede9fe; color: #5b21b6; }
.ty-probleem { background: var(--warn-bg); color: var(--warn-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ty-wijziging { background: #2e1f57; color: #c4b5fd; } }
:root[data-theme="dark"] .ty-wijziging { background: #2e1f57; color: #c4b5fd; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .5rem .85rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--cyan); font-weight: 500; }
.tab-n { font-size: .78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem; color: var(--muted); }
.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; }
.type-card { flex-direction: column; gap: .2rem; border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; cursor: pointer; background: var(--surface); position: relative; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card:has(input:checked) { border-color: var(--btn); box-shadow: inset 0 0 0 1px var(--btn); }
.type-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.type-name { font-weight: 600; font-family: var(--display); }
.type-pfx { font-family: var(--mono); font-size: .75rem; color: var(--cyan); font-weight: 500; }
fieldset.types { border-top: 0; padding-top: 0; }
[data-for][hidden], [data-not-for][hidden] { display: none !important; }
.panel h3 { font-size: .9rem; margin: 1rem 0 .3rem; color: var(--muted); font-weight: 600; }
.facts.cols { grid-template-columns: auto 1fr; }
.risk { font-size: .8rem; font-weight: 500; padding: 0 .45rem; border-radius: 4px; white-space: nowrap; }
.risk-laag { background: var(--ok-bg); color: var(--ok-ink); }
.risk-middel { background: var(--warn-bg); color: var(--warn-ink); }
.risk-hoog { background: var(--err-bg); color: var(--err-ink); }
.approval-open { border-left: 4px solid var(--p-hoog); }
.approval-goedgekeurd { border-left: 4px solid var(--ok-ink); }
.approval-afgewezen { border-left: 4px solid var(--p-kritiek); }
.approval p { margin: 0 0 .5rem; }
.approval-form { margin-top: .75rem; }
.danger-btn { color: var(--p-kritiek); }
.pill-known { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.row-with-action { display: flex; align-items: center; gap: .5rem; }
.row-with-action > a { flex: 1; min-width: 0; }
.row-with-action form { flex: none; }
.resolve-all { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }
.problem-actions { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.problem-actions .inline-form { margin: 0; flex: 1 1 320px; }
.entry { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; max-width: 640px; }
.entry-card { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.15rem; border-radius: 10px; text-decoration: none; background: var(--btn); color: #fff; }
.entry-card + .entry-card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.entry-card strong { font-family: var(--display); font-size: 1.1rem; font-weight: 600; }
.entry-card span { font-size: .9rem; opacity: .85; }
.entry-card:hover { background: var(--btn-hover); }
.entry-card + .entry-card:hover { background: var(--surface); border-color: var(--btn); }
@media (max-width: 600px) { .entry { grid-template-columns: 1fr; } }
.st-goedkeuring { color: var(--p-hoog); }
.st-ingepland { color: #5b21b6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-ingepland { color: #c4b5fd; } }
:root[data-theme="dark"] .st-ingepland { color: #c4b5fd; }
.st-line-goedkeuring { border-left-color: var(--p-hoog); }
.st-line-ingepland { border-left-color: #7c3aed; }

/* ---------- incidenten koppelen ---------- */
.link-form { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .25rem; display: flex; flex-direction: column; gap: .6rem; }
.link-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.link-list.scroll { max-height: 22rem; overflow-y: auto; }
.link-list > div[hidden] { display: none; }
.link-list > div + div .link-row, .link-list > .link-row + .link-row { border-top: 1px solid var(--line); }
.link-row { flex-direction: row; align-items: center; gap: .7rem; padding: .55rem .75rem; font-weight: 400; cursor: pointer; }
.link-row:hover { background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.link-row:has(input:checked) { background: var(--cyan-soft); }
.link-row input { width: auto; flex: none; accent-color: var(--btn); }
.link-row .num { flex: none; color: var(--muted); }
.link-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list .empty { padding: .75rem; }
.link-actions { align-items: center; }
.warn-text { color: var(--warn-ink); }

/* ---------- instellingen ---------- */
.narrow-wide { max-width: 760px; }
.settings h2 + .choice-row { margin-bottom: 1.5rem; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; }
.choice-row.langs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: .5rem; }
.choice { position: relative; display: flex; flex-direction: column; gap: .2rem; border: 1px solid var(--line); border-radius: 8px; padding: .8rem .9rem; cursor: pointer; background: var(--surface); font-weight: 400; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--btn); box-shadow: inset 0 0 0 1px var(--btn); }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice strong { font-family: var(--display); font-weight: 600; }
.swatch { display: flex; height: 2.2rem; border-radius: 6px; overflow: hidden; margin-bottom: .35rem; border: 1px solid var(--line); }
.swatch i { flex: 1; }
.theme-licht .swatch i:nth-child(1) { background: #0b1530; flex: .6; }
.theme-licht .swatch i:nth-child(2) { background: #f3f6fb; }
.theme-licht .swatch i:nth-child(3) { background: #1d4ed8; flex: .4; }
.theme-donker .swatch i:nth-child(1) { background: #050b1c; flex: .6; }
.theme-donker .swatch i:nth-child(2) { background: #0f1a36; }
.theme-donker .swatch i:nth-child(3) { background: #22d3ee; flex: .4; }
.theme-systeem .swatch i:nth-child(1) { background: linear-gradient(90deg, #f3f6fb 50%, #0f1a36 50%); flex: 1; }
.theme-systeem .swatch i:nth-child(2), .theme-systeem .swatch i:nth-child(3) { display: none; }
.lang-code { font-family: var(--mono); font-size: .78rem; color: var(--cyan); }
.me-name { color: #fff; font-weight: 500; }
.me a[aria-current] { color: #22d3ee; }
.auth-lang { display: flex; gap: .75rem; justify-content: center; margin-top: 1.25rem; font-size: .88rem; }
.auth-lang a { color: var(--muted); text-decoration: none; }
.auth-lang a[aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- bakken ---------- */
.side-queues { display: flex; flex-direction: column; gap: 1px; margin-top: -.5rem; }
.side-label { font-size: .75rem; color: #7f8db0; padding: 0 .7rem .25rem; font-family: var(--mono); }
.side-queues a { display: flex; justify-content: flex-start; gap: 0; color: var(--side-ink); text-decoration: none; padding: .3rem .7rem; border-radius: 6px; font-size: .9rem; }
.side-queues a:hover { background: var(--side-hover); color: #fff; }
.side-queues a[aria-current] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #22d3ee; }
.side-queues a.is-mine { color: #fff; }
.side-queues .qn { color: #22d3ee; white-space: nowrap; }
.qtag { font-size: .82rem; white-space: nowrap; color: var(--muted); text-decoration: none; }
a.qtag:hover { color: var(--accent); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.queue-card { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--surface); }
.queue-card:hover { border-color: var(--accent); }
.queue-card strong { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.15; }
.queue-card.is-mine { border-left: 4px solid #22d3ee; }
.queue-card.is-empty strong { color: var(--muted); }
.queue-name { font-weight: 500; font-size: .92rem; }
.queue-admin { display: flex; flex-direction: column; }
.queue-edit { display: flex; flex-direction: column; gap: .75rem; }
.queue-edit.is-off { opacity: .65; }
.queue-edit-head { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.queue-edit-head .grow { flex: 1 1 220px; }
.narrow-field { width: 6rem; }
.queue-pick { border: 0; padding: 0; margin: 0; }
.queue-pick legend { font-weight: 500; font-size: .9rem; margin-bottom: .35rem; }
.queue-checks { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.queue-checks .check { font-weight: 400; }
.sticky-actions { position: sticky; bottom: 0; padding: .75rem 0; background: var(--bg); margin-bottom: 1.25rem; }

/* ---------- overzicht aanpassen ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.dash-grid .panel, .dash-grid .counters { margin-bottom: 0; }
.dash-w { min-width: 0; }
.w-vol { grid-column: 1 / -1; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } }
.shortcuts-panel { padding: .9rem; }
.shortcut-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.shortcut { display: inline-flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--bg); font-weight: 500; }
.shortcut:hover { border-color: var(--accent); background: var(--surface); }
.shortcut.is-action { background: var(--btn); border-color: var(--btn); color: #fff; }
.shortcut.is-action:hover { background: var(--btn-hover); }
.sc-count { font-family: var(--display); font-weight: 600; color: var(--cyan); }
.edit-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.edit-list li { display: flex; align-items: center; gap: 1rem; padding: .6rem .8rem; flex-wrap: wrap; scroll-margin-top: 1rem; }
.edit-list li + li { border-top: 1px solid var(--line); }
.edit-list li.is-off .edit-main strong { color: var(--muted); font-weight: 500; }
.edit-list li:target { background: var(--cyan-soft); }
.edit-main { flex: 1 1 260px; font-weight: 400; }
.size-seg label { padding: 0; display: inline-flex; cursor: pointer; position: relative; }
.size-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.size-seg span { padding: .25rem .7rem; font-size: .85rem; color: var(--muted); }
.size-seg input:checked + span { background: var(--btn); color: #fff; }
.size-seg input:focus-visible + span { outline: 2px solid var(--accent); }
.move { display: inline-flex; gap: .3rem; }
.btn-icon { padding: .3rem .6rem; min-width: 2.2rem; }
.btn:disabled { opacity: .35; cursor: default; }
.push-right { margin-left: auto; }

/* ---------- assettypes en specificaties ---------- */
.specs-set[hidden] { display: none; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem 1.25rem; margin: 0; }
.spec-grid dt { color: var(--muted); font-size: .85rem; }
.spec-grid dd { margin: 0; font-weight: 500; }
.spec-sum { font-size: .85rem; color: var(--muted); min-width: 12rem; max-width: 18rem; }
.type-index { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.type-index a { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); font-size: .9rem; }
.type-index a.is-off { opacity: .6; }
.type-edit { scroll-margin-top: 1rem; display: flex; flex-direction: column; gap: .9rem; }
.type-edit.is-off { opacity: .75; }
.type-edit:target { box-shadow: 0 0 0 2px var(--cyan); }
.fields-table td { padding: .35rem .4rem; vertical-align: middle; }
.fields-table input, .fields-table select, .fields-table textarea { padding: .35rem .5rem; font-size: .9rem; }
.fields-table textarea { min-height: 2.1rem; resize: vertical; }
.fields-table .unit { width: 5.5rem; }
.fields-table .center { text-align: center; }
.fields-table input[type=checkbox] { width: auto; }
.fields-table .new-field td { background: color-mix(in srgb, var(--cyan) 6%, transparent); }

/* ---------- bijlagen ---------- */
.att-list { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.att { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; background: var(--surface); max-width: 100%; }
.att-img { flex-direction: column; align-items: flex-start; padding: .4rem; }
.att-thumb img { display: block; max-width: 220px; max-height: 150px; border-radius: 5px; object-fit: cover; }
.att-meta { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; font-size: .9rem; min-width: 0; }
.att-meta > a:first-child { font-weight: 500; overflow-wrap: anywhere; }
form.inline { display: inline; }
.file-drop { border: 1px dashed var(--line); border-radius: 8px; padding: .6rem .8rem; background: var(--bg); }
.file-drop input[type=file] { border: 0; padding: .2rem 0; background: transparent; }
.att-side a { overflow-wrap: anywhere; }
.chat-sys-att { display: flex; justify-content: center; }
.chat-it .att, .chat-me .att { background: var(--bg); }
/* ---------- timer en uren ---------- */
.reply-extras { display: flex; gap: .75rem; flex-wrap: wrap; align-items: stretch; }
.reply-extras .file-drop { flex: 1 1 280px; }
.timer { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: var(--bg); flex-wrap: wrap; }
.timer .check { font-weight: 400; }
.timer-clock { font-family: var(--mono); font-size: 1.05rem; color: var(--cyan); min-width: 5.2rem; }
.timer.is-paused .timer-clock { color: var(--muted); }
.timer-min { flex-direction: row; align-items: center; gap: .35rem; font-weight: 400; font-size: .9rem; }
.timer-min input { width: 4.2rem; padding: .3rem .4rem; text-align: right; }
.pill-time { background: var(--cyan-soft); color: var(--ink); border-color: transparent; }
.time-counters { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.bars li { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr auto; gap: .75rem; align-items: center; padding: .45rem 0; }
.bar { height: .55rem; border-radius: 999px; background: linear-gradient(90deg, var(--cyan) var(--w), var(--bg) var(--w)); }
.right { text-align: right; }
.note-cell { max-width: 26rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters input[type=date][hidden] { display: none; }
.list td.right, .list td.right strong { white-space: nowrap; }
.time-date { white-space: nowrap; }

/* ---------- geplande tijd: kleurenbalk ---------- */
.tbar { --c: #16a34a; display: flex; flex-direction: column; gap: .3rem; margin: .15rem 0 .2rem; }
.tbar-warn { --c: #ea8a0c; }
.tbar-over { --c: #dc2626; }
:root[data-theme="dark"] .tbar-ok { --c: #34d399; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tbar-ok { --c: #34d399; } }
.tbar-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.tbar-pct { font-family: var(--mono); font-size: .8rem; color: var(--c); font-weight: 500; }
.tbar-track { height: .55rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.tbar-fill { display: block; height: 100%; background: var(--c); border-radius: 999px; transition: width .4s ease, background-color .4s ease; }
.tbar-over .tbar-track { border-color: var(--c); }
.tbar-rest { color: var(--c); font-weight: 500; }
.tbar.is-live .tbar-fill { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 6px, transparent 6px 12px); }
@media (prefers-reduced-motion: reduce) { .tbar-fill { transition: none; } }
.tbar-compact { flex-direction: row; align-items: center; gap: .45rem; min-width: 8.5rem; margin: 0; }
.tbar-compact .tbar-track { flex: 1; height: .45rem; min-width: 3.5rem; }
.tbar-mini { white-space: nowrap; font-size: .78rem; }
.time-cell { min-width: 9rem; }
.est-input { width: 6.5rem; }
.tk-bar { padding: 0 0 .45rem; }

/* ---------- historie ---------- */
.panel-tabs { margin: -.25rem 0 1rem; }
.panel-tabs button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: .5rem .85rem; color: var(--muted); cursor: pointer; margin-bottom: -1px; font-family: var(--display); font-weight: 600; font-size: 1rem; }
.panel-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--cyan); }
.panel-tabs button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.hist-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .2rem .75rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: #fff; }
.hist-table td { vertical-align: top; }
.hist-table tr[hidden] { display: none; }
.hist-old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.hist-new { color: var(--ink); font-weight: 500; }
.hist-event td { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.hist-detail { color: var(--muted); max-width: 32rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-long { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .5rem; }
.hist-long .prose { background: var(--bg); border-radius: 6px; padding: .5rem .6rem; font-size: .9rem; text-decoration: none; }
@media (max-width: 700px) { .hist-long { grid-template-columns: 1fr; } }

/* ---------- bedrijven ---------- */
.company-card { scroll-margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.company-card:target { box-shadow: 0 0 0 2px var(--cyan); }
.company-card.is-off { opacity: .7; }
.company-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.company-cols h3 { margin-top: 0; }
@media (max-width: 900px) { .company-cols { grid-template-columns: 1fr; } }
