/* ---------------------------------------------------------------------------
   Ergänzungen für das Kundenportal.

   Grundlage ist /assets/stil.css - hier steht nur, was dort fehlt. Farben
   kommen ausschließlich aus den Variablen, damit die Mandantenfarben auch im
   Portal greifen. Alle Klickflächen bleiben mindestens 44 px hoch.
--------------------------------------------------------------------------- */

.kopfzeile { margin-bottom: 14px; }
.kopfzeile h1 { margin: 0; }

.benutzeranzeige { color: rgba(255, 255, 255, .9); font-size: .9rem; padding: 0 8px; align-self: center; }
.hauptnavigation a { display: inline-flex; align-items: center; }

/* Zähler in der Seitenleiste: offene Rechnungen, offene Meldungen */
.seitenleiste a { justify-content: flex-start; }
.seitenleiste .zaehler {
  margin-left: auto; font-size: .76rem; font-weight: 700; min-width: 20px; height: 20px;
  border-radius: 999px; display: none; place-items: center; padding: 0 6px;
  background: var(--flaeche-gedaempft); color: var(--text-gedaempft);
}
.seitenleiste .zaehler:not(:empty) { display: grid; }
.seitenleiste .zaehler.warnung { background: var(--warnung); color: #fff; }
.seitenleiste .zaehler.fehler { background: var(--fehler); color: #fff; }
.seitenleiste a.aktiv .zaehler { background: rgba(255, 255, 255, .24); color: #fff; }

/* --- Kleinteile ----------------------------------------------------------- */

.abstand-unten { margin-bottom: var(--abstand); }
.klein { font-size: .85rem; }
.loesung { color: var(--gut); }
.ueberfaellig { color: var(--fehler); font-size: .82rem; font-weight: 650; }

.marke-nummer {
  display: inline-block; font-family: var(--schrift-zahl); font-size: .85rem;
  background: var(--flaeche-gedaempft); border: 1px solid var(--rand);
  border-radius: var(--radius-klein); padding: 1px 7px; white-space: nowrap;
}

/* Name-Wert-Zeilen in Karten und Dialogen */
.merkzeile {
  display: grid; grid-template-columns: 210px 1fr; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--rand);
}
.merkzeile:last-child { border-bottom: 0; }
.merkzeile .name { color: var(--text-gedaempft); font-size: .9rem; }
.merkzeile .wert { min-width: 0; overflow-wrap: anywhere; }

/* --- Filterleiste über Listen --------------------------------------------- */

.filterleiste { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filterleiste .schalter {
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--rand-stark);
  background: var(--flaeche); font-family: inherit; font-size: .93rem; color: var(--text); cursor: pointer;
}
.filterleiste .schalter:hover { background: var(--flaeche-gedaempft); }
.filterleiste .schalter.aktiv { background: var(--primaer); color: #fff; border-color: var(--primaer); font-weight: 640; }
.filterleiste .schalter:focus-visible { outline: 3px solid rgba(20, 48, 79, .28); outline-offset: 1px; }

/* Auswahlkarten: Bezeichnung über der Erklärung, nicht daneben */
.wahl .titel, .wahl .beschreibung { display: block; }

/* --- Karten der Übersicht ------------------------------------------------- */

.mietkarte { cursor: pointer; transition: box-shadow .12s ease, transform .12s ease; }
.mietkarte:hover { box-shadow: var(--schatten-stark); transform: translateY(-1px); }
.mietkarte:focus-visible { outline: 3px solid rgba(20, 48, 79, .28); outline-offset: 2px; }
.mietkarte h3 { margin: 0; }

/* Karte in der Karte: ohne Schatten, damit die Ebenen erkennbar bleiben */
.karte .karte.flach { box-shadow: none; background: var(--flaeche); margin-bottom: 0; }
.karte .karte.flach h3 { margin: 0; }
.karte .karte.stillgelegt { background: var(--flaeche-gedaempft); }

/* --- Überwachungszeiten --------------------------------------------------- */

.fensterliste { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.fensterliste li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px dotted var(--rand); }
.fensterliste li:last-child { border-bottom: 0; }
.fensterliste .tagname { min-width: 110px; font-weight: 620; }
.fensterliste .zeitmarke {
  font-family: var(--schrift-zahl); font-size: .86rem; background: var(--info-grund);
  color: #123a68; border: 1px solid #c3d6ee; border-radius: var(--radius-klein); padding: 2px 8px;
}

.wochenplan { display: grid; gap: 8px; }
.wochenplan .tag {
  display: grid; grid-template-columns: 130px auto 1fr; gap: 12px; align-items: start;
  padding: 10px; border: 1px solid var(--rand); border-radius: var(--radius-klein); background: var(--flaeche);
}
.wochenplan .tag > .knopf { justify-self: start; margin-top: 4px; }
.wochenplan .tag .name { font-weight: 620; padding-top: 11px; }
.wochenplan .fenster { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.wochenplan .fenster:last-child { margin-bottom: 0; }
.wochenplan .fenster input { width: 96px; min-height: 44px; font-family: var(--schrift-zahl); text-align: center; }
.wochenplan .fenster input.falsch { border-color: var(--fehler); background: var(--fehler-grund); }
.wochenplan .leerhinweis { color: var(--text-gedaempft); font-size: .9rem; padding-top: 12px; }

.konfliktliste { margin: 8px 0; padding-left: 20px; }
.konfliktliste li { margin-bottom: 4px; }

.kontaktkette { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.kontaktkette li { padding-left: 4px; }
.kontaktkette .name { font-weight: 620; }

/* --- Anpassungen kleiner Bildschirme -------------------------------------- */

@media (max-width: 900px) {
  /* Die Seitenleiste rollt waagerecht. Ohne minmax(0, 1fr) wächst die Spalte
     auf die Breite aller Einträge und schiebt die Seite über den Bildschirm. */
  .seitenraster { grid-template-columns: minmax(0, 1fr); }
  .seitenraster > .seitenleiste { min-width: 0; max-width: 100%; }
  .kopfleiste .huelle { flex-wrap: wrap; row-gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .hauptnavigation { margin-left: 0; width: 100%; }
  .merkzeile { grid-template-columns: 1fr; gap: 2px; }
  .merkzeile .name { font-weight: 650; }
  .wochenplan .tag { grid-template-columns: 1fr; }
  .wochenplan .tag .name { padding-top: 0; }
  .benutzeranzeige { display: none; }
}

@media print {
  .filterleiste, .seitenleiste, .kopfleiste { display: none !important; }
  .mietkarte { break-inside: avoid; }
}
