:root {
  --navy: #102a43;
  --navy-2: #173a5e;
  --green: #e8801f;
  --green-dark: #cf6a12;
  --coral: #e5484d;
  --ok: #12a06c;
  --amber: #f5a524;
  --red: #e5484d;
  --ink: #102a43;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f7fa;
  --card: #ffffff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); display: flex; font-size: 15px;
}
a { color: var(--navy-2); }

/* zijbalk */
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--navy); color: #cbd5e1;
  padding: 22px 14px; display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; overflow-y: auto;
}
.brand { display: block; padding: 0 6px; }
.brand img { width: 100%; max-width: 200px; display: block; }
.clockwarn { background: var(--coral); color: #fff; font-size: 13px; border-radius: 8px; padding: 8px 10px; margin: 0 4px 12px; }
.site { color: #9fb3c8; font-size: 12px; padding: 10px 8px 16px; font-weight: 600; letter-spacing: .04em; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: #dbe4ee; text-decoration: none; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: 15px;
}
.sidebar nav a:hover { background: var(--navy-2); }
.sidebar nav a.active { background: var(--green); color: #fff; font-weight: 700; }
.ico { width: 18px; text-align: center; opacity: .9; }
.navlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7b93ad; padding: 16px 12px 6px; }
.badge { margin-left: auto; background: var(--green); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 700; }
.badge.warn { background: var(--coral); color: #fff; }

main { flex: 1; padding: 28px 32px; min-width: 0; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin-right: auto; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: #dcfce7; color: #14532d; }
.flash.error { background: #fee2e2; color: #7f1d1d; }

/* knoppen en velden */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 9px 16px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { border-color: #94a3b8; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 18px 28px; font-size: 20px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.search { max-width: 360px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.grid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); font-weight: 400; }
.check input { width: auto; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* kaarten en tabellen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; }
.tile .num { font-size: 28px; font-weight: 700; }
.tile .lbl { font-size: 13px; color: var(--muted); }
.tile.alert .num { color: var(--red); }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.action { background: var(--navy); color: #fff; border-radius: 12px; padding: 20px; text-decoration: none; font-size: 19px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.action small { font-weight: 400; color: #a9bdd2; font-size: 13px; }
.action:hover { background: var(--navy-2); }
.action.primary { background: var(--green); color: #fff; }
.action.primary small { color: #fff3e6; }
.action.primary:hover { background: var(--green-dark); }

table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fbfcfd; white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f8fafc; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e2e8f0; }
.pill.uitname { background: #ffe4dc; color: #9a3412; }
.pill.ontvangst { background: #d1fae5; color: #065f46; }
.pill.retour { background: #dbeafe; color: #1e3a8a; }
.pill.correctie { background: #fef3c7; color: #92400e; }
.pill.sent { background: #d1fae5; color: #065f46; }
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.failed { background: #fee2e2; color: #991b1b; }
.pill.none { background: #f1f5f9; color: #64748b; }
.bar { width: 90px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar span { display: block; height: 100%; border-radius: 3px; }
.low td { background: #fff7f7; }
.neg { color: var(--red); font-weight: 700; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* kioskscherm */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.scanbox { display: flex; gap: 10px; }
.scanbox input { font-size: 22px; padding: 16px 18px; border-width: 2px; }
.results { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.result { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.result:hover { border-color: var(--green); }
.result .rname { font-weight: 700; }
.result .rstock { margin-left: auto; color: var(--muted); white-space: nowrap; }
.lines .line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lines .line:last-child { border-bottom: 0; }
.line .lname { font-weight: 700; }
.line .lqty { margin-left: auto; font-size: 22px; font-weight: 700; min-width: 64px; text-align: right; cursor: pointer; background: #f1f5f9; border-radius: 8px; padding: 6px 12px; }
.line .warn { color: var(--red); font-size: 13px; }
.meta .grid { grid-template-columns: 1fr; gap: 12px; }
.finish { width: 100%; margin-top: 16px; }
.status-ok { background: #dcfce7; color: #14532d; border-radius: 10px; padding: 18px; font-size: 17px; margin-bottom: 16px; }

/* cijferblok */
.modal-back { position: fixed; inset: 0; background: rgba(16, 42, 67, .55); display: none; align-items: center; justify-content: center; z-index: 10; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 380px; max-width: 94vw; }
.modal h3 { margin: 0 0 2px; font-size: 20px; }
.modal .mstock { color: var(--muted); margin-bottom: 14px; }
.modal .display { font-size: 44px; font-weight: 700; text-align: right; background: #f1f5f9; border-radius: 10px; padding: 8px 16px; margin-bottom: 12px; min-height: 70px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { font: inherit; font-size: 26px; font-weight: 700; padding: 16px 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.pad button:active { background: #e2e8f0; }
.pad .ok { background: var(--green); border-color: var(--green); color: #fff; }
.modal .row { display: flex; gap: 8px; margin-top: 10px; }
.modal .row .btn { flex: 1; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; padding: 12px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .navlabel, .site { display: none; }
  main { padding: 18px 16px; }
  .scan-layout { grid-template-columns: 1fr; }
  table.data { display: block; overflow-x: auto; white-space: nowrap; }
}
@media print { .sidebar, .btn { display: none; } }

/* checklist bij de uitname */
.checklist .line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist .line:last-of-type { border-bottom: 0; }
.checklist .line .lqty { cursor: default; background: #fff4e8; color: #9a4d00; }
.checklist .line.done { opacity: .55; }
.checklist .line.done .lqty { background: #e7f6ef; color: var(--ok); }

/* ingelogde gebruiker onderaan de zijbalk */
.sidebar .me { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 4px; }
.sidebar .me a { color: #dbe4ee; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.sidebar .me a:hover, .sidebar .me a.active { background: var(--navy-2); }
.sidebar .me small { display: block; color: #7b93ad; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .logout { color: #9fb3c8; }

/* inlogscherm */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--navy); padding: 16px; }
.auth-page .card { width: 380px; max-width: 100%; }
.auth-page .card img { width: 190px; display: block; margin-bottom: 18px; }
.auth-page label { margin-top: 12px; }
.auth-page .links { margin-top: 14px; font-size: 14px; }
.copylink { word-break: break-all; font-family: ui-monospace, monospace; font-size: 13px; background: #f1f5f9; padding: 10px; border-radius: 8px; }
