:root {
  --bg: #f6f5f2;
  --card: #fff;
  --ink: #1d1d1b;
  --muted: #6d6b66;
  --line: #e3e0da;
  --accent: #2f5d50;
  --accent-ink: #fff;
  --warn: #fff4d6;
  --err: #fde3e1;
  --ok: #e3f2e8;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.1rem; margin: 1.2em 0 .6em; }
.card h2:first-child { margin-top: 0; }
h1 a { text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }

.top { background: var(--ink); color: #fff; margin-bottom: 20px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 12px; }
.logo { font-weight: 600; }
.nav { display: flex; gap: 16px; align-items: center; }
.nav a, .linklike { color: #fff; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.nav form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

label { display: block; margin: 0 0 12px; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.label { display: block; font-weight: 500; margin-bottom: 4px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.1); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-danger { background: #a3332b; border-color: #a3332b; color: #fff; }
.btn-small { padding: 4px 10px; font-size: .88rem; }
.btn-block { width: 100%; }
.actions, .inline-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.inline-buttons { margin: 0 0 12px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-ok { background: var(--ok); }
.flash-warn { background: var(--warn); }
.flash-err { background: var(--err); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.note { background: var(--warn); border-radius: 6px; padding: 6px 10px; margin-top: 6px; font-size: .9rem; }

/* Kleurcode per status: --st is de hoofdkleur, --st-bg de lichte achtergrond */
.st-concept        { --st: #8e8e8a; --st-bg: #efefec; }
.st-wacht_op_klant { --st: #d99a00; --st-bg: #fff2cc; }
.st-feedback       { --st: #e8590c; --st-bg: #ffe3d1; }
.st-goedgekeurd    { --st: #2b8a3e; --st-bg: #dcf3e2; }
.st-bezig          { --st: #7048e8; --st-bg: #ebe4ff; }
.st-gepubliceerd   { --st: #1c6fb8; --st-bg: #dceaf8; }
.st-deels, .st-fout { --st: #c92a2a; --st-bg: #fde3e1; }

.badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 99px; background: var(--st-bg, #eee); color: #1d1d1b; box-shadow: inset 0 0 0 1px var(--st, transparent); white-space: nowrap; }
.st-border { border-left: 4px solid var(--st, var(--line)) !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--st); margin-right: 5px; vertical-align: -1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); margin: 0 0 12px; }
.legend-item { white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { color: var(--ink); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; margin-bottom: 14px; }
.segmented label, .segmented a { display: flex; align-items: center; gap: 6px; padding: 6px 14px; margin: 0; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink); }
.segmented label + label, .segmented a + a { border-left: 1px solid var(--line); }
.segmented label:has(input:checked), .segmented a.active { background: var(--accent); color: #fff; }
.segmented input { accent-color: #fff; }

/* Editor: wat zichtbaar is hangt af van het soort post en aparte FB-tekst */
.type-reel, .type-story, .fb-fields, .fb-on-only { display: none; }
p.type-reel, p.type-story { margin: 0; }
.is-reel .type-feed, .is-story .type-feed { display: none; }
.is-reel .type-reel { display: inline; }
.is-reel p.type-reel { display: block; }
.is-story .type-story { display: inline; }
.is-story p.type-story { display: block; }
.is-story .not-story, .is-reel .type-feed-block, .is-story .type-feed-block { display: none !important; }
.fb-on .fb-fields { display: block; padding: 10px 12px; background: #f1f5fd; border-radius: 8px; margin-bottom: 12px; }
.fb-on .fb-on-only { display: inline; }
.fb-on .fb-off-only { display: none; }
.is-story .dropzone.has-image .stage, .is-reel .dropzone.has-image .stage { max-width: 320px; margin: 0 auto; }
.stage-empty { display: none; color: #ddd; padding: 60px 10px; text-align: center; }
.add-media { position: absolute; right: 8px; bottom: 8px; display: none; }
.dropzone.has-image .add-media { display: inline-block; }
.readonly .add-media, .readonly .media-tools { display: none !important; }

.media-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.media-item { position: relative; width: 74px; height: 74px; border-radius: 6px; overflow: hidden; background: #eee; border: 2px solid transparent; }
.media-item:first-child { border-color: var(--accent); }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item.removed { display: none; }
.media-item.media-error { background: var(--err); }
.media-item.media-pending, .media-item.media-busy { background: var(--warn); }
.media-badge { position: absolute; left: 3px; bottom: 3px; right: 3px; font-size: .62rem; background: rgba(0,0,0,.7); color: #fff; border-radius: 3px; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-error .media-badge, .media-pending .media-badge, .media-busy .media-badge { position: static; display: block; margin: 22px 3px 0; text-align: center; }
.media-tools { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.media-item:hover .media-tools, .media-item:focus-within .media-tools { opacity: 1; }
@media (hover: none) { .media-tools { opacity: 1; } }
.media-tools button { border: 0; background: rgba(0,0,0,.65); color: #fff; width: 20px; height: 20px; border-radius: 4px; font-size: .75rem; line-height: 20px; padding: 0; cursor: pointer; }
.media-new .mt-left, .media-new .mt-right { display: none; }
.video-preview { width: 100%; max-height: 420px; border-radius: 8px; background: #000; margin-top: 6px; }

.flash-info { background: #e5f0fb; }
.chip-reel { background: #ffe8d6; }
.chip-import { background: #eef0f2; color: #555; }
.chip-reused { background: #e5f0fb; }
.reused { color: #1c6fb8; margin-top: 2px; }
.net-reel { color: #c2410c; }
.net-reused { color: #1c6fb8; }

/* Archief */
.archive-row { display: flex; gap: 12px; align-items: center; padding: 8px 0 8px 10px; border-bottom: 1px solid var(--line); }
.archive-row .post-row-main { flex: 1; min-width: 0; }
.archive-row form { margin: 0; }
.pager { align-items: center; margin-top: 12px; }

/* Inspiratie */
.inspiration h3 { font-size: 1rem; margin: 18px 0 8px; }
.inspo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.inspo { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.inspo p { margin: 0 0 6px; }
.inspo form { margin-top: auto; }
.inspo-season { background: #f3f8f2; }
.inspo-gap { background: #fff8e6; }
.inspo-kicker { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.inspo-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.inspo-post { display: flex; flex-direction: column; gap: 4px; }
.inspo-post img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.inspo-post p { margin: 0; }
.inspo-post form { margin-top: auto; }

/* Voortgang import */
.progress { height: 12px; background: #eee; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* Klantportaal: carrousel en video */
.portal-media { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 8px; }
.portal-media > * { flex: 0 0 100%; scroll-snap-align: start; }
.portal-media img, .portal-media video { width: 100%; display: block; border-radius: 8px; background: #000; }
.portal-count { font-size: .8rem; color: var(--muted); }
.post-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.post-title h2 { margin-top: 0; }
.chip-story { background: #f3e8ff; }

/* Ideeën */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.idea { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fffdf6; }
.idea p { margin: 6px 0; }
.idea .inline-buttons { margin: 8px 0 4px; }
.idea .inline-buttons form { margin: 0; }
.idea details input, .idea details textarea { margin-bottom: 6px; }

/* Kalender */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-toolbar h2 { margin: 0; }
.cal-toolbar .inline-buttons, .cal-toolbar .segmented { margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.cal-dow { background: #faf9f6; text-align: center; font-size: .8rem; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal-day { background: #fff; padding: 6px; display: flex; flex-direction: column; min-width: 0; transition: background .1s; }
.cal-month .cal-day { min-height: 118px; }
.cal-week .cal-day { min-height: 420px; }
.cal-day.other { background: #fbfaf8; }
.cal-day.other .cal-day-head { opacity: .5; }
.cal-day.past { background: #f7f6f3; }
.cal-day.today .cal-day-head span { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal-day.drop { background: #e8f3ee; outline: 2px dashed var(--accent); outline-offset: -3px; }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.cal-add { text-decoration: none; width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 6px; color: var(--muted); opacity: 0; transition: opacity .1s; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--accent); color: #fff; }
@media (hover: none) { .cal-add { opacity: 1; } }
.cal-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cal-card { display: block; text-decoration: none; color: inherit; background: var(--st-bg); border-radius: 6px; padding: 4px 6px; font-size: .78rem; line-height: 1.3; overflow: hidden; }
.cal-card.movable { cursor: grab; }
.cal-card.dragging { opacity: .4; }
.cal-card.saving { opacity: .6; }
.cal-card img.cal-img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; margin-bottom: 4px; }
.cal-month .cal-card { display: flex; gap: 5px; align-items: center; }
.cal-card img.cal-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 3px; flex: none; }
.cal-meta { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.net { font-size: .62rem; font-weight: 700; padding: 0 3px; border-radius: 3px; background: rgba(255,255,255,.75); }
.net-facebook { color: #1c4fa8; }
.net-instagram { color: #b0236b; }
.net-story { color: #6b2bb0; }
.cal-client { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-caption { display: block; color: #4a4945; margin-top: 2px; }
.undated-items { flex-direction: row; flex-wrap: wrap; }
.undated-items .cal-card { width: 140px; }
@media (max-width: 760px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-week .cal-dow { display: none; }
  .cal-week .cal-day { min-height: 0; }
  .cal-month .cal-day { min-height: 70px; padding: 3px; }
  .cal-month .cal-caption, .cal-month .cal-client { display: none; }
}

.filter { margin-bottom: 10px !important; }
.person-head { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; padding: 0 2px; }
.person-actions { display: flex; align-items: center; gap: 6px; }
.chip { display: inline-block; font-size: .75rem; padding: 0 7px; border-radius: 4px; background: #eee; margin-right: 3px; }
.chip-facebook { background: #e1e9fb; }
.chip-instagram { background: #fbe1ee; }
.chip-linkedin { background: #dceef7; }
.count { font-size: .8rem; background: #eee; border-radius: 99px; padding: 1px 8px; vertical-align: middle; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.list-row.link { text-decoration: none; color: inherit; flex-wrap: wrap; }
.row-actions form, .row-actions { display: flex; gap: 6px; margin: 0; }
.person-row { display: flex; gap: 6px; align-items: center; padding: 4px 0; flex-wrap: wrap; }
.person-row input:not([type=checkbox]) { margin: 0; flex: 1 1 90px; min-width: 0; width: auto; }
.person-row label.check { margin: 0; }
.person-row.add { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row input { margin: 0; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; }

.post-list { display: flex; flex-direction: column; }
.post-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.post-row:hover { background: #faf9f6; }
.post-row.st-border { padding-left: 10px; }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 6px; overflow: hidden; background: #eee; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { font-size: .75rem; color: var(--muted); text-align: center; padding-top: 22px; }
.post-row-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; }
.post-row-caption { color: var(--muted); font-size: .9rem; }

/* Editor */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 800px) { .editor-grid { grid-template-columns: 1fr; } }
.editor { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); min-height: 280px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #faf9f6; margin-bottom: 8px; }
.dropzone.drag { border-color: var(--accent); background: #eef5f2; }
.dropzone input[type=file] { display: none; }
.dropzone .drop-hint { text-align: center; color: var(--muted); }
.dropzone .stage { display: none; }
.dropzone.has-image { border-style: solid; cursor: default; min-height: 0; display: block; background: #000; }
.dropzone.has-image .stage { display: block; }
.dropzone.has-image .drop-hint { display: none; }
.change-image { position: absolute; right: 8px; bottom: 8px; display: none; }
.dropzone.has-image .change-image { display: inline-block; }
.readonly .change-image { display: none !important; }

.stage { position: relative; user-select: none; touch-action: none; }
.stage img { display: block; width: 100%; height: auto; }
.marker {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .78); color: #fff; font-size: .8rem; padding: 3px 8px; border-radius: 5px;
  cursor: grab; white-space: nowrap; touch-action: none;
}
.marker::before { content: ""; position: absolute; left: 50%; top: -5px; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom-color: rgba(0, 0, 0, .78); }
.marker.dragging { cursor: grabbing; outline: 2px solid #fff; }
.readonly-stage { border-radius: 8px; overflow: hidden; cursor: pointer; }
.readonly-stage .marker, .readonly .marker { cursor: default; }
.readonly-stage.hide-tags .marker { display: none; }
.tag-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.tag-item { margin: 0; padding: 3px 0; }
.counter { margin: -8px 0 12px; }
.counter.over { color: #a3332b; font-weight: 600; }

/* Klantportaal */
.portal-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; }
@media (max-width: 700px) { .portal-grid { grid-template-columns: 1fr; } }
.caption-view { white-space: normal; background: #faf9f6; border-radius: 8px; padding: 10px; margin: 8px 0; }
.pin { font-size: 1.6rem; letter-spacing: .4em; text-align: center; margin-bottom: 12px !important; }
details summary { cursor: pointer; }
details.feedback { margin-top: 8px; }
details.feedback textarea { margin: 8px 0; }
h2.inline { display: inline; }
.log { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow: auto; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.danger summary { color: #a3332b; }
code { background: rgba(0, 0, 0, .06); padding: 0 4px; border-radius: 4px; }
.portal-post.st-border { padding-left: 16px; }
.fb-box { background: #f1f5fd; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.is-story-card .portal-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 6fr); }

/* Planningsdekking */
.coverage { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.cov-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.cov-stats > span { display: flex; flex-direction: column; }
.cov-stats > span.cov-ok, .cov-stats > span.cov-warn, .cov-stats > span.cov-alert { flex-direction: row; font-size: .86rem; padding: 3px 10px; border-radius: 99px; }
.cov-ok { background: #dcf3e2; }
.cov-warn { background: #fff2cc; }
.cov-alert { background: #fde3e1; }
.cov-strip { display: flex; gap: 2px; text-decoration: none; }
.cov-day { width: 9px; height: 22px; border-radius: 2px; background: var(--st, #e7e5e0); }
.cov-day.st-concept { background: #c9c9c4; }
.cov-monday { margin-left: 5px; }
.week-warning { border-left: 4px solid transparent; padding-left: 10px; border-radius: 0; }
.week-warning.cov-alert { border-left-color: #c92a2a; background: transparent; }
.week-warning.cov-warn { border-left-color: #d99a00; background: transparent; }

/* Servertijd in de balk */
.server-time { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.server-time .st-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8590c; }
.server-time .st-dot.ok { background: #51cf66; }
.server-time .st-date { opacity: .7; }
@media (max-width: 640px) { .server-time .st-date { display: none; } .nav { gap: 10px; } }
