/* ============================================================
   REESE CMR — designsysteem
   Alle kleuren staan als tokens in :root. Pas ze hier aan om
   het platform in één keer naar de REESE-huisstijl te trekken.
   ============================================================ */

:root {
  /* Merk */
  --brand:           #003F74;
  --brand-strong:    #00264D;
  --brand-soft:      #E7EDF4;
  --brand-contrast:  #FFFFFF;

  /* Oppervlakken */
  --bg:              #F5F6F8;
  --surface:         #FFFFFF;
  --surface-sunken:  #FAFBFC;
  --surface-hover:   #F2F4F6;

  /* Tekst */
  --text:            #15181C;
  --text-secondary:  #555C66;
  --text-muted:      #858C96;
  --text-inverse:    #FFFFFF;

  /* Lijnen */
  --border:          #E3E6EA;
  --border-strong:   #CDD2D9;

  /* Statuskleuren */
  --success:         #1F8A4C;
  --success-soft:    #E6F4EC;
  --warning:         #B7791F;
  --warning-soft:    #FDF3E2;
  --danger:          #C42B32;
  --danger-soft:     #FCEBEC;
  --info:            #1F6FB2;
  --info-soft:       #E8F1F9;
  --neutral-soft:    #EEF0F3;

  /* Vorm */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

  --sidebar-w: 268px;
  --topbar-h: 82px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--brand-soft); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ============================================================
   App-raster
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.app__main { min-width: 0; display: flex; flex-direction: column; }

.page {
  padding: 24px 28px 64px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ============================================================
   Zijbalk
   ============================================================ */

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar__logo {
  height: 50px;
  width: auto;
  max-width: 200px;
  display: block;
}

.portal__logo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(var(--topbar-h) - 20px);
  object-fit: contain;
  object-position: left center;
}

.sidebar__brand > a { display: block; min-width: 0; max-width: 100%; }

.sidebar__mark {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: block;
}

.auth__logo { height: 58px; width: auto; max-width: 280px; display: block; }

.sidebar__nav { padding: 14px 10px; flex: 1; }

.sidebar__label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 10px 6px;
}
.sidebar__label:first-child { padding-top: 2px; }

.navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .12s, color .12s;
}
.navlink:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.navlink svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }

.navlink.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}
.navlink.is-active svg { opacity: 1; }

.navlink__count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--neutral-soft);
  color: var(--text-secondary);
  border-radius: var(--r-full);
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.navlink__count--alert { background: var(--danger-soft); color: var(--danger); }
.navlink.is-active .navlink__count { background: rgba(255,255,255,.75); }

.sidebar__foot {
  border-top: 1px solid var(--border);
  padding: 12px;
  flex-shrink: 0;
}

/* Waas achter de uitgeschoven zijbalk. Staat op desktop volledig uit,
   anders zou het als derde rasterkind de inhoudskolom innemen. */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .4);
  z-index: 65;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

/* Marketingportaal */
.portal__name {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -.01em;
  color: var(--brand-strong);
}
.portal__title { display: flex; flex-direction: column; line-height: 1.3; }
.portal__title strong { font-size: 14.5px; }

/* ============================================================
   Topbalk
   ============================================================ */

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar__toggle {
  display: none;
  background: none; border: 0; padding: 6px;
  border-radius: var(--r-sm); cursor: pointer; color: var(--text-secondary);
}
.topbar__toggle:hover { background: var(--surface-hover); }

.search {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
}
.search input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search input::placeholder { color: var(--text-muted); }

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: var(--brand-contrast);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650;
  flex-shrink: 0;
}
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar--lg { width: 52px; height: 52px; font-size: 18px; border-radius: var(--r-md); }
.avatar--neutral { background: var(--neutral-soft); color: var(--text-secondary); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 60;
}
.dropdown__item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 0; background: none;
  border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.dropdown__item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.dropdown__item svg { width: 15px; height: 15px; opacity: .7; }
.dropdown__head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown__head strong { display: block; font-size: 13.5px; }
.dropdown__head span { font-size: 12px; color: var(--text-muted); }
.dropdown__sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   Paginakop
   ============================================================ */

.pagehead {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pagehead__text { flex: 1; min-width: 220px; }
.pagehead__text p { color: var(--text-secondary); font-size: 13.5px; margin: 4px 0 0; }
.pagehead__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { opacity: .5; }

/* ============================================================
   Knoppen
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--brand); color: var(--brand-contrast); }
.btn--primary:hover { background: var(--brand-strong); }

.btn--ghost { border-color: var(--border); background: var(--surface); color: var(--text-secondary); }
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); }

.btn--subtle { background: var(--neutral-soft); color: var(--text-secondary); }
.btn--subtle:hover { background: var(--border); color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.92); }

.btn--danger-ghost { border-color: var(--border); color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--icon { width: 32px; padding: 0; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   Kaarten
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card__head h2, .card__head h3 { flex: 1; min-width: 0; }
.card__head p { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.card__head-actions { display: flex; gap: 6px; flex-shrink: 0; }

.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  display: flex; align-items: center; gap: 10px;
}

/* Raster */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 980px) { .grid--split { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--tight { gap: 6px; }
.spacer { flex: 1; }

/* ============================================================
   Statistiektegels
   ============================================================ */

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: block;
  color: inherit;
}
a.stat:hover { border-color: var(--border-strong); text-decoration: none; box-shadow: var(--shadow-md); }

.stat__label {
  font-size: 12px; font-weight: 550; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
}
.stat__label svg { width: 15px; height: 15px; }
.stat__value {
  font-size: 26px; font-weight: 680; letter-spacing: -.025em;
  margin-top: 6px; line-height: 1.15;
}
.stat__meta { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }
.stat__meta--up { color: var(--success); }
.stat__meta--down { color: var(--danger); }
.stat__meta--alert { color: var(--danger); font-weight: 550; }

/* ============================================================
   Badges en chips
   ============================================================ */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--info); }
.badge--neutral { background: var(--neutral-soft); color: var(--text-secondary); }
.badge--muted   { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 550;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  white-space: nowrap;
  line-height: 1.6;
}
.chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--chip, var(--text-muted)); flex-shrink: 0;
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* ============================================================
   Tabellen
   ============================================================ */

/* Maten en aantallen */
.items-table td { padding: 6px 10px; }
.items-table th { padding: 9px 10px; }
.items-table .input {
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  min-height: 0;
}
.items-table .input.num { text-align: right; font-variant-numeric: tabular-nums; }
.items-table tfoot th {
  background: var(--surface-sunken);
  border-top: 1px solid var(--border);
  border-bottom: 0;
  text-transform: none;
  font-size: 13px;
  color: var(--text);
}
.items-table tbody tr:hover { background: transparent; }

.table-wrap { overflow-x: auto; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-sunken); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.shrink, .table th.shrink { width: 1%; white-space: nowrap; }
.table .muted { color: var(--text-muted); }

.cell-primary { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-primary strong { font-weight: 600; display: block; }
.cell-primary small { color: var(--text-muted); font-size: 12px; display: block; }
.cell-primary a { color: var(--text); }
.cell-primary a:hover { color: var(--brand); }

/* ============================================================
   Formulieren
   ============================================================ */

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field--wide { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.field .hint { font-size: 12px; color: var(--text-muted); }
.field .req { color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 8px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  min-height: 36px;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:disabled, .select:disabled { background: var(--surface-sunken); color: var(--text-muted); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858C96' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px;
  padding-right: 32px;
}

.fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.fieldset:last-of-type { margin-bottom: 0; }
.fieldset > legend {
  font-size: 13px; font-weight: 650; padding: 0 0 2px;
  color: var(--text);
}
.fieldset > .legend-hint { font-size: 12.5px; color: var(--text-muted); margin: 0 0 14px; }

/* Keuzevakjes als tegels */
.checkgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.checktile {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--surface);
  transition: border-color .12s, background .12s;
}
.checktile:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.checktile input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; flex-shrink: 0; }
.checktile:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.checktile .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.form-actions {
  display: flex; gap: 8px; align-items: center;
  padding-top: 18px; margin-top: 4px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Filterbalk */
.filters {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters .input, .filters .select { height: 36px; width: auto; min-width: 150px; }
.filters .search-inline { flex: 1; min-width: 200px; max-width: 320px; }

.tabbar {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabbar a {
  padding: 9px 13px;
  font-size: 13.5px; font-weight: 550;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabbar a:hover { color: var(--text); text-decoration: none; }
.tabbar a.is-active { color: var(--brand-strong); border-bottom-color: var(--brand); }
.tabbar .count { font-size: 11px; color: var(--text-muted); margin-left: 4px; }

/* ============================================================
   Meldingen
   ============================================================ */

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert--success { background: var(--success-soft); color: var(--success); border-color: rgba(31,138,76,.2); }
.alert--error   { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(196,43,50,.2); }
.alert--warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(183,121,31,.2); }
.alert--info    { background: var(--info-soft);    color: var(--info);    border-color: rgba(31,111,178,.2); }
.alert a { color: inherit; text-decoration: underline; }

/* Lege staat */
.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--text-muted);
}
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto 14px; }

/* ============================================================
   Lijsten
   ============================================================ */

.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.list__item:last-child { border-bottom: 0; }
a.list__item:hover { background: var(--surface-sunken); text-decoration: none; }
.list__item-body { flex: 1; min-width: 0; }
.list__item-title { font-weight: 600; font-size: 13.5px; }
.list__item-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.list__item-side { flex-shrink: 0; text-align: right; font-size: 12.5px; color: var(--text-muted); }

/* Definitielijst */
.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 9px 14px; font-size: 13.5px; }
.dl dt { color: var(--text-muted); font-size: 12.5px; }
.dl dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 8px; } }

/* Tijdlijn */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 16px; font-size: 13.5px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -22px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline__time { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   Agenda
   ============================================================ */

.cal { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cal__head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-sunken); border-bottom: 1px solid var(--border); }
.cal__head div { padding: 9px 10px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); text-align: center; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__day {
  min-height: 114px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.cal__day:nth-child(7n) { border-right: 0; }
.cal__grid > .cal__day:nth-last-child(-n+7) { border-bottom: 0; }
.cal__day--out { background: var(--surface-sunken); }
.cal__day--out .cal__daynum { color: var(--text-muted); opacity: .6; }
.cal__daynum { font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 2px 4px; }
.cal__day--today .cal__daynum {
  background: var(--brand); color: var(--brand-contrast);
  border-radius: var(--r-full); width: 21px; height: 21px;
  display: grid; place-items: center; padding: 0;
}
.cal__event {
  font-size: 11.5px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--neutral-soft);
  border-left: 3px solid var(--ev, var(--text-muted));
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.cal__event:hover { background: var(--surface-hover); text-decoration: none; }
.cal__event b { font-weight: 600; }
@media (max-width: 760px) {
  .cal__day { min-height: 74px; }
  .cal__event { font-size: 10.5px; padding: 2px 4px; }
}

/* Logo en kleuren van een portaal */
.logo-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  max-width: 100%;
}
.logo-preview img { max-width: 236px; width: auto; display: block; object-fit: contain; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative;
  width: 76px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}
.swatch:hover { border-color: var(--border-strong); }
.swatch__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, .92);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 0;
  text-align: center;
}

/* ============================================================
   Planbord
   ============================================================ */

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban__col {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.kanban__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.kanban__count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.kanban__list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  flex: 1;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  transition: background .12s;
}
.kanban__list.is-over { background: var(--brand-soft); }

.kanban__empty {
  margin: 0;
  padding: 18px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
}

.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: grab;
}
.kcard:active { cursor: grabbing; }
.kcard.is-dragging { opacity: .45; }
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.kcard__cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--neutral-soft);
}

.kcard__body { padding: 10px 12px 11px; }
.kcard__title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.kcard__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.kcard__sub { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.kcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}

/* Visuals bij een post */
.visuals { display: flex; flex-wrap: wrap; gap: 8px; }
.visual {
  width: 92px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-sunken);
}
.visual img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.visual__icon {
  display: grid; place-items: center; height: 68px; color: var(--text-muted);
}
.visual__icon svg { width: 22px; height: 22px; }
.visual__name {
  display: block; padding: 4px 6px; font-size: 11px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 760px) {
  .kanban { grid-auto-columns: minmax(230px, 85vw); }
}

/* ============================================================
   Grafiek (Instagram)
   ============================================================ */

.chart { width: 100%; height: 200px; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .area { fill: var(--brand); opacity: .09; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--brand); }
.chart text { font-size: 10px; fill: var(--text-muted); font-family: var(--font); }

.sparkbar { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.sparkbar span { flex: 1; background: var(--brand-soft); border-radius: 2px 2px 0 0; min-height: 2px; }

/* ============================================================
   Bestanden
   ============================================================ */

.filerow { display: flex; align-items: center; gap: 12px; }
.fileicon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--neutral-soft); color: var(--text-secondary);
}
.fileicon svg { width: 17px; height: 17px; }
.fileicon--img { background: #EDE7FB; color: #6B4FD8; }
.fileicon--doc { background: var(--info-soft); color: var(--info); }
.fileicon--pdf { background: var(--danger-soft); color: var(--danger); }
.fileicon--sheet { background: var(--success-soft); color: var(--success); }
.fileicon--video { background: var(--warning-soft); color: var(--warning); }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  background: var(--surface-sunken);
  transition: border-color .12s, background .12s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.dropzone svg { width: 24px; height: 24px; opacity: .5; margin-bottom: 6px; }
.dropzone strong { display: block; color: var(--text); font-size: 13.5px; }

/* ============================================================
   Dialoog
   ============================================================ */

dialog.modal {
  border: 0;
  border-radius: var(--r-lg);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
  color: var(--text);
  background: var(--surface);
}
dialog.modal::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal__head h2 { flex: 1; }
.modal__body { padding: 20px; max-height: 68vh; overflow-y: auto; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-sunken); }

/* ============================================================
   Aanmelden / installatie
   ============================================================ */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, var(--brand-soft), transparent 65%),
    var(--bg);
}
.auth__card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
}
.auth__card--wide { width: min(640px, 100%); }
.auth__brand { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.auth__title { font-size: 19px; margin-bottom: 4px; }
.auth__sub { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 22px; }

/* ============================================================
   Hulpklassen
   ============================================================ */

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-right { text-align: right; }
.hr { height: 1px; background: var(--border); border: 0; margin: 18px 0; }

/* ============================================================
   Responsief
   ============================================================ */

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .topbar__toggle { display: inline-flex; }
  .scrim { display: block; }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
}

@media (max-width: 640px) {
  .page { padding: 18px 16px 56px; }
  .topbar { padding: 0 16px; gap: 10px; }
  h1 { font-size: 19px; }
  .stat__value { font-size: 22px; }
  .table th, .table td { padding: 10px 12px; }
}

@media print {
  .sidebar, .topbar, .pagehead__actions, .filters, .btn { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .page { padding: 0; }
  .card { border-color: #ddd; box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
