/* ============================================================
   Voorraad — ontwerp-tokens
   Thema: "labelbonnetjes" — elke voorraadregel is een getrapt ticketje.
   Papierachtige achtergrond, diepgroen accent.
   ============================================================ */
:root {
  --papier: #F5F2EA;
  --papier-donker: #EAE5D8;
  --inkt: #23211C;
  --inkt-zacht: #6F6A5C;
  --lijn: #DAD3C0;
  --wit: #FFFDF9;

  --accent: #1F6F5C;
  --accent-donker: #164F42;
  --accent-zacht: #DCEBE6;

  --succes: #3FA66B;
  --succes-zacht: #DFF3E7;
  --gevaar: #D9503F;
  --gevaar-zacht: #FBE4E0;

  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --straal: 14px;
  --schaduw: 0 2px 10px rgba(35, 33, 28, 0.08);
}

* { box-sizing: border-box; }

/* Zorgt dat het hidden-attribuut ALTIJD wint van inline/flex display regels */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--papier);
  color: var(--inkt);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

button, input { font-family: inherit; }

a { color: var(--accent); }

/* ---------- layout ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--papier);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--papier);
  z-index: 5;
  border-bottom: 1px solid var(--lijn);
}

.topbar-merk { display: flex; align-items: center; gap: 8px; }
.topbar-merk h1 { font-size: 1.3rem; color: var(--accent-donker); }
.topbar-gebruiker { display: flex; align-items: center; gap: 10px; }
.gebruiker-naam { font-size: 0.85rem; color: var(--inkt-zacht); }

.topbar--detail { justify-content: flex-start; }
.topbar-titel {
  flex: 1;
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}

.btn-icoon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--wit);
  color: var(--accent-donker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: var(--schaduw);
  cursor: pointer;
}

.btn-verwijder {
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
  color: var(--inkt-zacht);
  box-shadow: none;
  background: transparent;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.btn-verwijder:hover {
  color: var(--gevaar);
  background: var(--gevaar-zacht);
}

.content { flex: 1; padding: 14px 14px 100px; }

/* ---------- zoekbalk ---------- */
.zoek-balk-container {
  margin-bottom: 14px;
}

.zoek-invoer {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--lijn);
  background: var(--wit);
  font-size: 0.95rem;
  color: var(--inkt);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.zoek-invoer:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-zacht);
}

/* ---------- logo & auth ---------- */
.logo-blok { text-align: center; margin-bottom: 22px; }
.logo-vinkje {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--wit);
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.logo-vinkje--klein { width: 30px; height: 30px; border-radius: 9px; font-size: 1rem; margin-bottom: 0; }
.logo-blok h1 { font-size: 1.7rem; color: var(--accent-donker); }
.logo-onderschrift { color: var(--inkt-zacht); font-size: 0.9rem; margin-top: 4px; }

.auth-scherm { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-kaart { width: 100%; max-width: 380px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 0.8rem; color: var(--inkt-zacht); margin-top: 10px; }
.auth-form input {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--wit);
  font-size: 1rem;
  color: var(--inkt);
}
.auth-form input:focus, .modal input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-wissel { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--inkt-zacht); }

.scheiding { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--inkt-zacht); font-size: 0.8rem; }
.scheiding::before, .scheiding::after { content: ""; flex: 1; height: 1px; background: var(--lijn); }

/* ---------- knoppen ---------- */
.btn {
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.btn--primary { background: var(--accent); color: var(--wit); margin-top: 16px; }
.btn--primary:active { background: var(--accent-donker); }
.btn--ghost { background: transparent; color: var(--inkt-zacht); border: 1px solid var(--lijn); }
.btn--google { background: var(--wit); color: var(--inkt); border: 1px solid var(--lijn); margin-top: 4px; }
.btn--klein { width: auto; padding: 10px 16px; margin-top: 0; }
.btn--gevaar { background: transparent; color: var(--gevaar); border: 1px solid var(--gevaar-zacht); }

/* ---------- flash ---------- */
.flash-stack { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(92%, 420px); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-size: 0.9rem; box-shadow: var(--schaduw); }
.flash--error { background: var(--gevaar-zacht); color: #8A2E22; }
.flash--success { background: var(--succes-zacht); color: #1F6B41; }

/* ---------- bak-groepen & ticket-stack ---------- */
.ticket-stack { display: flex; flex-direction: column; gap: 18px; }

.bak-groep {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bak-kop {
  font-size: 0.95rem;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--inkt-zacht);
  padding: 0 4px;
}

.bak-items-lijst {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
  border-radius: var(--straal);
  padding: 4px;
  transition: background-color 0.15s ease, outline 0.15s ease;
}

.bak-items-lijst.drop-highlight {
  background-color: var(--accent-zacht);
  outline: 2px dashed var(--accent);
}

.laad-tekst, .lege-staat { text-align: center; color: var(--inkt-zacht); margin-top: 40px; }
.lege-staat-titel { font-family: var(--font-display); font-size: 1.1rem; color: var(--inkt); margin-bottom: 6px; }
.lege-staat-tekst { font-size: 0.9rem; max-width: 320px; margin: 0 auto; line-height: 1.5; }

.ticket {
  position: relative;
  overflow: hidden;
  border-radius: var(--straal);
  background: var(--wit);
  box-shadow: var(--schaduw);
  user-select: none;
}

.ticket-voorgrond {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--wit);
  border-radius: var(--straal);
}

.ticket-voorgrond::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background-image: radial-gradient(circle, var(--papier) 1.6px, transparent 1.7px);
  background-size: 4px 9px;
  background-repeat: repeat-y;
  background-position: center;
}

.ticket-tekst {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
  cursor: text;
}

.ticket-invoer-inline {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--wit);
  color: var(--inkt);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-zacht);
}

.ticket-grip {
  flex-shrink: 0;
  color: var(--lijn);
  font-size: 1.2rem;
  padding: 4px 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ticket-grip:active { cursor: grabbing; }

/* Drag & Drop zwevende kloon en origineel */
.sleep-origineel {
  opacity: 0.35;
}

.drag-zwevend {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(35, 33, 28, 0.25);
  margin: 0;
  transform-origin: center center;
}

.ticket--lijst-item { cursor: pointer; }
.ticket-inhoud { flex: 1; min-width: 0; }
.ticket-naam { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.ticket-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--inkt-zacht); margin-top: 3px; }

.ticket-badge {
  flex-shrink: 0;
  background: var(--accent-zacht);
  color: var(--accent-donker);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---------- fab ---------- */
.fab {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(calc(-50% + 190px));
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--wit);
  font-size: 1.8rem;
  line-height: 1;
  border: none;
  box-shadow: 0 6px 16px rgba(31, 111, 92, 0.4);
  cursor: pointer;
  z-index: 20;
}
.fab:active { background: var(--accent-donker); }

@media (max-width: 520px) {
  .fab { transform: none; right: 20px; left: auto; }
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(35, 33, 28, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 40;
}
.modal[hidden] { display: none; }
.modal-kaart {
  background: var(--papier);
  width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
}
.modal-kaart h2 { font-size: 1.2rem; margin-bottom: 14px; }
.modal-kaart label {
  display: block;
  font-size: 0.8rem;
  color: var(--inkt-zacht);
  margin: 10px 0 4px;
}
.modal-kaart input[type="text"], 
.modal-kaart input[type="email"],
.modal-kaart input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--wit);
  font-size: 1rem;
}
.modal-knoppen { display: flex; gap: 10px; margin-top: 18px; }
.modal-knoppen .btn { margin-top: 0; }

.koppel-form { display: flex; gap: 8px; margin-top: 6px; }
.koppel-form input { flex: 1; }

.gekoppelde-lijst { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gekoppelde-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--wit); border-radius: 10px; padding: 10px 12px;
  font-size: 0.9rem;
}
.gekoppelde-item span.rol { font-size: 0.75rem; color: var(--inkt-zacht); }
.gekoppelde-item button {
  background: none; border: none; color: var(--gevaar); cursor: pointer; font-size: 0.85rem;
}

@media (min-width: 600px) {
  body { background: var(--papier-donker); }
  .app-shell { box-shadow: 0 0 0 1px var(--lijn); min-height: 100vh; }
}
