/* ── BEHEERPORTAAL ──────────────────────────────────── */

.admin-body { overflow: auto; background: var(--bg); }

.admin-layout {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: 100vh; padding-top: var(--bar-h);
}

.dataset-status { font-size: 0.68rem; color: var(--muted); }
.dataset-status.custom { color: var(--sage-dark); font-weight: 600; }

/* nav */
.admin-nav {
  border-right: 1px solid var(--border); background: var(--white);
  padding: 1.2rem 0.8rem; display: flex; flex-direction: column; gap: 0.25rem;
  position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h));
}
.nav-item {
  text-align: left; padding: 0.55rem 0.75rem;
  border: none; border-radius: var(--radius-sm); background: none;
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--blue-light); color: var(--blue-dark); font-weight: 600; }
.nav-count {
  display: inline-block; min-width: 18px; text-align: center;
  background: var(--blue); color: var(--white);
  font-size: 0.62rem; font-weight: 700; border-radius: 9px; padding: 1px 5px;
  margin-left: 0.3rem;
}
.nav-count:empty { display: none; }
.nav-note {
  margin-top: auto; font-size: 0.65rem; color: var(--light);
  line-height: 1.5; padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm);
}

/* main */
.admin-main { padding: 1.6rem 2rem 4rem; max-width: 1100px; }
.admin-view { display: none; }
.admin-view.open { display: block; }
.view-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem;
}
.view-head h1 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--dark); margin-bottom: 0.25rem; }
.view-head p { font-size: 0.78rem; color: var(--muted); line-height: 1.5; max-width: 560px; }
.view-head .btn-primary { flex-shrink: 0; }

/* buttons */
.admin-body .btn-primary { flex: 0 0 auto; padding: 0.6rem 1.2rem; font-size: 0.78rem; }
.admin-body .btn-ghost { flex: 0 0 auto; font-size: 0.75rem; }
.btn-danger-ghost {
  padding: 0.55rem 1rem; border: 1px solid #E3B9B9; border-radius: var(--radius-sm);
  background: none; color: #B54A4A; font-family: var(--font-sans);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.btn-danger-ghost:hover { background: #FBEFEF; }
.file-btn { display: inline-block; cursor: pointer; }
.btn-mini {
  padding: 0.25rem 0.6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--white); color: var(--text); font-family: var(--font-sans);
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
}
.btn-mini:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-mini.danger { color: #B54A4A; }
.btn-mini.danger:hover { border-color: #E3B9B9; background: #FBEFEF; }

/* themes */
.themes-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; }
.theme-list { display: flex; flex-direction: column; gap: 0.4rem; }
.theme-list-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--white);
  cursor: pointer; font-size: 0.78rem; transition: all 0.15s;
}
.theme-list-item:hover { border-color: var(--blue); }
.theme-list-item.active { border-color: var(--blue); background: var(--blue-light); }
.tli-name { font-weight: 600; color: var(--dark); }
.tli-count { margin-left: auto; font-size: 0.62rem; color: var(--light); }

.theme-editor {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem;
}
.editor-empty { font-size: 0.8rem; color: var(--light); font-style: italic; padding: 1rem 0; }
.editor-section {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--light);
  margin: 1.4rem 0 0.6rem; padding-top: 1.2rem; border-top: 1px solid var(--bg);
}
.editor-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.form-row input[type="number"] {
  width: 100%; padding: 0.5rem 0.65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.8rem; color: var(--text);
}
.form-row input[type="number"]:focus { outline: none; border-color: var(--blue); }
.editor-actions { display: flex; gap: 0.6rem; margin-top: 1.3rem; flex-wrap: wrap; }

/* outcomes & questions inside editor */
.outcome-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.85rem 1rem; margin-bottom: 0.7rem; background: var(--bg);
}
.outcome-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.outcome-title { font-size: 0.82rem; font-weight: 600; color: var(--dark); flex: 1; }
.question-row {
  display: flex; align-items: baseline; gap: 0.5rem;
  font-size: 0.75rem; color: var(--text); padding: 0.3rem 0 0.3rem 0.8rem;
  border-left: 2px solid var(--border); margin-bottom: 0.25rem;
}
.question-row .q-meta-mini { font-size: 0.62rem; color: var(--light); }
.question-row .row-actions { margin-left: auto; display: flex; gap: 0.3rem; flex-shrink: 0; }

/* inline edit forms */
.inline-form {
  background: var(--white); border: 1px dashed var(--blue);
  border-radius: var(--radius-sm); padding: 0.9rem; margin: 0.5rem 0;
}
.inline-form .form-row { margin-bottom: 0.6rem; }
.inline-form label { font-size: 0.68rem; }

/* coherence */
.coherence-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.coh-domain {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.9rem 1rem; margin-bottom: 0.7rem;
}
.coh-name { font-size: 0.85rem; font-weight: 600; color: var(--dark); margin-bottom: 0.5rem; }
.coh-checks { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.coh-check {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.22rem 0.65rem; cursor: pointer; user-select: none; transition: all 0.15s;
}
.coh-check.on { background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); font-weight: 600; }
.map-preview-wrap {
  position: sticky; top: calc(var(--bar-h) + 1rem);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.mp-title { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--light); margin-bottom: 0.6rem; }
#map-preview { width: 100%; height: auto; background: var(--bg); border-radius: var(--radius-sm); }
.mp-hint { font-size: 0.65rem; color: var(--light); margin-top: 0.6rem; line-height: 1.45; }

/* route B */
.rb-group {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.rb-group h3 { font-family: var(--font-serif); font-size: 1.05rem; color: var(--dark); margin-bottom: 0.7rem; }
.rb-row { display: grid; grid-template-columns: 180px 1fr 1fr 1fr; gap: 0.6rem; align-items: center; margin-bottom: 0.45rem; }
.rb-key { font-size: 0.75rem; font-weight: 600; color: var(--text); }
.rb-row select {
  width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--font-sans); font-size: 0.72rem; color: var(--text);
  background: var(--white);
}

/* proposals */
.prop-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 0.8rem;
}
.prop-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.prop-type {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 2px 8px; border-radius: 4px;
  background: var(--blue-light); color: var(--blue-dark);
}
.prop-status { font-size: 0.62rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.prop-status.nieuw { background: #FDF3E7; color: #B8762A; }
.prop-status.goedgekeurd { background: var(--sage-light); color: var(--sage-dark); }
.prop-status.afgewezen { background: #FBEFEF; color: #B54A4A; }
.prop-date { margin-left: auto; font-size: 0.65rem; color: var(--light); }
.prop-text { font-size: 0.85rem; color: var(--dark); line-height: 1.5; margin-bottom: 0.5rem; }
.prop-meta { font-size: 0.7rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.7rem; }
.prop-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.props-empty {
  padding: 2.5rem 1rem; text-align: center; font-size: 0.8rem;
  color: var(--light); background: var(--white); border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* publish */
.publish-info {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1.2rem;
  font-size: 0.8rem; color: var(--text); line-height: 1.7;
}
.publish-info .pi-badge {
  display: inline-block; font-size: 0.62rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; vertical-align: middle;
}
.pi-badge.standard { background: var(--bg); color: var(--muted); }
.pi-badge.custom { background: var(--sage-light); color: var(--sage-dark); }
.publish-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav-note { display: none; }
  .themes-layout, .coherence-layout { grid-template-columns: 1fr; }
  .rb-row { grid-template-columns: 1fr; }
}

/* ── ICON PICKER ────────────────────────────────────── */
.icon-picker { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.icon-opt {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); font-size: 1rem; color: var(--dark); cursor: pointer;
  transition: all 0.12s;
}
.icon-opt:hover { border-color: var(--blue); }
.icon-opt.on { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 2px rgba(55,122,255,0.15); }

/* ── RELATIETYPEN ───────────────────────────────────── */
.rel-list { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); }
.rel-list-label {
  font-size: 0.58rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--light); margin-bottom: 0.4rem;
}
.rel-row {
  font-size: 0.72rem; color: var(--text);
  padding: 0.5rem 0; border-bottom: 1px dashed var(--border);
}
.rel-row:last-child { border-bottom: none; }
.rel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.rel-name { font-weight: 600; }
.rel-fields {
  display: grid; grid-template-columns: 150px 1fr; gap: 0.4rem 0.6rem;
  align-items: center; margin-top: 0.45rem;
}
.rel-strength { display: flex; align-items: center; gap: 0.5rem; grid-column: 1 / -1; }
.rel-strength > span {
  font-size: 0.6rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--light); flex-shrink: 0;
}
.rel-strength input[type="range"] { flex: 1 1 auto; accent-color: var(--blue); }
.rel-strength output {
  font-size: 0.7rem; font-weight: 700; color: var(--blue-dark);
  min-width: 2.6rem; text-align: right;
}
.rel-fields > select, .rel-bron {
  padding: 0.28rem 0.45rem; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.68rem; color: var(--text); background: var(--white);
  width: 100%;
}
.rel-row select {
  padding: 0.25rem 0.45rem; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.68rem; color: var(--text); background: var(--white);
}

/* ── STATISTIEKEN ───────────────────────────────────── */
.stats-scope { font-size: 0.72rem; color: var(--muted); margin-bottom: 1rem; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stats-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.stats-card h3 { font-family: var(--font-serif); font-size: 1.05rem; color: var(--dark); margin-bottom: 0.8rem; }
.stat-row {
  display: grid; grid-template-columns: minmax(120px, 45%) 1fr 34px;
  align-items: center; gap: 0.6rem; margin-bottom: 0.45rem;
}
.stat-label { font-size: 0.72rem; color: var(--text); line-height: 1.3; }
.stat-bar {
  display: block; height: 8px; min-width: 3px;
  background: var(--blue); border-radius: 4px; opacity: 0.75;
}
.stat-n { font-size: 0.7rem; font-weight: 600; color: var(--muted); text-align: right; }
.stats-note { font-size: 0.7rem; color: var(--light); margin-top: 0.9rem; line-height: 1.5; }
.dataset-status.error { color: #B54A4A; font-weight: 600; }

@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } }
