/* ThuysVers Bezorgplatform — huisstijl 1-op-1 overgenomen van thuysvers_bezorger.html
   (DM Sans/DM Mono, groen palet, zachte groene borders/schaduwen, mono cijfers) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --green-100: #dafee2;
  --green-200: #b8fac6;
  --green-800: #14732b;
  --bg: #f7faf8;
  --bg2: #ffffff;
  --bg3: #f0f5f1;
  --border: #e2ede5;
  --border2: #c8dece;
  --text: #152218;
  --text2: #3d5c45;
  --text3: #7a9a81;
  --accent: #14732b;
  --accent2: #10852c;
  --accent-light: #effef2;
  --accent-mid: #b8fac6;
  --red: #dc2626;
  --red-light: #fef2f2;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'DM Mono', 'Courier New', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --schaduw: 0 1px 3px rgba(20,115,43,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --schaduw-md: 0 4px 12px rgba(20,115,43,0.10), 0 2px 4px rgba(0,0,0,0.04);
  /* aliassen voor bestaande pagina's */
  --groen: var(--accent);
  --groen-licht: var(--accent-light);
  --groen-donker: #115623;
  --kaart: var(--bg2);
  --rand: var(--border);
  --tekst: var(--text);
  --tekst-zacht: var(--text2);
  --tekst-zachter: var(--text3);
  --rood: var(--red);
  --rood-licht: var(--red-light);
  --oranje: var(--amber);
  --oranje-licht: var(--amber-light);
  --blauw: var(--blue);
  --blauw-licht: var(--blue-light);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Topbar / navigatie (analyse-tool stijl: tabs met onderstreping) ---- */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.topbar .logo::before {
  content: ""; width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2c1 3-1 4-1 6 3-1 6 1 6 4 0 3.3-2.7 6-6 6s-6-2.7-6-6c0-2 1-3.5 2-4.5C7.5 9 9 8 9 6c0-1.5 1.5-3 3-4z'/%3E%3C/svg%3E");
  background-size: 18px; background-position: center; background-repeat: no-repeat;
}
.topbar .logo b, .topbar .logo { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.topbar .logo span { display: block; font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.topbar nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; align-self: stretch; }
.topbar nav a {
  color: var(--text3); text-decoration: none; font-weight: 500; font-size: 13px;
  padding: 16px 13px 14px; border-bottom: 2px solid transparent; white-space: nowrap;
  display: flex; align-items: center;
}
.topbar nav a:hover { color: var(--accent); }
.topbar nav a.actief { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.container { max-width: 1280px; margin: 0 auto; padding: 24px 22px 60px; }
.container.smal { max-width: 760px; }

h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 11px; font-weight: 700; margin: 0 0 14px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
h3 { font-size: 14px; font-weight: 700; margin: 0; }
.sub { color: var(--text3); font-size: 13px; margin: 0 0 20px; }

/* ---- Kaarten & grids ---- */
.kaart { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--schaduw); padding: 18px; }
.grid { display: grid; gap: 12px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi-kaart { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--schaduw); }
.kpi-kaart .label { font-size: 11px; font-weight: 500; color: var(--text3); }
.kpi-kaart .waarde { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 2px; }
.kpi-kaart .waarde small { font-size: 13px; color: var(--text3); font-weight: 400; }
.kpi-kaart .waarde.goed { color: var(--accent); }
.kpi-kaart .waarde.slecht { color: var(--red); }
.kpi-kaart .waarde.matig { color: var(--amber); }

/* ---- Tabellen ---- */
table.lijst { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.lijst th {
  text-align: left; font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px;
  border-bottom: 2px solid var(--border); background: var(--bg3);
}
table.lijst td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.lijst tr:last-child td { border-bottom: none; }
table.lijst tr.klikbaar { cursor: pointer; }
table.lijst tr.klikbaar:hover td, table.lijst tbody tr:hover td { background: var(--accent-light); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- Verschil-cellen (gepland vs werkelijk, analyse-tool) ---- */
.diff-cell { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.diff-cell.pos-big { color: var(--red); }
.diff-cell.pos-mid { color: var(--amber); }
.diff-cell.on-time { color: var(--text3); }
.diff-cell.neg { color: var(--accent); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge.groen { background: var(--green-100); color: var(--green-800); }
.badge.grijs { background: var(--bg3); color: var(--text3); }
.badge.rood { background: #fee2e2; color: #991b1b; }
.badge.oranje { background: #fef3c7; color: #92400e; }
.badge.blauw { background: #dbeafe; color: #1e40af; }

/* ---- Knoppen & formulieren ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; border-radius: 9px;
  font-weight: 600; font-size: 13px; padding: 9px 16px; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: background .12s, box-shadow .12s;
}
.btn:hover { background: var(--accent2); box-shadow: var(--schaduw-md); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secundair { background: var(--bg2); color: var(--text2); border: 1px solid var(--border2); }
.btn.secundair:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); box-shadow: none; }
.btn.gevaar { background: var(--red); }
.btn.groot { font-size: 16px; padding: 14px 22px; width: 100%; }
.btn.klein { font-size: 12px; padding: 5px 11px; }

input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
label.veld { display: block; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.veld-rij { display: flex; gap: 12px; flex-wrap: wrap; }
.veld-rij > div { flex: 1; min-width: 140px; }

/* ---- Zoekbalk (analyse-tool) ---- */
.zoek-balk {
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg2);
}
.zoek-balk:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.zoek-balk input { flex: 1; border: 0; background: transparent; box-shadow: none !important; padding: 11px 0; }

/* ---- Voortgangsbalken ---- */
.balk { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.balk > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; transition: width .3s; }
.balk.oranje > div { background: linear-gradient(90deg, var(--amber), #b45309); }
.balk.rood > div { background: linear-gradient(90deg, var(--red), #b91c1c); }

/* grote voortgang met label erin (live-cards) */
.live-progress { position: relative; height: 22px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.live-progress-bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.live-progress-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono); color: var(--text);
  text-shadow: 0 1px 2px rgba(255,255,255,.6);
}

/* ---- Live status-cards (kritiek/waarschuwing/ok/voor/klaar) ---- */
.live-card {
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  border-left-width: 6px; border-left-color: var(--border2);
  background: var(--bg2); box-shadow: var(--schaduw); cursor: pointer;
  transition: box-shadow .12s, transform .12s;
}
.live-card:hover { box-shadow: var(--schaduw-md); transform: translateY(-1px); }
.live-card.live-critical { border-left-color: var(--red); background: #fef2f2; }
.live-card.live-critical .live-progress-bar { background: linear-gradient(90deg, var(--red), #b91c1c); }
.live-card.live-warning { border-left-color: var(--amber); background: #fffbeb; }
.live-card.live-warning .live-progress-bar { background: linear-gradient(90deg, var(--amber), #b45309); }
.live-card.live-ok { border-left-color: #16a34a; background: #f0fdf4; }
.live-card.live-ahead { border-left-color: var(--accent); background: #ecfdf5; }
.live-card.live-done { border-left-color: var(--text3); opacity: .75; }
.live-card .live-row { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; color: var(--text2); }
.live-card .live-row .rood { color: var(--red); font-weight: 600; }
.live-card .live-row .oranje { color: var(--amber); font-weight: 600; }
.live-card .live-row .groen { color: var(--accent); font-weight: 600; }

/* ---- Timeline / Gantt (CS-dashboard) ---- */
.tl-head {
  display: grid; grid-template-columns: 300px 1fr; align-items: center;
  background: #eef4ef; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 12px 12px 0 0; font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .04em;
}
.tl-axis { position: relative; height: 30px; }
.tl-axis span { position: absolute; top: 8px; transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px; }
.tl-wrap { border: 1px solid var(--border); border-radius: 0 0 12px 12px; overflow: hidden; overflow-y: auto; background: var(--bg2); max-height: 440px; }
.tl-row { display: grid; grid-template-columns: 300px 1fr; border-bottom: 1px solid var(--border); cursor: pointer; align-items: center; }
.tl-row:hover { background: var(--accent-light); }
.tl-row.sel { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent); }
.tl-meta { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; min-width: 0; }
.tl-meta .tl-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tl-meta .tl-name small { display: block; font-weight: 400; color: var(--text3); font-size: 11px; }
.cdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dlybadge { font-size: 10.5px; font-weight: 700; border-radius: 30px; padding: 3px 8px; white-space: nowrap; }
.dlybadge.ok { background: var(--accent-light); color: var(--accent); }
.dlybadge.warn { background: var(--amber-light); color: var(--amber); }
.dlybadge.bad { background: var(--red-light); color: var(--red); }
.miniprog { width: 70px; height: 6px; border-radius: 4px; background: var(--bg3); overflow: hidden; flex: none; }
.miniprog i { display: block; height: 100%; }
.tl-bar { position: relative; height: 46px; margin-right: 12px; }
.tl-track { position: absolute; top: 50%; transform: translateY(-50%); height: 10px; border-radius: 6px; opacity: .30; }
.tl-prog { position: absolute; top: 50%; transform: translateY(-50%); height: 10px; border-radius: 6px; }
.tl-node { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #999; }
.tl-node.done { background: currentColor; border-color: currentColor; }
.tl-node.fail { background: var(--red); border-color: var(--red); }
.tl-now { position: absolute; top: 4px; bottom: 4px; width: 2px; background: #0c1410; z-index: 4; }
.tl-now::before { content: "nu"; position: absolute; top: -2px; left: 3px; font-size: 9px; font-weight: 700; color: #0c1410; }

/* ---- Route-analyse layout (sidebar + content, analyse-tool) ---- */
.ra-layout {
  display: grid; grid-template-columns: 270px 1fr; gap: 0; min-height: 560px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schaduw);
}
.ra-sidebar { background: var(--bg2); border-right: 1px solid var(--border); overflow-y: auto; max-height: 80vh; }
.ra-sidebar-head {
  padding: 12px 16px; font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--border);
  background: var(--bg3); position: sticky; top: 0;
}
.ra-content { padding: 20px; overflow-y: auto; max-height: 80vh; background: var(--bg); }
.ra-driver-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; transition: background .1s; }
.ra-driver-item:hover { background: var(--accent-light); }
.ra-driver-item.active { background: var(--accent-light); border-left-color: var(--accent); }
.ra-driver-name { font-size: 13px; font-weight: 600; }
.ra-driver-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.ra-driver-score { font-family: var(--mono); font-size: 12px; margin-top: 5px; font-weight: 500; }
.ra-kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.ra-kpi { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; min-width: 88px; box-shadow: var(--schaduw); }
.ra-kpi-val { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.ra-kpi-lbl { font-size: 10px; color: var(--text3); margin-top: 2px; font-weight: 500; }
.ra-route-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ra-route-tab {
  font-size: 12px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border2);
  cursor: pointer; color: var(--text2); background: var(--bg2); font-weight: 500; font-family: inherit; transition: all .15s;
}
.ra-route-tab:hover { border-color: var(--accent); color: var(--accent); }
.ra-route-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chart-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); width: 100%; max-width: 560px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { border: 0; background: var(--bg3); color: var(--text2); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Toast ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 12px 20px; border-radius: 12px; opacity: 0; transition: all 0.25s; z-index: 1100; max-width: 90vw;
}
#toast.zichtbaar { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.fout { background: var(--red); }

/* ---- Mobiel (driver-app / track) ---- */
.mobiel-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 90px; }
.mobiel-kop { background: var(--accent); color: #fff; padding: 18px 20px; }
.mobiel-kop h1 { color: #fff; font-size: 18px; }
.mobiel-kop .sub { color: rgba(255,255,255,0.75); margin: 0; font-size: 13px; }
.actie-balk {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 50;
}

.leeg { text-align: center; color: var(--text3); padding: 40px 20px; font-size: 13px; }
.rij { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.klein-grijs { font-size: 11.5px; color: var(--text3); }

@media (max-width: 860px) {
  .ra-layout { grid-template-columns: 1fr; }
  .ra-sidebar { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--border); }
  .tl-head, .tl-row { grid-template-columns: 220px 1fr; }
}

@media print {
  .topbar, .btn, .niet-printen { display: none !important; }
  body { background: #fff; }
  .kaart { box-shadow: none; border: 1px solid #ccc; }
}
