/* Postmaker, in de huisstijl van Krumps */
:root {
  --ink: #0c2e40;
  --ink-2: #1b4257;
  --yellow: #fde900;
  --green: #1dad7d;
  --paper: #f3f6f7;
  --card: #ffffff;
  --line: #d5dee3;
  --muted: #5b7180;
  --danger: #c4372b;
  --radius: 10px;
  --font: 'Prompt', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--paper); }
a { color: var(--ink); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: .98rem; font-weight: 600; margin-top: 1.6em; }
code { background: var(--paper); padding: 2px 6px; border-radius: 4px; font-size: .85em; word-break: break-all; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.muted { color: var(--muted); }
.help { color: var(--muted); font-size: .86rem; margin: .3em 0 .9em; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.brand small { font-weight: 400; opacity: .7; margin-left: 4px; }
.brand-mark { width: 22px; height: 22px; background: var(--yellow); border-radius: 50% 50% 50% 0; display: inline-block; }
.brand-mark.big { width: 40px; height: 40px; margin-bottom: 12px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .92rem; }
.nav a:hover { background: var(--ink-2); }

/* ---------- knoppen en velden ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid transparent; border-radius: 999px;
  padding: 9px 20px; font: 500 .95rem var(--font); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: #f2dc00; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 13px; font-size: .85rem; }
.btn-big { width: 100%; padding: 14px 22px; font-size: 1.05rem; font-weight: 600; }
.btn.is-busy { opacity: 1; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy { animation: none; } }
.link-danger { background: none; border: 0; padding: 0; color: var(--danger); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; font: 400 .95rem/1.45 var(--font); color: var(--ink); background: #fff; border: 1.5px solid var(--line);
  border-radius: 8px; padding: 9px 12px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
input[type=range] { width: 100%; accent-color: var(--green); }
input[type=file] { font: inherit; font-size: .85rem; max-width: 100%; }
label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; accent-color: var(--green); width: 17px; height: 17px; flex: none; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.input-with-btn .btn { flex: none; }

.flash { margin: 14px 24px 0; padding: 11px 16px; border-radius: 8px; background: #e2f5ee; border-left: 4px solid var(--green); }
.flash-error { background: #fbe9e7; border-left-color: var(--danger); }
.auth .flash, .card .flash { margin: 0 0 14px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); vertical-align: middle; }
.tag-warn { background: #fff7c2; color: #6b5d00; }

/* ---------- inloggen ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--ink) radial-gradient(circle at 85% 10%, rgba(253, 233, 0, .16) 0 220px, transparent 221px); }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 36px 32px; }
.auth-card h1 { margin-bottom: .3em; }
.auth-card .muted { margin-bottom: 1.6em; }

/* ---------- pagina's ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.crumb { margin: 0 0 4px; font-size: .88rem; }
.crumb a { color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 240px; }
.inline { display: inline; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card-danger { border-color: #efc6c1; }
.empty { background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }
.empty p { max-width: 52ch; margin: 0 auto 18px; color: var(--muted); }
.form-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.stack > * + * { margin-top: 10px; }
.stack-sm { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.right { text-align: right; white-space: nowrap; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: .82rem; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { text-decoration: none; }
.is-off { opacity: .55; }
.swatches { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }

/* beheer: klant */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.color-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.color-row { display: grid; grid-template-columns: 44px 110px 1fr auto; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 40px; border: 1.5px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 12px; }
.asset { margin: 0; font-size: .82rem; }
.asset-img { aspect-ratio: 4 / 3; border-radius: 8px; display: grid; place-items: center; padding: 10px; border: 1px solid var(--line); }
.asset-img img { max-height: 100%; object-fit: contain; }
.asset figcaption { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; }
.checker { background-color: #fff; background-image: conic-gradient(#e7ecee 25%, transparent 0 50%, #e7ecee 0 75%, transparent 0); background-size: 16px 16px; }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; background: var(--paper); border-radius: 8px; }
.upload-form input:not([type=file]):not([type=checkbox]), .upload-form select { width: auto; flex: 1 1 160px; }
.upload-form .check { margin: 0; }
.font-list { list-style: none; padding: 0; margin: 0 0 12px; }
.font-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.user-list { list-style: none; padding: 0; margin: 0 0 18px; }
.user-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.user-list details { text-align: right; }
.user-list summary { list-style: none; }
.user-list summary::-webkit-details-marker { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs img, .thumb-empty { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--paper); }

/* beheer: teksten */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chips a { text-decoration: none; padding: 5px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .88rem; }
.text-field > span { display: block; }
.text-field.is-changed > input, .text-field.is-changed > textarea { border-color: var(--green); }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--paper) 35%); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 320px minmax(0, 1fr) 340px; gap: 20px; padding: 20px 24px 40px; align-items: start; max-width: 1600px; margin: 0 auto; }
.panel-input, .panel-edit { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-input { position: sticky; top: 20px; }
.lbl { display: block; font-weight: 600; font-size: .98rem; margin: 18px 0 8px; }
.panel-input .lbl:first-child, .block > .lbl:first-child { margin-top: 0; }
#pm-topic { font-size: 1rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: 500 .85rem var(--font); color: var(--ink); cursor: pointer; }
.seg button:hover { border-color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.photo-box { display: grid; gap: 10px; margin-bottom: 20px; }
.photo-thumb { display: flex; align-items: center; gap: 12px; }
.photo-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.file-btn { position: relative; margin: 0; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.status { min-height: 1.4em; margin: 12px 0 0; font-size: .9rem; color: var(--green); }
.status.is-error { color: var(--danger); }

.panel-stage { min-width: 0; }
.format-tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: .88rem; }
.code-input { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; font-weight: 600 !important; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: .88rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.stage { display: grid; place-items: center; min-height: 420px; border-radius: var(--radius);
  background: #e6ecef radial-gradient(circle at 1px 1px, #cfd9de 1px, transparent 1.5px) 0 0 / 18px 18px; padding: 0; }
.canvas-wrap { box-shadow: 0 18px 40px -18px rgba(12, 46, 64, .45); line-height: 0; }
.stage-empty { text-align: center; padding: 40px 24px; max-width: 360px; }
.stage-empty-frame { width: 150px; aspect-ratio: 4 / 5; margin: 0 auto 22px; border-radius: 8px; background: var(--ink);
  position: relative; overflow: hidden; }
.stage-empty-frame::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: var(--yellow); }
.stage-empty-frame::after { content: ''; position: absolute; left: 14px; bottom: 16%; width: 60%; height: 7px; border-radius: 4px; background: var(--ink);
  box-shadow: 0 -14px 0 var(--ink); }
.stage-empty p { color: var(--muted); }
.result { margin-top: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.change { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.change .lbl { margin-top: 0; }

.block + .block { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
.field { display: block; font-weight: 500; font-size: .85rem; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; }
#pm-caption { margin-bottom: 10px; font-size: .92rem; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.tray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.tray-item { aspect-ratio: 1; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.tray-item:hover { border-color: var(--ink); }
.tray-item img { max-height: 100%; object-fit: contain; }

/* posts */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-thumb { display: block; aspect-ratio: 4 / 5; background: var(--paper); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-meta { padding: 12px 14px 4px; display: grid; gap: 2px; }
.post-meta strong { font-weight: 500; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-actions { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px 14px; margin-top: auto; }

/* ---------- kleinere schermen ---------- */
@media (max-width: 1280px) {
  .editor { grid-template-columns: 300px minmax(0, 1fr); }
  .panel-edit { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
  .panel-edit .block + .block { border-top: 0; margin-top: 0; padding-top: 0; }
}
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .panel-input { position: static; }
  .panel-edit { display: block; }
  .panel-edit .block + .block { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
  .stage { min-height: 300px; }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 14px; }
  .page { padding: 20px 14px 50px; }
  .row2, .checks { grid-template-columns: 1fr; }
  .color-row { grid-template-columns: 44px 1fr auto; }
  .color-row input[name="color_name[]"] { grid-column: 1 / 3; }
  .inline-form { width: 100%; }
  .inline-form input { min-width: 0; }
  .card { padding: 18px; }
  .actions .btn { flex: 1 1 100%; }
}
