/*
 * Nachbauten: Handy, Mail, Programmfenster, Meldung und ihre Teile.
 * Sie sollen wie die echten Systeme der Betriebe aussehen, nicht wie die Tivaos-Seite:
 * Systemschrift, Farbe des jeweiligen Beispielbetriebs (--g-marke), keine Violett-Töne.
 * Mindestschrift 13 px. Nichts darin ist bedienbar.
 */

.g-handy, .g-mail, .g-fenster, .vorschau-mail, .vorschau-pinnwand, .vorschau-kacheln {
  --g-schrift: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --g-text: #1f2328;
  --g-leise: #5f6670;
  --g-linie: #dfe2e6;
  --g-grund: #f3f4f6;
  font-family: var(--g-schrift);
  color: var(--g-text);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

/* Farben der Beispielbetriebe (frei gewählt) */
.g-farbe-physio { --g-marke: #0f766e; --g-marke-hell: #e3f3f1; }
.g-farbe-friseur { --g-marke: #1e429f; --g-marke-hell: #e6ecfa; }
.g-farbe-restaurant { --g-marke: #9a3412; --g-marke-hell: #fbeee6; }
.g-farbe-rollladen { --g-marke: #334155; --g-marke-hell: #e8edf3; }
.g-farbe-salon { --g-marke: #7c2d6b; --g-marke-hell: #f5e8f2; }
.g-farbe-dach { --g-marke: #b91c1c; --g-marke-hell: #fbe9e9; }
.g-farbe-shop { --g-marke: #b45309; --g-marke-hell: #fdf0e1; }
.g-farbe-buero { --g-marke: #374151; --g-marke-hell: #eceef1; }
.g-farbe-coach { --g-marke: #0e7490; --g-marke-hell: #e2f3f7; }
.g-farbe-reinigung { --g-marke: #15803d; --g-marke-hell: #e5f4ea; }
.g-farbe-makler { --g-marke: #1e3a8a; --g-marke-hell: #e6ebf7; }
.g-farbe-agentur { --g-marke: #3f3f46; --g-marke-hell: #ededf0; }

/* ---------- Handy ---------- */

.g-handy {
  width: 316px;
  max-width: 100%;
  padding: 9px;
  border-radius: 40px;
  background: #1b1a1f;
  box-shadow: 0 18px 40px -16px rgba(20, 10, 30, 0.45);
}
.g-schirm {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  border-radius: 32px;
  overflow: hidden;
  background: #fff;
}
.g-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
}
.g-status-zeichen {
  width: 22px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
}
.g-status-zeichen::after {
  content: '';
  position: absolute;
  inset: 1.5px 5px 1.5px 1.5px;
  background: currentColor;
  border-radius: 1px;
}
.g-handy--dunkel .g-schirm { background: linear-gradient(165deg, #3b4262 0%, #1c2033 100%); color: #fff; }

/* Website des Betriebs */
.g-webkopf {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  border-bottom: 3px solid var(--g-marke);
  font-weight: 600;
}
.g-webkopf-logo { width: 20px; height: 20px; border-radius: 50%; background: var(--g-marke); flex-shrink: 0; }
.g-webkopf-menue { margin-left: auto; width: 18px; height: 12px; border-block: 2px solid var(--g-text); position: relative; }
.g-webkopf-menue::after { content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 2px; background: var(--g-text); }

.g-seite { display: grid; gap: 10px; padding: 14px 14px 18px; }
.g-seite-titel { font-size: 18px; font-weight: 700; }

.g-titel { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.g-nummer {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--g-marke);
  color: #fff;
  font-size: 13px;
}

/* App eines Betriebs */
.g-appkopf {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  background: var(--g-marke);
  color: #fff;
}
.g-appkopf-logo { width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, 0.3); }
.g-appkopf-titel { font-weight: 600; font-size: 15px; }
.g-appkopf-rechts { margin-left: auto; font-size: 13px; }
.g-app { flex: 1; display: grid; gap: 10px; align-content: start; padding: 12px; background: var(--g-grund); }
.g-leiste { display: flex; border-top: 1px solid var(--g-linie); background: #fff; }
.g-leiste-punkt {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 0 12px;
  text-align: center;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--g-leise);
  border-top: 2px solid transparent;
  overflow: hidden;
  text-overflow: clip;
}
.g-leiste-punkt--aktiv { color: var(--g-marke); border-top-color: var(--g-marke); }

/* ---------- Teile ---------- */

.g-text { margin: 0; font-size: 14px; max-width: none; }
.g-text + .g-text { margin-top: 6px; }
.g-text--leise { color: var(--g-leise); font-size: 13px; }
.g-text--leer { color: var(--g-leise); font-size: 13px; }
.g-text--mitte { text-align: center; }
.g-link { color: var(--g-marke); text-decoration: underline; text-underline-offset: 2px; }

.g-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.g-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.g-knopf--voll, .g-knopf--app { flex: 1 1 auto; background: var(--g-marke); color: #fff; }
.g-knopf--kontur { background: #fff; border: 1px solid #c9ced6; color: var(--g-text); }
.g-knopf--grau { background: #f1f1f1; color: #222; min-height: 32px; }
.g-knopf--schlecht { background: #fff; border: 1px solid #efc2c2; color: #a61b1b; }
.g-knopf--gut { background: #2e7d32; color: #fff; }

.g-schild {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.g-schild--offen { background: #fbf0c8; color: #6e5100; }
.g-schild--gut { background: #e2f1e3; color: #1d5b21; }
.g-schild--grau { background: #ececec; color: #4f4f4f; }
.g-schild--blau { background: #e2edfb; color: #0d4789; }
.g-schild--schlecht { background: #fbe3e3; color: #8a1c1c; }
.g-schild--neu { background: var(--g-marke-hell); color: var(--g-marke); }

.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chip { padding: 2px 10px; border: 1px solid var(--g-linie); border-radius: 999px; font-size: 13px; background: #fff; }
.g-chip--aktiv { background: var(--g-marke); border-color: var(--g-marke); color: #fff; }

.g-kacheln { display: grid; gap: 6px; }
.g-kacheln--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-kacheln--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-kacheln--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-kachel {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 4px 4px;
  border: 1px solid #cfd4db;
  border-radius: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: #fff;
  white-space: nowrap;
}
.g-kachel--gewaehlt { background: var(--g-marke); border-color: var(--g-marke); color: #fff; font-weight: 600; }

.g-kalender { border: 1px solid var(--g-linie); border-radius: 10px; padding: 8px; }
.g-kalender-kopf { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; padding: 0 4px 6px; }
.g-kalender-wochentage, .g-kalender-tage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.g-kalender-wochentage span { font-size: 13px; color: var(--g-leise); padding-bottom: 2px; }
.g-tag { display: grid; place-items: center; height: 27px; font-size: 13px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.g-tag--grau { color: #6c727b; text-decoration: line-through; }
.g-tag--gewaehlt { background: var(--g-marke); color: #fff; font-weight: 700; }

.g-feld { display: grid; gap: 3px; }
.g-feld-name { font-size: 13px; font-weight: 600; }
.g-feld-wert { min-height: 36px; padding: 7px 10px; border: 1px solid #cfd4db; border-radius: 8px; background: #fff; font-size: 14px; }
.g-feld-wert--leer { color: #8c939c; }
.g-feld-wert--gross { min-height: 60px; }

.g-haken { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.g-haken-kasten { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid #8c939c; border-radius: 4px; position: relative; }
.g-haken-kasten--an { background: var(--g-marke); border-color: var(--g-marke); }
.g-haken-kasten--an::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.g-hervor { padding: 8px 10px; border-radius: 8px; background: var(--g-marke-hell); font-weight: 600; font-size: 14px; }

.g-zeilen { display: grid; margin: 8px 0; }
.g-zeile { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 8px; padding: 4px 0; font-size: 13px; }
.g-zeile-name { color: var(--g-leise); }
.g-zeile-wert { font-weight: 600; overflow-wrap: anywhere; }

.g-kennzahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.g-kennzahl { display: grid; gap: 2px; padding: 8px 4px; border-radius: 10px; background: #fff; text-align: center; }
.g-kennzahl-wert { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-kennzahl-name { font-size: 13px; line-height: 1.2; color: var(--g-leise); }

.g-abschnitt { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; font-weight: 700; font-size: 15px; }
.g-abschnitt-zahl { font-size: 13px; color: var(--g-leise); font-weight: 600; }

.g-karte { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.g-karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.g-zeit { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.g-karte-name { font-weight: 600; }
.g-karte-meta { font-size: 13px; color: var(--g-marke); }
.g-karte-notiz { font-size: 13px; color: #4b5157; background: #f6f7f8; border-radius: 6px; padding: 5px 8px; }
.g-karte .g-knoepfe { margin-top: 6px; }

/* ---------- Mail ---------- */

.g-mail {
  width: 100%;
  max-width: 380px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px -14px rgba(20, 10, 30, 0.35);
}
.g-mail-meta { padding: 12px 16px; border-bottom: 1px solid var(--g-linie); }
.g-mail-von { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--g-leise); }
.g-mail-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--g-marke);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.g-mail-betreff { margin-top: 6px; font-weight: 700; font-size: 15px; line-height: 1.35; }
.g-mail-koerper { padding: 12px; background: #f4f4f4; }
.g-mail-kopf { padding: 13px 16px; border-radius: 8px 8px 0 0; background: var(--g-marke); color: #fff; font-weight: 600; font-size: 16px; }
.g-mail-inhalt { padding: 14px 16px; background: #fff; }
.g-mail-koerper > .g-mail-inhalt:first-child { border-radius: 8px; }
.g-mail-titel { margin-bottom: 8px; font-size: 16px; font-weight: 700; }
.g-mail-inhalt .g-knoepfe { margin: 4px 0 8px; }
.g-mail-fuss { padding: 9px 16px; border-top: 1px solid #eee; border-radius: 0 0 8px 8px; background: #fff; color: var(--g-leise); font-size: 13px; }

/* ---------- Programmfenster ---------- */

.g-fenster {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 36px -16px rgba(20, 10, 30, 0.4);
}
.g-fenster-leiste { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: #eceef1; }
.g-fenster-leiste i { width: 10px; height: 10px; border-radius: 50%; background: #cdd1d6; }
.g-fenster-leiste span { margin-left: 8px; font-size: 13px; color: var(--g-leise); }
.g-fenster-inhalt { padding: 14px; }

/* ---------- Meldung und Sperrbildschirm ---------- */

.g-meldung { padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.94); color: var(--g-text); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.g-meldung-kopf { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--g-leise); }
.g-meldung-symbol { width: 18px; height: 18px; border-radius: 5px; background: var(--g-marke); }
.g-meldung-zeit { margin-left: auto; }
.g-meldung-titel { margin-top: 3px; font-weight: 700; font-size: 14px; }
.g-meldung-text { font-size: 13px; }

.g-sperre { flex: 1; padding: 26px 12px 20px; text-align: center; }
.g-sperre-uhr { font-size: 60px; font-weight: 300; line-height: 1.1; }
.g-sperre-datum { font-size: 15px; opacity: 0.9; }
.g-sperre-meldungen { display: grid; gap: 8px; margin-top: 28px; text-align: left; }

/* ---------- Kleine Vorschauen auf der Startseite ---------- */

.vorschau-mail { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: #fff; border-left: 4px solid var(--g-marke); }
.vorschau-mail-von { font-size: 13px; color: var(--g-leise); }
.vorschau-mail-betreff { font-weight: 700; }
.vorschau-pinnwand { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.vorschau-spalte { display: grid; gap: 4px; align-content: start; padding: 6px; border-radius: 8px; background: #fff; }
.vorschau-spalte-name { font-size: 13px; font-weight: 700; color: var(--g-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vorschau-karte { padding: 4px 6px; border-radius: 6px; border-left: 3px solid var(--g-marke); background: var(--g-grund); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vorschau-kacheln { display: grid; gap: 8px; }
.vorschau-schild { display: block; }

@media (max-width: 420px) {
  .vorschau-pinnwand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vorschau-pinnwand .vorschau-spalte:nth-child(3) { display: none; }
  .g-kacheln--6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Tabelle und Datei (Fassung 3) ---------- */

.g-tabelle { display: grid; font-size: 13px; overflow-x: auto; }
.g-tabelle-kopf, .g-tabelle-zeile { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(80px, 1fr); gap: 8px; padding: 7px 8px; }
.g-tabelle-kopf { background: var(--g-grund); color: var(--g-leise); font-weight: 600; border-radius: 6px; }
.g-tabelle-zeile { border-bottom: 1px solid var(--g-linie); align-items: center; }
.g-tabelle-zeile span { overflow-wrap: anywhere; }
.g-datei { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--g-linie); border-radius: 8px; background: #fff; }
.g-datei-symbol { display: grid; place-items: center; width: 34px; height: 40px; border-radius: 4px; background: var(--g-marke); color: #fff; font-size: 13px; font-weight: 700; }
.g-datei-text { display: grid; }
.g-datei-name { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.g-datei-zusatz { font-size: 13px; color: var(--g-leise); }
