:root {
  --brand: #004682;
  --brand-600: #003d6f; /* hover */
  --brand-100: #e9f1fb;
  --bg: #ffffff;
  --text: #004682;
  --danger-bg: #ffe5e5;
  --danger-text: #7a0000;
  --warn-bg: #fff6e5;
  --warn-text: #8a4b00;
  --info-bg: #e9f1fb;
  --info-text: #0b2a52;
  --border: #cbd5e1;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* altijd minstens viewport-hoogte */
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

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

header {
  background: var(--brand);
  color: #fff;
}
header .container { padding: 16px 24px; }
header h1 { margin: 0; font-size: 20px; color: #fff; }
nav a { color: #fff; margin-right: 16px; }
nav a:hover { text-decoration: underline; }
nav form.logout-form { display: inline; }
nav form.logout-form button.link-button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  margin-right: 16px;
  padding: 0;
  font: inherit;
}
nav form.logout-form button.link-button:hover { text-decoration: underline; }

.container {
  flex: 1;           /* neemt resterende ruimte in */
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
  width: 100%;
}

.container.wide {
  max-width: none;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

h2, h3 { color: var(--text); margin-top: 0; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn.secondary:hover { background: var(--brand-100); }

/* Forms */
.form {
  display: block;
}
.form .form-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.form label {
  font-weight: 600;
}
.input, input[type="text"], input[type="email"], input[type="password"], input[type="file"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 160px; }

.input:focus, input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--brand-100);
  border-color: var(--brand);
}

/* Actions row */
.form .form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Responsive two-column alignment for larger screens */
@media (min-width: 720px) {
  .form .form-group {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
  }
  .form label { text-align: right; padding-right: 12px; }
}

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid #e5e7eb; padding: 8px; text-align: left; color: var(--text); }

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

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.badge.info  { background: var(--info-bg);  color: var(--info-text); }
.badge.warn  { background: var(--warn-bg);  color: var(--warn-text); }
.badge.error { background: var(--danger-bg); color: var(--danger-text); }

/* Footer */
footer { padding: 24px; color: var(--text); }

/* Admin utilities */
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pagination { margin-top: 12px; }
.pagination .badge { margin-right: 4px; }

.muted { color: #555; font-size: 14px; }

/* Preserve line breaks in AI feedback */
.feedback-message { white-space: pre-wrap; }

/* --- PROMPTS (cross-browser consistent) --- */
.prompt { 
  margin-bottom: 0.75rem; 
}

.prompt label {
  display: grid;
  grid-template-columns: 1.25em 1fr; /* vaste kolom voor checkbox, flex voor tekst */
  align-items: start;                /* top-uitlijning in alle browsers */
  column-gap: 0.6rem;
  cursor: pointer;
}

.prompt input[type="checkbox"] {
  /* neutraliseer UA-margins + maak grootte consistent */
  margin: 0;
  inline-size: 1.1em;
  block-size: 1.1em;
  /* klein optisch duwtje voor cap-height */
  translate: 0 .12em;
  /* optioneel: iets groter laten ogen
     scale: 1.05; */
}

.prompt-text { display: block; }

.prompt-text .title {
  display: block;
  font-weight: 600;
  line-height: 1.2;
}

.prompt-text .muted {
  display: block;
  margin-top: 0.15rem;
  line-height: 1.25;
  /* je had al .muted globaal (14px & #555); dat blijft gelden.
     Wil je lokaal net iets kleiner/lichter, zet dan bijv.:
     font-size: 0.92em; color: #666; */
}

/* --- PROMPTS: altijd stacked, ongeacht schermbreedte --- */
.form .prompt {
  margin-bottom: 0.75rem;
}

/* Zorgt voor checkbox links + tekstblok rechts (titel boven beschrijving) */
.form .prompt label {
  display: grid;
  grid-template-columns: 1.25em 1fr; /* vaste kolom voor checkbox, flex voor tekst */
  align-items: start;
  column-gap: 0.6rem;

  /* Override globale breed-scherm labelregels */
  text-align: left;
  padding-right: 0;
}

.form .prompt input[type="checkbox"] {
  /* neutraliseer UA-margins + consistente grootte in alle browsers */
  margin: 0;
  inline-size: 1.1em;  /* logische eigenschappen */
  block-size: 1.1em;
  width: 1.1em;        /* fallback */
  height: 1.1em;
  translate: 0 .12em;  /* mini optische uitlijning */
}

.form .prompt .prompt-text { display: block; }

.form .prompt .prompt-text .title {
  display: block;
  font-weight: 600;
  line-height: 1.2;
}

.form .prompt .prompt-text .muted {
  display: block;
  margin-top: 0.15rem;
  line-height: 1.25;
  /* je globale .muted (14px, #555) blijft gelden */
}

/* (optioneel) als er toch iets anders wint qua specificiteit, zet dan: */
/* .form .prompt label { text-align: left !important; padding-right: 0 !important; } */

.error {
  color: red;
  font-weight: bold;
  margin: 4px 0 0 0;
}