/* =============================================
   Einstellungen — Gleisbau OS (core/einstellungen.js, Regeln: DESIGN.md)
   Im Programmrahmen (bauteile.css): in der Spalte die Bereiche, innen Karten mit Zeilen: links Name und Hinweis,
   rechts die Wahl. Richtet sich nach der Breite des Fensters (@container fenster).
   ============================================= */

.einstellungen.view.active { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--flaeche); color: var(--text); }

/* ---------- Bereiche ---------- */
.einst-nav { display: flex; flex-direction: column; gap: 1px; }   /* Einträge: bauteile.css .rahmen-eintrag */

/* ---------- Seite, Karten, Zeilen ---------- */
.einst-seite { display: flex; flex: 1; flex-direction: column; gap: var(--a5); min-width: 0; min-height: 0; overflow: auto; padding: var(--a5); }
.einst-abschnitt h3 { margin: 0 0 var(--a2); font-size: var(--s-titel); font-weight: 600; }
.einst-karte { border: 1px solid var(--linie); border-radius: var(--r-menue); }
.einst-zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--a2) var(--a4); min-height: 52px; padding: var(--a3) var(--a3); }
.einst-zeile + .einst-zeile { border-top: 1px solid var(--linie); }
.einst-zeile .l { display: flex; flex: 1 1 260px; flex-direction: column; min-width: 0; max-width: 60ch; }
.einst-zeile .l b { font-weight: 500; }
.einst-zeile .l span { color: var(--text-2); font-size: var(--s-klein); }
.einst-zeile.breit .l { max-width: none; }
.einst-breit { flex: 1 1 100%; min-width: 0; }
.einst-hinweis { margin: var(--a2) 0 0; color: var(--text-2); font-size: var(--s-klein); }
.einst-knoepfe { display: flex; flex-wrap: wrap; gap: var(--a2); }
/* Verwaltung › Ordner für neue Projekte: links der Text (ein Ordner je Zeile), rechts die Vorschau als Ordnerbaum;
   im schmalen Fenster untereinander */
.einst-ordner { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--a3); }
.einst-ordner-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 460px;
  padding: var(--a2) var(--a3);
  border: 1px solid var(--linie-stark);
  border-radius: var(--r-knopf);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  white-space: pre;
  tab-size: 4;
  overflow: auto;
  resize: vertical;
}
.einst-ordner-text:focus { border-color: var(--akzent); outline: none; box-shadow: 0 0 0 3px var(--akzent-hover); }
.einst-ordner-vorschau { min-height: 120px; max-height: 620px; overflow: auto; padding: var(--a2) var(--a3); border-radius: var(--r-knopf); background: var(--flaeche-2); }
.einst-ordner-zeile { display: flex; align-items: center; gap: var(--a2); min-height: 26px; }
.einst-ordner-zeile.ebene-2 { padding-left: var(--a5); }
.einst-ordner-zeile.ebene-3 { padding-left: calc(2 * var(--a5)); }
.einst-ordner-zeile span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#einst-ordner .einst-knoepfe { margin-top: var(--a2); }
.einst-wert { color: var(--text-2); font-variant-numeric: tabular-nums; }
.einst-telefon { width: 220px; }

/* Konto: Bild mit den Anfangsbuchstaben, Name, Rechte */
.einst-konto { display: flex; align-items: center; gap: var(--a3); min-width: 0; }
.einst-konto .avatar { width: 48px; height: 48px; font-size: var(--s-titel); }

/* Akzentfarbe: runde Knöpfe in ihrer Farbe (design.css [data-farbe]) */
.farbwahl { display: flex; flex-wrap: wrap; gap: var(--a3); }
.farbwahl button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--akzent); box-shadow: inset 0 0 0 1px var(--glas-kante); cursor: default; }
.farbwahl button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 4px var(--akzent); }

/* Tapete: Vorschau je Tapete (design.css [data-tapete]) */
.tapetenwahl, .tapetenwahl .tapeten { display: flex; flex-wrap: wrap; gap: var(--a3); }
.tapetenwahl button { display: flex; flex-direction: column; gap: var(--a1); padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--s-klein); font-weight: 500; cursor: default; }
.tapetenwahl .vorschau {
  display: block;
  width: 120px;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-knopf);
  background: radial-gradient(70% 55% at 62% 44%, var(--tapete-c), transparent 70%), linear-gradient(180deg, var(--tapete-a) 0%, var(--tapete-b) 64%);
  box-shadow: var(--schatten-klein);
}
.tapetenwahl .vorschau.bild { background-position: center; background-size: cover; }
/* „Bild wählen …“: Fläche mit Rand und Symbol */
.bild-waehlen .vorschau { display: grid; place-items: center; background: var(--flaeche-2); box-shadow: inset 0 0 0 1px var(--linie-stark); color: var(--text-2); }
.bild-waehlen .vorschau .ic { width: 24px; height: 24px; }
.bild-waehlen:hover:not(:disabled) .vorschau { background: var(--akzent-hover); color: var(--akzent); }
.bild-waehlen:disabled { opacity: 0.6; }
.tapetenwahl button[aria-checked="true"] .vorschau { box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 4px var(--akzent); }

/* Tabellen der Verwaltung: Speicher je Projekt, Sicherungen */
.einst-tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.einst-tabelle th, .einst-tabelle td { padding: var(--a1) var(--a2); border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
.einst-tabelle thead th { color: var(--text-2); font-size: var(--s-klein); font-weight: 500; }
.einst-tabelle tbody th { font-weight: 500; }
.einst-tabelle tfoot th, .einst-tabelle tfoot td { border-bottom: 0; color: var(--text-2); }
.einst-tabelle .zahl { text-align: right; white-space: nowrap; }
.einst-tabelle .gesamt { font-weight: 600; }
.einst-tabelle .einst-hinweis { display: block; margin: 0; }
.einst-zeit { white-space: nowrap; }
.einst-sicherung { display: flex; flex-direction: column; align-items: flex-start; gap: var(--a3); }

/* ---------- Schmalere Fenster und Handy (die Bereiche liegen dann in der Schublade) ---------- */
@container fenster (max-width: 899px) {
  .einst-tabelle .teil { display: none; }
}
@container fenster (max-width: 640px) {
  .einst-seite { padding: var(--a4); }
  .einst-telefon { width: 100%; }
}

/* ---------- Sicherheitsprotokoll (Dialog #modal-sicherheitsprotokoll, admin.js spOeffnen): Filter, Tabelle mit festem Kopf;
   Fehlversuche fallen auf ---------- */
.dialog.sp-dialog { width: min(980px, 100%); }
.sp-rahmen { max-height: 480px; overflow: auto; border: 1px solid var(--linie); border-radius: var(--r-knopf); }
.sp-tabelle { width: 100%; border-collapse: collapse; font-size: var(--s-klein); }
.sp-tabelle th { position: sticky; top: 0; padding: var(--a1) var(--a2); background: var(--flaeche-2); color: var(--text-2); font-size: var(--s-hinweis); font-weight: 600; text-align: left; }
.sp-tabelle td { padding: var(--a1) var(--a2); border-top: 1px solid var(--linie); white-space: nowrap; vertical-align: top; }
.sp-tabelle td.sp-details { min-width: 220px; color: var(--text-2); white-space: normal; word-break: break-word; }
.sp-warnung td:nth-child(2) { color: var(--gefahr); font-weight: 600; }
/* Monat speichern (admin.js spMonatSpeichern): Wahl des Monats und Knopf links in der Knopfreihe */
.sp-monat { display: flex; flex-wrap: wrap; gap: var(--a2); }
.sp-monat .feld { width: auto; }
/* Übersicht der letzten 7 Tage (admin.js spLageZeigen) */
.sp-lage { display: flex; flex-wrap: wrap; gap: var(--a1) var(--a4); margin: 0; padding: 0; list-style: none; color: var(--text-2); }
.sp-lage b { color: var(--text); font-variant-numeric: tabular-nums; }
.sp-lage .alarm, .sp-lage .alarm b { color: var(--gefahr); }
/* Externe Sicherung über der Liste (einstellungen.js sicherungExtern) */
.einst-hinweis.warnung { color: var(--warnung); }
.einst-hinweis.alarm { color: var(--gefahr); }
