/* ================================================================
   Pakbon Checker – stylesheet
   Twee modi:
     - Tablet/portret  → winkel-upload & dashboard
     - Desktop         → kantoor-overzicht & detail
   ================================================================ */

:root {
  --shop:    #1e293b;
  --bg:      #f1f5f9;
  --surface: #ffffff;
  --border:  #e2e8f0;
  --text:    #1e293b;
  --muted:   #64748b;
  --groen:   #16a34a;
  --rood:    #dc2626;
  --geel:    #d97706;
  --r:       10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

/* ── Navigatie ─────────────────────────────────────────────── */
.nav {
  background: var(--shop);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-brand {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand small {
  font-size: 11px;
  font-weight: 400;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 6px;
  border-radius: 4px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.12); }

/* ── Flash ─────────────────────────────────────────────────── */
.flash {
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
}
.flash-succes { background: #dcfce7; color: #166534; border-bottom: 1px solid #bbf7d0; }
.flash-fout   { background: #fee2e2; color: #991b1b; border-bottom: 1px solid #fecaca; }

/* ── Desktop container (kantoor + detail) ──────────────────── */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ── Tablet container (upload + shop-dashboard) ────────────── */
.tablet-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.tablet-kop {
  text-align: center;
  margin-bottom: 24px;
}
.tablet-kop h1 {
  font-size: 24px;
  font-weight: 800;
}
.tablet-subtitel {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ── Upload: grote uploadknop op dashboard ─────────────────── */
.tablet-upload-knop {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--shop);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 20px;
  border-radius: var(--r);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  transition: filter .15s;
}
.tablet-upload-knop:hover { filter: brightness(.9); }

/* ── Upload: secties ───────────────────────────────────────── */
.tablet-sectie {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
}
.tablet-sectie--optioneel {
  border-style: dashed;
  background: #fafafa;
}
.tablet-sectie-kop {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.stap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--shop);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.stap-badge--grijs { background: #94a3b8; }
.verplicht-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--rood);
  background: #fee2e2;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: auto;
}
.optioneel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: auto;
}
.tablet-hulptekst {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Geen pakbon checkbox ──────────────────────────────────── */
.geen-pakbon-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.geen-pakbon-wrapper:has(input:checked) {
  border-color: var(--geel);
  background: #fffbeb;
  color: #92400e;
}
.geen-pakbon-wrapper input[type=checkbox] {
  width: 22px; height: 22px;
  accent-color: var(--geel);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Camera-knop ───────────────────────────────────────────── */
.foto-gebied {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.foto-thumbnail-rij {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.foto-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.foto-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--border);
}
.foto-thumb span {
  font-size: 11px;
  color: var(--muted);
}

.camera-knop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--shop);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  min-height: 56px;
  transition: filter .15s;
}
.camera-knop:hover, .camera-knop:active { filter: brightness(.88); }
.camera-knop--secundair {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}
.camera-knop--secundair:hover { background: #e2e8f0; filter: none; }
.camera-icoon { font-size: 22px; }

/* ── Leverancier select ────────────────────────────────────── */
.tablet-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color .15s;
}
.tablet-select:focus {
  outline: none;
  border-color: var(--shop);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shop) 15%, transparent);
}

/* ── Textarea ──────────────────────────────────────────────── */
.tablet-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  margin-top: 12px;
}
.tablet-textarea:focus {
  outline: none;
  border-color: var(--shop);
}

/* ── Submit-blok ───────────────────────────────────────────── */
.tablet-submit-blok {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.tablet-submit-knop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px;
  background: var(--shop);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s;
  min-height: 60px;
}
.tablet-submit-knop:hover { filter: brightness(.9); }
.tablet-submit-knop:disabled { opacity: .6; cursor: not-allowed; }
.tablet-annuleer {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.tablet-annuleer:hover { color: var(--text); }

/* ── Shop-dashboard rijen ──────────────────────────────────── */
.dashboard-rij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
  gap: 12px;
}
.dashboard-rij:last-child { border-bottom: none; }
.dashboard-rij:hover { background: #f8fafc; }
.dashboard-rij--fout { background: #fff5f5; }
.dashboard-rij--fout:hover { background: #fee2e2; }
.dashboard-rij--kassascherm { background: #fffbeb; }
.dashboard-rij--kassascherm:hover { background: #fef3c7; }

.dashboard-rij-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dashboard-datum {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
}
.dashboard-leverancier {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-rij-rechts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dashboard-pijl {
  font-size: 20px;
  color: var(--muted);
  margin-left: 4px;
}

/* ── Kassascherm thumbnails ────────────────────────────────── */
.kassascherm-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.kassascherm-thumbs a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color .15s;
}
.kassascherm-thumbs a:hover { border-color: var(--shop); }
.kassascherm-thumbs img {
  display: block;
  width: 160px;
  height: 120px;
  object-fit: cover;
}

/* ── Kantoor tabel: gekleurde rijen ────────────────────────── */
.kantoor-rij-fout td { background: #fff5f5; }
.kantoor-rij-kassascherm td { background: #fffbeb; }

/* ── Gedeelde kaart ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Knoppen ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s;
  font-family: inherit;
}
.btn:hover { filter: brightness(.92); }
.btn-primary   { background: var(--shop); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-groen { background: #dcfce7; color: #15803d; }
.badge-rood  { background: #fee2e2; color: #b91c1c; }
.badge-geel  { background: #fef9c3; color: #a16207; }
.badge-blauw { background: #dbeafe; color: #1d4ed8; }
.badge-grijs { background: #f1f5f9; color: #64748b; }

/* ── Tabel (kantoor) ───────────────────────────────────────── */
.tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabel th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
}
.tabel td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tabel tr:last-child td { border-bottom: none; }

/* ── Pagina-kop ────────────────────────────────────────────── */
.pagina-kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.pagina-kop h1 { font-size: 22px; font-weight: 700; }
.pagina-kop small { font-size: 13px; color: var(--muted); }

/* ── Key-value lijst ───────────────────────────────────────── */
.kv-lijst { font-size: 14px; }
.kv-rij {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}
.kv-rij:last-child { border-bottom: none; }
.kv-sleutel { color: var(--muted); min-width: 160px; flex-shrink: 0; }
.kv-waarde  { font-weight: 500; }
.sectie-kop {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Artikeltabel ──────────────────────────────────────────── */
.artikel-tabel { width: 100%; border-collapse: collapse; font-size: 13px; }
.artikel-tabel th {
  text-align: left;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.artikel-tabel td { padding: 6px 8px; border: 1px solid var(--border); vertical-align: top; }

/* ── Vergelijking ──────────────────────────────────────────── */
.afwijking-item {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}
.afwijking-fout         { background: #fef2f2; border-left: 3px solid #ef4444; }
.afwijking-waarschuwing { background: #fffbeb; border-left: 3px solid #f59e0b; }
.afwijking-info         { background: #eff6ff; border-left: 3px solid #3b82f6; }
.afwijking-label        { font-weight: 600; margin-bottom: 4px; }
.afwijking-waarden      { display: flex; gap: 16px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.afwijking-waarden span strong { color: var(--text); }
.overeenkomst-item {
  padding: 5px 12px;
  font-size: 13px;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Verwerking spinner ────────────────────────────────────── */
.verwerking-box { text-align: center; padding: 48px 24px; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--shop);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.verwerking-box p { color: var(--muted); font-size: 14px; }

/* ── Beoordeling formulier ─────────────────────────────────── */
.form-groep { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.optioneel  { font-weight: 400; color: var(--muted); }
.form-input, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--shop);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shop) 15%, transparent);
}
.form-textarea { min-height: 80px; resize: vertical; }

.akkoord-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.akkoord-checkbox-wrapper:has(input:checked) {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #15803d;
}
.akkoord-checkbox-wrapper input[type=checkbox] {
  width: 22px;
  height: 22px;
  accent-color: #16a34a;
  cursor: pointer;
  flex-shrink: 0;
}
.beoordeling-samenvatting {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r);
  font-size: 14px;
}
.beoordeling-samenvatting.akkoord      { background: #f0fdf4; border: 1px solid #bbf7d0; }
.beoordeling-samenvatting.niet-akkoord { background: #fef2f2; border: 1px solid #fecaca; }

/* ── Fout-box ──────────────────────────────────────────────── */
.fout-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r);
  padding: 20px;
  font-size: 14px;
  color: #991b1b;
  margin-bottom: 20px;
}
.fout-box pre { margin-top: 8px; font-size: 12px; white-space: pre-wrap; }

/* ── Lege staat ────────────────────────────────────────────── */
.leeg-staat {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.leeg-staat p { margin: 8px 0 24px; font-size: 15px; }

/* ── Inline SKU-editor ─────────────────────────────────────── */
.sku-waarde {
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  display: inline-block;
  border: 1px solid transparent;
  transition: background .1s, border-color .1s;
}
.sku-waarde:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.sku-leeg {
  color: var(--muted);
  font-family: inherit;
  font-style: italic;
  font-size: 13px;
}
.sku-invoer {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Alert ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
}
.alert-succes { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-fout   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Responsief ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container, .tablet-container { padding: 12px; }
  .tabel th, .tabel td { padding: 8px 6px; font-size: 12px; }
  .kassascherm-thumbs img { width: 120px; height: 90px; }
}
