/* styles.css — Seitenlayout der Hauptseite.

   Alle Farben, Abstände und Komponenten stehen in design.css. Hier steht
   nur, wie die vier Ansichten der Hauptseite angeordnet sind.

   Gerüst: body.seite ist eine Flex-Spalte über die volle Fensterhöhe.
   Darunter liegt .rumpf mit der linken Navigation (.reiter) und der
   Bühne (.buehne), in der genau eine Ansicht sichtbar ist. Die
   Tabellenansichten (.inhalt-fest) geben ihre Höhe an den Tabellenrahmen
   weiter, der dann selbst rollt. Gerollt wird immer INNEN, die Seite
   selbst rollt nie. */

body.seite { height: 100vh; overflow: hidden; }

.ansicht { flex: 1 1 auto; min-height: 0; }

.buehne > .lade,
.buehne > .fehler {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
}


/* ==================================================================
   Kopfzeile
   ================================================================== */

/* Der Daten-Stand weicht erst spät: Seit der Knopf «Neu laden» weg ist, hat
   die Kopfzeile mehr Platz, und der Stand ist die einzige Stelle, an der man
   sieht, wie frisch die Daten sind. */
@media (max-width: 1000px) {
  .stand { display: none; }
}


/* ==================================================================
   Übersicht
   ================================================================== */

#zeitstrahl {
  padding-bottom: var(--a2);
  overscroll-behavior-x: contain;
}

.verteilung-name {
  display: block; font-size: var(--t-s);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Kennzahl-Kacheln: auto-fit, damit jede Reihe bündig abschliesst. */
.kacheln { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kacheln .kachel { min-height: 108px; }


/* ==================================================================
   Tabellenansichten (Geräte, Benutzer, Telefonnummern)
   ================================================================== */

.werkzeug-bereich {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--a3);
}

.werkzeug-bereich .anzahl { margin-left: auto; }

.filtergitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--a4) var(--a5);
}

.spaltengruppe { margin-bottom: var(--a4); }
.spaltengruppe h3 {
  color: var(--text-leise); font-size: var(--t-xs); font-weight: 500;
  margin-bottom: var(--a2);
}
.spaltengruppe .liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0 var(--a4);
}
.spaltengruppe label { font-size: var(--t-m); cursor: pointer; display: block; padding: 3px 0; }
.spaltengruppe input { margin-right: var(--a2); }

.werkzeugzeile { display: flex; gap: var(--a2); margin-top: var(--a3); flex-wrap: wrap; }

.filterfeld > label {
  display: block; font-size: var(--t-xs); font-weight: 500;
  color: var(--text-leise); margin-bottom: var(--a1);
}
.filterfeld select {
  width: 100%; font: inherit; font-size: var(--t-m);
  min-height: 40px; padding: var(--a2) var(--a3);
  border: 1px solid var(--umriss); border-radius: var(--r-klein);
  background: var(--weiss); color: var(--text);
}
.filterfeld select:hover { border-color: var(--text); }
.filterfeld select:focus { outline: none; border-color: var(--primaer); box-shadow: inset 0 0 0 1px var(--primaer); }


/* ==================================================================
   Software
   ================================================================== */

.sw-toolbar { margin-bottom: var(--a5); }

.sw-kategorie { margin-bottom: var(--a6); }
.sw-kategorie h2 {
  font-size: var(--t-l); font-weight: 500;
  color: var(--text); margin-bottom: var(--a3);
}

.sw-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--a4);
}

.sw-karte {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r);
  padding: var(--a4) var(--a5);
  font: inherit; color: var(--text); text-align: left;
  cursor: pointer; display: flex; flex-direction: column; gap: var(--a2);
  transition: background .12s, border-color .12s;
}
.sw-karte:hover { background: var(--flaeche); border-color: var(--umriss-leicht); }

.sw-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--a3); }
.sw-name { font-size: var(--t-m); font-weight: 500; overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.sw-zahlen { display: flex; gap: var(--a4); font-size: var(--t-xs); color: var(--text-leise); }
.sw-zahl { font-variant-numeric: tabular-nums; }
.sw-zahl b { font-family: var(--schrift-titel); font-size: var(--t-xl); font-weight: 400;
             color: var(--text); display: block; line-height: 1.2; }
.sw-vorschlaege { font-size: var(--t-xs); color: var(--text-still); }


/* ==================================================================
   Schmale Fenster
   ================================================================== */

@media (max-width: 760px) {
  .kopf-marke { flex: 1 1 auto; }
  .kopf-rechts { flex: 0 0 auto; }

  .kopf .knopf,
  .toolbar .knopf,
  .toolbar .suche { min-height: 40px; }

  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kacheln .kachel { min-height: 92px; }

  #zeitstrahl .zeitstrahl-tick,
  #zeitstrahl .zeitstrahl-zelle { min-width: 64px; }

  .werkzeug-bereich .anzahl { margin-left: 0; order: 99; flex-basis: 100%; }
  .toolbar #knopf-neu,
  .toolbar #knopf-neu-telefon { margin-left: auto; }

  .sw-gitter { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

  .filtergitter,
  .spaltengruppe .liste { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .kacheln { gap: var(--a2); }
}
