/* NRG-TEC planner — opmaak volgens het brandbook (2025):
   primaire kleuren #FFB41C, #C46D00, #1E2346 · secundaire #1A1917, #FFF7E6, #FFF1E6, #E6EBFF, #D2050A, #5AC878
   hoofdlettertype Montserrat (lopende tekst), tweede lettertype Outfit (titels, knoppen, labels).
   Beide worden meegeleverd in assets/fonts (zie fonts.css); er worden geen lettertypes van buitenaf geladen. */
:root {
  --navy: #1E2346; --navy-2: #2a3060; --amber: #FFB41C; --amber-dark: #C46D00; --tint: #FFF7E6; --tint-2: #FFF1E6;
  --bg: #F6F5F1; --panel: #ffffff; --ink: #1A1917; --muted: #6b6a66; --line: #e3e0d8; --line-2: #cfcbc0;
  --ok: #2f8f4e; --ok-bg: #e4f5ea; --ok-brand: #5AC878; --warn: #C46D00; --warn-text: #8a4d00; --warn-bg: #FFF1E6; --bad: #D2050A; --bad-bg: #fde8e8; --info-bg: #E6EBFF;
  --r: 10px; --shadow: 0 8px 30px rgba(30, 35, 70, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Montserrat", "Outfit", "Segoe UI", system-ui, sans-serif; font-weight: 500; }
body.modal-open { overflow: hidden; }
a { color: var(--navy); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
small, .muted { color: var(--muted); font-size: 13px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber-dark); }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; accent-color: var(--navy); }
textarea { min-height: 80px; resize: vertical; }

/* schil */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .box { background: var(--panel); border-radius: 16px; padding: 32px; max-width: 420px; width: 100%; box-shadow: var(--shadow); text-align: center; }
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 6px 6px 2px; }
.brand img { width: 100%; height: auto; display: block; }
.brand small { display: block; color: #c9ccdf; margin-top: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
h1, h2, h3, .btn, .chip, .nav a, .pill, th { font-family: "Outfit", "Montserrat", "Segoe UI", system-ui, sans-serif; }
.pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.ok { background: var(--ok-brand); color: var(--navy); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #e6e8f3; text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a.on { background: var(--amber); color: var(--navy); }
.nav .badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.nav a.on .badge { background: var(--navy); }
.nav .sep { margin: 8px 10px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9aa0c3; }
.side-foot { margin-top: auto; font-size: 12px; color: #c9ccdf; display: flex; flex-direction: column; gap: 8px; }
.side-foot select { background: var(--navy-2); color: #fff; border-color: #3d4478; font-size: 12px; padding: 6px 8px; }
.mode { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--amber); color: var(--navy); font-weight: 700; font-size: 11px; }
main { padding: 22px 26px 60px; min-width: 0; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* knoppen en chips */
.btn { border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.btn.primary:hover { background: #ffc24a; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0b8b8; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.icon { padding: 6px 9px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.scheduled { background: var(--info-bg); color: var(--navy); }
.pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.cancelled { background: var(--bad-bg); color: var(--bad); }
.pill.busy { background: #eee; color: var(--muted); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.tag { background: var(--tint); color: var(--warn-text); }
.init { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--c, var(--navy)); color: #fff; font-size: 11px; font-weight: 800; flex: none; }
.init.light { color: var(--navy); }

/* panelen, tabellen */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel + .panel { margin-top: 14px; }
.cols { display: grid; gap: 14px; }
.cols.two { grid-template-columns: 1fr 1fr; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi b { font-size: 22px; display: block; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: #faf9f6; }
tr.row { cursor: pointer; } tr.row:hover td { background: var(--tint); }
tr.off td { color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--r); }
.notice { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: #7a4300; }
.notice.bad { background: var(--bad-bg); color: #8a0007; }
.notice.ok { background: var(--ok-bg); color: #1d6b3b; }
.notice.info { background: var(--info-bg); color: var(--navy); }

/* weekoverzicht */
.week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.week.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-height: 300px; display: flex; flex-direction: column; }
.day.today { border-color: var(--amber-dark); box-shadow: inset 0 3px 0 var(--amber); }
.day.picked { border-color: var(--navy); box-shadow: inset 0 3px 0 var(--navy), 0 0 0 2px var(--navy); }
.datepick { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.datepick span { color: var(--muted); font-size: 13px; }
.datepick input { width: auto; padding: 6px 8px; }
.day header { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; }
.day header b { font-size: 14px; } .day header small { font-weight: 700; }
.day .list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.day .free { padding: 4px 10px 10px; font-size: 12px; color: var(--muted); margin-top: auto; }
.ap { border: 1px solid var(--line); border-left: 4px solid var(--c, var(--navy)); border-radius: 8px; padding: 6px 8px; background: #fff; cursor: pointer; font-size: 13px; line-height: 1.3; }
.ap:hover { background: var(--tint); }
.ap .t { font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ap .n { font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap .s { color: var(--muted); font-size: 12px; }
.ap.cancelled { opacity: .55; text-decoration: line-through; }
.ap.busy { background: repeating-linear-gradient(135deg, #f4f3ef 0 6px, #fff 6px 12px); border-left-color: #999; }
.ap.online .n::after { content: " · online"; color: var(--warn-text); font-size: 11px; }
.ap .flag { color: var(--warn-text); font-size: 11px; font-weight: 700; }

/* dagoverzicht met tijdlijn */
.lanes-wrap { overflow-x: auto; }
.lanes { display: grid; grid-template-columns: 56px repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.lane-h { font-weight: 700; padding: 6px 8px; display: flex; align-items: center; gap: 8px; }
.timeline { position: relative; height: calc(var(--mins) * 1px); }
.timeline .hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.timeline .hour span { position: relative; top: -8px; background: var(--bg); padding-right: 4px; }
.lane { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); height: calc(var(--mins) * 1px); overflow: hidden; }
.lane .win { position: absolute; left: 0; right: 0; background: var(--tint-2); border-top: 1px dashed var(--amber-dark); border-bottom: 1px dashed var(--amber-dark); }
.lane .blk { position: absolute; left: 6px; right: 6px; border-radius: 8px; border: 1px solid var(--line-2); border-left: 4px solid var(--c, var(--navy)); background: #fff; padding: 4px 8px; font-size: 12px; overflow: hidden; cursor: pointer; }
.lane .blk:hover { background: var(--tint); }
.lane .blk.cancelled { opacity: .5; text-decoration: line-through; }
.lane .blk.busy { background: repeating-linear-gradient(135deg, #f4f3ef 0 6px, #fff 6px 12px); border-left-color: #999; }
.lane .gap { position: absolute; left: 10px; right: 10px; font-size: 11px; color: var(--muted); text-align: center; border-top: 1px dashed var(--line-2); padding-top: 2px; }
.lane .gap.wait { color: var(--warn-text); font-weight: 700; }

/* nieuwe afspraak */
.steps { display: grid; grid-template-columns: 1fr; gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-size: 13px; }
.step.done h2 .num { background: var(--ok); }
.step.off { opacity: .55; }
.clist { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.clist div { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.clist div:hover, .clist div.on { background: var(--tint); }
.cust { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; background: var(--tint); border-radius: 8px; padding: 10px 12px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; cursor: pointer; background: #fff; }
.radios label.on { border-color: var(--navy); background: var(--info-bg); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dh { font-size: 11px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; }
.cal .d { border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 13px; cursor: pointer; background: #fff; min-height: 46px; }
.cal .d small { display: block; font-size: 10px; }
.cal .d.free:hover { border-color: var(--navy); }
.cal .d.free small { color: var(--ok); }
.cal .d.full, .cal .d.closed, .cal .d.none, .cal .d.past { background: #f1efe9; color: var(--muted); cursor: default; }
.cal .d.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.cal .d.on small { color: #ffd77a; }
.cal .d.today { outline: 2px solid var(--amber); }
.cal .d.pad { visibility: hidden; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 8px; }
.reco { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.reco .slot { border: 2px solid var(--amber); background: var(--tint); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.reco .slot:hover { background: #ffecc2; }
.reco .slot b { font-size: 18px; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slots .sl { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; background: #fff; font-weight: 600; font-size: 13px; }
.slots .sl:hover { border-color: var(--navy); background: var(--info-bg); }
.slots .sl.best { border-color: var(--amber-dark); }
.slots .sl small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.replist { display: flex; flex-direction: column; gap: 10px; }
.replist > div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: start; }
.replist .who { display: flex; align-items: center; gap: 8px; font-weight: 700; }

/* lade */
.backdrop { position: fixed; inset: 0; background: rgba(26, 25, 23, .45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.wide { width: min(760px, 100%); }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer .drawer-body { padding: 18px 20px; overflow: auto; flex: 1; }
.drawer footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(26, 25, 23, .45); }
.dialog .box { background: #fff; border-radius: 12px; padding: 20px; max-width: 440px; width: calc(100% - 32px); box-shadow: var(--shadow); }
.dialog .box .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.fld small { display: block; margin-top: 3px; }
.fld.inline { display: flex; align-items: center; gap: 8px; } .fld.inline > span { margin: 0; text-transform: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; margin: 8px 0 14px; }
.kv > span:nth-child(odd) { color: var(--muted); font-size: 13px; }
.log { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.log li { padding: 4px 0 4px 12px; font-size: 13px; }
.log li small { display: block; }
.hours td { padding: 4px 6px; }
.hours input[type=text] { padding: 5px 8px; }

/* meldingen */
.nlist { display: flex; flex-direction: column; gap: 8px; }
.nitem { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.nitem.unread { border-left: 4px solid var(--amber); }
.nitem.warn { background: var(--warn-bg); }
.nitem .meta { font-size: 12px; color: var(--muted); }
.mailbox { white-space: pre-wrap; background: #faf9f6; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.task.done { opacity: .55; text-decoration: line-through; }
.task input { margin-top: 3px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 60; box-shadow: var(--shadow); font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.help h3 { margin-top: 18px; }
.help p, .help li { max-width: 760px; }
kbd { background: #eee; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(3, 1fr); } .cols.two, .cols.three { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } main { padding: 14px; } .week { grid-template-columns: 1fr; } .lanes { grid-template-columns: 40px repeat(var(--n, 3), minmax(150px, 1fr)); min-width: calc(40px + var(--n, 3) * 158px); } .grid2, .grid3 { grid-template-columns: 1fr; } .replist > div { grid-template-columns: 1fr; } }

/* hulpgids: vraagteken rechtsonder en zoekpaneel */
.help-fab { position: fixed; right: 18px; bottom: 18px; z-index: 44; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--amber); color: var(--navy); font: 800 22px/1 Outfit, Montserrat, sans-serif; box-shadow: 0 4px 14px rgba(30,35,70,.25); }
.help-fab:hover, .help-fab:focus-visible { background: var(--navy); color: #fff; outline: 2px solid var(--amber); outline-offset: 2px; }
.help-panel { position: fixed; right: 18px; bottom: 72px; z-index: 45; width: min(440px, calc(100% - 36px)); max-height: min(640px, calc(100vh - 100px)); display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(30,35,70,.25); padding: 12px; }
.help-panel[hidden] { display: none; }
.help-panel header { display: flex; justify-content: space-between; align-items: center; }
.help-panel footer { font-size: 13px; text-align: right; }
.help-res { overflow: auto; min-height: 0; flex: 1; }
.help-res h3, .help h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
.help-item { border-bottom: 1px solid var(--line); padding: 6px 0; }
.help-item summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.help-body { padding: 6px 2px 4px; font-size: 14px; line-height: 1.5; }
.help-body ul, .help-body ol { margin: 4px 0; padding-left: 20px; }
.help-body p { margin: 4px 0; }
kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; font: 600 12px/1.6 Montserrat, sans-serif; background: #fff; color: var(--ink); }
@media print { .help-fab, .help-panel { display: none !important; } }
/* enkel bekijken (vertegenwoordiger met 'enkel eigen klanten'): geen knoppen om aan te maken of te wijzigen */
body.view-only #newBtn, body.view-only #gSync, body.view-only #addRep, body.view-only .drawer .btn.primary, body.view-only .drawer .btn.danger { display: none !important; }
