@font-face { font-family: Kanit; font-weight: 300; src: url(fonts/kanit-300-latin.woff2) format("woff2"); }
@font-face { font-family: Kanit; font-weight: 400; src: url(fonts/kanit-400-latin.woff2) format("woff2"); }
@font-face { font-family: Kanit; font-weight: 500; src: url(fonts/kanit-500-latin.woff2) format("woff2"); }
@font-face { font-family: Kanit; font-weight: 600; src: url(fonts/kanit-600-latin.woff2) format("woff2"); }

:root {
  --navy: #052350; --ink: #000528; --red: #B61414; --cyan: #0EB3C8;
  --paper: #F4F6F9; --mist: #D2D7E0; --steel: #7F90A7; --muted: #52627A; --white: #fff;
  --green: #1E8E5A; --amber: #D98A00; --grey: #9AA6B8;
  --u0: #EEF1F5; --u1: #D9F2F6; --u2: #A9E3EC; --u3: #CDEBD9; --u4: #F6D2D2;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Kanit, system-ui, sans-serif; font-weight: 300; color: var(--ink); background: var(--paper); font-size: 14px; }
h1, h2, h3 { font-weight: 500; color: var(--navy); margin: 0 0 .6em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--mist); background: var(--white); color: var(--navy); border-radius: var(--radius); padding: 5px 12px; }
button:hover { border-color: var(--steel); }
button.primary { background: var(--navy); border-color: var(--navy); color: var(--white); font-weight: 400; }
button.primary:hover { background: #0a3470; }
button.danger { color: var(--red); }
button.link { border: 0; background: none; padding: 0 4px; color: var(--muted); }
button.link:hover { color: var(--navy); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--mist); border-radius: var(--radius); padding: 5px 8px; background: var(--white); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* top bar */
header.top { background: var(--navy); color: var(--white); display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 52px; position: sticky; top: 0; z-index: 20; }
header.top .brand { font-weight: 500; font-size: 18px; letter-spacing: .3px; }
header.top .brand span { color: var(--cyan); }
header.top nav { display: flex; gap: 4px; }
header.top nav a { color: #c8d2e2; text-decoration: none; padding: 6px 12px; border-radius: var(--radius); position: relative; }
header.top nav a:hover { color: var(--white); background: rgba(255,255,255,.07); }
header.top nav a.active { color: var(--white); background: rgba(255,255,255,.13); }
header.top .badge { background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
header.top .user { margin-left: auto; display: flex; gap: 8px; align-items: center; color: #c8d2e2; }
header.top .user button { background: transparent; color: #c8d2e2; border-color: rgba(255,255,255,.25); }

main { padding: 20px; max-width: 100%; }
.card { background: var(--white); border-radius: 8px; border: 1px solid var(--mist); padding: 16px 18px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* login */
.login { max-width: 380px; margin: 10vh auto; }
.login .card { padding: 28px; }
.login input { width: 100%; margin-bottom: 12px; }
.login button { width: 100%; }
.login .qr { display: block; margin: 10px auto; width: 200px; height: 200px; }
.error { color: var(--red); margin: 8px 0; min-height: 1em; }
.notice { background: #FFF6E0; border: 1px solid #F0D9A0; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; }

/* tables */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--mist); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: 12px; background: var(--white); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F7F9FC; }

/* planbord */
.board-wrap { overflow: auto; max-height: calc(100vh - 150px); background: var(--white); border: 1px solid var(--mist); border-radius: 8px; }
table.board { width: auto; min-width: 100%; }
table.board th, table.board td { border-bottom: 1px solid #E8EBF0; padding: 0; height: 32px; }
table.board thead th { position: sticky; top: 0; z-index: 3; text-align: center; padding: 4px 2px; border-bottom: 1px solid var(--mist); }
table.board thead th.now { color: var(--navy); box-shadow: inset 0 -3px 0 var(--cyan); }
table.board .lab { position: sticky; left: 0; z-index: 2; background: var(--white); min-width: 300px; max-width: 300px; padding: 0 10px; border-right: 1px solid var(--mist); }
table.board thead .lab { z-index: 4; }
table.board td.wk { min-width: 64px; width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
tr.worker td { border-top: 1px solid var(--mist); }
tr.worker .lab { font-weight: 400; cursor: pointer; }
tr.worker .lab .caret { display: inline-block; width: 14px; color: var(--steel); }
tr.worker td.wk { font-size: 12px; cursor: pointer; }
td.wk.u0 { background: var(--u0); color: var(--steel); }
td.wk.u1 { background: var(--u1); }
td.wk.u2 { background: var(--u2); }
td.wk.u3 { background: var(--u3); }
td.wk.u4 { background: var(--u4); color: var(--red); font-weight: 500; }
td.wk.na { background: repeating-linear-gradient(45deg, #F1F3F6, #F1F3F6 4px, #E7EAEF 4px, #E7EAEF 8px); color: var(--steel); }
tr.assign .lab { padding-left: 26px; font-size: 13px; }
tr.assign .lab .pname { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
tr.assign .lab .cust { color: var(--muted); font-size: 11px; display: block; line-height: 1; margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr.assign td.wk { position: relative; }
tr.assign input.h { width: 100%; height: 31px; border: 0; border-radius: 0; text-align: center; background: transparent; padding: 0 2px; -moz-appearance: textfield; }
tr.assign input.h::-webkit-outer-spin-button, tr.assign input.h::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
tr.assign input.h:hover { background: #F4F8FB; }
tr.assign input.h.filled { background: #EAF6F8; font-weight: 400; }
tr.assign.tent input.h.filled { background: repeating-linear-gradient(45deg, #FFF8E8, #FFF8E8 5px, #FFF0CC 5px, #FFF0CC 10px); }
tr.assign input.h.saving { color: var(--steel); }
tr.assign input.h.err { outline: 2px solid var(--red); }
tr.assign .act { position: absolute; bottom: 1px; right: 3px; font-size: 9px; color: var(--steel); pointer-events: none; }
tr.assign td.wk.past input.h { color: var(--muted); }
tr.addrow .lab { padding-left: 26px; }
.tag { display: inline-block; font-size: 10px; border-radius: 3px; padding: 0 5px; margin-left: 4px; vertical-align: middle; font-weight: 400; }
.tag.tent { background: #FFF0CC; color: #7A5200; }
.tag.pipe { background: #E8E2FA; color: #4B2E9A; }
.menu-btn { float: right; color: var(--steel); border: 0; background: none; padding: 2px 4px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* popover / modal */
.pop { position: absolute; z-index: 50; background: var(--white); border: 1px solid var(--mist); border-radius: 8px; box-shadow: 0 6px 24px rgba(5,35,80,.15); padding: 6px; min-width: 200px; }
.pop button { display: block; width: 100%; text-align: left; border: 0; padding: 7px 10px; }
.pop button:hover { background: var(--paper); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,5,40,.35); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.modal { background: var(--white); border-radius: 10px; padding: 22px; width: 420px; max-width: 94vw; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.modal .grid .full { grid-column: 1 / -1; }
.modal input, .modal select, .modal textarea { width: 100%; }
.modal .buttons { display: flex; justify-content: flex-end; gap: 8px; }

/* projecten */
.health { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; }
.health.groen { background: var(--green); } .health.oranje { background: var(--amber); }
.health.rood { background: var(--red); } .health.grijs { background: var(--grey); }
.bar { height: 8px; background: var(--u0); border-radius: 4px; overflow: hidden; width: 110px; display: inline-block; vertical-align: middle; position: relative; }
.bar > i { display: block; height: 100%; background: var(--cyan); }
.bar > i.over { background: var(--red); }
.bar > b { position: absolute; top: 0; height: 100%; background: rgba(5,35,80,.25); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1px solid var(--mist); border-radius: 8px; padding: 12px 14px; }
.kpi .v { font-size: 24px; font-weight: 500; color: var(--navy); }
.kpi .l { font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 14px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input[type=checkbox], .modal input[type=checkbox] { width: auto; }
label.row { display: flex; color: var(--ink); }
.comment { border-bottom: 1px solid var(--mist); padding: 8px 0; white-space: pre-wrap; }
.comment .meta { font-size: 12px; color: var(--muted); }
.reasons { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }

/* feed */
.feed-day { font-weight: 500; color: var(--navy); margin: 16px 0 6px; }
.feed-item { display: flex; gap: 12px; padding: 7px 10px; border-radius: var(--radius); }
.feed-item.new { background: #EAF6F8; }
.feed-item .t { color: var(--muted); width: 48px; flex: none; font-variant-numeric: tabular-nums; }
.feed-item .who { color: var(--navy); font-weight: 400; width: 150px; flex: none; }

/* beschikbaarheid */
table.avail td.wk input { width: 56px; text-align: center; border-color: transparent; background: transparent; padding: 4px 2px; }
table.avail td.wk input:hover { border-color: var(--mist); }
table.avail td.wk { padding: 2px; text-align: center; position: relative; white-space: nowrap; }
table.avail td.wk.src-handmatig input { background: #FFF0CC; }
table.avail td.wk.src-standaard input { color: var(--muted); }
table.avail td.wk .reset { position: absolute; top: 0; right: 0; font-size: 10px; padding: 0 3px; border: 0; background: none; color: var(--steel); }
pre.log { background: var(--paper); padding: 10px; border-radius: var(--radius); white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 9px 18px; border-radius: 8px; z-index: 80; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }
