/* ==========================================================================
   ACQUA MORELLI Vertriebskalkulation – Gestaltung nach MBG Corporate Design
   ========================================================================== */

:root {
  --monza:        #CE0538;
  --monza-dunkel: #A00429;
  --monza-hell:   #FDE7EC;
  --schwarz:      #0B0B0B;

  --flaeche:        #FFFFFF;
  --flaeche-2:      #F6F6F7;
  --flaeche-3:      #EDEDEF;
  --flaeche-kopf:   #0B0B0B;
  --text:           #16161A;
  --text-leise:     #6A6A75;
  --text-invers:    #FFFFFF;
  --linie:          #DFDFE4;
  --linie-stark:    #B9B9C2;

  --gruen:      #0B7A4B;
  --gruen-hell: #E8F5EE;
  --rot:        #C01126;
  --rot-hell:   #FDECEE;

  --feld:        #FFFFFF;
  --feld-rand:   #D4D4DB;
  --feld-fokus:  var(--monza);
  --abgeleitet:  #F2F4F8;

  --schrift-kopf: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --schrift-text: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --schrift-zahl: 'IBM Plex Mono', 'Consolas', ui-monospace, monospace;

  --radius: 6px;
  --schatten: 0 1px 2px rgba(11, 11, 11, .06), 0 4px 14px rgba(11, 11, 11, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --flaeche:      #141417;
    --flaeche-2:    #1C1C21;
    --flaeche-3:    #24242B;
    --flaeche-kopf: #000000;
    --text:         #F2F2F4;
    --text-leise:   #9A9AA6;
    --linie:        #2E2E36;
    --linie-stark:  #43434F;
    --feld:         #1C1C21;
    --feld-rand:    #3A3A44;
    --abgeleitet:   #202027;
    --monza-hell:   #3A0A18;
    --gruen:        #4ADE9B;
    --gruen-hell:   #0E2A1E;
    --rot:          #FF6B7E;
    --rot-hell:     #33131A;
  }
}
:root[data-theme="dark"] {
  --flaeche:      #141417;
  --flaeche-2:    #1C1C21;
  --flaeche-3:    #24242B;
  --flaeche-kopf: #000000;
  --text:         #F2F2F4;
  --text-leise:   #9A9AA6;
  --linie:        #2E2E36;
  --linie-stark:  #43434F;
  --feld:         #1C1C21;
  --feld-rand:    #3A3A44;
  --abgeleitet:   #202027;
  --monza-hell:   #3A0A18;
  --gruen:        #4ADE9B;
  --gruen-hell:   #0E2A1E;
  --rot:          #FF6B7E;
  --rot-hell:     #33131A;
}

* { box-sizing: border-box; }

/* Muss den Layout-Regeln von .leiste und .ansicht vorgehen. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--flaeche-2);
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--schrift-kopf); font-weight: 700; letter-spacing: -.01em; margin: 0; }

/* --- Kopfbereich ---------------------------------------------------------- */
/* Die Brandbar bleibt in beiden Farbmodi hell: Das Lockup ist durchgehend
   Monza-Rot, auf schwarzem Grund käme der Claim auf ein Kontrastverhältnis
   von nur 3,5:1 und wäre kaum zu lesen. Die lokal gesetzten Variablen sorgen
   dafür, dass Knöpfe und Umschalter im Kopf dem hellen Grund folgen, auch
   wenn der Rest der Anwendung im Dunkelmodus läuft. */
.kopf {
  background: #FFFFFF;
  color: #16161A;
  --text: #16161A;
  --text-leise: #6A6A75;
  --feld: #FFFFFF;
  --feld-rand: #D4D4DB;
  --linie-stark: #B9B9C2;
  --flaeche-3: #EDEDEF;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--monza);
}
/* Das Lockup steht freigestellt auf der Brandbar – transparenter Hintergrund,
   keine eingebrannte Fläche. Es ist rund doppelt so breit wie hoch. */
.kopf__logo {
  height: 56px; width: auto; display: block; flex: 0 0 auto;
}
.kopf__titel { font-size: 19px; line-height: 1.25; color: #0B0B0B; }
.kopf__titel span { display: block; font-family: var(--schrift-text); font-weight: 400; font-size: 12px; color: #6A6A75; letter-spacing: .02em; margin-top: 3px; }
.kopf__rechts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Reiter --------------------------------------------------------------- */
.reiter {
  display: flex;
  gap: 2px;
  background: var(--flaeche-kopf);
  padding: 0 24px;
  border-bottom: 1px solid var(--linie);
}
.reiter button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9A9AA6;
  font-family: var(--schrift-kopf);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.reiter button:hover { color: #FFF; }
.reiter button[aria-selected="true"] { color: #FFF; border-bottom-color: var(--monza); }

/* --- Werkzeugleiste ------------------------------------------------------- */
.leiste {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky;
  top: 0;
  z-index: 40;
}
.leiste__gruppe { display: flex; align-items: center; gap: 7px; }
.leiste__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); font-weight: 600; }

.knopf {
  appearance: none;
  font-family: var(--schrift-text);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--feld-rand);
  background: var(--feld);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.knopf:hover { border-color: var(--linie-stark); background: var(--flaeche-3); }
.knopf--haupt { background: var(--monza); border-color: var(--monza); color: #FFF; }
.knopf--haupt:hover { background: var(--monza-dunkel); border-color: var(--monza-dunkel); }
.knopf--klein { font-size: 12px; padding: 4px 9px; }
.knopf--warn { color: var(--rot); border-color: var(--rot); background: transparent; }
.knopf--warn:hover { background: var(--rot-hell); }

/* Segmentierter Umschalter */
.segment { display: inline-flex; border: 1px solid var(--feld-rand); border-radius: var(--radius); overflow: hidden; background: var(--feld); }
.segment button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--schrift-text); font-size: 13px; font-weight: 600;
  padding: 6px 13px; color: var(--text-leise); border-right: 1px solid var(--feld-rand);
}
.segment button:last-child { border-right: 0; }
.segment button[aria-pressed="true"] { background: var(--monza); color: #FFF; }
.segment button:not([aria-pressed="true"]):hover { background: var(--flaeche-3); color: var(--text); }

/* Prozenteingabe in der Werkzeugleiste, etwa die Absatzabschmelzung. */
.prozentfeld {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--feld-rand); border-radius: var(--radius);
  background: var(--feld); padding: 0 9px 0 0;
}
.prozentfeld:focus-within { border-color: var(--monza); box-shadow: 0 0 0 2px var(--monza-hell); }
.prozentfeld input {
  width: 62px; border: 0; background: transparent; color: var(--text);
  font-family: var(--schrift-zahl); font-size: 13px; font-variant-numeric: tabular-nums;
  text-align: right; padding: 6px 2px 6px 9px;
}
.prozentfeld input:focus { outline: none; }
.prozentfeld span { font-family: var(--schrift-zahl); font-size: 12px; color: var(--text-leise); }
.prozentfeld.aktiv input { font-weight: 600; }
.prozentfeld.aktiv--minus { border-color: var(--rot); background: var(--rot-hell); }
.prozentfeld.aktiv--minus input { color: var(--rot); }
.prozentfeld.aktiv--plus { border-color: var(--gruen); background: var(--gruen-hell); }
.prozentfeld.aktiv--plus input { color: var(--gruen); }

.schalter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.schalter input { accent-color: var(--monza); width: 15px; height: 15px; cursor: pointer; }

/* --- Inhaltsbereich ------------------------------------------------------- */
.inhalt { padding: 18px 24px 60px; }
.ansicht[hidden] { display: none; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  margin-bottom: 18px;
  overflow: hidden;
}
.karte__kopf {
  padding: 12px 16px;
  border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--flaeche);
}
.karte__kopf h2 { font-size: 14px; letter-spacing: .01em; }
.karte__kopf p { margin: 0; font-size: 12px; color: var(--text-leise); }

/* --- Tabellen ------------------------------------------------------------- */
.tabellenrahmen { overflow: auto; max-width: 100%; }

table.kalk { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
table.kalk th, table.kalk td { border-bottom: 1px solid var(--linie); padding: 0; text-align: right; white-space: nowrap; }

table.kalk thead th {
  position: sticky; top: 0; z-index: 20;
  background: var(--flaeche); vertical-align: bottom;
  padding: 6px 10px; font-family: var(--schrift-kopf); font-size: 12px; font-weight: 700;
  border-bottom: 2px solid var(--linie-stark);
}
table.kalk thead th.gruppenkopf {
  text-align: center; background: var(--schwarz); color: #FFF;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--linie); padding: 5px 10px;
}
/* Spezifität muss "table.kalk th, table.kalk td" übertreffen, sonst
   erben die Beschriftungen die rechtsbündige Ausrichtung der Wertspalten. */
table.kalk th.zeilenkopf, table.kalk td.zeilenkopf {
  position: sticky; left: 0; z-index: 25;
  background: var(--flaeche);
  text-align: left; padding: 7px 14px 7px 16px;
  font-weight: 500; min-width: 290px; max-width: 290px;
  white-space: normal; line-height: 1.3;
  border-right: 1px solid var(--linie-stark);
}
thead th.zeilenkopf { z-index: 30; }

.produktkopf { line-height: 1.25; }
.produktkopf .art { display: block; font-family: var(--schrift-zahl); font-size: 11px; color: var(--monza); font-weight: 600; }
.produktkopf .gebinde { display: block; font-family: var(--schrift-text); font-size: 10px; color: var(--text-leise); font-weight: 400; margin-top: 2px; }

/* Zeilentypen */
tr.z-eingabe td.zeilenkopf { color: var(--text); }
tr.z-summe { background: var(--flaeche-3); }
tr.z-summe td.zeilenkopf { background: var(--flaeche-3); font-family: var(--schrift-kopf); font-weight: 700; }
tr.z-ergebnis { background: var(--monza-hell); }
tr.z-ergebnis td.zeilenkopf { background: var(--monza-hell); font-family: var(--schrift-kopf); font-weight: 700; color: var(--monza); }
tr.z-ergebnis td { border-top: 2px solid var(--monza); border-bottom: 2px solid var(--monza); }
tr.z-ergebnis td.zeilenkopf { border-top: 2px solid var(--monza); border-bottom: 2px solid var(--monza); }
tr.z-stamm { background: var(--flaeche-2); }
tr.z-stamm td.zeilenkopf { background: var(--flaeche-2); font-size: 12px; color: var(--text-leise); }
tr.abstand td { height: 9px; padding: 0; border-bottom: 0; background: var(--flaeche); }
tr.abstand td.zeilenkopf { background: var(--flaeche); }
tr.z-summe.basiszeile td { border-top: 1px solid var(--linie-stark); }

/* Zellen */
td.wert { padding: 0; }
input.zelle {
  width: 100%; min-width: 92px;
  border: 1px solid transparent; background: transparent;
  font-family: var(--schrift-zahl); font-size: 13px; font-variant-numeric: tabular-nums;
  text-align: right; padding: 7px 10px; color: inherit; border-radius: 3px;
}
input.zelle:hover { border-color: var(--feld-rand); background: var(--feld); }
input.zelle:focus { outline: none; border-color: var(--feld-fokus); background: var(--feld); box-shadow: 0 0 0 2px var(--monza-hell); position: relative; z-index: 5; }
input.zelle.abgeleitet { background: var(--abgeleitet); color: var(--text-leise); font-style: italic; }
input.zelle.abgeleitet:hover, input.zelle.abgeleitet:focus { background: var(--feld); color: var(--text); font-style: normal; }
input.zelle.geaendert { box-shadow: inset 3px 0 0 var(--monza); }

div.zelle {
  padding: 7px 10px; font-family: var(--schrift-zahl); font-size: 13px;
  font-variant-numeric: tabular-nums; min-width: 92px;
}
div.zelle.stark { font-weight: 600; }
.negativ { color: var(--rot); }
.positiv { color: var(--gruen); }

td.prozent div, td.prozent input {
  font-size: 11px; color: var(--text-leise); min-width: 62px; padding: 7px 8px;
  font-family: var(--schrift-zahl); text-align: right;
}
th.prozent { font-size: 10px !important; color: var(--text-leise); }

/* Preis- und Prozentspalte eines Artikels bilden einen Block. Die jeweils
   letzte Spalte des Blocks trägt den Abstand zum nächsten Artikel – als
   Rahmen in Kartenfarbe, damit auch Zeilenhintergründe dort aussetzen. */
table.kalk th.prozent,
table.kalk td.prozent,
table.kalk.ohne-prozent th.blockende,
table.kalk.ohne-prozent td.blockende { border-right: 1cm solid var(--flaeche); }

/* Am rechten Tabellenrand entsteht sonst nur überflüssiger Leerraum. */
table.kalk th.prozent:last-child,
table.kalk td.prozent:last-child,
table.kalk.ohne-prozent th.blockende:last-child,
table.kalk.ohne-prozent td.blockende:last-child { border-right: 0; }

/* Die Gruppenüberschrift läuft bewusst als durchgehender Balken über die
   Blöcke ihrer Gruppe hinweg. */
table.kalk thead th.gruppenkopf { border-right: 1cm solid var(--flaeche); }
table.kalk thead th.gruppenkopf:last-child { border-right: 0; }

/* --- P&L Tabelle ---------------------------------------------------------- */
table.guv { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.guv th, table.guv td { padding: 8px 12px; border-bottom: 1px solid var(--linie); text-align: right; white-space: nowrap; }
table.guv th { font-family: var(--schrift-kopf); font-size: 12px; font-weight: 700; background: var(--flaeche); position: sticky; top: 0; z-index: 10; border-bottom: 2px solid var(--linie-stark); }
table.guv th:first-child, table.guv td:first-child { text-align: left; white-space: normal; }
table.guv td.zahl { font-family: var(--schrift-zahl); font-variant-numeric: tabular-nums; }
table.guv tr.summe { background: var(--flaeche-3); font-weight: 700; }
table.guv tr.summe td { border-top: 1px solid var(--linie-stark); }
table.guv tr.ergebnis { background: var(--monza-hell); }
table.guv tr.ergebnis td { border-top: 2px solid var(--monza); border-bottom: 2px solid var(--monza); font-weight: 700; color: var(--monza); font-size: 14px; }
table.guv tbody tr:hover:not(.summe):not(.ergebnis) { background: var(--flaeche-2); }
table.guv input.menge {
  width: 130px; text-align: right; font-family: var(--schrift-zahl); font-size: 13px;
  padding: 6px 9px; border: 1px solid var(--feld-rand); border-radius: var(--radius);
  background: var(--feld); color: var(--text);
}
table.guv input.menge:focus { outline: none; border-color: var(--monza); box-shadow: 0 0 0 2px var(--monza-hell); }
table.guv input.text {
  width: 100%; padding: 6px 9px; border: 1px solid var(--feld-rand); border-radius: var(--radius);
  background: var(--feld); color: var(--text); font-family: var(--schrift-text); font-size: 13px;
}
table.guv input.text:focus { outline: none; border-color: var(--monza); box-shadow: 0 0 0 2px var(--monza-hell); }
.gruppenzeile td { background: var(--schwarz); color: #FFF; font-family: var(--schrift-kopf); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; }

/* --- Kennzahlenkacheln ---------------------------------------------------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--schatten); }
.kachel__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); font-weight: 600; }
.kachel__wert { font-family: var(--schrift-zahl); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 5px; letter-spacing: -.02em; }
.kachel__zusatz { font-size: 12px; color: var(--text-leise); margin-top: 3px; }
.kachel--haupt { border-color: var(--monza); border-left-width: 4px; }
.kachel--haupt .kachel__wert { color: var(--monza); }

/* --- Hinweise / Fußzeile -------------------------------------------------- */
.hinweis {
  background: var(--flaeche-3); border-left: 3px solid var(--monza);
  padding: 11px 14px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12.5px; color: var(--text-leise); margin-bottom: 16px;
}
.hinweis strong { color: var(--text); }
.hinweis--warnung { background: var(--monza-hell); border-left-color: var(--monza); color: var(--text); }
.hinweis--gut { background: var(--gruen-hell); border-left-color: var(--gruen); }
.fuss { padding: 20px 24px 40px; font-size: 11.5px; color: var(--text-leise); text-align: center; }
.fuss code { font-family: var(--schrift-zahl); background: var(--flaeche-3); padding: 1px 5px; border-radius: 3px; }

.legende { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-leise); padding: 10px 16px; border-top: 1px solid var(--linie); background: var(--flaeche-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid var(--feld-rand); display: inline-block; }
.legende i.i-eingabe { background: var(--feld); }
.legende i.i-abgeleitet { background: var(--abgeleitet); }
.legende i.i-summe { background: var(--flaeche-3); }
.legende i.i-ergebnis { background: var(--monza-hell); border-color: var(--monza); }

/* Meldung */
.meldung {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: var(--schwarz); color: #FFF; padding: 11px 20px; border-radius: var(--radius);
  font-size: 13px; box-shadow: 0 8px 28px rgba(0,0,0,.28); opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; z-index: 100; max-width: 90vw;
}
.meldung.sichtbar { opacity: 1; transform: translateX(-50%) translateY(0); }

.produktwahl { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Stände & Vergleich --------------------------------------------------- */
.auswahl {
  font-family: var(--schrift-text); font-size: 13px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--feld-rand); background: var(--feld); color: var(--text);
  max-width: 320px; cursor: pointer;
}
.auswahl:focus { outline: none; border-color: var(--monza); box-shadow: 0 0 0 2px var(--monza-hell); }

.reiter .zaehler {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 6px;
  border-radius: 9px; background: var(--monza); color: #FFF;
  font-family: var(--schrift-zahl); font-size: 10px; font-weight: 600; vertical-align: 1px;
}
.reiter .zaehler[data-leer="true"] { background: rgba(255,255,255,.18); color: #9A9AA6; }

/* Differenzspalten: Verbesserung grün, Verschlechterung rot. Da Kosten als
   negative Beträge geführt werden, stimmt die Richtung automatisch. */
td.diff { font-weight: 600; }
td.diff.besser { color: var(--gruen); }
td.diff.schlechter { color: var(--rot); }
td.diff.gleich { color: var(--text-leise); font-weight: 400; }

table.guv td.spalteA { background: var(--flaeche-2); }
table.guv th.spalteA { background: var(--flaeche-2); }
table.guv td.trenner, table.guv th.trenner { border-left: 1px solid var(--linie-stark); }

.standname {
  width: 100%; max-width: 260px; padding: 5px 9px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-family: var(--schrift-text); font-size: 13px; font-weight: 600;
}
.standname:hover { border-color: var(--feld-rand); background: var(--feld); }
.standname:focus { outline: none; border-color: var(--monza); background: var(--feld); box-shadow: 0 0 0 2px var(--monza-hell); }

.marke {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--flaeche-3); color: var(--text-leise); white-space: nowrap;
}
.marke--original { background: var(--monza-hell); color: var(--monza); }
.marke--aktuell { background: var(--gruen-hell); color: var(--gruen); }
.marke--freeze  { background: var(--flaeche-3); color: var(--text-leise); }

.leer {
  padding: 28px 16px; text-align: center; color: var(--text-leise); font-size: 13px;
}

/* --- Anmeldung ------------------------------------------------------------ */
.anmeldung {
  position: fixed; inset: 0; z-index: 200;
  background: var(--flaeche-2);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.anmeldung__karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-top: 3px solid var(--monza);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(11, 11, 11, .12);
  padding: 32px;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 8px;
}
.anmeldung__logo { height: 48px; width: auto; align-self: flex-start; margin-bottom: 14px; }
.anmeldung__karte h1 { font-family: var(--schrift-kopf); font-size: 19px; margin-bottom: 4px; }
.anmeldung__text { margin: 0 0 14px; font-size: 13px; color: var(--text-leise); line-height: 1.5; }
.anmeldung__karte label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-leise); font-weight: 600; margin-top: 8px;
}
.anmeldung__karte input {
  padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--feld-rand); background: var(--feld); color: var(--text);
  font-family: var(--schrift-text); font-size: 14px;
}
.anmeldung__karte input:focus {
  outline: none; border-color: var(--monza); box-shadow: 0 0 0 2px var(--monza-hell);
}
.anmeldung__karte button { margin-top: 18px; padding: 10px; font-size: 14px; }
.anmeldung__meldung {
  margin: 0 0 6px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--rot-hell); color: var(--rot);
  font-size: 13px; line-height: 1.45; border-left: 3px solid var(--rot);
}
.anmeldung__fuss { margin: 14px 0 0; font-size: 12px; color: var(--text-leise); text-align: center; }

/* Solange niemand angemeldet ist, bleibt die Anwendung dahinter verborgen. */
body.angemeldet-nein > .kopf,
body.angemeldet-nein > .reiter,
body.angemeldet-nein > .leiste,
body.angemeldet-nein > main,
body.angemeldet-nein > .fuss { filter: blur(6px); pointer-events: none; user-select: none; }

/* --- Angemeldete Person --------------------------------------------------- */
.benutzer { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.benutzer__name { font-family: var(--schrift-zahl); font-size: 12px; color: var(--text-leise); }

/* Ohne Bearbeitungsrecht: Eingaben sperren, statt sie still zu verwerfen. */
body.nur-lesen input.zelle,
body.nur-lesen input.menge,
body.nur-lesen input.text,
body.nur-lesen input.standname { pointer-events: none; opacity: .75; }
body.nur-lesen #btnFreeze,
body.nur-lesen #btnFreeze2,
body.nur-lesen #btnFreeze3,
body.nur-lesen #btnReset,
body.nur-lesen #btnImport { display: none; }

/* --- C-Level View --------------------------------------------------------
   Bewusst wenige Zahlen, große Typografie, kein Tabellenraster.            */
.clevel {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  max-width: 1080px;
  margin: 0 auto;
  overflow: hidden;
}
.clevel__kopf {
  padding: 26px 32px 22px;
  border-bottom: 1px solid var(--linie);
}
.clevel__kopf h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 18px; }

/* Muss Spalte für Spalte mit .kpi übereinstimmen – sonst steht die
   Überschrift nicht über den Zahlen, auf die sie sich bezieht. */
.clevel__staende {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 16px;
  align-items: end;
}
/* Ohne min-width: 0 wachsen Grid-Spalten mit ihrem längsten Wort mit. Ein
   langer Standname („21.09.2026, 20:06:48 Uhr — Preis auf 40cent …") würde
   seine Spalte dehnen und das ganze Raster gegenüber den Zahlen verschieben.
   Stattdessen bricht der Name um. */
.clevel__staende > * { min-width: 0; }
.clevel__stand { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; text-align: right; }
.clevel__stand .marke { align-self: flex-end; }
.clevel__stand strong {
  font-family: var(--schrift-kopf); font-size: 15px; margin-top: 4px;
  line-height: 1.3; overflow-wrap: anywhere; hyphens: auto;
}
.clevel__stand span:last-child {
  font-family: var(--schrift-zahl); font-size: 12px; color: var(--text-leise);
  overflow-wrap: anywhere;
}
.clevel__stand--delta { justify-content: flex-end; }
.clevel__pfeil {
  font-size: 12px; color: var(--text-leise); align-self: flex-end;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}

.kpi {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--linie);
}
.kpi:last-of-type { border-bottom: 0; }
.kpi--ergebnis { background: var(--monza-hell); border-top: 2px solid var(--monza); border-bottom: 0; }
.kpi__name { font-family: var(--schrift-kopf); font-size: 15px; font-weight: 700; }
.kpi__name small { display: block; font-family: var(--schrift-text); font-size: 11.5px; font-weight: 400; color: var(--text-leise); margin-top: 2px; }
.kpi__wert {
  font-family: var(--schrift-zahl); font-variant-numeric: tabular-nums;
  text-align: right; font-size: 21px; font-weight: 500; letter-spacing: -.02em;
}
.kpi__wert small { display: block; font-size: 11px; color: var(--text-leise); font-weight: 400; margin-top: 3px; letter-spacing: 0; }
.kpi__wert--basis { color: var(--text-leise); font-weight: 400; }
.kpi--ergebnis .kpi__wert { font-size: 26px; font-weight: 600; }
.kpi--ergebnis .kpi__name { font-size: 17px; color: var(--monza); }

.kpi__delta {
  text-align: right;
  font-family: var(--schrift-zahl); font-variant-numeric: tabular-nums;
  font-size: 24px; font-weight: 600; letter-spacing: -.02em;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.kpi__delta small { font-size: 12px; font-weight: 400; color: var(--text-leise); letter-spacing: 0; }
.kpi__delta.besser { color: var(--gruen); }
.kpi__delta.schlechter { color: var(--rot); }
.kpi__delta.gleich { color: var(--text-leise); font-weight: 400; }

.clevel__fuss {
  margin: 0; padding: 16px 32px 20px;
  font-size: 12px; color: var(--text-leise);
  border-top: 1px solid var(--linie); background: var(--flaeche-2);
}

@media (max-width: 760px) {
  .kpi { grid-template-columns: 1fr 1fr; row-gap: 10px; padding: 16px 20px; }
  .kpi__name { grid-column: 1 / -1; }
  .clevel__kopf { padding: 20px; }
}

@media print {
  .kopf__rechts, .reiter, .leiste, .knopf { display: none !important; }
  /* Browser drucken Flächenfarben oft nicht – Kopfzeile auf hellen Grund
     umstellen, damit Titel und Signet lesbar bleiben. */
  .kopf { background: #FFF !important; color: #0B0B0B !important; padding: 0 0 8px; border-bottom: 2px solid var(--monza); }
  .kopf__titel span { color: #555 !important; }
  .kopf__logo { height: 38px; }
  body { background: #FFF; font-size: 10px; }
  .karte { box-shadow: none; page-break-inside: avoid; }
  .tabellenrahmen { overflow: visible; }
  input.zelle { border: 0 !important; background: transparent !important; }
  @page { size: A4 landscape; margin: 10mm; }
}
