/* =====================================================================
   STAMMDATEN - Erscheinungsbild (15.10.2026, FB_102)
   Ansicht: js/ze/erscheinungsbild.js (Klassen ebv-...)

   Baut auf style.css und zeiterfassung.css auf (ze-karte, feld, eingabe,
   knopf, ze-dialog-knoepfe, ze-db-hinweis) - hier stehen NUR die Formen
   dieser Ansicht. Farben ausschliesslich ueber die Tokens aus design.css,
   damit hell und dunkel von selbst stimmen. Einzige Ausnahme: das weisse
   Logo-Plaettchen (#fff fest wie in kopfzeile.css, .kopf-kundenlogo) -
   die Logos der Kunden sind fuer hellen Grund gemacht. Seit FB_103
   (15.10.2026) gibt es dazu die Varianten --akzent (kein Plaettchen) und
   --farbe (eigene Farbe als style) - siehe unten.

   DIE VORSCHAU (#ebvVorschau): Das Skript setzt dort die Variablen, die
   auch das Mandanten-Stylesheet setzt (--rot, --rot-rgb, --rot-dunkel,
   --rot-hell, --rot-rand, --zeile-hover, --auf-akzent, --auf-akzent-rgb,
   --akzent-text, --icon-*). Die Beispiele benutzen NUR diese - plus die
   festen --fehler...-Werte, die nie umfaerben.
   ACHTUNG: --verlauf-kopf, --fokus und --auf-rot werden auf :root aus
   --rot gerechnet und vererben den FERTIGEN Wert - auf der Box neu
   gesetztes --rot aendert sie nicht. Deshalb steht der Verlauf der
   Mini-Kopfleiste unten ausgeschrieben (wie admin-erscheinungsbild.css).
   ===================================================================== */

/* ---------------- Aufteilung ---------------- */

.ebv-band {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--info-rand);
  border-radius: var(--radius-m);
  background: var(--info-hell);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}

.ebv-raster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 14px;
  align-items: start;
}

.ebv-spalte { min-width: 0; }

@media (max-width: 900px) {
  .ebv-raster { grid-template-columns: minmax(0, 1fr); }
}

/* Nur fuer Screenreader (Legenden der Fieldsets). */
.ebv-unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ebv-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ebv-fieldset:disabled { opacity: .6; }

.ebv-knoepfe { margin-top: 4px; }

/* Die Feldhinweise tragen hier ganze Saetze (Dateipruefung) - etwas groesser als sonst. */
.ebv-fieldset .feld-hinweis { font-size: 11.5px; line-height: 1.45; }

/* ---------------- Akzentfarbe ---------------- */

.ebv-stand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--abstand-s);
  margin: 0 0 var(--abstand-m);
  font-size: 13px;
  color: var(--text-mittel);
}

.ebv-stand code { font-size: 13px; color: var(--text); }

/* Farbmuster - der Wert kommt als --ebv-muster aus dem Skript (immer #rrggbb). */
.ebv-muster {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-rund);
  border: 1px solid var(--rand-stark);
  background: var(--ebv-muster, var(--rot));
}

.ebv-farbfelder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 var(--abstand-l);
  align-items: start;
}

.ebv-farbwahl {
  display: block;
  width: 72px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--rand-stark);
  border-radius: var(--radius-s);
  background: var(--eingabe);
  cursor: pointer;
}

.ebv-farbwahl:focus-visible { outline: none; border-color: var(--akzent-text); box-shadow: var(--fokus); }
.ebv-farbwahl:disabled { cursor: not-allowed; }

.ebv-hex {
  max-width: 160px;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: .5px;
}

.ebv-hex[aria-invalid="true"] { border-color: var(--fehler); }

.ebv-ungespeichert {
  margin: 0 0 var(--abstand-s);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--info);
}

.ebv-ungespeichert[hidden] { display: none; }

/* ---------------- Logo ---------------- */

.ebv-logo-stand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--abstand-m);
  margin-bottom: var(--abstand-l);
}

/* Weisses Plaettchen wie in der Kopfleiste - bewusst FEST #fff, auch im dunklen Schema. */
.ebv-plaettchen {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 64px;
  max-width: 240px;
  padding: 8px 14px;
  border: 1px solid var(--rand-stark);
  border-radius: var(--radius-m);
  background: #ffffff;
}

.ebv-plaettchen img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ebv-plaettchen--leer {
  height: auto;
  min-height: 52px;
  border-style: dashed;
  background: transparent;
  font-size: 12.5px;
  color: var(--text-grau);
}

/* Hintergrund des gespeicherten Logos (15.10.2026, FB_103): "akzent" = auf dem Verlauf der
   Leiste. Die Karte liegt AUSSERHALB der Vorschau-Box - --verlauf-kopf ist hier also der der
   GESPEICHERTEN Farbe (Seite in Mandantenfarbe), genau der Grund oben. "--farbe": die Farbe
   kommt als style vom Skript (nur nach der Wert-Regel). */
.ebv-plaettchen--akzent {
  border-color: transparent;
  background: var(--verlauf-kopf);
}

.ebv-logo-info { font-size: 12.5px; color: var(--text-mittel); }

.ebv-datei { padding: 7px 10px; font-size: 13px; cursor: pointer; }
.ebv-datei:disabled { cursor: not-allowed; }

.feld .feld-hinweis.ebv-dateifehler { color: var(--fehler-text); font-weight: 600; }

/* ---------------- Vorschau ---------------- */

.ebv-vorschau {
  overflow: hidden;
  border: 1px solid var(--rand-stark);
  border-radius: var(--radius);
  background: var(--flaeche);
}

/* Mini-Kopfleiste: links "W6" und Titel, MITTIG das Logo, rechts der Avatar -
   dieselbe Aufteilung wie die echte Leiste mit Logo (kopfzeile.css, kopf--mit-logo). */
.ebv-kopf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 14px;             /* 9 statt 10 px (15.10.2026): Platz fuer das 40-px-Plaettchen, Hoehe bleibt 58 px */
  background: linear-gradient(135deg, var(--rot) 0%, var(--rot-dunkel) 100%);
  color: var(--auf-akzent);
}

.ebv-kopf-links {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ebv-w6 {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-m);
  background: rgba(var(--auf-akzent-rgb), 0.18);
  border: 1px solid rgba(var(--auf-akzent-rgb), 0.2);
  color: var(--auf-akzent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.ebv-kopf-titel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.ebv-kopf-titel strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  color: var(--auf-akzent);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ebv-kopf-titel small {
  overflow: hidden;
  font-size: 11px;
  color: rgba(var(--auf-akzent-rgb), 0.78);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Kundenlogo mittig: weisses Plaettchen, Breite nach dem Logo.
   15.10.2026: im Massstab der Mini-Leiste (58 zu 76 px) wie das neue Plaettchen oben
   (kopfzeile.css: 52 px hoch, bis 276 px breit, Polster 4px 8px) - Logo-Flaeche hier
   34 x bis 198 px, dasselbe Seitenverhaeltnis wie 44 x 260 px (js/logo-zuschnitt.js). */
.ebv-kopf-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 40px;
  max-width: 210px;
  padding: 3px 6px;
  border-radius: var(--radius-s);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ebv-kopf-logo[hidden] { display: none; }

/* Hintergrund (FB_103) wie .kopf-kundenlogo--akzent / --farbe in kopfzeile.css: "akzent" =
   kein Plaettchen, das Logo steht auf dem Verlauf der Mini-Leiste (also in der GEWAEHLTEN
   Farbe der Vorschau); "--farbe" = Farbe als style vom Skript, Schatten wie beim weissen. */
.ebv-kopf-logo--akzent {
  background: transparent;
  box-shadow: none;
}

.ebv-kopf-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ebv-avatar {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-rund);
  background: rgba(var(--auf-akzent-rgb), 0.9);
  color: var(--rot-dunkel);
  font-size: 11px;
  font-weight: 800;
}

.ebv-inhalt {
  display: grid;
  gap: var(--abstand-m);
  padding: 14px;
}

.ebv-beispiele {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: var(--abstand-m);
  align-items: start;
}

@media (max-width: 520px) {
  .ebv-beispiele { grid-template-columns: minmax(0, 1fr); }
}

/* Modul-Kachel wie in der Gruppenuebersicht (style.css, .modul-icon / .modul-pill). */
.ebv-kachel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--karte);
}

.ebv-kachel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--rot-rand);
  border-radius: var(--radius);
  background: var(--rot-hell);
  color: var(--akzent-text);
}

.ebv-kachel-icon svg { width: 28px; height: 28px; }

.ebv-kachel-titel { font-size: 13.5px; font-weight: 800; color: var(--text); }

/* Marke = Akzent als FLAECHE. */
.ebv-marke {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-l);
  background: var(--rot);
  color: var(--auf-akzent);
  font-size: 10.5px;
  font-weight: 700;
}

.ebv-rechts {
  display: grid;
  gap: var(--abstand-s);
  align-content: start;
  min-width: 0;
}

/* Reiter: aktiver Reiter = Akzent als TEXT/LINIE. */
.ebv-reiter {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rand);
}

.ebv-reiter-punkt {
  margin-bottom: -1px;
  padding: 5px 10px;
  border-bottom: 2px solid transparent;
  font-size: 12.5px;
  color: var(--text-mittel);
}

.ebv-reiter-punkt--aktiv {
  border-bottom-color: var(--akzent-text);
  color: var(--akzent-text);
  font-weight: 700;
}

/* Getoente Flaeche (Hinweisband, ausgewaehlter Eintrag). */
.ebv-toenung {
  padding: 8px 10px;
  border: 1px solid var(--rot-rand);
  border-radius: var(--radius-s);
  background: var(--rot-hell);
  color: var(--akzent-text);
  font-size: 12.5px;
}

.ebv-text { margin: 0; font-size: 12.5px; color: var(--text-mittel); }

.ebv-link {
  color: var(--akzent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Hauptknopf = Akzent als FLAECHE, Schrift automatisch lesbar. */
.ebv-knopf {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  padding: 7px 15px;
  border: 1px solid var(--rot);
  border-radius: var(--radius-s);
  background: var(--rot);
  color: var(--auf-akzent);
  font-size: 12.5px;
  font-weight: 700;
}

/* Gefahr-Knopf und Fehlermeldung: IMMER rot - feste --fehler...-Werte, nie der Akzent. */
.ebv-knopf--gefahr {
  border-color: var(--fehler);
  background: var(--fehler);
  color: var(--auf-fehler);
}

.ebv-fehler {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--fehler-rand);
  border-radius: var(--radius-s);
  background: var(--fehler-hell);
  color: var(--fehler-text);
  font-size: 12.5px;
}

.ebv-fehler-text { min-width: 0; }

.ebv-fussnote { margin: 0; font-size: 11.5px; color: var(--text-grau); }

.ebv-kontrast {
  margin: var(--abstand-m) 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-mittel);
}

.ebv-kontrast:empty { display: none; }

.ebv-hinweise {
  margin: var(--abstand-m) 0 0;
  padding: 9px 14px 9px 30px;
  border: 1px solid var(--warn-rand);
  border-radius: var(--radius-s);
  background: var(--warn-hell);
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.55;
}

.ebv-hinweise[hidden] { display: none; }

.ebv-vorschau-fehler {
  margin: var(--abstand-s) 0 0;
  font-size: 12.5px;
  color: var(--text-grau);
}

.ebv-vorschau-fehler[hidden] { display: none; }

/* ---------------- Was gilt wofuer ---------------- */

.ebv-regeln {
  display: grid;
  gap: var(--abstand-s);
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-mittel);
}

.ebv-regeln strong { color: var(--text); }

/* ---------------- Schmale Bildschirme ---------------- */

@media (max-width: 600px) {
  .ebv-farbfelder { grid-template-columns: minmax(0, 1fr); }
  .ebv-hex { max-width: none; }
  .ebv-kopf { padding: 8px 10px; gap: 8px; }
  .ebv-kopf-logo { max-width: 130px; height: 34px; padding: 3px 5px; }
}
