/* ==========================================================================
   Villa Admin: der Reiter Urlaubsmeldung
   --------------------------------------------------------------------------
   Angelegt 10.09.2026, am 11.09.2026 auf Dirks Ansage umgebaut.

   Vorbild ist das Meldungsformular der Praxis Ragnitz: links die Eingabe
   in nummerierten Bloecken, rechts die Vorschau, die beim Scrollen stehen
   bleibt, unten der Verlauf. Dirks Begruendung: uebersichtlicher.

   Uebernommen ist der AUFBAU, nicht die Farbe. Ragnitz ist gruen und
   creme, die Villa ist burgund und gold.

   Dunkelmodus ist mitgebaut, das Panel schaltet ueber
   html[data-theme="dark"], siehe assets/js/dark-mode.js.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Zwei Spalten. Unter 880 Pixeln untereinander, sonst nebeneinander mit
   der Vorschau rechts. Genau wie beim Doktor.
   -------------------------------------------------------------------------- */
.um-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.5vw, 28px);
  align-items: start;
}

@media (min-width: 880px) {
  .um-layout {
    /* minmax(0, ...) statt 1fr: sonst sprengt ein breites Bild die Spalte. */
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
  .um-vorschau-spalte {
    position: sticky;
    top: clamp(18px, 3.5vw, 44px);
  }
}

.um-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Ein nummerierter Block
   -------------------------------------------------------------------------- */
.um-field {
  margin: 0;
  padding: 18px 18px 20px;
  border: 1px solid var(--vr-linie-soft, #D3DCE4);
  border-radius: var(--vr-radius-md, 8px);
  background: var(--vr-papier, #F7FAFC);
}

.um-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 0 12px;
  font-family: var(--vr-font-display, Georgia, serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vr-burgund, #1F354C);
}

.um-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--vr-burgund, #1F354C);
  color: var(--vr-creme, #EAEEF3);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}

.um-note {
  margin: 8px 0 0;
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-muted, #515E6A);
  line-height: 1.45;
}

.um-heute {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: var(--vr-radius-full, 9999px);
  background: var(--vr-creme-tief, #D9E0E8);
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-muted, #515E6A);
}

/* --------------------------------------------------------------------------
   Felder
   -------------------------------------------------------------------------- */
.um-zwei {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 12px;
}

.um-feld { margin-top: 12px; }
.um-feld:first-child { margin-top: 0; }

.um-feld label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--vr-text-xs, 0.75rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vr-text-muted, #515E6A);
}

.um-feld input[type="text"],
.um-feld input[type="date"],
.um-feld textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--vr-linie, #A3B2C2);
  border-radius: var(--vr-radius-sm, 4px);
  background: var(--vr-papier, #F7FAFC);
  color: var(--vr-text-dunkel, #191E23);
  /* 16px, sonst zoomt iOS beim Antippen in das Feld hinein. */
  font-size: 16px;
  font-family: var(--vr-font-body, Georgia, serif);
  line-height: 1.45;
}

.um-feld textarea { resize: vertical; }

.um-feld input:focus-visible,
.um-feld textarea:focus-visible {
  outline: 2px solid var(--vr-gold, #5B83AC);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Anlass-Kacheln
   -------------------------------------------------------------------------- */
.um-anlass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}

.um-anlass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px;
  border: 1.5px solid var(--vr-linie, #A3B2C2);
  border-radius: var(--vr-radius-md, 8px);
  background: var(--vr-papier, #F7FAFC);
  color: var(--vr-text-dunkel, #191E23);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.um-anlass:hover:not(:disabled) {
  border-color: var(--vr-burgund, #1F354C);
  transform: translateY(-2px);
}

.um-anlass.is-selected {
  background: var(--vr-burgund, #1F354C);
  border-color: var(--vr-burgund, #1F354C);
  color: var(--vr-creme, #EAEEF3);
}

.um-anlass:focus-visible {
  outline: 3px solid var(--vr-gold, #5B83AC);
  outline-offset: 2px;
}

.um-anlass:disabled { cursor: default; opacity: 0.65; }
.um-anlass-ico svg { width: 30px; height: 30px; display: block; }
.um-anlass-label { font-size: 14px; font-weight: 600; }

/* --------------------------------------------------------------------------
   Fotokacheln
   -------------------------------------------------------------------------- */
.um-motive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px;
}

.um-motiv {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid var(--vr-linie-soft, #D3DCE4);
  border-radius: var(--vr-radius-md, 8px);
  background: var(--vr-papier, #F7FAFC);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.um-motiv:hover:not(:disabled) { border-color: var(--vr-gold, #5B83AC); }
.um-motiv:focus-visible {
  outline: 3px solid var(--vr-gold, #5B83AC);
  outline-offset: 2px;
}
.um-motiv.is-selected {
  border-color: var(--vr-burgund, #1F354C);
  box-shadow: 0 0 0 1px var(--vr-burgund, #1F354C);
}
.um-motiv:disabled { cursor: default; opacity: 0.65; }

.um-motiv img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.um-motiv-name {
  display: block;
  padding: 8px 10px;
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-muted, #515E6A);
}

.um-motiv.is-selected .um-motiv-name {
  color: var(--vr-burgund, #1F354C);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Rechte Spalte: die Vorschau
   -------------------------------------------------------------------------- */
.um-vorschau-rahmen {
  border: 1px solid var(--vr-linie-soft, #D3DCE4);
  border-radius: var(--vr-radius-lg, 16px);
  background: var(--vr-papier, #F7FAFC);
  box-shadow: var(--vr-shadow-md, 0 4px 12px rgba(16,21,25, 0.10));
  overflow: hidden;
}

.um-vorschau-eyebrow {
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--vr-linie-soft, #D3DCE4);
  background: var(--vr-creme-tief, #D9E0E8);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vr-text-muted, #515E6A);
}

.um-vorschau {
  padding: clamp(18px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.um-pv-figure { margin: 0; border-radius: var(--vr-radius-md, 8px); overflow: hidden; }

.um-pv-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.um-pv-titel {
  margin: 0;
  font-family: var(--vr-font-display, Georgia, serif);
  font-size: var(--vr-text-xl, 1.5rem);
  color: var(--vr-burgund, #1F354C);
}

.um-pv-text,
.um-pv-nachsatz {
  margin: 0;
  font-size: var(--vr-text-base, 1rem);
  line-height: 1.55;
  color: var(--vr-text-dunkel, #191E23);
}

.um-pv-nachsatz {
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-muted, #515E6A);
}

.um-pv-phase {
  border-left: 3px solid var(--vr-gold, #5B83AC);
  padding-left: 14px;
}

.um-pv-phase-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vr-text-muted, #515E6A);
  font-weight: 600;
}

.um-pv-reopen {
  display: block;
  margin-top: 2px;
  font-size: var(--vr-text-md, 1.125rem);
  font-weight: 600;
  color: var(--vr-burgund, #1F354C);
}

/* --------------------------------------------------------------------------
   Speichern und Meldungen
   -------------------------------------------------------------------------- */
.um-speichern {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--vr-radius-md, 8px);
  background: var(--vr-burgund, #1F354C);
  color: var(--vr-creme, #EAEEF3);
  font-family: var(--vr-font-display, Georgia, serif);
  font-size: var(--vr-text-md, 1.125rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  /* 44 Pixel sind Pflicht, nicht Geschmack. */
  min-height: 44px;
}

.um-speichern:hover:not(:disabled) { background: var(--vr-burgund-tief, #142231); }
.um-speichern:focus-visible { outline: 3px solid var(--vr-gold, #5B83AC); outline-offset: 2px; }
.um-speichern:disabled { opacity: 0.55; cursor: default; }

.um-hinweis {
  padding: 10px 14px;
  border-radius: var(--vr-radius-sm, 4px);
  background: var(--vr-creme-tief, #D9E0E8);
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-muted, #515E6A);
}

.um-hinweis--fehler {
  background: #E9ECF0;
  color: var(--vr-burgund, #1F354C);
  font-weight: 600;
}

.um-hinweis--gut {
  background: #E6E9EB;
  color: #304255;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Verlauf, unten ueber die volle Breite
   -------------------------------------------------------------------------- */
.um-liste-abschnitt { margin-top: clamp(24px, 4vw, 40px); }

.um-liste-h {
  margin: 0 0 12px;
  font-family: var(--vr-font-display, Georgia, serif);
  font-size: var(--vr-text-lg, 1.25rem);
  color: var(--vr-burgund, #1F354C);
}

.um-liste { display: flex; flex-direction: column; gap: 10px; }

.um-zeile {
  padding: 14px 16px;
  border: 1px solid var(--vr-linie-soft, #D3DCE4);
  border-left: 3px solid var(--vr-gold, #5B83AC);
  border-radius: var(--vr-radius-sm, 4px);
  background: var(--vr-papier, #F7FAFC);
}

.um-zeile-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.um-zeile-typ {
  font-family: var(--vr-font-display, Georgia, serif);
  font-size: var(--vr-text-md, 1.125rem);
  color: var(--vr-burgund, #1F354C);
}

.um-zeile-zeitraum {
  margin-top: 4px;
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-dunkel, #191E23);
}

.um-zeile-fuss {
  margin-top: 6px;
  font-size: var(--vr-text-sm, 0.875rem);
  color: var(--vr-text-muted, #515E6A);
}

.um-vermerk {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--vr-radius-full, 9999px);
  background: var(--vr-creme-tief, #D9E0E8);
  font-style: italic;
}

.um-abzeichen {
  padding: 3px 10px;
  border-radius: var(--vr-radius-full, 9999px);
  font-size: var(--vr-text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.um-abzeichen--laeuft  { background: #E6E9EB; color: #304255; }
.um-abzeichen--geplant { background: #D9E0E8; color: #416386; }
.um-abzeichen--beendet { background: #DDE1E5; color: #515E6A; }
.um-abzeichen--entwurf { background: #DDE1E5; color: #515E6A; }

/* --------------------------------------------------------------------------
   Dunkelfassung, nach demo-patches.css ab Zeile 519:
   Grund #151A1E, Karten #20252A, Text #E4EBF1, Rahmen #363F49.
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .um-field,
html[data-theme="dark"] .um-anlass,
html[data-theme="dark"] .um-motiv,
html[data-theme="dark"] .um-vorschau-rahmen,
html[data-theme="dark"] .um-zeile,
html[data-theme="dark"] .um-feld input[type="text"],
html[data-theme="dark"] .um-feld input[type="date"],
html[data-theme="dark"] .um-feld textarea {
  background: #20252A;
  border-color: #363F49;
  color: #E4EBF1;
}

html[data-theme="dark"] .um-vorschau-eyebrow,
html[data-theme="dark"] .um-heute,
html[data-theme="dark"] .um-hinweis,
html[data-theme="dark"] .um-vermerk {
  background: #1B1F24;
  border-color: #363F49;
  color: #9BA5AF;
}

html[data-theme="dark"] .um-legend,
html[data-theme="dark"] .um-pv-titel,
html[data-theme="dark"] .um-pv-reopen,
html[data-theme="dark"] .um-liste-h,
html[data-theme="dark"] .um-zeile-typ,
html[data-theme="dark"] .um-motiv.is-selected .um-motiv-name {
  color: #9EB3C8;
}

html[data-theme="dark"] .um-step,
html[data-theme="dark"] .um-anlass.is-selected,
html[data-theme="dark"] .um-speichern {
  background: #2F4B68;
  color: #E4EBF1;
  border-color: #2F4B68;
}

html[data-theme="dark"] .um-note,
html[data-theme="dark"] .um-motiv-name,
html[data-theme="dark"] .um-feld label,
html[data-theme="dark"] .um-pv-phase-label,
html[data-theme="dark"] .um-pv-nachsatz,
html[data-theme="dark"] .um-zeile-fuss {
  color: #9BA5AF;
}

html[data-theme="dark"] .um-pv-text,
html[data-theme="dark"] .um-zeile-zeitraum {
  color: #E4EBF1;
}

html[data-theme="dark"] .um-hinweis--fehler { background: #252E37; color: #B8C4D0; }
html[data-theme="dark"] .um-hinweis--gut    { background: #21272E; color: #B1BAC2; }

html[data-theme="dark"] .um-abzeichen--laeuft  { background: #21272E; color: #B1BAC2; }
html[data-theme="dark"] .um-abzeichen--geplant { background: #202932; color: #9EB3C8; }
html[data-theme="dark"] .um-abzeichen--beendet,
html[data-theme="dark"] .um-abzeichen--entwurf { background: #25292E; color: #9BA5AF; }

/* --------------------------------------------------------------------------
   Schmale Schirme. Nur die drei Breakpunkte, die im Haus gelten.
   -------------------------------------------------------------------------- */
@media (max-width: 490px) {
  .um-anlass-grid,
  .um-motive,
  .um-zwei {
    grid-template-columns: 1fr;
  }
}
