/* Huisstijl spaice (spaice.nl): Greed Standard voor tekst, Martina Plantijn voor koppen,
   off-white vlakken, spaice-blauw als enige accent, pil-knoppen, hoekradius 16px. */
@font-face { font-family: "Greed Standard"; src: url("/static/huisstijl/GreedStandard-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Greed Standard"; src: url("/static/huisstijl/GreedStandard-Medium.otf") format("opentype"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Martina Plantijn"; src: url("/static/huisstijl/MartinaPlantijn-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Martina Plantijn"; src: url("/static/huisstijl/MartinaPlantijn-Medium.otf") format("opentype"); font-weight: 500 700; font-display: swap; }
:root {
  --font: "Greed Standard", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --display: "Martina Plantijn", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --accent: #3dadff; --accent-dark: #0f82e0; --accent-soft: #d1ebff;
  --bg: #f8f8f7; --surface: #fff; --surface-2: #f2f2f0; --border: #ebe9e5; --border-strong: #d8d6ce;
  --text: #363330; --text-2: #4a4744; --muted: #6a6763;
  --ok: #127823; --ok-soft: #e0f2ea;
  --warn: #8a5a12; --warn-soft: #fde8c8;
  --fail: #e40014; --fail-soft: #fde3e4;
  --none: #6a6763; --none-soft: #ebe9e5;
  --r: 16px; --shadow: 0 1px 2px rgba(54,51,48,.04), 0 8px 24px rgba(54,51,48,.05);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
h1, h2, h3 { margin: 0; letter-spacing: -.005em; font-family: var(--display); font-weight: 500; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 8px; }
.boot { padding: 40px; color: var(--muted); }

/* raamwerk */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #fff; color: var(--text-2); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 17px; padding: 2px 8px 20px; }
.logo:hover { text-decoration: none; }
.logo .mark { height: 28px; width: auto; display: block; }
.logo .pulse { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(54,51,48,.08), 0 0 0 1px var(--border); }
.logo small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 999px; color: var(--text-2); }
.nav:hover { background: var(--surface-2); text-decoration: none; }
.nav.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.nav .count { margin-left: auto; background: var(--fail); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.nav .count.warn { background: #fabc75; color: #5a3a00; }
.me { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.me b { color: var(--text); display: block; font-size: 13px; }
.main { padding: 26px 30px 60px; min-width: 0; max-width: 1500px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 24px; }
.head h1 .st { vertical-align: middle; font-family: var(--font); }
.head p { margin: 2px 0 0; color: var(--muted); }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.demo-bar { background: #363330; color: #d8d6ce; font-size: 12px; padding: 5px 14px; text-align: center; }

/* knoppen en formulieren */
.btn { font: inherit; font-weight: 500; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: var(--text-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.danger { color: var(--fail); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-dark); cursor: pointer; }
.link:hover { text-decoration: underline; }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 9px; font: inherit; background: #fff; color: var(--text); }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus, .btn:focus-visible, .link:focus-visible, .nav:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field.check { display: flex; gap: 8px; align-items: flex-start; }
.field.check > span { margin: 0; font-weight: 400; font-size: 14px; color: var(--text); }
.field.check input { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-error { background: var(--fail-soft); color: var(--fail); border-radius: 9px; padding: 8px 12px; margin-bottom: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* kaarten en tabellen */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; align-items: start; }
.cols-3 { grid-template-columns: repeat(3, 1fr); align-items: start; }
.cols-wide { grid-template-columns: 1.7fr 1fr; align-items: start; }
.kpis { grid-template-columns: repeat(5, 1fr); margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 500; letter-spacing: -.02em; margin-top: 2px; font-family: var(--display); }
.kpi .hint { font-size: 12px; color: var(--text-2); }
.big { font-size: 26px; font-weight: 500; font-family: var(--display); }
.big small { font: 500 15px var(--font); color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafaf9; }
tr.urgent td { background: var(--fail-soft); }
tr.dim td { opacity: .7; }
.matrix th.c, .matrix td.c { text-align: center; padding-left: 6px; padding-right: 6px; }
.matrix .group td { background: var(--surface-2); font-weight: 700; font-size: 12px; color: var(--text-2); padding: 7px 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right-text { text-align: right; }
.empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.error-box { background: var(--fail-soft); color: var(--fail); border-radius: var(--r); padding: 16px 18px; }

/* status */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.ok { color: var(--ok); background: var(--ok-soft); }
.st.warn { color: var(--warn); background: var(--warn-soft); }
.st.fail { color: var(--fail); background: var(--fail-soft); }
.st.none, .st.unknown { color: var(--none); background: var(--none-soft); }
.dot { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.dot.ok { background: var(--ok-soft); color: var(--ok); }
.dot.warn { background: var(--warn-soft); color: var(--warn); }
.dot.fail { background: var(--fail-soft); color: var(--fail); }
.dot.none, .dot.unknown { background: var(--none-soft); color: var(--none); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.tag.crit { background: var(--fail); color: #fff; border-color: var(--fail); }
.tag.high { background: #e8590c; color: #fff; border-color: #e8590c; }
.tag.med { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.v-snapshot { background: #fff4e6; color: #a85d00; border-color: #ffd8a8; }
.tag.v-managed { background: #e6fcf5; color: #087f5b; border-color: #96f2d7; }
.tag.v-offsite { background: #e7f5ff; color: #1864ab; border-color: #a5d8ff; }

.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: start; }
.attention li:last-child { border-bottom: 0; }
.attention b { display: block; }
.attention .where { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--accent-dark); border-color: var(--accent); }

.checks { grid-template-columns: repeat(3, 1fr); }
.check { padding: 14px 16px; }
.check.warn { border-color: rgba(237,161,0,.5); }
.check.fail { border-color: rgba(228,0,20,.35); }
.check.none { opacity: .75; }
.check .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.check .top b { font-size: 14px; }
.check .top .st { margin-left: auto; }
.check p { margin: 0; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.check .meta { margin-top: 8px; font-size: 11px; color: var(--muted); }

.bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar i.warn { background: #f59f00; } .bar i.fail { background: var(--fail); }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.uptime { display: flex; gap: 2px; margin-top: 8px; }
.uptime i { flex: 1; height: 22px; border-radius: 2px; background: #0aab24; }
.uptime i.warn { background: #fab005; } .uptime i.fail { background: #fa5252; } .uptime i.geen { background: var(--none-soft); }

.chips { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { font: inherit; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips .gap { width: 12px; }
.exception { background: var(--surface-2); border-left: 3px solid var(--none); padding: 6px 10px; border-radius: 6px; font-size: 12px; color: var(--text-2); margin-top: 4px; }

.variants { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.variant { padding: 14px 16px; }
.variant h3 { font-size: 14px; margin-bottom: 6px; font-family: var(--font); }
.variant p { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.variant ul { margin: 0; padding-left: 16px; font-size: 12px; color: var(--text-2); }
.variant .price { font-size: 12px; font-weight: 600; margin-top: 8px; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: start; }
.checklist li:last-child { border-bottom: 0; }
.checklist b { display: block; }
.checklist .how { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.cb { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #fff; padding: 0; color: #fff; }
.cb.on { background: var(--ok); border-color: var(--ok); }
.cb.auto { border-style: dashed; }
button.cb { cursor: pointer; }

.msg { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; font-size: 13px; max-width: 82%; white-space: pre-line; overflow-wrap: anywhere; }
.msg.klant { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.notitie { background: #fff6c7; border-color: #ecd57a; }
.msg.status { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 12px; padding: 0; }
.thread { display: flex; flex-direction: column; gap: 10px; }

/* venster en meldingen */
.overlay { position: fixed; inset: 0; background: rgba(54,51,48,.45); display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: var(--r); box-shadow: 0 20px 60px rgba(54,51,48,.3); width: 100%; max-width: 620px; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; }
.modal-head .link { margin-left: auto; font-size: 20px; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px 20px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #363330; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; }
.toast.fail { background: var(--fail); }
pre.plain { margin: 0; font: 13px/1.5 var(--font); white-space: pre-wrap; }
details > summary { cursor: pointer; }

/* inloggen */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #ebe9e5; }
.login { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(54,51,48,.16); min-height: 520px; }
.login .brand { background: linear-gradient(160deg, #d1ebff, #8cd1fa 70%, #3dadff); padding: 44px; display: flex; flex-direction: column; }
.login .brand h1 { font-size: 38px; margin-top: auto; }
.login .brand p { color: var(--text-2); max-width: 340px; }
.login .form { padding: 44px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.login .ms { font: inherit; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border: 1px solid #8c8c8c; border-radius: 4px; font-weight: 600; background: #fff; color: var(--text); cursor: pointer; }
.login .ms:hover { text-decoration: none; background: #fafafa; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.kop { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* klantportaal */
.portal { max-width: 1100px; margin: 0 auto; min-height: 100vh; }
.portal-top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--border); }
.portal-top .who { margin-left: auto; font-size: 13px; color: var(--text-2); }
.portal-main { padding: 26px 28px 60px; }
.portal-main h1 { font-size: 26px; }
.banner { display: flex; align-items: center; gap: 14px; background: var(--accent-soft); border: 1px solid #8cd1fa; border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; }
.banner.warn { background: var(--warn-soft); border-color: rgba(237,161,0,.4); }
.banner .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.banner .icon { font-size: 22px; }
.sol { padding: 18px 20px; }
.sol h3 { font-size: 17px; }
.sol .state { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; font-size: 15px; font-weight: 600; }
.sol .state .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.sol .state .ic.ok { background: var(--ok-soft); color: var(--ok); } .sol .state .ic.warn { background: var(--warn-soft); color: var(--warn); }
.sol .state .ic.fail { background: var(--fail-soft); color: var(--fail); } .sol .state .ic.none { background: var(--none-soft); color: var(--none); }
.sol ul { list-style: none; margin: 0; padding: 0; }
.sol li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.sol li > span:first-child { width: 22px; text-align: center; }
.sol li .v { margin-left: auto; color: var(--text-2); text-align: right; }
.sol li .v.warn { color: var(--warn); } .sol li .v.fail { color: var(--fail); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .cols-wide, .cols-2, .cols-3, .checks, .variants { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .side .logo { width: 100%; padding-bottom: 6px; }
  .nav-label { display: none; }
  .me { margin: 0 0 0 auto; border: 0; padding: 6px 10px; }
  .main { padding: 18px 14px 40px; }
  .kpis, .form-grid { grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .brand { padding: 28px; } .login .brand h1 { font-size: 28px; margin-top: 24px; }
  .dl { grid-template-columns: 120px 1fr; }
  .banner { flex-wrap: wrap; }
}
@media print { .side, .actions, #toasts { display: none !important; } .app { display: block; } }
