:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #dfe3e8;
  --ink: #1f2933;
  --muted: #6b7280;
  --accent: #0b7285;
  --accent-ink: #ffffff;
  --ok: #197741;
  --bad: #b42318;
  --warn: #9a6700;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.pill { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); }
.pill.ok { background: #e6f4ea; color: var(--ok); border-color: #b7e0c4; }
.pill.bad { background: #fdeceb; color: var(--bad); border-color: #f3c3bf; }

/* ---- layout met linker-zijbalk ---- */
.layout { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 234px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 4px; font-size: 16px; font-weight: 700; color: var(--ink);
}
.sidebar .brand:hover { text-decoration: none; }
.brand-badge {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand-text { font-weight: 600; } .brand-text b { font-weight: 800; }

.nav-section {
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 16px 10px 6px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px; margin-bottom: 2px;
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.sidebar nav a:hover { background: #f1f3f5; text-decoration: none; }
.sidebar nav a.active { background: #e4eff1; color: var(--accent); font-weight: 600; }
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }

/* tabbladen (instellingen) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 20px; }
.tabs .tab {
  background: none; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tabs .tab:hover { background: #f1f3f5; filter: none; }
.tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* keuze-uitleg onder een radio/checkbox netjes uitlijnen */
.fields label.check { align-items: flex-start; }
.fields label.check input[type=radio] { margin-top: 3px; }

/* beheeromgeving (los van de app) */
.admin-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border);
}
.admin-bar .brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.admin-bar-right { display: flex; align-items: center; gap: 12px; }
.brand-badge.admin { background: #7a3e9d; }

/* inlogscherm */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-card { padding: 26px 24px; }
.login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; font-size: 17px;
}

.sidebar-foot { margin-top: auto; padding-top: 14px; }
.sidebar-status { display: flex; gap: 8px; padding: 0 8px 8px; }
.user-box {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px; border-top: 1px solid var(--border); font-size: 12px;
}
.user-mail {
  color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 130px;
}
.user-box button.link { font-size: 12px; }

.content { flex: 1; min-width: 0; }
main { max-width: 1200px; margin: 24px auto; padding: 0 24px; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row;
    flex-wrap: wrap; align-items: center; gap: 4px; }
  .sidebar nav { display: flex; gap: 4px; }
  .nav-section { display: none; }
  .sidebar-status { margin: 0 0 0 auto; }
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 24px; margin-bottom: 20px;
}
h2 { margin-top: 0; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: #e6f4ea; color: var(--ok); }
.flash.error { background: #fdeceb; color: var(--bad); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.inline { display: inline; }
.hint { color: var(--muted); font-size: 13px; }
.hint.bad { color: var(--bad); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

button, .button-link {
  background: var(--accent); color: var(--accent-ink); border: none; cursor: pointer;
  padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
button:hover, .button-link:hover { filter: brightness(1.08); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #e4e7eb; color: var(--ink); }
button.small { padding: 5px 12px; font-size: 13px; }
button.busy { background: var(--bad); color: #fff; opacity: 1; cursor: progress; }
button.busy:hover { filter: none; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; }
button.link.danger { color: var(--bad); }

input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 14px; background: #fff; font-family: inherit;
}
input[type=file] { padding: 6px; }
input[type=checkbox], input[type=radio] { width: auto; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: auto; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { display: flex; gap: 12px; align-items: center; }

/* verkoopoverzicht: zebra-strepen + uitklapbare regels */
table.sales .check-col { width: 34px; text-align: center; padding-right: 0; }
table.sales .check-col input { width: auto; margin: 0; cursor: pointer; }
table.sales .caret-col { width: 26px; text-align: center; padding-right: 0; }
/* inhoudsopgave help: onder elkaar */
.help-toc { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; font-size: 14px; }

/* melding bovenaan het overzicht: welke overzet-modus actief is */
.mode-note {
  margin: 0 0 12px; font-size: 13px; color: var(--muted);
  background: #eef4f6; border: 1px solid #d5e4e8; border-radius: 8px;
  padding: 8px 12px; display: inline-block;
}
.mode-note b { color: var(--ink); }
table.sales tbody tr.alt > td { background: #eef4f6; }   /* tint bij het teal-accent */
table.sales tbody tr.day-row { cursor: pointer; }
table.sales tbody tr.day-row:hover > td { background: #e2edef; }
table.sales tbody tr.day-row.alt:hover > td { background: #dde9eb; }
table.sales .caret { display: inline-block; color: var(--muted); font-size: 11px;
  transition: transform .12s ease; }
table.sales tr.day-row.open .caret { transform: rotate(90deg); color: var(--accent); }
/* de detailregel deelt de tint van zijn dag, maar zonder scheidingslijn ertussen */
table.sales tr.day-row.open > td { border-bottom: none; }
table.sales tr.detail-row > td { padding-top: 0; padding-bottom: 12px; }

table.breakdown { width: auto; min-width: 460px; margin: 4px 0 2px; font-size: 13px; }
table.breakdown th { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
table.breakdown td { padding: 4px 10px; border-bottom: 1px dashed var(--border); background: transparent; }
table.breakdown tfoot td { font-weight: 700; border-bottom: none; border-top: 1px solid var(--border); }
table.breakdown .num { min-width: 90px; }
table.breakdown .ledger { color: var(--accent); min-width: 200px; }

.badge { font-size: 12px; padding: 2px 9px; border-radius: 6px; text-transform: capitalize; }
.badge.new { background: #eef2f7; color: var(--muted); }
.badge.extracted { background: #e7f1fb; color: #1c5fa8; }
.badge.pushed { background: #e6f4ea; color: var(--ok); }
.badge.error { background: #fdeceb; color: var(--bad); }

/* review layout */
.review { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; height: calc(100vh - 130px); }
.pdf-pane { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #333; }
.form-pane { overflow-y: auto; padding-right: 4px; }
@media (max-width: 900px) {
  .review { grid-template-columns: 1fr; height: auto; }
  .pdf-pane { height: 70vh; }
}

.fields fieldset {
  border: 1px solid var(--border); border-radius: 10px; margin: 0 0 16px; padding: 14px 16px;
}
.fields legend { font-weight: 600; padding: 0 6px; }
.fields label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.fields label input, .fields label select, .fields label textarea { margin-top: 4px; color: var(--ink); }
.fields label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.fields label.check input { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

table.lines td, table.lines th { padding: 6px 8px; font-size: 13px; }
table.lines tfoot td { font-weight: 600; }

/* drag & drop upload */
#upload-form { margin-bottom: 12px; }
#upload-form .row { margin-top: 14px; }
#dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 30px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 10px; background: #fbfcfd;
  transition: border-color .15s, background .15s;
}
#dropzone:hover { border-color: var(--accent); }
#dropzone.drag { border-color: var(--accent); background: #eef7f9; }
#dropzone.has-files { border-style: solid; background: #fff; }
.dz-icon { font-size: 28px; }
.dz-text { color: var(--muted); font-size: 14px; }
.dz-link { color: var(--accent); text-decoration: underline; }
.file-list { list-style: none; margin: 6px 0 0; padding: 0; }
.file-list li {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  color: var(--ink); padding: 2px 0;
}
.file-list li::before { content: "📄 "; }
.dz-option { margin: 14px 0 4px; font-size: 14px; }

/* Zettle -> Moneybird categorie-koppeling */
table.cat-map td { vertical-align: middle; }
table.cat-map td:first-child { width: 42%; font-weight: 500; color: var(--ink); }
table.cat-map select { margin: 0; }

/* contact-zoeker */
.contact-picker { margin-bottom: 12px; }
.contact-current { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.contact-current strong { color: var(--ink); }
.contact-current .link { margin-left: 8px; font-size: 12px; }
.contact-results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 7px; }
.contact-results:empty { display: none; }
.contact-results li { padding: 7px 10px; font-size: 14px; border-bottom: 1px solid var(--border); }
.contact-results li:last-child { border-bottom: none; }
.contact-hit { cursor: pointer; }
.contact-hit:hover { background: #eef7f9; }
.contact-results li.muted { color: var(--muted); cursor: default; }
