:root {
  color-scheme: dark;
  --bg: #070C16; --bg-2: #0D1524; --card: #111B2E; --card-2: #16233B; --fg: #F2F5FA; --muted: #A3AFC2; --dim: #8794AA;
  --line: #1F2B42; --line-2: #2E3D5A; --blue: #2F7BFF; --blue-hi: #8DB6FF; --blue-bg: #12264A;
  --green: #4FD18B; --amber: #F5B544; --red: #FF7A7A;
  --display: Archivo, "Segoe UI", system-ui, sans-serif; --body: Manrope, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); }
a { color: var(--blue-hi); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800; }
h2 { font-size: 1.1rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.klein { font-size: 13px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.zij { flex: 0 0 236px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.zij img { width: 92px; margin: 0 0 18px 10px; }
.zij a, .zij button { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--muted); font: inherit; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.zij a:hover, .zij button:hover { color: var(--fg); background: var(--card); }
.zij a[aria-current="page"] { color: var(--fg); background: var(--card-2); font-weight: 700; }
.zij .kop { margin: 18px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.zij .tel { font-size: 12px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 8px; }
.inhoud { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 36px) 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1500px; }
.onder { display: none; }

@media (max-width: 860px) {
  .zij { display: none; }
  .inhoud { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); gap: 16px; }
  .onder { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--bg-2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .onder a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
  .onder a[aria-current="page"] { color: var(--fg); }
  .onder a.plus span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue); color: #fff; font-size: 22px; line-height: 1; }
  .onder svg { width: 22px; height: 22px; }
  .eerst-mobiel { order: -1; }
}

/* koppen */
.paginakop { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.paginakop > div { flex: 1 1 260px; }
.paginakop p { margin: 2px 0 0; }
.terug { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }

/* knoppen en formulieren */
.knop { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; font: inherit; font-weight: 700; color: var(--fg); background: transparent; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.knop:hover { border-color: var(--blue-hi); }
.knop.blauw { color: #fff; background: var(--blue); border-color: var(--blue); }
.knop.blauw:hover { background: #4A8DFF; }
.knop.rood { color: var(--red); border-color: #5A2A2A; }
.knop.klein { min-height: 36px; padding: 0 12px; font-size: 13px; }
.knop:disabled { opacity: .5; cursor: default; }
.knoppen { display: flex; flex-wrap: wrap; gap: 8px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--fg); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .knop:focus-visible, a:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 1px; }
.velden { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.velden .breed { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; }
.fout { color: var(--red); font-weight: 600; }

/* kaarten */
.kaart { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.kaart > h2 { margin-bottom: 12px; }
.rij2 { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.rij2 > * { flex: 1 1 340px; }
.rij2 > .groot { flex: 3 1 480px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi b { font-family: var(--display); font-size: 26px; font-weight: 800; }
.kpi small { color: var(--dim); font-size: 12px; }
.lijst { list-style: none; margin: 0; padding: 0; }
.lijst li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.lijst li:first-child { border-top: 0; padding-top: 0; }
.lijst a { color: var(--fg); text-decoration: none; font-weight: 700; }
.lijst a:hover { color: var(--blue-hi); }
.stip { flex: none; width: 10px; height: 10px; border-radius: 999px; margin-top: 7px; background: var(--blue-hi); }
.stip.let-op { background: var(--amber); } .stip.fout { background: var(--red); }
.leeg { color: var(--muted); padding: 8px 0; }
.balk { display: grid; grid-template-columns: 130px 1fr 32px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.balk div { height: 10px; background: #1A2740; border-radius: 999px; overflow: hidden; }
.balk i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.balk b { text-align: right; }
.voortgang { height: 12px; background: #1A2740; border-radius: 999px; overflow: hidden; }
.voortgang i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.label { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; color: var(--blue-hi); background: var(--blue-bg); }
.label.concept { color: var(--amber); background: #2A2110; }
.label.verstuurd { color: var(--blue-hi); }
.label.geaccepteerd { color: var(--green); background: #10291D; }
.label.afgewezen, .label.verlopen { color: var(--muted); background: var(--card-2); }

/* kanban */
.bord-wrap { overflow-x: auto; padding-bottom: 8px; margin: 0 -4px; }
.bord { display: grid; grid-template-columns: repeat(7, minmax(170px, 1fr)); gap: 10px; min-width: 1260px; padding: 0 4px; }
.kolom { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.kolom.over { border-color: var(--blue); background: #0F1C33; }
.kolom > header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-weight: 700; font-size: 14px; }
.kolom > header span { color: var(--muted); font-weight: 600; }
.pkaart { background: var(--card); border: 1px solid #24324D; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: grab; }
.pkaart:hover { border-color: var(--line-2); }
.pkaart.sleep { opacity: .4; }
.pkaart a { color: var(--fg); text-decoration: none; font-weight: 700; }
.pkaart .dienst { font-size: 11px; font-weight: 700; color: var(--blue-hi); text-transform: uppercase; letter-spacing: .04em; }
.pkaart .onderrij { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.pkaart select { min-height: 36px; padding: 4px 8px; font-size: 13px; }
.m-goed { color: var(--green); font-weight: 700; } .m-matig { color: var(--amber); font-weight: 700; } .m-laag { color: var(--red); font-weight: 700; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 12px 16px; color: var(--muted); font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--fg); border-color: var(--blue); }

/* tabellen */
.tabel-wrap { overflow-x: auto; }
table.tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabel th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabel td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabel td.num, .tabel th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabel input, .tabel select { min-height: 38px; padding: 4px 8px; }
.tabel .w-oms { min-width: 260px; }
.tabel .w-oms .label { margin-top: 4px; }
.tabel .w-aantal { min-width: 84px; width: 90px; } .tabel .w-prijs { min-width: 100px; width: 110px; } .tabel .w-eenh { min-width: 72px; width: 80px; } .tabel .w-soort { min-width: 150px; }
.tabel tr.groep td { padding-top: 18px; font-weight: 800; font-family: var(--display); border-bottom: 0; }
.tabel tr.groep .label { margin-left: 6px; }
.icoon { min-width: 38px; min-height: 38px; display: inline-grid; place-items: center; background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer; font: inherit; font-size: 18px; }
.icoon:hover { color: var(--red); border-color: var(--line-2); }

.som { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14px; }
.som dt { color: var(--muted); }
.som dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.som .tot { font-weight: 800; color: var(--fg); font-size: 16px; padding-top: 6px; border-top: 1px solid var(--line); }

.contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login img { width: 120px; margin: 0 auto 8px; }

/* ---------- live kantoor ---------- */
.kantoor { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px;
  background: linear-gradient(#0E1830, #0A1222); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.bureau { position: relative; background: #111B2E; border: 1px solid #1F2B42; border-radius: 14px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.bureau svg { width: 100%; height: auto; display: block; }
.bureau b { font-size: 14px; }
.bureau .rol { font-size: 12px; color: var(--dim); }
.ballon { position: relative; font-size: 12.5px; line-height: 1.35; padding: 6px 9px; border-radius: 10px; background: var(--card-2); color: var(--fg); margin-top: 4px; min-height: 2.7em; }
.bureau.bezig .ballon { background: #1B2E52; }
.bureau.bezig .ballon::before { content: ""; position: absolute; top: -6px; left: 22px; border: 6px solid transparent; border-top: 0; border-bottom-color: #1B2E52; }
.status-stip { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #3A4762; }
.bureau.bezig .status-stip { background: var(--green); box-shadow: 0 0 0 0 rgba(79, 209, 139, .6); animation: puls 1.8s infinite; }
@keyframes puls { 70% { box-shadow: 0 0 0 8px rgba(79, 209, 139, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 209, 139, 0); } }
.bureau .scherm { fill: #0A1222; }
.bureau.bezig .scherm { fill: #12305E; }
.bureau .regel { opacity: .25; }
.bureau.bezig .regel { animation: regel 1.4s infinite; }
.bureau.bezig .regel:nth-of-type(2) { animation-delay: .35s; }
.bureau.bezig .regel:nth-of-type(3) { animation-delay: .7s; }
@keyframes regel { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.bureau.bezig .arm-l { animation: typ .28s infinite alternate; transform-origin: 40px 60px; }
.bureau.bezig .arm-r { animation: typ .28s .14s infinite alternate; transform-origin: 46px 60px; }
@keyframes typ { to { transform: translateY(2px); } }
.bureau .koffie { opacity: 1; transition: opacity .3s; }
.bureau.bezig .koffie { opacity: 0; }
.bureau .stoom { opacity: .5; animation: stoom 3s infinite; }
@keyframes stoom { 0% { transform: translateY(0); opacity: 0; } 40% { opacity: .5; } 100% { transform: translateY(-6px); opacity: 0; } }
.bureau:not(.bezig) .persoon { animation: adem 4s ease-in-out infinite; transform-origin: 40px 80px; }
@keyframes adem { 50% { transform: scale(1.015) translateY(-.5px); } }

.veld { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.locatie { background: #111B2E; border: 1px solid #1F2B42; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.locatie svg { width: 100%; height: auto; display: block; background: linear-gradient(#16264A, #1B2F55 70%, #1F3A2C 70%); }
.locatie .info { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.locatie .info b { font-size: 14px; }
.locatie .info span { font-size: 12.5px; color: var(--muted); }
.locatie.probleem { border-color: #6B2A2A; }
.locatie .hamer { transform-origin: 158px 32px; animation: hamer .5s infinite alternate ease-in; }
@keyframes hamer { from { transform: rotate(-35deg); } to { transform: rotate(10deg); } }
.locatie .bus { animation: rijden 6s linear infinite; }
@keyframes rijden { from { transform: translateX(-70px); } to { transform: translateX(250px); } }
.locatie .wiel { transform-box: fill-box; transform-origin: center; animation: draai .6s linear infinite; }
@keyframes draai { to { transform: rotate(360deg); } }
.locatie .alarm { animation: knipper 1s infinite; }
.locatie .vlam { transform-box: fill-box; transform-origin: center bottom; animation: vlam .22s infinite alternate ease-in-out; }
@keyframes vlam { from { transform: scale(.85, .7); opacity: .75; } to { transform: scale(1.1, 1.25); opacity: 1; } }
.locatie .vonk { animation: vonk .5s infinite steps(1); }
.locatie .later { animation-delay: .25s; }
@keyframes vonk { 0% { opacity: 1; } 50% { opacity: 0; } }
.locatie .lamp { animation: lamp 3s infinite; }
@keyframes lamp { 0%, 45% { opacity: 0; } 50%, 100% { opacity: .9; } }
.locatie .sleutel { transform-origin: 106px 76px; animation: sleutel .6s infinite alternate ease-in-out; }
@keyframes sleutel { from { transform: rotate(-12deg); } to { transform: rotate(14deg); } }
.locatie .druppel { animation: druppel 1.1s infinite ease-in; }
.locatie .druppel.later { animation-delay: .55s; }
@keyframes druppel { from { transform: translateY(0); opacity: 1; } to { transform: translateY(14px); opacity: 0; } }
@keyframes knipper { 50% { opacity: .2; } }
.tijdlijn li { align-items: baseline; }
@media (prefers-reduced-motion: reduce) {
  .bureau *, .locatie *, .status-stip { animation: none !important; }
}

#melding { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 18px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
#melding.fout { border-color: #5A2A2A; color: var(--red); }
@media (max-width: 860px) {
  #melding { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 22px; }
}

/* Hoofdkwartier (isometrisch kantoor) */
.hq-balk { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.hq-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); font-size:12.5px; font-weight:700; }
.hq-chip i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.hq-stip { width:7px; height:7px; border-radius:50%; background:#64748B; }
.hq-chip.bezig .hq-stip { background:#4FD18B; box-shadow:0 0 0 3px rgba(79,209,139,.2); }
.hq-vloer { width:100%; }
a.bureau { cursor: pointer; transition: border-color .15s, transform .15s; }
a.bureau:hover, a.bureau:focus-visible { border-color: var(--blue-hi); transform: translateY(-2px); }
a.bureau .ballon::after { content: " \2192"; opacity: .7; }
