/* ======= FORMULIER EDITOR ======= */
#screen-editor { padding: 16px; }

.editor-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.editor-card.sectie-verborgen { opacity: 0.55; }
.editor-card-header {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  user-select: none; background: #f4f7fb; border-bottom: 1px solid transparent;
}
.editor-card.open .editor-card-header { border-bottom-color: var(--border); }
.editor-card-header:hover { background: #eaf0f8; }

.editor-titel-input {
  flex: 1; border: 1px solid transparent; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--text);
  padding: 3px 6px; border-radius: 4px; outline: none;
}
.editor-titel-input:focus { background: #fff; border-color: var(--blue-mid); }

.editor-type-badge {
  font-size: 11px; background: var(--blue-light); color: var(--blue);
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.editor-arrow { font-size: 11px; width: 14px; flex-shrink: 0; cursor: pointer; padding: 4px 6px; }
.editor-eye-btn {
  border: none; background: none; cursor: pointer;
  font-size: 17px; padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.editor-eye-btn:hover { background: rgba(0,0,0,0.07); }
.editor-move-btns { display: flex; gap: 3px; }
.editor-move-btns button {
  border: 1px solid var(--border); background: #fff;
  padding: 3px 7px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.editor-move-btns button:disabled { opacity: 0.3; cursor: default; }
.editor-move-btns button:not(:disabled):hover { background: var(--blue-light); }

.editor-card-body { padding: 12px 14px; }
.editor-veld-list { display: flex; flex-direction: column; gap: 6px; }
.editor-veld-row {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px;
  background: #f8f9fa; border: 1px solid var(--border); border-radius: 6px;
}
.editor-veld-row.veld-verborgen { opacity: 0.45; }
.editor-veld-label {
  flex: 1; border: 1px solid transparent; background: transparent;
  font-size: 13px; padding: 3px 6px; border-radius: 4px; outline: none;
}
.editor-veld-label:focus { background: #fff; border-color: var(--blue-mid); }
.editor-veld-type {
  font-size: 11px; color: var(--muted); background: #e9ecef;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.editor-instelling { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.editor-instelling label { font-size: 13px; font-weight: 600; color: var(--muted); }
.editor-instelling input[type=number] {
  width: 75px; padding: 7px 10px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none;
}
.editor-instelling input[type=number]:focus { border-color: var(--blue-mid); }
.editor-geen-inst { font-size: 13px; color: var(--muted); padding: 4px 0; font-style: italic; }

/* ======= STATISTIEKEN ======= */
#screen-stats { padding: 20px; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@media (max-width: 768px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .stat-cards { grid-template-columns: 1fr 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.stat-card .stat-getal {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.stat-card.totaal .stat-getal  { color: var(--blue); }
.stat-card.goed   .stat-getal  { color: var(--green); }
.stat-card.fout   .stat-getal  { color: var(--red); }
.stat-card.open   .stat-getal  { color: var(--accent); }

/* Secties */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .stats-grid { grid-template-columns: 1fr; } }

.stats-sectie {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.stats-sectie-header {
  background: var(--blue);
  color: #fff;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.stats-sectie-body { padding: 14px 18px; }

/* Horizontale bar */
.stat-rij {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-rij:last-child { margin-bottom: 0; }
.stat-rij-naam {
  width: 130px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-rij-bar-wrap {
  flex: 1;
  background: #eef2f6;
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}
.stat-rij-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 3px;
}
.stat-rij-getal {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Maand grafiek (verticaal) */
.maand-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-bottom: 24px;
  position: relative;
}
.maand-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}
.maand-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.maand-bar {
  border-radius: 3px 3px 0 0;
  transition: height 0.5s ease;
  min-height: 2px;
}
.maand-bar.goed { background: var(--green); }
.maand-bar.fout { background: var(--red); }
.maand-bar.rest { background: var(--blue-light); }
.maand-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.maand-total {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
}

/* Keurder tabel */
.keurder-row {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f6;
  gap: 10px;
}
.keurder-row:last-child { border-bottom: none; }
.keurder-naam { flex: 1; font-size: 14px; font-weight: 600; }
.keurder-badge {
  font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 12px; white-space: nowrap;
}
.keurder-badge.goed { background: #d4edda; color: #155724; }
.keurder-badge.fout { background: #f8d7da; color: #721c24; }
.keurder-badge.totaal { background: var(--blue-light); color: var(--blue); }

/* ======= BEHEERDERSPANEEL ======= */
#screen-admin { padding: 20px; }

.admin-tabs {
  display: flex; border: 1.5px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.admin-tab {
  flex: 1; padding: 12px; text-align: center; font-size: 14px; font-weight: 700;
  cursor: pointer; background: #f8f9fa; color: var(--muted); border: none; transition: all 0.15s;
}
.admin-tab.actief { background: var(--blue); color: #fff; }

.admin-user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); gap: 12px; flex-wrap: wrap;
}
.admin-user-row.inactief { opacity: 0.55; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-naam { font-size: 15px; font-weight: 700; color: var(--blue); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.admin-user-acties { display: flex; gap: 4px; flex-shrink: 0; }

.admin-rol-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.admin-rol-badge.beheerder { background: #e8d5f5; color: #5b2d8e; }
.admin-rol-badge.keurder   { background: var(--blue-light); color: var(--blue); }
.admin-rol-badge.inactief  { background: #f8d7da; color: var(--red); }

/* Gebruiker modal */
.admin-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center;
}
.admin-modal {
  background: #fff; border-radius: 14px; padding: 28px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); margin: 16px;
}
.admin-modal h3 { font-size: 18px; color: var(--blue); margin-bottom: 20px; }
.admin-modal .field { margin-bottom: 14px; }

/* ======= PROFIEL MODAL ======= */
#profiel-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center;
}
#profiel-overlay.open { display: flex; }
#profiel-modal {
  background: #fff; border-radius: 14px; padding: 28px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  max-height: 90vh; overflow-y: auto; margin: 16px;
}
#profiel-modal h3 { font-size: 18px; color: var(--blue); margin-bottom: 4px; }
#profiel-modal p { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
#sig-canvas {
  border: 2px dashed var(--border); border-radius: 8px;
  background: #fafafa; cursor: crosshair;
  touch-action: none; display: block; width: 100%;
}
#sig-canvas.heeft-tekening { border-color: var(--blue-mid); background: #fff; }
.sig-huidig {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; text-align: center; margin-bottom: 16px; background: #f8f9fa;
}
.sig-huidig img { max-height: 60px; max-width: 100%; }
.sig-huidig p { margin: 0; font-size: 12px; color: var(--muted); }
.sig-tabs {
  display: flex; gap: 0; margin-bottom: 14px;
  border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden;
}
.sig-tab {
  flex: 1; padding: 9px; text-align: center; font-size: 13px; font-weight: 600;
  cursor: pointer; background: #f8f9fa; color: var(--muted); border: none; transition: all 0.15s;
}
.sig-tab.actief { background: var(--blue); color: #fff; }
