@font-face { font-family: "Abril Fatface"; src: url("/fonts/AbrilFatface-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --ink: #1f1b2e; --ink-soft: #5c5670; --paper: #fbf6ea; --card: #ffffff; --line: #e7dfcd;
  --night: #1b0f33; --violet: #5b21b6; --violet-soft: #f3edff; --gold: #ffd166; --gold-deep: #8a5a00;
  --red: #b42318; --red-soft: #fdecea; --green: #17693c; --green-soft: #e4f4ea; --amber-soft: #fff3d6;
  --radius: 14px; --gap: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--paper); min-height: 100dvh; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-family: "Abril Fatface", Georgia, serif; font-weight: 400; font-size: clamp(28px, 4vw, 38px); letter-spacing: .01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: var(--violet); }
p { margin: 0; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
.boot { padding: 40px; text-align: center; }

/* Indeling */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--night); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100dvh; }
.brand { font-family: "Abril Fatface", Georgia, serif; font-size: 22px; line-height: 1.1; padding: 0 10px; color: var(--gold); }
.brand small { display: block; font: 500 13px/1.4 system-ui, sans-serif; color: #cfc8e2; margin-top: 4px; overflow-wrap: anywhere; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: #e6e1f2; text-decoration: none; font-weight: 500; transition: background .15s; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { background: var(--gold); color: var(--night); font-weight: 700; }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; font-size: 13px; color: #cfc8e2; }
.side-foot button { align-self: flex-start; background: none; border: 0; color: #fff; padding: 8px 0; font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
.main { padding: clamp(18px, 3vw, 36px); min-width: 0; max-width: 1240px; width: 100%; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.head-left { min-width: 0; }
.head p { color: var(--ink-soft); margin-top: 4px; }
.back { display: inline-block; margin-bottom: 6px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Onderdelen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card-sub { color: var(--ink-soft); font-size: 14px; margin: -8px 0 12px; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.two { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.tiles { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin-bottom: var(--gap); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--violet); }
.tile b { display: block; font-family: "Abril Fatface", Georgia, serif; font-weight: 400; font-size: 36px; line-height: 1.1; }
.tile span { color: var(--ink-soft); font-size: 14px; }
.tile.warn { background: var(--amber-soft); border-color: #f0d596; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--night); background: var(--night); color: #fff; font: 600 15px/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s; }
.btn:hover { background: var(--violet); border-color: var(--violet); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--night); }
.btn.ghost:hover { background: var(--violet-soft); color: var(--night); border-color: var(--night); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); color: var(--red); }
.btn[disabled] { opacity: .55; cursor: default; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--violet-soft); color: var(--violet); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--gold-deep); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.mute { background: #eee9dd; color: var(--ink-soft); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .btn { margin-top: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 15px; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); color: #5e4100; font-size: 15px; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row-main { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.row-title { font-weight: 600; }
a.event-link { display: block; color: inherit; text-decoration: none; }
a.event-link:hover .row-title { color: var(--violet); text-decoration: underline; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #b9b2a2; margin-right: 6px; }
.dot.on { background: #1f9d55; box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }

/* Formulieren */
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span, .field > label { font-size: 14px; font-weight: 600; }
.field small { color: var(--ink-soft); font-size: 13px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #c9c0ab; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; min-width: 0; }
textarea { min-height: 88px; resize: vertical; }
input[type="color"] { padding: 4px; height: 44px; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--violet); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 500; }
.savebar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--line); z-index: 5; }

/* Agenda */
.cal-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-title { font-weight: 700; font-size: 18px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: #f4edda; font-size: 13px; font-weight: 600; text-align: center; padding: 6px 0; }
.cal-day { background: var(--card); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.off { background: #f8f3e6; color: #8d8672; }
.cal-num { display: flex; justify-content: space-between; align-items: center; gap: 2px; border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 14px; font-weight: 600; color: inherit; cursor: pointer; border-radius: 6px; width: 100%; min-height: 28px; }
.cal-num:hover { background: var(--violet-soft); }
.cal-day.today .cal-num { color: var(--violet); }
.cal-day.today .cal-num > span:first-child { background: var(--night); color: #fff; border-radius: 99px; padding: 0 7px; }
.chip { display: block; padding: 3px 6px; border-radius: 6px; font-size: 13px; line-height: 1.25; text-decoration: none; background: var(--violet-soft); color: var(--night); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip:hover { background: #e4d9ff; }
.chip.aanvraag { background: var(--amber-soft); }
.chip.problem { box-shadow: inset 3px 0 0 var(--red); }
.site-mark { font-size: 11px; font-weight: 700; color: var(--gold-deep); background: var(--amber-soft); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.site-mark.bezet { color: var(--red); background: var(--red-soft); }
.cal-list { display: none; margin-top: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 14px; color: var(--ink-soft); align-items: center; }

/* Ontwerpen */
.designs { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.design { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.checker { background: repeating-conic-gradient(#e8e2d3 0% 25%, #f8f4ea 0% 50%) 50% / 18px 18px; border-radius: 8px; display: flex; justify-content: center; }
.checker img { max-height: 240px; width: auto; }
.photos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.photos img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 8px; background: #eee9dd; }

/* Voorbeeld beginscherm */
.preview { aspect-ratio: 16/10; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px; overflow: hidden; }
.preview h3 { font-family: "Abril Fatface", Georgia, serif; font-weight: 400; font-size: clamp(20px, 3vw, 28px); overflow-wrap: anywhere; }
.preview span { padding: 9px 18px; border-radius: 99px; font-weight: 700; font-size: 14px; animation: breathe 2.4s ease-in-out infinite; overflow-wrap: anywhere; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.code { font: 700 26px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .12em; overflow-wrap: anywhere; }
.secret { font: 13px/1.4 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; background: #f4edda; padding: 10px; border-radius: 8px; }

/* Inloggen */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 20%, #4a2a86 0, var(--night) 60%); }
.login form { background: var(--card); padding: 28px; border-radius: 18px; width: min(100%, 400px); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: rise .4s ease-out; }
.login h1 { color: var(--night); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Meldingen en dialoog */
#toasts { position: fixed; right: 16px; bottom: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--night); color: #fff; padding: 12px 16px; border-radius: 10px; max-width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: rise .2s ease-out; pointer-events: auto; }
.toast.bad { background: var(--red); }
dialog { border: 0; border-radius: 16px; padding: 22px; width: min(calc(100vw - 32px), 460px); color: var(--ink); }
dialog::backdrop { background: rgba(27,15,51,.55); }
dialog form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 900px) {
  .two { grid-template-columns: minmax(0, 1fr); }
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 66px; }
  .side { position: static; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; justify-content: space-between; }
  .brand { padding: 0; font-size: 18px; }
  .brand small { display: none; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; gap: 0; background: var(--night); padding: 4px; z-index: 20; }
  .nav a { flex: 1 1 0; justify-content: center; padding: 6px 2px; font-size: 12px; text-align: center; min-width: 0; }
  .side-foot { padding: 0; }
  .side-foot span { display: none; }
  .savebar { bottom: 66px; }
  #toasts { bottom: 76px; }
}
@media (max-width: 640px) {
  .cal-list { display: block; }
  .cal-day { min-height: 76px; padding: 3px; }
  .chip { font-size: 12px; padding: 2px 3px; }
  .cal-num { padding: 1px; flex-wrap: wrap; }
  .site-mark { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
