/* Instellingen-venster in Outlook-stijl (F5.13): grote modal met links de
   categorieen en rechts het gekozen paneel. Vlakke kaartstijl (volledige rand +
   lichte schaduw, huisstijl) - geen accentbalken. De panelen zelf hergebruiken
   de vk-*-opmaak van Voorkeuren (radio's, statusregel, uitlegtekst). */

.instv {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.instv__scrim {
  position: absolute;
  inset: 0;
  background: rgba(28, 42, 57, .45);
}
.instv__venster {
  position: relative;
  width: min(880px, 94vw);
  height: min(640px, 88vh);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg, var(--shadow));
  overflow: hidden;
}

/* Kop: titel, zoekveld en sluitknop. */
.instv__kop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.instv__kop h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--blue-700);
  white-space: nowrap;
}
.instv__zoek {
  position: relative;
  flex: 1 1 auto;
  max-width: 360px;
}
.instv__zoek svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.instv__zoek input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-50);
  font: inherit;
  font-size: .85rem;
  color: var(--ink-900);
}
.instv__zoek input:focus {
  outline: 2px solid var(--blue-100);
  outline-offset: 0;
  border-color: var(--blue-700);
  background: var(--paper);
}
.instv__kop .btn-ico { margin-left: auto; flex: none; }

/* Romp: categorieen links, paneel rechts. */
.instv__romp {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}
.instv__nav {
  flex: 0 0 218px;
  overflow-y: auto;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: var(--bg-50);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.instv__nav-kop {
  padding: 8px 10px 3px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.instv__nav-knop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .88rem;
  color: var(--ink-900);
  text-align: left;
  cursor: pointer;
}
.instv__nav-knop svg { width: 16px; height: 16px; flex: none; color: var(--blue-700); }
.instv__nav-knop:hover { background: var(--blue-100); }
.instv__nav-knop.is-actief { background: var(--blue-100); color: var(--blue-700); font-weight: 600; }
.instv__nav-leeg {
  margin: 8px 10px;
  font-size: .85rem;
  color: var(--muted);
  font-style: italic;
}

.instv__paneel {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
}
.instv__paneel-titel {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--blue-700);
}
.instv__leeg,
.instv__paneel .instv__bezig {
  margin: 10px 0;
  font-size: .9rem;
  color: var(--muted);
}

/* Blokken binnen een paneel: een subkop per instelling, gescheiden door een
   dunne lijn (1px - geen accentbalken). */
.instv__blok { padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.instv__blok:last-child { border-bottom: 0; }
.instv__blok-titel {
  margin: 0 0 6px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-900);
}

/* Keuzes onder elkaar (gelezen-gedrag, leesvensterstand in het paneel): rustiger
   dan de horizontale vk-keuze van Voorkeuren. */
.instv__keuzes { display: flex; flex-direction: column; gap: 6px; }
.instv__keuzes .vk-radio { align-items: flex-start; }
.instv__seconden {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  font-size: .85rem;
  color: var(--ink-900);
}
.instv__seconden input {
  width: 58px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .85rem;
  text-align: center;
}
.instv__seconden input:focus { outline: 2px solid var(--blue-100); outline-offset: 0; border-color: var(--blue-700); }

/* Vinkjeslijsten (hover-snelacties, knoppen per map). */
.instv__vinkjes { display: flex; flex-direction: column; gap: 4px; }
.instv__vinkje {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--ink-900);
  cursor: pointer;
}
.instv__vinkje:hover { background: var(--bg-50); }
.instv__vinkje input { width: 15px; height: 15px; flex: none; cursor: pointer; accent-color: var(--blue-700); }

/* Mapkiezer boven de per-map vinkjeslijst (Acties aanpassen, F5.16). */
.instv__maprij {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
  flex-wrap: wrap;
}
.instv__maprij select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .85rem;
  color: var(--ink-900);
  background: var(--paper);
}
.instv__maprij .btn--licht { padding: 6px 12px; font-size: .82rem; }

/* Categorieen-beheer (F5.18): rijen met kleurstip + naam + knoppen, en het
   toevoeg-blok met naamveld, kleurkeuze (25 Outlook-presets) en knop. */
.instv__catlijst { display: flex; flex-direction: column; gap: 2px; max-width: 460px; }
.instv__catrij {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--ink-900);
}
.instv__catrij:hover { background: var(--bg-50); }
.instv__catnaam { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instv__catrij .btn-ico { flex: none; }
.instv__catnieuw { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.instv__catnieuw input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .88rem;
  color: var(--ink-900);
}
.instv__catnieuw input[type="text"]:focus { outline: 2px solid var(--blue-100); outline-offset: 0; border-color: var(--blue-700); }
.instv__catnieuw .btn { align-self: flex-start; }
.instv__kleuren { display: flex; flex-wrap: wrap; gap: 6px; }
.instv__kleur {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.instv__kleur:hover { border-color: var(--blue-700); }
.instv__kleur:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.instv__kleur.is-actief { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--blue-700); }

/* Nette lege staat (bv. het Meldingen-paneel zolang F5.21 er nog niet is). */
.instv__leegstaat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 38px 16px;
  text-align: center;
  color: var(--muted);
}
.instv__leegstaat svg { width: 30px; height: 30px; color: var(--blue-700); opacity: .55; }
.instv__leegstaat p { margin: 0; font-size: .9rem; max-width: 420px; }

/* Statusregel bij direct opslaan (zelfde rol als vk-status op Voorkeuren). */
.instv__status { font-size: .82rem; color: var(--muted); min-height: 1.1em; display: block; margin-top: 6px; }

/* Paneel "Sneltoetsen" (F7.1): de keymap-groepen in nette kolommen; de rijen
 * hergebruiken de .sneltoets__*-opmaak van de overlay. */
.instv-sneltoetsen { margin-top: 6px; column-width: 240px; column-gap: 28px; }
.instv-sneltoetsen .sneltoets__groep:first-child { margin-top: 4px; }

/* Regels-paneel (OR22-OR25): de regellijst met aan/uit + volgorde + knoppen, en
   de regel-editor (voorwaarden/acties). Vlakke rijen (geen accentbalken). */
.instv-regels { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.instv-regel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.instv-regel.is-uit { opacity: .6; }
.instv-regel__aan { flex: none; display: inline-flex; }
.instv-regel__aan input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--blue-700); }
.instv-regel__tekst { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.instv-regel__naam { font-size: .88rem; font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instv-regel__sam { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instv-regel__knoppen { flex: none; display: flex; gap: 2px; }
.instv-regel__knoppen .btn-ico:disabled { opacity: .35; cursor: default; }
#instv-regel-nieuw { align-self: flex-start; }
#instv-regel-nieuw svg { width: 15px; height: 15px; }

/* Regel-editor en het auto-antwoord-paneel: nette labels + velden. */
.instv-veld { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.instv-veld__label { font-size: .82rem; font-weight: 600; color: var(--ink-900); }
.instv-veld input[type="text"],
.instv-veld input[type="email"],
.instv-veld select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .88rem;
  color: var(--ink-900);
  background: var(--paper);
}
.instv-veld input:focus,
.instv-veld select:focus { outline: 2px solid var(--blue-100); outline-offset: 0; border-color: var(--blue-700); }
.instv-regel-groep {
  margin: 0 0 14px;
  padding: 10px 12px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.instv-regel-groep legend {
  padding: 0 6px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue-700);
}
.instv-regel-editor__acties { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

/* Auto-antwoord-periode: datum/tijd-velden naast elkaar (datumkiezer/tijdkiezer). */
.instv-aa-periode { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 8px 12px; max-width: 460px; }
.instv-aa-periode .instv-veld { margin: 0; }

/* Smal scherm: venster bijna paginavullend, categorieen als smalle kolom. */
@media (max-width: 640px) {
  .instv__venster { width: 96vw; height: 92vh; }
  .instv__nav { flex-basis: 132px; }
  .instv__kop { flex-wrap: wrap; }
  .instv__zoek { order: 3; flex-basis: 100%; max-width: none; }
  .instv-aa-periode { grid-template-columns: 1fr; }
}
