/* ── Kaarten & grids ───────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card + .card, .stack > * + * { margin-top: 14px; }
.card-title {
  font-size: var(--t-emphasis); font-weight: 500; letter-spacing: -0.006em;
  text-transform: none; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.card-title .actions { display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 940px) { .g2, .g3, .g4, .split { grid-template-columns: 1fr; } }
@media (min-width: 941px) and (max-width: 1120px) { .g4 { grid-template-columns: 1fr 1fr; } }

/* ── KPI's ─────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 12px; }
.kpis > * { min-width: 0; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 14px 15px 13px;
  transition: border-color 0.14s var(--ease);
}
.kpi:hover { border-color: var(--line); }
.kpi .lbl { font-size: 11px; font-weight: 450; color: var(--faint); letter-spacing: 0; text-transform: none; }
.kpi .val {
  font-family: var(--mono); font-weight: 500; font-size: 24px;
  letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.kpi .sub { font-size: 11px; color: var(--ghost); margin-top: 3px; }
.kpi.accent { border-color: var(--line); background: var(--paper-2); }
.kpi.accent .val { color: var(--groen-licht); }
.pos { color: var(--groen); } .neg { color: var(--rood); }

/* ── Knoppen ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 5px 11px;
  font-size: 12.5px; font-weight: 500; letter-spacing: -0.005em;
  cursor: pointer; white-space: nowrap;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease);
}
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn:active { background: var(--selected); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--rosso); border-color: var(--rosso); color: #fff; }
.btn-primary:hover { background: var(--rosso-deep); border-color: var(--rosso-deep); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--mid); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: var(--r-sm); }
.btn-ai { background: var(--paper-2); border-color: var(--line); color: var(--rosso-text); }
.btn-ai:hover { background: var(--hover); border-color: var(--rosso); }

.pills { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 2px; gap: 1px; }
.pills button { border: 0; background: transparent; padding: 4px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; color: var(--faint); cursor: pointer; transition: background 0.12s, color 0.12s; white-space: nowrap; }
.pills button:hover { color: var(--ink); }
.pills button.on { background: var(--selected); color: var(--ink); }

/* ── Tabellen ──────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ghost); padding: 7px 9px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl td { padding: 8px 9px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 0.1s; }
.tbl tbody tr:hover td { background: var(--paper-2); }
.tbl .r { text-align: right; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

/* ── Badges & chips ────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; letter-spacing: 0; padding: 2px 7px; border-radius: var(--r-xs); white-space: nowrap; }
.b-groen { background: var(--groen-bg); color: var(--groen); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-rood { background: var(--rood-bg); color: var(--rood); }
.b-grijs { background: var(--hover); color: var(--faint); }
.b-blauw { background: var(--blauw-bg); color: var(--blauw); }
.b-rosso { background: var(--rosso-soft); color: var(--rosso-text); }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 3px 9px; font-size: 12px; font-weight: 450; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--ghost); font-size: 13px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--rood); }

/* ── Formulieren ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 450; letter-spacing: 0; text-transform: none; color: var(--faint); }
input, select, textarea {
  font-family: var(--sans); font-size: 13px; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 7px 10px; outline: none; width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--ghost); }
input:focus, select:focus, textarea:focus { border-color: var(--rosso); box-shadow: 0 0 0 3px var(--rosso-glow); }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
input[type="number"], .mono, .tbl td { font-variant-numeric: tabular-nums; }
.frm { display: grid; gap: 12px; }
.frm-2 { grid-template-columns: 1fr 1fr; }
/* Grid- en flexkinderen krijgen standaard min-width:auto, waardoor ze niet
   kleiner kunnen worden dan hun inhoud. Bij een keuzelijst is dat de langste
   optie, dus "Vierde vrijdag van november (Black Friday)" duwde het hele
   venster breder dan het scherm. Dit houdt ze binnen de lijnen. */
.frm > *, .frm-2 > *, .field { min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 640px) { .frm-2 { grid-template-columns: 1fr; } }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 120; background: var(--scrim); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 7vh 16px; overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); width: 540px; max-width: 100%; padding: 22px; animation: rise 0.18s var(--ease); }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.modal-box h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 18px; }

/* ── Toast ─────────────────────────────────────────────────────────── */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 7px; }
.toast { background: var(--paper-2); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r-md); padding: 9px 14px; font-size: 12.5px; font-weight: 450; box-shadow: var(--shadow-lift); animation: rise 0.16s var(--ease); max-width: 320px; }
.toast.err { border-color: var(--rood); color: var(--rood); }

/* ── Checkpoints ───────────────────────────────────────────────────── */
.cp { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start; background: var(--paper-2); }
.cp + .cp { margin-top: 7px; }
.cp-dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; flex: none; }
.cp.go { border-color: var(--groen); }
.cp.kill { border-color: var(--rood); }
.cp .cp-t { font-weight: 550; font-size: 13px; }
.cp .cp-m { font-size: 11px; color: var(--ghost); }
.cp .cp-msg { font-size: 12px; margin-top: 3px; color: var(--mid); }

/* ── Signalen ──────────────────────────────────────────────────────── */
.signal { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: var(--r-md); font-size: 12.5px; border: 1px solid transparent; }
.signal + .signal { margin-top: 7px; }
.s-amber { background: var(--amber-bg); color: var(--amber); }
.s-rood { background: var(--rood-bg); color: var(--rood); }
.s-groen { background: var(--groen-bg); color: var(--groen); }

/* ── Waterval-lint ─────────────────────────────────────────────────── */
.ribbon { display: flex; width: 100%; height: 34px; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-soft); }
.ribbon > div { position: relative; min-width: 3px; transition: flex-basis 0.5s var(--ease); }
.ribbon > div:hover { filter: brightness(1.12); }
.ribbon-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.ribbon-legend .li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); }
.ribbon-legend .sw { width: 8px; height: 8px; border-radius: 2px; }
.ribbon-legend b { font-variant-numeric: tabular-nums; color: var(--ink); font-family: var(--mono); font-weight: 500; }

/* ── Diversen ──────────────────────────────────────────────────────── */
.empty { text-align: center; color: var(--faint); padding: 34px 12px; font-size: 12.5px; }
.empty .eh { font-size: 14px; font-weight: 550; color: var(--ink); letter-spacing: -0.005em; margin-bottom: 4px; }
.empty .big { font-size: 24px; margin-bottom: 8px; opacity: 0.5; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.muted { color: var(--ghost); font-size: 11.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.clickable { cursor: pointer; }
.prose p { margin-bottom: 7px; }
.qc-line { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; padding: 2px 0; }
.qc-line .ic { flex: none; width: 14px; text-align: center; font-weight: 600; }
.qc-line.ok .ic { color: var(--groen); }
.qc-line.nok .ic { color: var(--rood); }
.qc-line .why { color: var(--ghost); }
.progress-log { font-size: 12px; line-height: 1.8; max-height: 230px; overflow-y: auto; font-family: var(--mono); }

[data-toggle] { transition: background 0.12s var(--ease); border-radius: var(--r-sm); }
[data-toggle]:hover { background: var(--paper-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--thumb-hover); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Agenda ────────────────────────────────────────────────────────── */
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calcell { min-height: 76px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 5px 6px; font-size: 11px; }
.calcell .d { font-weight: 500; color: var(--ghost); font-size: 11px; font-variant-numeric: tabular-nums; }
.calcell.today { border-color: var(--rosso); }
.calcell.dim { opacity: 0.4; }
.calev { margin-top: 2px; padding: 1px 5px; border-radius: var(--r-xs); background: var(--hover); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.calev.sale { background: var(--rood-bg); color: var(--rood); }
.calev.kids { background: var(--blauw-bg); color: var(--blauw); }
.calev.women { background: var(--rosso-soft); color: var(--rosso-text); }
.calev.camp { background: var(--groen-bg); color: var(--groen); }

/* Bewerkbare momenten laten zien dat je erop kunt klikken. Alleen eigen
   momenten krijgen data-evedit; de vaste seizoenskalender dus niet, en die
   voelt daardoor terecht niet aan als knop. */
.calev[data-evedit] { cursor: pointer; transition: filter 0.12s var(--ease), box-shadow 0.12s var(--ease); }
.calev[data-evedit]:hover { filter: brightness(0.94); box-shadow: inset 0 0 0 1px var(--line-strong); }
[data-theme="dark"] .calev[data-evedit]:hover { filter: brightness(1.25); }

.ag-listcard [data-evedit] { transition: background 0.12s var(--ease); }
.ag-listcard [data-evedit]:hover { background: var(--hover); }
.ag-listcard [data-evedit]:hover .ag-hint { opacity: 1; }
.ag-hint { opacity: 0; transition: opacity 0.12s var(--ease); }
@media (hover: none) { .ag-hint { opacity: 1; } }
@media (max-width: 940px) { .calcell { min-height: 54px; } }
@media (max-width: 720px) {
  .ag-monthcard { display: none; }
  .ag-listcard .card-title::after { content: ' · maandweergave op desktop'; color: var(--ghost); font-weight: 400; }
}
