/* abwesenheit.css · Rechnungseingang BA 4 – Ansicht „Abwesenheit“ (abwesenheit.js)
   ALMAS-Webdesign v2: hell, weiche Schatten, Rot nur als Akzent. Nur Klassen mit Präfix abw-,
   damit nichts in andere Ansichten wirkt. Zweispaltig erst ab 900 px Inhaltsbreite (Container-Query),
   darunter alles untereinander – kein waagerechter Überlauf. */

#abwesenheitInhalt { container-type: inline-size; min-width: 0; }

/* ── Meldung über Listenaktionen (Ändern / Absagen) ── */
.abw-meldung:empty { display: none; }
.abw-meldung-box {
  display: flex; align-items: flex-start; gap: 12px; min-width: 0;
  margin-bottom: var(--space-md); padding: 14px 14px 14px 16px;
  background: var(--bg-secondary); border: 1px solid var(--border-secondary); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); font-size: 14px; color: var(--text-primary);
}
.abw-meldung-box > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.abw-meldung-box p + p, .abw-meldung-box ul { margin-top: 4px; }
.abw-meldung-box ul { padding-left: 18px; color: var(--text-secondary); }
.abw-meldung-box .abw-ergebnis-ic { color: #0057B8; }
.abw-meldung-zu { flex: 0 0 auto; }
/* Hinweis vom Server (z. B. „Vertretung ist selbst abwesend“): gelb statt blau */
.abw-meldung-box--warn { background: #FFF8EA; border-color: rgba(138, 90, 0, .28); }
.abw-meldung-box--warn .abw-ergebnis-ic { color: #8A5A00; }
/* Rückmeldung direkt in der betroffenen Zeile: volle Zeilenbreite unter Inhalt und Knöpfen */
.abw-zeile-meldung { flex: 1 1 100%; min-width: 0; }
.abw-zeile-meldung .abw-meldung-box { margin: 2px 0 0; animation: abw-auftauchen .28s cubic-bezier(.22, .61, .36, 1); }
.abw-karte .abw-meldung .abw-meldung-box { margin: 8px 0 4px; }

/* ── Kennzahlen oben ── */
.abw-kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.abw-kennzahlen:empty { display: none; }
.abw-kennzahl {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 16px 18px; background: var(--bg-secondary); border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.abw-kennzahl-ic {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--almas-red-light); color: var(--almas-red-hover);
}
.abw-kennzahl-ic svg { width: 20px; height: 20px; }
.abw-kennzahl--laufend .abw-kennzahl-ic { background: #FBF1DD; color: #8A5A00; }
.abw-kennzahl--geplant .abw-kennzahl-ic { background: #E7EEFE; color: #0057B8; }
.abw-kennzahl--frei .abw-kennzahl-ic { background: #E5F5EE; color: #147A3D; }
.abw-kennzahl-text { display: flex; flex-direction: column; min-width: 0; }
.abw-kennzahl-wert { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.abw-kennzahl-lbl { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }

/* ── Raster: Formular | Liste ── */
.abw-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); align-items: start; }
.abw-raster > * { min-width: 0; margin-bottom: 0; }
@container (min-width: 900px) {
  .abw-raster { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.abw-raster + .abw-karte, .abw-raster + .abw-raster { margin-top: var(--space-md); }
.abw-karte { min-width: 0; }
.abw-karte:hover { box-shadow: var(--shadow-sm); } /* ruhig: Formulare heben sich nicht beim Überfahren */
.abw-titel { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text-primary); margin: 0 0 6px; }
.abw-kartenkopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.abw-kartenkopf .abw-titel { margin: 0; }
.abw-zaehler { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.abw-kartenkopf--werkzeuge { align-items: center; margin-bottom: 4px; }
.abw-werkzeuge { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }

/* ── Formular ── */
.abw-form { min-width: 0; }
.abw-erklaerung {
  font-size: 13.5px; line-height: 1.5; color: var(--text-secondary);
  margin: 0 0 var(--space-md); padding: 10px 12px; background: var(--bg-primary); border-radius: var(--radius-md);
}
.abw-felder-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 var(--space-md); }
.abw-felder-2 > * { min-width: 0; }
.abw-form .almas-form-group, .abw-dlg-form .almas-form-group { margin-bottom: 14px; }
.abw-form .almas-form-group label, .abw-dlg-form .almas-form-group label { font-weight: 600; color: var(--text-primary); }
.abw-optional { font-weight: 400; color: var(--text-secondary); } /* AA: --text-tertiary hätte nur 3,3:1 */
.abw-feldhilfe { font-size: 12.5px; color: var(--text-secondary); margin: 6px 0 0; line-height: 1.45; }
.abw-feldhilfe--oben { margin: -8px 0 14px; }
#abwesenheitInhalt .almas-input, #abwesenheitInhalt .almas-textarea, .abw-modal .almas-input, .abw-modal .almas-textarea { min-height: 44px; }
#abwesenheitInhalt .almas-input[aria-invalid="true"], .abw-modal .almas-input[aria-invalid="true"] { border-color: #C20F1C; box-shadow: 0 0 0 3px rgba(194, 15, 28, .12); }
/* Während des Speicherns gesperrt (readOnly): sichtbar ruhiger, damit niemand eine Korrektur hineintippt */
.abw-form[aria-busy="true"] .almas-input, .abw-form[aria-busy="true"] .almas-textarea,
.abw-modal[aria-busy="true"] .almas-input, .abw-modal[aria-busy="true"] .almas-textarea {
  background: var(--bg-primary); color: var(--text-secondary); cursor: progress;
}
.abw-form-fuss { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.abw-form-fuss .almas-btn { min-height: 44px; padding-left: 18px; padding-right: 20px; }
.abw-form-fuss .almas-btn svg { width: 17px; height: 17px; }

/* Fehler im Formular / Dialog */
.abw-fehler {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  margin: 2px 0 14px; padding: 10px 12px; background: #FDE7E8; border: 1px solid rgba(194, 15, 28, .24);
  border-radius: var(--radius-md); font-size: 13.5px; color: var(--text-primary); line-height: 1.45;
}
.abw-fehler > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.abw-fehler ul { padding-left: 18px; }
.abw-fehler-ic { flex: 0 0 auto; width: 18px; height: 18px; color: #C20F1C; margin-top: 1px; }
.abw-fehler-ic svg { width: 18px; height: 18px; display: block; }

/* Ergebnis nach dem Eintragen */
.abw-ergebnis-platz:empty { display: none; }
.abw-ergebnis {
  margin-top: var(--space-md); padding: 14px 16px; border-radius: var(--radius-md);
  background: #F3FAF6; border: 1px solid rgba(20, 122, 61, .22); outline: none;
  animation: abw-auftauchen .28s cubic-bezier(.22, .61, .36, 1);
}
.abw-ergebnis-titel { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; color: var(--text-primary); margin: 0 0 8px; overflow-wrap: anywhere; }
.abw-ergebnis-titel .abw-ergebnis-ic { color: #147A3D; }
.abw-ergebnis-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.abw-ergebnis-zeile { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--text-primary); line-height: 1.45; min-width: 0; }
.abw-ergebnis-zeile > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.abw-ergebnis-ic { flex: 0 0 auto; width: 18px; height: 18px; display: inline-grid; place-items: center; margin-top: 1px; }
.abw-ergebnis-ic svg { width: 17px; height: 17px; display: block; }
.abw-ergebnis-zeile--ok .abw-ergebnis-ic { color: #147A3D; }
.abw-ergebnis-zeile--warn .abw-ergebnis-ic { color: #8A5A00; }
.abw-ergebnis-zeile--info .abw-ergebnis-ic { color: #0057B8; }

/* ── Listen ── */
.abw-gruppe { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary); margin: 14px 0 2px; }
.abw-gruppe:first-child { margin-top: 6px; }
.abw-gruppe-zahl { font-weight: 600; letter-spacing: 0; margin-left: 4px; font-variant-numeric: tabular-nums; }
.abw-mehr { margin-top: 6px; min-height: 40px; color: var(--text-primary); }
.abw-liste { list-style: none; margin: 0; padding: 0; }
.abw-zeile {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--border-secondary); min-width: 0;
}
.abw-liste .abw-zeile:last-child { border-bottom: none; }
.abw-zeile-haupt { flex: 1 1 280px; min-width: 0; }
.abw-zeile-kopf { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.abw-zeitraum { font-weight: 700; font-size: 14.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.abw-dauer { font-size: 12.5px; color: var(--text-secondary); }
.abw-person { margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.abw-liste--kompakt .abw-person { margin-top: 0; }
.abw-name { font-weight: 600; color: var(--text-primary); }
.abw-mail { color: var(--text-secondary); font-size: 13px; }
.abw-meta { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 13px; color: var(--text-secondary); min-width: 0; }
.abw-meta-zeile { overflow-wrap: anywhere; }
.abw-meta-k { display: inline-block; min-width: 118px; color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.abw-meta .abw-name { font-weight: 600; font-size: 13px; }
.abw-ohne { color: var(--text-secondary); font-style: italic; }
.abw-notiz { margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; white-space: pre-line; }
.abw-zeile-aktionen { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 0 1 auto; min-width: 0; }
.abw-zeile-aktionen .almas-btn { min-height: 36px; }
.abw-knopf-absagen { color: #C20F1C; }
.abw-knopf-absagen:hover { background: #FDE7E8; color: #A50D18; }
.abw-zeile--abgesagt .abw-zeitraum, .abw-zeile--vergangen .abw-zeitraum { color: var(--text-secondary); }
.abw-zeile--abgesagt .abw-zeitraum { text-decoration: line-through; text-decoration-color: rgba(92, 95, 102, .5); }
.abw-leer, .almas-empty.abw-leer { padding: 28px 12px; color: var(--text-secondary); } /* .almas-empty nimmt --text-tertiary (3,3:1) */
.abw-leer p { max-width: 360px; }
.abw-hinweis-klein { font-size: 13px; color: var(--text-secondary); margin: 10px 0 4px; }
.abw-zaehltext { font-size: 13px; color: var(--text-secondary); margin: 0 0 2px; }
.abw-zaehltext:empty { display: none; }

/* ── Admin-Abschnitt ── */
.abw-admin { margin-top: var(--space-xl); }
.abw-abschnitt { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--text-primary); margin: 0 0 var(--space-md); }

/* Schalter (wie die Pillen-Umschalter der App, eigene Klassen) */
.abw-schalter { display: inline-flex; gap: 3px; padding: 4px; background: var(--bg-tertiary); border-radius: 999px; box-shadow: inset 0 1px 2px rgba(16, 17, 22, .06); max-width: 100%; }
.abw-schalter-knopf {
  border: none; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 36px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.abw-schalter-knopf:hover { color: var(--text-primary); }
.abw-schalter-knopf.aktiv { background: #fff; color: var(--text-primary); box-shadow: var(--shadow-md); }
.abw-schalter-knopf:focus-visible { outline: 2px solid var(--almas-red-hover); outline-offset: 2px; }
.abw-suche { display: block; min-width: 0; flex: 1 1 200px; max-width: 260px; }
.abw-suche .almas-input { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }

/* ── Dialog ── */
.abw-modal { max-width: 520px; }
.abw-modal h2 { margin-bottom: 8px; }
.abw-dlg-text { font-size: 14px; color: var(--text-secondary); margin: 0 0 var(--space-md); overflow-wrap: anywhere; }
.abw-dlg-text strong { color: var(--text-primary); }
.abw-dlg-hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #E7EEFE; border-radius: var(--radius-md); font-size: 13.5px; color: var(--text-primary); }
.abw-dlg-hinweis .abw-ergebnis-ic { color: #0057B8; }
.abw-modal .abw-fehler { margin-top: 12px; margin-bottom: 0; }
.abw-modal .almas-modal-actions .almas-btn { min-height: 44px; }
.abw-knopf-gefahr, .abw-knopf-gefahr:hover { background: #C20F1C; color: #fff; } /* AA: Weiß auf #C20F1C = 6:1 */
.abw-knopf-gefahr:hover { background: #A50D18; }

.abw-unsichtbar { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Fokus sichtbar auch für die Listen-Knöpfe */
#abwesenheitInhalt .almas-btn:focus-visible, .abw-modal .almas-btn:focus-visible { outline: 2px solid var(--almas-red-hover); outline-offset: 2px; }
/* Fokusziele nach Eintragen / Ändern / Absagen (tabindex=-1): Ring nur bei Tastaturbedienung */
.abw-meldung-box:focus, .abw-titel:focus, .abw-zeile:focus { outline: none; }
.abw-ergebnis:focus-visible, .abw-meldung-box:focus-visible, .abw-titel:focus-visible, .abw-zeile:focus-visible { outline: 2px solid var(--almas-red-hover); outline-offset: 3px; border-radius: var(--radius-md); }

@keyframes abw-auftauchen { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .abw-ergebnis, .abw-modal-overlay, .abw-modal, .abw-zeile-meldung .abw-meldung-box { animation: none !important; }
  .abw-schalter-knopf { transition: none; }
  #abwesenheitInhalt .almas-btn, .abw-modal .almas-btn { transition: none; transform: none !important; }
}

@media (max-width: 560px) {
  .abw-zeile-aktionen { width: 100%; }
  .abw-zeile-aktionen .almas-btn { min-height: 44px; flex: 1 1 auto; }
  .abw-suche { max-width: none; }
  .abw-meta-k { min-width: 0; margin-right: 4px; }
  .abw-form-fuss .almas-btn { width: 100%; }
}
