/* ============================================================
 * style.css · Objectfacturatie-check
 * - één stylesheet voor beide talen (/ en /en/)
 * - mobiel eerst: tabellen klappen onder 700px om naar kaartjes,
 *   zodat er op 375px geen enkele horizontale scrollbalk nodig is
 * - contrast: alle tekst-/achtergrondcombinaties halen WCAG AA (≥ 4,5:1)
 * ============================================================ */

:root {
  --brand: #0e3b5c;
  --brand-dark: #092a43;
  --accent: #0b6ea8;
  --ink: #16202b;
  --body: #33414f;
  --muted: #4a5a68;
  --line: #d3dde5;
  --line-strong: #b6c5d1;
  --bg: #f2f5f8;
  --card: #ffffff;
  --ok-bg: #e8f4ec;
  --ok-ink: #14532d;
  --warn-bg: #fff4e0;
  --warn-ink: #6b4700;
  --err-bg: #fbe9ea;
  --err-ink: #8d1116;
  --info-bg: #e8f1fb;
  --info-ink: #103a63;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(14, 59, 92, .08), 0 6px 18px rgba(14, 59, 92, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden; /* vangnet: geen enkele pagina-scrollbalk horizontaal */
}

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.65rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .7rem; }

a { color: #0b4f8a; text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 4px;
  color: var(--ink);
}

/* ---------- toegankelijkheid ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  z-index: 50;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- kop ---------- */
.site-head {
  background: var(--brand);
  color: #fff;
  padding: 12px 0;
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; color: #fff; }
.brand .logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: #fff; color: var(--brand); font-size: 1rem;
}
.lang { display: inline-flex; gap: 6px; }
.lang-btn {
  font: inherit; font-weight: 600;
  min-width: 46px; min-height: 38px;
  padding: 6px 10px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 8px;
  cursor: pointer;
}
.lang-btn:hover { background: rgba(255, 255, 255, .14); }
.lang-btn[aria-pressed="true"], .lang-btn.is-on {
  background: #fff;
  color: var(--brand-dark);
  border-color: #fff;
}

main { padding: 20px 16px 40px; }
.page-title { margin-bottom: .35rem; }
.lead { color: var(--muted); }

/* ---------- kaarten ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 18px;
}
.card > h2 { margin-top: 0; }
.note-card { background: #fbfcfd; }

.banner {
  background: var(--info-bg);
  border: 1px solid #bcd4ea;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 18px;
}
.banner p { margin-bottom: .45rem; }

.hint { color: var(--muted); font-size: .92rem; }
.hint.note {
  background: #f7f9fb;
  border-left: 3px solid var(--line-strong);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}
.hint-inline { display: block; color: var(--muted); font-size: .78rem; }
.field-err, .cell-err { display: block; color: var(--err-ink); font-size: .82rem; font-weight: 600; min-height: 0; }
.field-err:empty, .cell-err:empty { display: none; }

/* ---------- formulieren ---------- */
label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.field { margin-bottom: 12px; max-width: 320px; }

input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 9px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #b3261e; background: #fffafa; }
textarea { min-height: 108px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
select { max-width: 100%; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.check input { width: 18px; height: 18px; flex: 0 0 auto; }
.check-text { font-size: .92rem; color: var(--ink); }

/* ---------- knoppen ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: #f3f7fa; border-color: var(--accent); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: #8d1116; border-color: #8d1116; color: #fff; }
.btn-danger:hover { background: #6f0d11; border-color: #6f0d11; color: #fff; }
.btn-quiet { background: #fff; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 .6rem; }
.btn-row .btn { flex: 0 1 auto; }

.confirm {
  background: var(--err-bg);
  border: 1px solid #e7b7ba;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 0;
}
.form-status { color: var(--muted); font-size: .9rem; min-height: 1.2em; margin: .35rem 0 0; }

/* ---------- tabellen ---------- */
.tw { width: 100%; max-width: 100%; overflow-x: auto; }
table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
}
table.grid caption { text-align: left; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
}
table.grid thead th {
  color: var(--ink);
  font-size: .84rem;
  text-transform: none;
  border-bottom: 2px solid var(--line-strong);
  white-space: nowrap;
}
table.grid tbody tr:hover { background: #f8fbfd; }
table.grid tfoot th, table.grid tfoot td {
  border-top: 2px solid var(--line-strong);
  border-bottom: 0;
  font-weight: 700;
  color: var(--ink);
}
table.grid td input, table.grid td select { min-width: 0; }
.obj-row .obj-name { min-width: 150px; }
.obj-row .obj-rate, .obj-row .obj-min { max-width: 110px; }
.shift-row .sh-note { min-width: 120px; }
.shift-row .sh-date { min-width: 140px; }
.shift-row .sh-break { max-width: 92px; }
.row-error { background: #fff6f6; }
.row-conflict { background: #fdf1f1; }
.row-error td.c-hours, .row-conflict td.c-hours { font-weight: 700; }
.empty-row td { color: var(--muted); font-style: italic; }
#results-table .r-amount { white-space: nowrap; }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  margin: 0 4px 2px 0;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #b7dcc4; }
.badge-quiet { background: #eef3f7; color: var(--muted); border-color: var(--line); }
.badge-error { background: var(--err-bg); color: var(--err-ink); border-color: #e7b7ba; }
.badge-conflict { background: var(--err-bg); color: var(--err-ink); border-color: #d98b90; }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #e6c68a; }
.badge-min { background: var(--info-bg); color: var(--info-ink); border-color: #b9d2ea; }

/* ---------- meldingen ---------- */
.warn-list { list-style: none; margin: 0 0 .6rem; padding: 0; }
.warn {
  border: 1px solid var(--line-strong);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 9px 11px;
  margin: 0 0 8px;
  background: #fbfcfd;
}
.warn-error { border-left-color: #8d1116; background: var(--err-bg); color: var(--err-ink); }
.warn-overlap { border-left-color: #b3261e; background: #fdeeee; color: var(--err-ink); }
.warn-long { border-left-color: #a86b00; background: var(--warn-bg); color: var(--warn-ink); }
.ok-note {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border: 1px solid #b7dcc4;
  border-radius: 8px;
  padding: 9px 11px;
  margin: 0 0 .6rem;
}
.errors { list-style: none; margin: .5rem 0 0; padding: 0; }
.paste-error {
  background: var(--err-bg);
  color: var(--err-ink);
  border: 1px solid #e7b7ba;
  border-radius: 8px;
  padding: 7px 10px;
  margin: 0 0 6px;
  font-size: .9rem;
}
.paste-raw { display: block; color: #5d3033; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; word-break: break-all; }

.copy-preview {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-size: .82rem;
  white-space: pre;
  margin: .5rem 0 0;
}
.results-note { color: var(--muted); font-size: .9rem; }

/* ---------- voettekst ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 16px 0;
  color: var(--muted);
  font-size: .92rem;
}
.site-foot p { margin: 0; }

/* ---------- eigen sectie: andere beveiligingstools ---------- */
#nl-sec-suite {
  background: #eef3f7;
  border-top: 1px solid var(--line);
  padding: 22px 16px 30px;
}
#nl-sec-suite .sec-inner { max-width: 1140px; margin: 0 auto; }
#nl-sec-suite h2 { font-size: 1.05rem; margin: 0 0 .3rem; }
#nl-sec-suite p { color: var(--muted); font-size: .92rem; margin: 0 0 .6rem; }
#nl-sec-suite ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
#nl-sec-suite li { margin: 0; }
#nl-sec-suite a {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand);
}
#nl-sec-suite a:hover { border-color: var(--accent); color: var(--brand-dark); }
#nl-sec-suite .sec-hub { margin-top: .7rem; font-size: .88rem; }

/* ---------- print: alleen de resultatenlijst ---------- */
#print-sheet { display: none; }

@media print {
  body { background: #fff; }
  body > * { display: none !important; }
  #print-sheet { display: block !important; }
  #print-sheet .ps-inner { padding: 0; }
  #print-sheet .ps-brand { font-weight: 700; color: #000; margin: 0 0 2px; }
  #print-sheet .ps-title { font-size: 15pt; margin: 0 0 2px; }
  #print-sheet .ps-meta { color: #333; font-size: 9pt; margin: 0 0 10px; }
  #print-sheet table.ps-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  #print-sheet table.ps-table th, #print-sheet table.ps-table td {
    border: 1px solid #666; padding: 4px 6px; text-align: left;
  }
  #print-sheet table.ps-table thead th { background: #eee; }
  #print-sheet table.ps-table tfoot th, #print-sheet table.ps-table tfoot td { font-weight: 700; background: #f6f6f6; }
  #print-sheet .ps-note { margin-top: 8px; font-size: 8.5pt; color: #333; }
  @page { margin: 14mm; }
}

/* ---------- smalle schermen: tabellen als kaartjes ---------- */
@media (max-width: 700px) {
  h1 { font-size: 1.32rem; }
  main { padding: 16px 12px 32px; }
  .wrap { padding: 0 12px; }
  .card { padding: 13px; }

  .tw { overflow-x: visible; }
  table.grid { font-size: .95rem; }
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid td, table.grid tfoot { display: block; width: 100%; }
  table.grid tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px 10px;
    margin: 0 0 10px;
    background: #fff;
  }
  table.grid tbody tr:hover { background: #fff; }
  table.grid td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 0;
    padding: 4px 0;
    text-align: right;
  }
  table.grid td::before {
    content: attr(data-label);
    flex: 0 0 44%;
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    font-size: .86rem;
    min-width: 0;
  }
  table.grid td > * { max-width: 56%; }
  table.grid td input, table.grid td select { max-width: 56%; }
  table.grid td .hint-inline, table.grid td .cell-err { max-width: 56%; text-align: right; }
  table.grid td.c-hours, table.grid td.c-state { justify-content: space-between; }
  table.grid tfoot tr { background: #f7f9fb; }
  table.grid tfoot th { font-size: .86rem; color: var(--muted); }
  table.grid tfoot th, table.grid tfoot td { display: flex; justify-content: space-between; align-items: center; }
  table.grid tfoot th::before, table.grid tfoot td::before { content: attr(data-label); }
  .empty-row { border: 0; }
  .empty-row td { display: block; text-align: left; }
  .obj-row .obj-name, .shift-row .sh-note, .shift-row .sh-date { min-width: 0; }
  .rate-row { display: block; }
}

@media (max-width: 420px) {
  .btn { width: 100%; }
  .btn-row .btn { flex: 1 1 100%; }
  .lang-btn { width: auto; }
  #nl-sec-suite ul { flex-direction: column; }
  #nl-sec-suite a { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
