/* Wiener Solutions App — Oberfläche.
 *
 * Eine Arbeitsoberfläche, kein Marketing-Auftritt: editorial und ruhig, näher
 * an einem gut gesetzten Dokument als an einer Startup-Landingpage. Deshalb
 * viel Weißraum, wenige Linien, keine Effekte, die Aufmerksamkeit kosten.
 *
 * Animationen gibt es an genau zwei Stellen: beim Seitenwechsel ein sehr kurzes
 * Aufblenden, und in der Simulation, wo die Abfolge der Punkt ist. Alles andere
 * wäre im Videocall Ablenkung. `prefers-reduced-motion` schaltet beides ab.
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--text);
  font-family: var(--schrift);
  font-size: var(--gr-basis);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Zahlen springen nicht. Ohne das wandern die Spalten in jeder Tabelle beim
   Filtern um ein paar Pixel und das Ganze sieht nach Bastelei aus. */
table, .zahl, .betrag, input[type="number"], .kennzahl-wert, .tag-nr {
  font-variant-numeric: tabular-nums;
}

a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3 { margin: 0; font-weight: 500; }

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

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--papier);
  border-bottom: 1px solid var(--linie);
}

.topbar-inner {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 20px;
}

/* Das Logo des Betriebs zuerst. Er soll seine eigene Marke sehen, bevor er
   irgendetwas anderes registriert. */
.betrieb { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Höhe fest, Breite frei. Ein Kundenlogo hat irgendein Seitenverhältnis — das
   Dizman-Logo ist 2,3:1 und wäre in einem 42×42-Kasten 42×18 groß, also
   unleserlich. Kein Rahmen und kein Hintergrund: das Logo bringt seinen eigenen
   mit, und ein weißer Kasten auf dem warmen Papierton sieht aus wie ein
   Ladefehler. */
.betrieb-logo {
  height: 42px; width: auto; max-width: 210px; flex: none;
  object-fit: contain; object-position: left center;
  display: block;
}

/* Ohne hochgeladenes Logo: Monogramm in der Akzentfarbe des Betriebs. Kein
   Platzhalterbild — ein leerer grauer Kasten sieht aus wie ein Ladefehler. */
.betrieb-mono {
  width: 42px; height: 42px; flex: none;
  border-radius: var(--radius-s);
  background: var(--akzent); color: var(--akzent-text);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 21px; letter-spacing: .01em;
}

.betrieb-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; }
.betrieb-zeile { color: var(--text-schwach); font-size: var(--gr-mikro); line-height: 1.3; }

.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }

/* Die Flows stehen als eigene Punkte in der Navigation: der Kunde soll oben
   ablesen können, was sein System alles für ihn tut. */
.nav a {
  padding: 8px 13px;
  border-radius: var(--radius-s);
  color: var(--text-mittel);
  font-size: var(--gr-klein); font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.nav a:hover { background: var(--flaeche-3); color: var(--text); }
.nav a.aktiv { background: var(--text); color: var(--papier); }

.topbar-ende { display: flex; align-items: center; gap: 8px; }

.angemeldet {
  font-size: var(--gr-mikro); color: var(--text-schwach);
  padding: 6px 11px; border-radius: 999px; background: var(--flaeche-2);
  border: 1px solid var(--linie); white-space: nowrap;
}

/* Live-Hinweis: nur wenn der Demo-Modus AUS ist. Dann aber unübersehbar. */
.live-hinweis {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--st-faellig-bg);
  color: var(--st-faellig);
  border: 1px solid color-mix(in oklab, var(--st-faellig) 30%, transparent);
  font-size: var(--gr-mikro); font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase;
}
.live-punkt { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ================================================================ Seite === */

.shell { max-width: var(--breite); margin: 0 auto; padding: 28px 24px 96px; }

.seiten-kopf { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.seiten-kopf > div:first-child { min-width: 0; }

/* Serifen-Überschrift, groß. Der wichtigste einzelne Griff, der die App vom
   Standard-SaaS-Look wegzieht. */
h1.titel {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.05; letter-spacing: -.015em;
  font-weight: 400;
}
.untertitel { color: var(--text-schwach); font-size: var(--gr-klein); margin-top: 6px; max-width: 62ch; }

.kopf-aktionen { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.seiten-wechsel { animation: auf .16s ease-out; }
@keyframes auf { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =========================================================== Kennzahlen === */

.kennzahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--linie);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.kennzahl { background: var(--flaeche); padding: 18px 20px 16px; }
.kennzahl-titel {
  font-size: var(--gr-mikro); font-weight: 500;
  color: var(--text-schwach);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px;
}
.kennzahl-wert {
  font-family: var(--serif); font-weight: 400;
  font-size: 34px; line-height: 1; letter-spacing: -.01em;
}
.kennzahl-wert.klein { font-size: 27px; }
.kennzahl-zusatz { margin-top: 7px; font-size: var(--gr-mikro); color: var(--text-schwach); }
.kennzahl.warnung .kennzahl-wert { color: var(--st-faellig); }

/* =============================================================== Karten === */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.karte + .karte { margin-top: 20px; }

.karte-kopf {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--linie);
}
.karte-kopf h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.karte-kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.karte-koerper { padding: 20px; }
.karte-hinweis { padding: 12px 20px; border-top: 1px solid var(--linie); font-size: var(--gr-mikro); color: var(--text-schwach); }

.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.spalten-2-1 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .spalten, .spalten-2-1 { grid-template-columns: 1fr; } }

/* ============================================================= Tabellen === */

.tabelle-huelle { overflow-x: auto; }

table.liste { width: 100%; border-collapse: collapse; font-size: var(--gr-klein); }

table.liste th {
  text-align: left; font-weight: 500;
  font-size: var(--gr-mikro); letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-schwach);
  padding: 11px 14px;
  background: var(--flaeche-2);
  border-bottom: 1px solid var(--linie);
  white-space: nowrap;
}
table.liste th.sortierbar { cursor: pointer; user-select: none; }
table.liste th.sortierbar:hover { color: var(--text); }
table.liste th .pfeil { opacity: .45; margin-left: 4px; }

table.liste td { padding: 12px 14px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
table.liste tbody tr:last-child td { border-bottom: 0; }
table.liste tbody tr.klickbar { cursor: pointer; }
table.liste tbody tr.klickbar:hover td { background: var(--flaeche-2); }

/* Die Kundenspalte bekommt Platz. Ohne das bricht „Bauunternehmen Krause GmbH"
   auf drei Zeilen um und die Tabelle sieht gedrängt aus, obwohl daneben Luft ist. */
table.liste td:nth-child(2) { min-width: 200px; }

td.rechts, th.rechts { text-align: right; }
td.betrag { font-weight: 500; white-space: nowrap; }
.haupttext { font-weight: 500; }
.nebentext { color: var(--text-schwach); font-size: var(--gr-mikro); margin-top: 2px; }
.nummer { font-variant-numeric: tabular-nums; color: var(--text-mittel); white-space: nowrap; }

.leer { padding: 44px 20px; text-align: center; color: var(--text-schwach); }
.leer strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 5px; font-weight: 500; }

/* ============================================================== Status ==== */

.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: var(--gr-mikro); font-weight: 700; white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-entwurf     { color: var(--st-entwurf);   background: var(--st-entwurf-bg); }
.st-versendet,
.st-offen       { color: var(--st-offen);     background: var(--st-offen-bg); }
.st-ueberfaellig{ color: var(--st-faellig);   background: var(--st-faellig-bg); }
.st-bezahlt,
.st-angenommen  { color: var(--st-bezahlt);   background: var(--st-bezahlt-bg); }
.st-abgelehnt   { color: var(--st-abgelehnt); background: var(--st-abgelehnt-bg); }
.st-nachgefasst { color: var(--akzent);       background: var(--akzent-zart); }

/* ============================================================== Filter ==== */

.filterzeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 13px 20px; border-bottom: 1px solid var(--linie); }

.chip {
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--linie-stark); background: var(--flaeche);
  color: var(--text-mittel); font-size: var(--gr-klein); font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chip:hover { background: var(--flaeche-2); }
.chip.aktiv { background: var(--text); color: var(--papier); border-color: var(--text); }
.chip .n { opacity: .6; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* ============================================================= Buttons ==== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--linie-stark);
  background: var(--flaeche); color: var(--text);
  font-family: inherit; font-size: var(--gr-klein); font-weight: 500;
  cursor: pointer; white-space: nowrap;
  /* Ein <a class="btn"> ist ein Knopf und kein Fließtextlink — ohne das erbt er
     die Unterstreichung aus der a-Regel und sieht aus wie beides halb. */
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--flaeche-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn-primaer { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 700; }
.btn-primaer:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }

.btn-dunkel { background: var(--text); border-color: var(--text); color: var(--papier); font-weight: 700; }
.btn-dunkel:hover { background: #000; border-color: #000; }

.btn-schlicht { border-color: transparent; background: transparent; color: var(--text-mittel); }
.btn-schlicht:hover { background: var(--flaeche-3); color: var(--text); }

.btn-gefahr { color: var(--st-faellig); border-color: color-mix(in oklab, var(--st-faellig) 30%, var(--linie)); }
.btn-gefahr:hover { background: var(--st-faellig-bg); }

/* Zusage und Absage am Angebot. Bewusst in den gedeckten Statusfarben und nicht
   in Grün/Rot: die beiden stehen in einer Tabellenzeile neben Beträgen, und ein
   Ampelpaar dort zieht mehr Aufmerksamkeit auf sich als die Zahlen. */
.btn-ja { color: var(--st-bezahlt); border-color: color-mix(in oklab, var(--st-bezahlt) 32%, var(--linie)); }
.btn-ja:hover { background: var(--st-bezahlt-bg); }
.btn-nein { color: var(--st-abgelehnt); border-color: color-mix(in oklab, var(--st-abgelehnt) 28%, var(--linie)); }
.btn-nein:hover { background: var(--st-abgelehnt-bg); }

/* In der Liste stehen die beiden nebeneinander. */
table.liste td .btn-icon + .btn-icon { margin-left: 6px; }

.btn-gross { padding: 12px 22px; font-size: var(--gr-basis); }
.btn-klein { padding: 6px 11px; font-size: var(--gr-mikro); }

/* =============================================================== Formen === */

label.feld { display: block; margin-bottom: 14px; }
label.feld > span, .feld-titel {
  display: block; margin-bottom: 6px;
  font-size: var(--gr-mikro); font-weight: 500;
  color: var(--text-mittel); letter-spacing: .02em;
}

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], input[type="time"], input[type="url"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--linie-stark);
  border-radius: var(--radius-s);
  background: var(--flaeche);
  color: var(--text);
  font-family: inherit; font-size: var(--gr-klein);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px var(--akzent-hell);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6B64' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.feld-hinweis { margin-top: 5px; font-size: var(--gr-mikro); color: var(--text-schwach); line-height: 1.45; }

.feld-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.feld-reihe-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 720px) { .feld-reihe, .feld-reihe-3 { grid-template-columns: 1fr; } }

input[type="color"] {
  width: 46px; height: 38px; padding: 3px;
  border: 1px solid var(--linie-stark); border-radius: var(--radius-s);
  background: var(--flaeche); cursor: pointer;
}

/* ---- Schalter ---- */

.schalter { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.schalter input { position: absolute; opacity: 0; width: 0; height: 0; }
.schalter-spur {
  width: 42px; height: 24px; flex: none;
  border-radius: 999px; background: var(--flaeche-3);
  border: 1px solid var(--linie-stark);
  position: relative; transition: background .16s ease, border-color .16s ease;
}
.schalter-spur::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--flaeche); box-shadow: var(--schatten);
  transition: transform .16s ease;
}
.schalter input:checked + .schalter-spur { background: var(--akzent); border-color: var(--akzent); }
.schalter input:checked + .schalter-spur::after { transform: translateX(18px); }
.schalter input:focus-visible + .schalter-spur { box-shadow: 0 0 0 3px var(--akzent-hell); }
.schalter-text { font-size: var(--gr-klein); }

/* ---- Segmentierte Auswahl (Tonalität) ---- */

.segmente { display: inline-flex; padding: 3px; gap: 3px; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--radius-s); }
.segmente button {
  padding: 7px 14px; border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-mittel);
  font-family: inherit; font-size: var(--gr-klein); font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.segmente button:hover { color: var(--text); }
.segmente button.aktiv { background: var(--flaeche); color: var(--text); font-weight: 700; box-shadow: var(--schatten); }

/* ========================================================== Regelkarten === */

.regel { border-bottom: 1px solid var(--linie); }
.regel:last-child { border-bottom: 0; }
.regel.inaktiv { background: var(--flaeche-2); }
.regel.inaktiv .regel-vorschau { opacity: .5; }

.regel-kopf { display: flex; align-items: center; gap: 14px; padding: 15px 20px; flex-wrap: wrap; }
.regel-titel { font-weight: 700; font-size: 16px; }
.regel-ausloeser { color: var(--text-schwach); font-size: var(--gr-mikro); margin-top: 2px; }
.regel-stufe {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--flaeche-3); color: var(--text-mittel);
  display: grid; place-items: center;
  font-size: var(--gr-mikro); font-weight: 700;
}
.regel.an .regel-stufe { background: var(--akzent); color: var(--akzent-text); }

.regel-koerper { display: grid; grid-template-columns: 300px 1fr; gap: 0; border-top: 1px solid var(--linie); }
@media (max-width: 900px) { .regel-koerper { grid-template-columns: 1fr; } }

.regel-einstellungen { padding: 18px 20px; border-right: 1px solid var(--linie); }
@media (max-width: 900px) { .regel-einstellungen { border-right: 0; border-bottom: 1px solid var(--linie); } }

/* Die Vorschau steht direkt daneben und ändert sich beim Umschalten sofort —
   ohne Speichern, ohne Nachladen. Das ist die Anforderung, an der die ganze
   Seite hängt. */
.regel-vorschau { padding: 18px 22px; background: var(--flaeche-2); min-width: 0; }
.vorschau-kopf { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.vorschau-marke { font-size: var(--gr-mikro); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-schwach); }
.vorschau-an { font-size: var(--gr-mikro); color: var(--text-schwach); }

.vorschau-blatt {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-s);
  padding: 18px 20px;
}
.vorschau-betreff { font-weight: 700; margin-bottom: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--linie); }
.vorschau-text { white-space: pre-wrap; font-size: var(--gr-klein); line-height: 1.6; color: var(--text-mittel); }

/* ======================================================== Aktivitätsfeed === */

.feed { display: flex; flex-direction: column; }

.feed-eintrag { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--linie); }
.feed-eintrag:last-child { border-bottom: 0; }

/* Automatische Einträge sind der Punkt der ganzen Seite: hier begreift der
   Kunde, dass das Ding ohne ihn arbeitet. Deshalb bekommen sie die Akzentfarbe
   und die anderen bleiben grau. */
.feed-punkt { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 7px; background: var(--linie-stark); }
.feed-eintrag.auto .feed-punkt { background: var(--akzent); }

.feed-text { font-size: var(--gr-klein); line-height: 1.5; }
.feed-detail { color: var(--text-schwach); font-size: var(--gr-mikro); margin-top: 3px; }
.feed-zeit { margin-left: auto; color: var(--text-schwach); font-size: var(--gr-mikro); white-space: nowrap; padding-left: 12px; }
.feed-marke {
  display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 4px;
  background: var(--akzent-zart); color: var(--akzent);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  vertical-align: 1px;
}

/* ============================================================= Dokument === */

/* Die Dokumentvorschau im Look des Betriebs. Bewusst papiernah: weiße Fläche,
   ruhiges Raster, die Akzentfarbe nur als schmale Linie und in den Summen. Ein
   Angebot, das aussieht wie ein Angebot, überzeugt mehr als eines, das aussieht
   wie eine Web-App. */
.dokument {
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 42px 46px;
  box-shadow: var(--schatten-2);
  color: #1A1A18;
  font-size: 14px;
  line-height: 1.55;
}
@media (max-width: 720px) { .dokument { padding: 26px 22px; } }

.dok-kopf { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 22px; border-bottom: 2px solid var(--akzent); }
.dok-logo { max-height: 58px; max-width: 190px; object-fit: contain; }
.dok-mono { width: 54px; height: 54px; border-radius: 8px; background: var(--akzent); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 26px; }
.dok-absender { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--text-mittel); line-height: 1.5; }
.dok-absender strong { color: var(--text); font-size: 14px; display: block; margin-bottom: 3px; }

.dok-adresse { margin: 30px 0 26px; display: flex; gap: 24px; align-items: flex-start; }
.dok-empfaenger { line-height: 1.55; }
.dok-meta { margin-left: auto; text-align: right; font-size: 13px; color: var(--text-mittel); }
.dok-meta div { white-space: nowrap; }
.dok-meta b { color: var(--text); font-weight: 500; }

.dok-titel { font-family: var(--serif); font-size: 27px; line-height: 1.15; margin-bottom: 6px; }
.dok-betreff { font-weight: 700; margin-bottom: 18px; }
.dok-anrede { margin-bottom: 18px; }

table.dok-positionen { width: 100%; border-collapse: collapse; margin: 22px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.dok-positionen th {
  text-align: left; font-weight: 700; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-mittel);
  padding: 8px 10px; border-bottom: 1px solid var(--linie-stark);
}
table.dok-positionen td { padding: 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.dok-positionen .pos-nr { color: var(--text-schwach); width: 30px; }
table.dok-positionen .pos-be { color: var(--text-schwach); font-size: 12.5px; margin-top: 2px; }

.dok-summen { margin-top: 18px; margin-left: auto; width: min(320px, 100%); font-variant-numeric: tabular-nums; }
.dok-summen div { display: flex; justify-content: space-between; padding: 5px 10px; font-size: 13.5px; }
.dok-summen .gesamt {
  margin-top: 6px; padding: 11px 10px;
  border-top: 2px solid var(--akzent);
  font-weight: 700; font-size: 17px;
}
.dok-fuss { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--linie); font-size: 11.5px; color: var(--text-schwach); display: flex; gap: 26px; flex-wrap: wrap; }
.dok-fuss div { flex: 1 1 150px; }
.dok-fuss b { display: block; color: var(--text-mittel); font-weight: 500; margin-bottom: 2px; }

/* ------- Positionseditor ------- */

table.pos-editor { width: 100%; border-collapse: collapse; font-size: var(--gr-klein); }
table.pos-editor th {
  text-align: left; font-size: var(--gr-mikro); font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-schwach);
  padding: 8px 6px;
}
table.pos-editor td { padding: 4px 6px; vertical-align: top; }
table.pos-editor input { padding: 7px 9px; }
/* Beim Auswahlfeld muss rechts Platz für den Pfeil bleiben — die knappere
   Zellen-Polsterung oben würde ihn sonst über den Text legen. */
table.pos-editor select { padding: 7px 26px 7px 9px; background-position: right 8px center; }
table.pos-editor .sp-menge { width: 84px; }
table.pos-editor .sp-einheit { width: 108px; }
table.pos-editor .sp-preis { width: 108px; }
/* Mengen- und Preisfelder ohne Spinner: die Pfeilchen fressen die halbe
   Feldbreite und niemand klickt eine Quadratmeterzahl hoch. */
table.pos-editor input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
table.pos-editor input[type="number"]::-webkit-outer-spin-button,
table.pos-editor input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }
table.pos-editor .sp-summe { width: 118px; text-align: right; padding-top: 14px; font-weight: 500; white-space: nowrap; }
table.pos-editor .sp-weg { width: 34px; }

.katalog-waehler { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Auswahlfeld mit einem Knopf daneben — Kunde wählen oder gleich anlegen. */
.mit-knopf { display: flex; gap: 8px; align-items: stretch; }
.mit-knopf select { flex: 1; min-width: 0; }
.btn-icon { padding: 0; width: 38px; flex: none; }

/* ------- Verlauf am Beleg ------- */

.verlauf { border-top: 1px solid var(--linie); }
.verlauf-zeile { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.verlauf-zeile:last-child { border-bottom: 0; }
.verlauf-punkt { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 7px; background: var(--linie-stark); }
.verlauf-zeile.auto .verlauf-punkt { background: var(--akzent); }
.verlauf-text { font-size: var(--gr-klein); line-height: 1.45; }
.verlauf-detail { color: var(--text-schwach); font-size: var(--gr-mikro); margin-top: 2px; }
.verlauf-link { display: inline-block; margin-top: 3px; font-size: var(--gr-mikro); }
.verlauf-zeit { margin-left: auto; color: var(--text-schwach); font-size: var(--gr-mikro); white-space: nowrap; padding-left: 10px; }

/* ------- Vorlagenliste ------- */

.vorlagen-liste { border: 1px solid var(--linie); border-radius: var(--radius-s); overflow: hidden; }
.vorlagen-zeile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--linie); background: var(--flaeche);
}
.vorlagen-zeile:last-child { border-bottom: 0; }
.vorlagen-zeile:hover { background: var(--flaeche-2); }
.vorlagen-zeile > div:first-child { flex: 1; min-width: 0; }

/* =========================================================== Simulation === */

.sim-kopf { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.sim-fortschritt { flex: 1; min-width: 160px; height: 3px; background: var(--flaeche-3); border-radius: 999px; overflow: hidden; }
.sim-balken { height: 100%; background: var(--akzent); width: 0; transition: width .4s ease; }

.sim-lauf { padding: 8px 0; }

/* Ruhige, lesbare Abfolge mit Datumsstempel — eher wie ein Kontoauszug, der
   sich selbst schreibt, als wie ein Feuerwerk. */
.sim-schritt {
  display: grid; grid-template-columns: 96px 1fr; gap: 18px;
  padding: 16px 22px;
  position: relative;
  opacity: 0; transform: translateY(6px);
  transition: opacity .34s ease, transform .34s ease;
}
.sim-schritt.da { opacity: 1; transform: none; }

.sim-datum { text-align: right; padding-top: 1px; }
.tag-nr { font-family: var(--serif); font-size: 21px; line-height: 1; }
.sim-datum .kalender { font-size: var(--gr-mikro); color: var(--text-schwach); margin-top: 3px; }

/* Die durchgehende Linie macht aus Einzelmeldungen einen Ablauf. */
.sim-inhalt { border-left: 2px solid var(--linie); padding-left: 20px; padding-bottom: 4px; position: relative; }
.sim-inhalt::before {
  content: ''; position: absolute; left: -6px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--flaeche-2); border: 2px solid var(--linie-stark);
}
.sim-schritt.system .sim-inhalt::before { background: var(--akzent); border-color: var(--akzent); }
.sim-schritt.stille .sim-inhalt { border-left-style: dashed; }
.sim-schritt.stille .sim-titel { color: var(--text-schwach); }

.sim-titel { font-weight: 700; font-size: 16px; }
.sim-text { color: var(--text-mittel); font-size: var(--gr-klein); margin-top: 4px; }
.sim-auto {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 4px;
  background: var(--akzent-zart); color: var(--akzent);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  vertical-align: 2px;
}
.sim-nachricht {
  margin-top: 11px; padding: 13px 16px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-s);
}
.sim-nachricht .betreff { font-weight: 700; font-size: var(--gr-klein); margin-bottom: 7px; }
.sim-nachricht .text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; color: var(--text-mittel); }

/* ============================================================== Rechner === */

.rechner { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .rechner { grid-template-columns: 1fr; } }

.ergebnis-block { padding: 22px 24px; border-bottom: 1px solid var(--linie); }
.ergebnis-block:last-child { border-bottom: 0; }
.ergebnis-titel { font-size: var(--gr-mikro); text-transform: uppercase; letter-spacing: .06em; color: var(--text-schwach); margin-bottom: 10px; }
.ergebnis-zahl { font-family: var(--serif); font-size: 46px; line-height: 1; letter-spacing: -.015em; }
.ergebnis-zahl.mittel { font-size: 34px; }
.ergebnis-zahl.klein { font-size: 27px; color: var(--text-mittel); }
.ergebnis-erklaerung { margin-top: 10px; font-size: var(--gr-klein); color: var(--text-mittel); line-height: 1.55; max-width: 60ch; }
.ergebnis-rechenweg { margin-top: 8px; font-size: var(--gr-mikro); color: var(--text-schwach); font-variant-numeric: tabular-nums; }

.annahme { display: grid; grid-template-columns: 1fr 118px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--linie); }
.annahme:last-child { border-bottom: 0; }
.annahme label { font-size: var(--gr-klein); }
.annahme .dazu { display: block; color: var(--text-schwach); font-size: var(--gr-mikro); }

/* =============================================== Overlay, Modal, Drawer === */

.schirm {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(26, 26, 24, .34);
  display: flex; justify-content: flex-end;
  animation: einblenden .14s ease-out;
}
.schirm.mitte { align-items: center; justify-content: center; padding: 24px; }
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }

.schublade {
  background: var(--papier); width: min(760px, 100%); height: 100%;
  display: flex; flex-direction: column;
  box-shadow: var(--schatten-3);
  animation: rein .2s cubic-bezier(.22,.61,.36,1);
}
@keyframes rein { from { transform: translateX(24px); opacity: .7; } to { transform: none; opacity: 1; } }

.dialog {
  background: var(--papier); width: min(560px, 100%);
  max-height: 90vh; display: flex; flex-direction: column;
  border-radius: var(--radius); box-shadow: var(--schatten-3);
}
.dialog.breit { width: min(1080px, 100%); }

/* Der Beleg-Editor läuft auf Vollbild: links der Positionseditor, rechts das
   Dokument, und beides will Platz. Im zentrierten Kasten blieb auf einem
   geteilten 13-Zoll-Bildschirm eine Spalte für die Bezeichnung und eine für
   alles andere übrig. */
.dialog.voll {
  width: 100%; max-width: none;
  height: 100%; max-height: none;
  border-radius: 0;
}
.schirm.mitte:has(.dialog.voll) { padding: 0; }

.schublade-kopf, .dialog-kopf {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; border-bottom: 1px solid var(--linie);
}
.schublade-kopf h2, .dialog-kopf h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.schublade-kopf .rechts, .dialog-kopf .rechts { margin-left: auto; display: flex; gap: 8px; }
.schublade-koerper, .dialog-koerper { padding: 22px; overflow-y: auto; flex: 1; }
.schublade-fuss, .dialog-fuss {
  padding: 14px 22px; border-top: 1px solid var(--linie);
  display: flex; gap: 8px; align-items: center; background: var(--flaeche-2);
}
.dialog-fuss .rechts, .schublade-fuss .rechts { margin-left: auto; display: flex; gap: 8px; }

.x-knopf {
  width: 32px; height: 32px; flex: none;
  border: 0; background: transparent; border-radius: var(--radius-xs);
  cursor: pointer; color: var(--text-schwach); font-size: 17px; line-height: 1;
}
.x-knopf:hover { background: var(--flaeche-3); color: var(--text); }

/* =============================================================== Toasts === */

/* `pointer-events: none` ist hier nicht Kosmetik: die Meldung erscheint unten
   mittig und liegt damit genau über der Fußzeile eines offenen Dialogs. Ohne das
   schluckte sie drei Sekunden lang jeden Klick auf die Knöpfe darunter — wer
   nach „Angebot versendet" gleich auf „Angenommen" klickte, löste nichts aus und
   sah auch nicht, warum. Zum Anklicken gibt es in einem Toast ohnehin nichts. */
.toasts {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-s);
  background: var(--text); color: var(--papier);
  font-size: var(--gr-klein); font-weight: 500;
  box-shadow: var(--schatten-3);
  animation: rauf .18s ease-out;
}
.toast.fehler { background: var(--st-faellig); }
@keyframes rauf { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================ Sonstiges === */

.hinweisbox {
  padding: 14px 18px; border-radius: var(--radius-s);
  background: var(--akzent-zart);
  border: 1px solid var(--akzent-linie);
  font-size: var(--gr-klein); line-height: 1.55; color: var(--text-mittel);
}
.hinweisbox b { color: var(--text); }
.hinweisbox.ernst { background: var(--st-faellig-bg); border-color: color-mix(in oklab, var(--st-faellig) 26%, transparent); }
.hinweisbox.ruhig { background: var(--flaeche-2); border-color: var(--linie); }

.einstellungs-gruppe + .einstellungs-gruppe { margin-top: 20px; }

/* Die beiden Gesprächswerkzeuge unten im Demo-Kasten. */
.demo-werkzeuge {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--linie);
}

.abschnitt-titel {
  font-family: var(--serif); font-size: 23px; font-weight: 400;
  margin: 34px 0 14px; letter-spacing: -.01em;
}
.abschnitt-titel:first-child { margin-top: 0; }

.dienst-zeile { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.dienst-zeile:last-child { border-bottom: 0; }
.dienst-name { font-weight: 500; min-width: 210px; }
.dienst-wert { flex: 1; min-width: 220px; }
.maskiert { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--gr-klein); color: var(--text-mittel); letter-spacing: .02em; }

/* Die Demo-Kennzeichnung bleibt dezent — ein Vermerk in der Fußzeile, kein
   Banner. Der Kunde soll sein System sehen; dass es Beispieldaten sind, sage
   ich ihm im Gespräch selbst. */
.fusszeile {
  max-width: var(--breite); margin: 0 auto;
  padding: 20px 24px 34px;
  color: var(--text-schwach); font-size: var(--gr-mikro);
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--linie);
}
.fusszeile .rechts { margin-left: auto; }

/* Standardhinweise, die im Gespräch immer kommen (DSGVO, Serverstandort) —
   stehen direkt in der App, nicht im Verkaufsgespräch nachgereicht. */
.dsgvo { font-size: var(--gr-mikro); color: var(--text-schwach); line-height: 1.55; max-width: 68ch; }

/* ================================================================ Login === */

.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-karte { width: min(400px, 100%); }
.login-marke { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; justify-content: center; }
.login-marke img { width: 40px; height: 40px; border-radius: var(--radius-s); }
.login-marke span { font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.login-fehler { margin-top: 12px; color: var(--st-faellig); font-size: var(--gr-klein); min-height: 20px; }

/* ================================================================ Druck === */

@media print {
  .topbar, .nav, .kopf-aktionen, .fusszeile, .karte-kopf .rechts, .btn, .toasts { display: none !important; }
  body { background: #fff; }
  .shell { padding: 0; max-width: none; }
  .dokument { border: 0; box-shadow: none; padding: 0; }
  .schirm { position: static; background: none; display: block; }
  .dialog, .schublade { box-shadow: none; width: auto; max-height: none; }
  .dialog-kopf, .dialog-fuss, .schublade-kopf, .schublade-fuss { display: none; }
  .dialog-koerper, .schublade-koerper { overflow: visible; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .sim-schritt { opacity: 1; transform: none; }
}
