/* Beheer — Christelijke Gemeente Immanuel.
   Zelfde huisstijl als de voorkant (public/css/site.css): zand, één zeeblauw,
   Source Serif voor koppen, Hanken Grotesk voor de rest. Altijd licht. */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --zand: #F3EEE4;
  --zand-2: #E8E0D1;
  --schuim: #FBF9F4;
  --zee: #1D4A63;
  --zee-diep: #0F2D3E;
  --zee-licht: #7FA7B6;
  --inkt: #17222B;
  --grijs: #5B6A72;
  --lijn: #D6CCBA;
  --op-zee: #F3EEE4;
  --op-zee-zacht: #A9C1CB;
  --goed: #2F7A55;
  --let-op: #A8641C;
  --fout: #B3261E;

  --f-display: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --f-tekst: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --r: 6px;
  --zijbalk: 256px;
  color-scheme: light;
}

body {
  font-family: var(--f-tekst);
  background: var(--zand);
  color: var(--inkt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; }
a { color: var(--zee); }
svg.i { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--zee); outline-offset: 2px; }

.label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grijs);
}
.zacht { color: var(--grijs); }

/* ---------- inloggen ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--zee-diep) url("/images/zee-breed.webp") 60% center / cover no-repeat;
  position: relative;
}
.login-screen::before { content: ""; position: absolute; inset: 0; background: rgba(8, 26, 38, .55); }

.login-card {
  position: relative;
  background: var(--schuim);
  padding: 2.5rem;
  border-radius: var(--r);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 70px rgba(8, 26, 38, .35);
}
.login-card__logo { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto 1.75rem; }
.login-card h1 { font-size: 1.9rem; color: var(--zee); margin-bottom: 0.15rem; }
.login-card > p { color: var(--grijs); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* ---------- formulieren ---------- */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--inkt);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--lijn);
  border-radius: var(--r);
  background: #fff;
  color: var(--inkt);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--zee);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--zee) 15%, transparent);
}
.form-group textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.error-msg {
  color: var(--fout);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: color-mix(in srgb, var(--fout) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--fout) 25%, transparent);
  border-radius: var(--r);
}
.success-msg {
  color: var(--goed);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- knoppen ---------- */
.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-admin:disabled { opacity: .6; cursor: progress; }
.btn-admin--primary { background: var(--zee); color: var(--zand); width: 100%; padding: 0.8rem; }
.btn-admin--primary:hover { background: var(--zee-diep); }
.btn-admin--accent { background: var(--zee); color: var(--zand); }
.btn-admin--accent:hover { background: var(--zee-diep); }
.btn-admin--danger { background: var(--fout); color: #fff; }
.btn-admin--ghost { background: transparent; color: var(--grijs); padding: 0.4rem 0.75rem; }
.btn-admin--ghost:hover { color: var(--zee); background: var(--zand-2); }
.btn-admin--gevaar { color: var(--fout); }
.btn-admin--gevaar:hover { color: var(--fout); background: color-mix(in srgb, var(--fout) 10%, transparent); }
.btn-admin--small { padding: 0.35rem 0.8rem; font-size: 0.84rem; }
.btn-admin--groot { padding: 0.85rem 1.4rem; font-size: 0.98rem; }

/* ---------- opbouw ---------- */
#adminApp { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--zijbalk);
  background: var(--zee-diep);
  color: var(--op-zee);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar__header { padding: 1.5rem 1.4rem 1.25rem; position: relative; }
.sidebar__logo { display: block; color: var(--op-zee); line-height: 0; }
.sidebar__logo svg { width: 100%; max-width: 190px; height: auto; aspect-ratio: 878.35 / 206.35; }
.sidebar__sub { margin-top: 0.6rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--op-zee-zacht); }
.sidebar__upload {
  margin: 0 1.1rem 0.75rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--op-zee); color: var(--zee-diep); font: 600 0.92rem var(--f-tekst);
  transition: background-color .2s;
}
.sidebar__upload:hover { background: #fff; }
.sidebar__close {
  display: none;
  position: absolute;
  top: 1.1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--op-zee);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 0;
}
.sidebar__nav { flex: 1; padding: 0.5rem 0.75rem; overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--r);
  color: var(--op-zee-zacht);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}
.sidebar__link svg.i { width: 20px; height: 20px; }
.sidebar__link:hover { background: rgba(243, 238, 228, .07); color: var(--op-zee); }
.sidebar__link.active { background: rgba(243, 238, 228, .12); color: var(--op-zee); }
.sidebar__footer { border-top: 1px solid rgba(243, 238, 228, .12); padding: 0.6rem 0.75rem; display: grid; gap: 2px; }

.admin-main { flex: 1; margin-left: var(--zijbalk); min-width: 0; }
.admin-header {
  background: color-mix(in srgb, var(--zand) 92%, transparent);
  backdrop-filter: blur(8px);
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--lijn);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-header h1 { font-size: 1.6rem; flex: 1; color: var(--zee); }
.admin-user { color: var(--grijs); font-size: 0.9rem; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--inkt); font-size: 1.5rem; line-height: 0; }
.admin-content { padding: 2rem; max-width: 1200px; }

/* ---------- dashboard ---------- */
.upload-kaart {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
  background: var(--zee-diep); color: var(--op-zee); border-radius: var(--r);
  padding: 1.75rem 2rem; margin-bottom: 1.5rem; position: relative; overflow: hidden;
}
.upload-kaart h2 { font-size: 1.6rem; color: var(--op-zee); }
.upload-kaart p { color: var(--op-zee-zacht); margin-top: 0.25rem; }
.upload-kaart .btn-admin { background: var(--op-zee); color: var(--zee-diep); }
.upload-kaart .btn-admin:hover { background: #fff; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--schuim); padding: 1.25rem 1.4rem; border-radius: var(--r); border: 1px solid var(--lijn); }
.stat-card__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grijs); margin-bottom: 0.35rem; }
.stat-card__value { font-family: var(--f-display); font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--zee); font-variant-numeric: lining-nums tabular-nums; }

.snelle-acties { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.snelle-acties .btn-admin { background: var(--schuim); color: var(--zee); border-color: var(--lijn); }
.snelle-acties .btn-admin:hover { border-color: var(--zee); }

/* ---------- tabellen ---------- */
.tabel-wrap { overflow-x: auto; background: var(--schuim); border: 1px solid var(--lijn); border-radius: var(--r); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-weight: 600;
  color: var(--grijs);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-bottom: 1px solid var(--lijn);
  white-space: nowrap;
}
.admin-table td { padding: 0.8rem 1rem; border-bottom: 1px solid color-mix(in srgb, var(--lijn) 60%, transparent); vertical-align: middle; }
.admin-table td strong { font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: color-mix(in srgb, var(--zand) 60%, transparent); }
.admin-table td { white-space: nowrap; }
.admin-table td:first-child { white-space: normal; min-width: 14rem; }
.admin-table td:last-child { text-align: right; }

.status { display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.status--ok { color: var(--goed); background: color-mix(in srgb, var(--goed) 12%, transparent); }
.status--concept { color: var(--let-op); background: color-mix(in srgb, var(--let-op) 12%, transparent); }
.status--uit { color: var(--grijs); background: var(--zand-2); }
.status--fout { color: var(--fout); background: color-mix(in srgb, var(--fout) 10%, transparent); }
.status--admin { color: var(--zee); background: color-mix(in srgb, var(--zee) 12%, transparent); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: var(--zee); background: color-mix(in srgb, var(--zee) 10%, transparent); text-transform: capitalize; }

/* ---------- werkbalk en panelen ---------- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.toolbar > span { color: var(--grijs); font-size: 0.92rem; }
.toolbar h3 { font-size: 1.25rem; }
.intro { color: var(--grijs); margin-bottom: 1.25rem; max-width: 40rem; }

.panel {
  background: var(--schuim);
  border-radius: var(--r);
  border: 1px solid var(--lijn);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
}
.panel__title { font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 0.9rem; color: var(--zee); }
.panel .admin-table { background: transparent; }
.panel .admin-table th { padding-left: 0; }
.panel .admin-table td { padding-left: 0; }

/* ---------- uploadvak ---------- */
.file-upload {
  border: 1.5px dashed var(--zee-licht);
  border-radius: var(--r);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  background: color-mix(in srgb, var(--zand) 55%, #fff);
}
.file-upload:hover,
.file-upload.dragover { border-color: var(--zee); background: color-mix(in srgb, var(--zee) 6%, #fff); }
.file-upload input[type="file"] { display: none; }
.file-upload__icon { color: var(--zee); margin-bottom: 0.4rem; display: grid; place-items: center; }
.file-upload__text { color: var(--grijs); font-size: 0.92rem; }
.file-upload__name { color: var(--zee); font-weight: 600; margin-top: 0.5rem; word-break: break-all; }

/* ---------- schakelaar ---------- */
.toggle { display: flex !important; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 500 !important; }
.toggle input {
  appearance: none;
  width: 40px !important;
  height: 22px;
  padding: 0 !important;
  border: 0 !important;
  background: var(--lijn) !important;
  border-radius: 11px !important;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex: none;
}
.toggle input:checked { background: var(--goed) !important; }
.toggle input::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle input:checked::after { transform: translateX(18px); }

/* ---------- venster ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 26, 38, .5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--schuim);
  border-radius: var(--r);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(8, 26, 38, .3);
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--lijn);
}
.modal__header h2 { font-size: 1.35rem; color: var(--zee); }
.modal__close { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--grijs); line-height: 1; }
.modal__close:hover { color: var(--inkt); }
.modal__body { padding: 1.5rem; }

.laden { text-align: center; padding: 3rem 1rem; color: var(--grijs); }
.laden::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 0.75rem;
  border: 3px solid var(--lijn); border-top-color: var(--zee); border-radius: 50%;
  animation: draai 0.8s linear infinite;
}
@keyframes draai { to { transform: rotate(360deg); } }

/* ---------- smal ---------- */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(8, 26, 38, .4); }
  .sidebar__close { display: block; }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .admin-header { padding: 0.9rem 1rem; }
  .admin-header h1 { font-size: 1.35rem; }
  .admin-user { display: none; }
  .admin-content { padding: 1.25rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .upload-kaart { grid-template-columns: 1fr; padding: 1.4rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat-card { padding: 1rem; }
  .admin-table { font-size: 0.86rem; }
  .admin-table th, .admin-table td { padding: 0.6rem 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
