/* ansichten.css — seitenspezifische Regeln: Start, Dashboard, Bestellungen, Anfragen,
   Lieferscheine, Liefertermine, Wareneingang, Stammdaten-Ansichten, Admin, /spec.
   Dritte von drei Dateien (SPEC 14.5). */
/* Dashboard */
section.dashboard { margin: 1rem 0 1.5rem 0; }
h2.dashboard-titel { font-size: 1em; color: var(--muted); font-weight: 600; margin: 0 0 0.5rem 0; text-transform: uppercase; letter-spacing: 0.5pt; }
.dashboard-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;
}
@media (min-width: 1100px) { .dashboard-grid { grid-template-columns: repeat(4, 1fr); } }
/* Anfrage-Dashboard hat drei Kacheln — ohne Modifier bliebe die vierte Spalte leer */
@media (min-width: 1100px) { .dashboard-grid.drei { grid-template-columns: repeat(3, 1fr); } }
.dashboard-kachel {
  background: var(--karte); border: 1px solid var(--rand);
  padding: 0.75rem; min-height: 160px;
}
.dashboard-kachel h3 {
  margin: 0 0 0.5rem 0; font-size: 0.85em; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5pt;
}

/* Torte */
.torte { display: flex; gap: 0.75rem; align-items: center; }
.torte svg { flex-shrink: 0; }
.torte-legende { list-style: none; padding: 0; margin: 0; font-size: 0.85em; flex: 1; }
.torte-legende li { display: flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0; }
.farbmarker { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.torte-legende .name { flex: 1; }
.torte-legende .wert { color: var(--muted); }

/* Horizontale Balken (Top-Lieferanten) */
.balken-liste { display: flex; flex-direction: column; gap: 0.4rem; }
.balken-zeile { display: grid; grid-template-columns: 1fr 3fr auto; gap: 0.4rem; align-items: center; font-size: 0.85em; }
.balken-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balken-bar-hg { background: #f0f0f0; height: 12px; border-radius: 2px; overflow: hidden; }
.balken-bar { height: 100%; }
.balken-wert { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Vertikale Monatsbalken */
.monatsbalken {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px;
  height: 130px; align-items: end;
}
.monat { display: flex; flex-direction: column; align-items: center; height: 100%; font-size: 0.7em; }
.monat-bar-hg { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.monat-bar { width: 100%; background: #1f4a8a; min-height: 1px; }
.monat-name { color: var(--muted); padding-top: 2px; }
.monat-wert { color: var(--muted); font-size: 0.85em; }

/* Statusbalken am Zeilenanfang der Bestellübersicht. 13px statt 3px — der
   schmale Streifen war kaum zu erkennen. Die transparente Grundregel sorgt
   dafür, dass „offen"-Zeilen dieselbe Einrückung haben und die erste Spalte
   nicht je nach Status springt. Nur Zeilen mit Status-Klasse, damit andere
   .uebersicht-Tabellen (Lieferanten, Benutzer) unverändert bleiben. */
.uebersicht tr[class*="status-"] td:first-child { border-left: 13px solid transparent; }
.uebersicht tr.status-ueberfaellig td:first-child { border-left-color: var(--ueberfaellig-fg); }
.uebersicht tr.status-teilgeliefert td:first-child { border-left-color: #1f4a8a; }
.uebersicht tr.status-erledigt td:first-child { border-left-color: var(--erledigt-fg); }

/* Anfrageübersicht: Kopfzeile je Anfrage, darunter je Unternehmen eine
   Unterzeile. Unterzeilen ohne obere Trennlinie, damit der Block zusammenhält;
   die Kopfzeile bekommt eine kräftigere Linie als Blockgrenze. */
.uebersicht tr.anfrage-kopf td { border-top: 2px solid var(--rand); vertical-align: top; }
.uebersicht tr.anfrage-unterzeile td { border-top: 1px dotted var(--rand); }
.uebersicht td.notiz { max-width: 18rem; color: var(--muted); font-size: 0.9em; }

.badge {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px;
  font-size: 0.85em; font-weight: 500;
}
.badge.status-entwurf { background: #fff; color: var(--muted); border: 1px dashed var(--muted); }
.badge.status-offen { background: var(--offen); color: var(--fg); }
.badge.status-ueberfaellig { background: var(--ueberfaellig-bg); color: var(--ueberfaellig-fg); }
.badge.status-teilgeliefert { background: #e0eaf5; color: #1f4a8a; }
.badge.status-erledigt { background: var(--erledigt-bg); color: var(--erledigt-fg); }
.badge.versand-fehlgeschlagen { background: var(--fehler-bg); color: var(--fehler-fg); }

section.kopf dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem;
  background: var(--karte); border: 1px solid var(--rand); padding: 1rem;
}
section.kopf dt { font-weight: 600; color: var(--muted); }
section.kopf dd { margin: 0; }

/* Reiter für Termin-Ansichten */
.reiter { display: flex; gap: 0.25rem; margin: 1rem 0 0.5rem; border-bottom: 1px solid var(--rand); }
.reiter a {
  padding: 0.4rem 1rem; text-decoration: none;
  color: var(--muted); border: 1px solid transparent; border-bottom: none;
  border-radius: 4px 4px 0 0; background: transparent;
}
.reiter a:hover { color: var(--fg); background: #f0f0f0; }
.reiter a.aktiv {
  color: var(--fg); background: var(--karte);
  border-color: var(--rand); border-bottom: 1px solid var(--karte);
  margin-bottom: -1px; font-weight: 600;
}

form.filter label.checkbox { flex-direction: row; align-items: center; gap: 0.4rem; color: var(--fg); }

/* Termin-Liste */
.termine-block { margin-top: 1rem; }
.termine-block h2 { margin: 0.5rem 0; font-size: 1em; color: var(--muted); font-weight: 600; }
.termine-block.ueberfaellig h2 { color: var(--ueberfaellig-fg); }
.termine-block.ueberfaellig table.termine tr { background: var(--ueberfaellig-bg); }
table.termine small { color: var(--muted); }
table.termine tr.prio-terminkritisch td { border-left-color: #b06000; }

/* Feste Spaltenbreiten, damit alle KW-Blöcke bündig zueinander stehen */
table.termine { table-layout: fixed; }
table.termine th:nth-child(1), table.termine td:nth-child(1) { width: 10.5rem; } /* Termin + Pill */
table.termine th:nth-child(2), table.termine td:nth-child(2) { width: 18%; }     /* Lieferant */
table.termine th:nth-child(3), table.termine td:nth-child(3) { width: auto; }    /* Material (+ terminkritisch) */
table.termine th:nth-child(4), table.termine td:nth-child(4) { width: 6.5rem; }  /* Menge */
table.termine th:nth-child(5), table.termine td:nth-child(5) { width: 9rem; }    /* Bestellung */
table.termine th:nth-child(6), table.termine td:nth-child(6) { width: 7rem; }    /* Status */
table.termine th:nth-child(7), table.termine td:nth-child(7) { width: 9.5rem; }  /* Aktion */
table.termine td { overflow-wrap: anywhere; }
/* Lieferantenname einzeilig mit Ellipsis; voller Name via title-Tooltip
   und dem existierenden lieferant-hover-Popover erreichbar. */
table.termine td.lieferant-zelle,
table.termine td.material-zelle { overflow-wrap: normal; }
table.termine td.lieferant-zelle span.lieferant-hover,
table.termine td.material-zelle span {
  display: block; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.pill {
  display: inline-block; padding: 0.05rem 0.4rem; border-radius: 8px;
  font-size: 0.75em; margin-left: 0.25rem;
}
.pill.gefordert { background: #fbf1cc; color: #7a5a00; }
.pill.bestaetigt { background: #d8f0d8; color: var(--erledigt-fg); }
.pill.prio-terminkritisch { background: #ffe0b3; color: #7a3800; }

/* Zeitstrahl */
.zeitstrahl-scroll {
  overflow-x: scroll;
  background: var(--karte);
  border: 1px solid var(--rand);
  padding: 0.5rem;
  /* Explizite Scrollbar-Breite, damit sie unter macOS auch mit
     „Auto-hide" sichtbar bleibt. */
  scrollbar-width: auto;
}
.zeitstrahl { display: grid; column-gap: 0; row-gap: 2px; position: relative; min-width: max-content; }
.zs-ecke { background: #f0f0f0; padding: 0.3rem 0.5rem; font-weight: 600; border-bottom: 1px solid var(--rand); position: sticky; left: 0; z-index: 2; }
.zs-header {
  background: #f0f0f0; padding: 0.3rem 0.1rem; font-size: 0.75em; text-align: center;
  border-left: 1px solid var(--rand); border-bottom: 1px solid var(--rand);
  color: var(--muted);
}
.zs-header.zs-heute { background: #cfe0f5; color: var(--akzent); font-weight: 600; }
.zs-label {
  background: var(--karte); padding: 0.25rem 0.5rem; font-size: 0.85em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px dotted #eee; position: sticky; left: 0; z-index: 1;
}
.zs-balken {
  background: var(--akzent); border-radius: 3px;
  align-self: center; height: 12px; margin: 0 2px;
}
.zs-balken.zs-ueberfaellig { background: var(--ueberfaellig-fg); }
.zs-marker {
  align-self: center; justify-self: center;
  color: #f5b800; font-size: 1.15em; font-weight: 700;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
  z-index: 3; cursor: help;
}
.zs-balken { cursor: help; }
#zs-info {
  position: absolute; display: none; z-index: 300;
  background: #fffdf5; color: var(--fg);
  border: 1px solid var(--rand);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.75rem; font-size: 0.85em;
  min-width: 14rem; max-width: 22rem; pointer-events: none;
}
#zs-info dt { color: var(--muted); font-weight: 500; margin-top: 0.25rem; }
#zs-info dt:first-child { margin-top: 0; }
#zs-info dd { margin: 0 0 0.15rem 0; font-weight: 500; }
.zs-heutebalken {
  background: rgba(31, 74, 138, 0.08); border-left: 2px solid var(--akzent);
  align-self: stretch;
}

.zeitstrahl-legende { display: flex; gap: 0.75rem; margin-top: 0.5rem; font-size: 0.85em; color: var(--muted); }
.pill.zs-balken-legende { background: var(--akzent); color: #fff; }
.pill.zs-ueberfaellig-legende { background: var(--ueberfaellig-fg); color: #fff; }
.pill.zs-marker-legende { background: #f5e0c3; color: #7a3800; }
.pill.zs-heute-legende { background: #cfe0f5; color: var(--akzent); }

/* Kalender */
#kalender { background: var(--karte); border: 1px solid var(--rand); padding: 0.5rem; margin-top: 0.5rem; }
.kalender-event.ueberfaellig { background: var(--ueberfaellig-fg) !important; border-color: var(--ueberfaellig-fg) !important; }
.kalender-event.prio-terminkritisch { border-left: 3px solid #b06000 !important; }

/* Versand-Aktionen */
.versand-fehler {
  background: var(--fehler-bg); color: var(--fehler-fg); padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--fehler-fg);
}
.versand-fehler pre { white-space: pre-wrap; font-size: 0.85em; margin: 0.4rem 0; }
tr.versand-fehlgeschlagen { background: var(--fehler-bg); }
tr.versand-fehlgeschlagen td form.inline { display: inline-block; margin-left: 0.4rem; }

/* Stammdaten */
.stammdaten-kacheln { display: flex; gap: 1rem; margin-top: 1rem; }
.kachel {
  display: block; flex: 1; padding: 1rem; background: var(--karte);
  border: 1px solid var(--rand); text-decoration: none; color: var(--fg);
}
.kachel:hover { background: #f0f0f0; }
.kachel h2 { color: var(--akzent); margin: 0 0 0.5rem 0; }
.kachel p { margin: 0; color: var(--muted); }
tr.inaktiv { opacity: 0.55; }
/* Kontaktperson anlegen: schmale Felder, die sich der Fensterbreite anpassen —
   so viele Spalten wie Platz ist (min. 11rem je Feld), Rest bricht um. */
form.kontakt-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.5rem;
  padding: 0.75rem; background: var(--karte); border: 1px solid var(--rand); margin-top: 0.5rem;
  max-width: 64rem;
}
form.kontakt-form input { padding: 0.3rem; width: 100%; min-width: 0; }
form.kontakt-form .inline-checkbox {
  display: flex; align-items: center; gap: 0.3rem; grid-column: 1 / -2; white-space: nowrap;
}
form.kontakt-form .inline-checkbox input { width: auto; }
form.kontakt-form button { grid-column: -2; justify-self: end; }
form.anmelden { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
form.anmelden label { display: flex; flex-direction: column; font-size: 0.9em; color: var(--muted); }
form.anmelden input { padding: 0.4rem; }
form.anmelden button { align-self: flex-start; margin-top: 0.5rem; }

/* Wareneingang — breite Tabelle mit drei Aktionsknöpfen pro Zeile */
/* Wareneingangstabelle (26.08.2026 flexibel): Spalten nach Inhalt, Material
   nimmt den Rest; zwischen ~62rem und Kartenbreite scrollt der Wrapper
   horizontal statt Spalten übereinanderzuschieben; unter 900px Karten. */
.tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.we-liste { background: var(--karte); table-layout: auto; width: 100%; min-width: 56rem; }
table.we-liste th, table.we-liste td { padding: 0.55rem 0.45rem; vertical-align: middle; }
table.we-liste th { white-space: nowrap; }
table.we-liste td.lieferant-zelle strong, table.we-liste td.lieferant-zelle small { max-width: 11rem; }
table.we-liste th:nth-child(-n+4), table.we-liste td:nth-child(-n+4) { white-space: nowrap; width: 1%; }  /* Daten, Besteller: so schmal wie der Inhalt */
table.we-liste th:nth-child(5), table.we-liste td:nth-child(5) { min-width: 9rem; max-width: 14rem; }   /* Lieferant · Ref. */
table.we-liste th:nth-child(6), table.we-liste td:nth-child(6) { white-space: nowrap; width: 1%; }      /* Bestellpos. */
table.we-liste th:nth-child(7), table.we-liste td:nth-child(7) { min-width: 10rem; }                     /* Material: flexibel */
table.we-liste th:nth-child(8), table.we-liste td:nth-child(8) { white-space: nowrap; width: 1%; }      /* Menge */
table.we-liste th:nth-child(9), table.we-liste td:nth-child(9) { width: 1%; }                            /* Erfassen: Knöpfe bestimmen die Breite */
table.we-liste td.lieferant-zelle strong,
table.we-liste td.lieferant-zelle small {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.we-liste td.bestellpos-zelle a { font-size: 0.85em; }
table.we-liste tr.prio-terminkritisch td:first-child { border-left: 3px solid #b06000; }
table.we-liste tr.we-ueberfaellig { background: var(--ueberfaellig-bg); }
table.we-liste small { color: var(--muted); }
.nicht-bestaetigt {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px;
  background: var(--ueberfaellig-bg); color: var(--ueberfaellig-fg);
  font-size: 0.85em; font-weight: 500;
}

.we-aktionen-kopf { text-align: center; }
td.we-aktionen { text-align: right; white-space: nowrap; }
td.we-aktionen button.we-btn + button.we-btn { margin-left: 0.3rem; }
button.we-btn {
  border: none; color: #fff; cursor: pointer;
  padding: 0.4rem 0.7rem; font-size: 0.82em; font-weight: 500;
  border-radius: 4px; min-width: 0;
}
button.we-btn.we-io { background: #1a5a1a; }
button.we-btn.we-io:hover { background: #124712; }
button.we-btn.we-teil { background: #b06000; }
button.we-btn.we-teil:hover { background: #884800; }
button.we-btn.we-beanstandung { background: var(--ueberfaellig-fg); }
button.we-btn.we-beanstandung:hover { background: #750000; }

/* Wareneingang — Erfassungsdialog */
.we-modal-header.we-header-menge_abweichend { background: #b06000; }
.we-modal-header.we-header-beanstandung { background: var(--ueberfaellig-fg); }
.we-kontext {
  background: #f5f5f5; padding: 0.75rem 1rem; margin: 0.5rem 1rem;
  border-left: 3px solid var(--akzent);
}
form.we-form { padding: 0 1rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.we-feld { display: flex; flex-direction: column; font-size: 0.9em; color: var(--muted); }
.we-feld input, .we-feld textarea { padding: 0.5rem; font-size: 1em; }
.we-feld .hinweis { margin-top: 0.25rem; font-size: 0.85em; }

/* Event-Tooltip im Kalender */
#event-tooltip {
  display: none; position: absolute; z-index: 1000;
  background: var(--karte); color: var(--fg);
  border: 1px solid var(--rand); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.6rem 0.75rem; min-width: 280px; max-width: 360px;
  font-size: 0.85em; pointer-events: none;
}
#event-tooltip header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 0.3rem 0; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rand);
}
#event-tooltip header strong { color: var(--akzent); }
#event-tooltip .tt-pos { color: var(--muted); font-size: 0.9em; }
#event-tooltip .tt-titel { font-weight: 500; margin: 0.25rem 0 0.4rem 0; }
#event-tooltip .tt-badges { margin-bottom: 0.4rem; }
#event-tooltip dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 0.75rem;
  margin: 0;
}
#event-tooltip dt { color: var(--muted); }
#event-tooltip dd { margin: 0; }
#event-tooltip .tt-nummer { color: var(--muted); font-size: 0.9em; }
#event-tooltip footer {
  margin-top: 0.5rem; padding-top: 0.35rem; border-top: 1px solid var(--rand);
  color: var(--muted); font-size: 0.85em; font-style: italic;
}
.tt-badge {
  display: inline-block; padding: 0.05rem 0.4rem; border-radius: 8px;
  font-size: 0.8em; font-weight: 500;
}
.tt-badge.tt-wunsch { background: #eef; color: #446; }
.tt-badge.tt-bestaetigt { background: var(--erledigt-bg); color: var(--erledigt-fg); }
.tt-badge.tt-terminkritisch { background: #ffe0b3; color: #7a3800; }

/* Startseite (SPEC 2.1) — Nachfolger des Login-Overlays */
h1.start-gruss { color: var(--akzent); font-size: 1.7em; margin-bottom: 1rem; }
.start-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 64rem;
}
@media (min-width: 900px) {
  .start-grid { grid-template-columns: 3fr 2fr; }
  .start-spruch, .start-notizen, .start-diesel { grid-column: 1 / -1; }
}
.start-karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 6px;
  padding: 1.1rem 1.5rem 1.25rem;
}
.start-karte h2 {
  margin: 0 0 0.75rem 0;
  font-size: 0.85em; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--muted);
}
.start-aufgaben { font-size: 1.1em; }
.start-aufgaben ul { list-style: none; margin: 0; padding: 0; }
.start-aufgaben li { margin: 0.25rem 0; }
.start-aufgaben li a {
  display: block; padding: 0.35rem 0.5rem; margin: 0 -0.5rem;
  color: var(--fg); text-decoration: none; border-radius: 4px;
}
.start-aufgaben li a:hover { background: var(--bg); }
.start-aufgaben li a b { font-variant-numeric: tabular-nums; }
.start-aufgaben li.ueberfaellig a { color: var(--ueberfaellig-fg); font-weight: 500; }
.start-aufgaben .ok-text { margin: 0; color: var(--muted); }
.start-schnell { display: flex; flex-direction: column; gap: 0.5rem; }
.start-schnell h2 { margin-bottom: 0.25rem; }
.start-aktion {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; border: 1px solid var(--rand); border-radius: 4px;
  color: var(--fg); text-decoration: none; font-weight: 500;
}
.start-aktion:hover { border-color: var(--akzent); color: var(--akzent); }
.start-aktion svg {
  width: 18px; height: 18px; flex: none; color: var(--akzent);
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round;
}
body.nicht-produktiv .start-aktion svg { color: #a10000; }
.start-spruch blockquote { margin: 0; font-size: 1.15em; }
.start-spruch blockquote p { margin: 0 0 0.3rem 0; font-style: italic; }
.start-spruch blockquote footer {
  color: var(--muted); font-size: 0.85em;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.start-spruch .spruch-neu { font-style: normal; font-size: 0.95em; }

/* Release Notes „Neu im Portal" — HTML aus dem Trix-Editor im Admin-Panel */
.start-notizen h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 0.5rem; }
.start-notizen .inhalt { line-height: 1.5; }
.start-notizen .inhalt h1 { font-size: 1.05em; margin: 0.9rem 0 0.3rem; color: var(--akzent); }
.start-notizen .inhalt h1:first-child, .start-notizen .inhalt div:first-child { margin-top: 0; }
.start-notizen .inhalt ul, .start-notizen .inhalt ol { margin: 0.3rem 0 0.6rem; padding-left: 1.4rem; }
.start-notizen .inhalt li { margin: 0.15rem 0; }
.start-notizen .inhalt blockquote {
  margin: 0.5rem 0; padding: 0.2rem 0.9rem; border-left: 3px solid var(--rand); color: var(--muted);
}
.start-notizen .inhalt pre {
  background: var(--bg); padding: 0.5rem 0.75rem; border-radius: 4px; white-space: pre-wrap; font-size: 0.9em;
}
.start-notizen .inhalt a { color: var(--akzent); }

/* Trix-Editor im Admin-Panel */
.rn-feld { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.35rem; }
trix-toolbar .trix-button-group { margin-bottom: 0.4rem; }
/* Anhänge sind abgeschaltet; doppelte Klasse, weil trix.css nach style.css geladen wird */
trix-toolbar .trix-button-group.trix-button-group--file-tools { display: none; }
trix-editor.rn-editor {
  min-height: 22rem; padding: 0.75rem 1rem; background: #fff;
  border: 1px solid var(--rand); border-radius: 4px; line-height: 1.5;
}
trix-editor.rn-editor h1 { font-size: 1.15em; margin: 0.8rem 0 0.3rem; }

/* Link auf die Spezifikation unten rechts in „Neu im Portal“ */
.start-notizen .spec-link {
  display: block; text-align: right; margin-top: 0.75rem;
  font-size: 0.8em; color: var(--muted); text-decoration: none;
}
.start-notizen .spec-link:hover { color: var(--akzent); text-decoration: underline; }

/* Gerenderte SPEC.md (/spec) */
.markdown { max-width: 58rem; line-height: 1.55; }
.markdown h1 { font-size: 1.6em; }
.markdown h2 { font-size: 1.3em; margin-top: 2.2rem; padding-top: 0.6rem; border-top: 1px solid var(--rand); }
.markdown h3 { font-size: 1.08em; margin-top: 1.5rem; }
.markdown table { border-collapse: collapse; margin: 0.75rem 0; font-size: 0.92em; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--rand); padding: 0.3rem 0.55rem; vertical-align: top; text-align: left; }
.markdown th { background: var(--bg); }
.markdown pre { background: var(--bg); padding: 0.6rem 0.8rem; border-radius: 4px; overflow-x: auto; font-size: 0.88em; }
.markdown code { font-size: 0.92em; }
.markdown blockquote { margin: 0.75rem 0; padding: 0.2rem 0.9rem; border-left: 3px solid var(--rand); color: var(--muted); }
.markdown hr { border: 0; border-top: 1px solid var(--rand); margin: 1.5rem 0; }
.markdown hr + h2 { border-top: 0; padding-top: 0; margin-top: 0; } /* SPEC trennt Abschnitte mit --- */
.markdown .toc { background: var(--karte); border: 1px solid var(--rand); border-radius: 6px; padding: 0.75rem 1.25rem; font-size: 0.9em; }
.markdown .toc ul { margin: 0.2rem 0; padding-left: 1.2rem; }
.markdown .toc > ul { padding-left: 0; list-style: none; columns: 2; column-gap: 2rem; }
.markdown .toc > ul > li { break-inside: avoid; }
.markdown .toc a { text-decoration: none; }
.spec-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.spec-kopf small { color: var(--muted); }
.gespeichert-ok {
  background: #e4f3e4; border: 1px solid #9ccc9c; color: #1a5a1a;
  padding: 0.5rem 0.75rem; border-radius: 4px; margin: 0.75rem 0;
}
#konfetti {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 1000;
  transition: opacity 0.6s ease;
}
#konfetti.aus { opacity: 0; }

/* Angebotsvergleich (SPEC 9.7): eine Spalte je Lieferant. Der Wrapper
   scrollt in beide Richtungen; Kopfzeile, Summenzeile und die ersten zwei
   Spalten bleiben stehen, damit man bei 8 Firmen × 20 Positionen nie den
   Bezug verliert. */
.vergleich-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--rand); }
.vergleich-wrap table.vergleich { margin: 0; border-collapse: separate; border-spacing: 0; }
.vergleich thead th { position: sticky; top: 0; z-index: 3; background: #f5f5f5; }
.vergleich tfoot th { position: sticky; bottom: 0; z-index: 3; background: #f5f5f5; border-top: 2px solid var(--rand); }
.vergleich .fix { position: sticky; background: var(--karte); z-index: 2; }
.vergleich thead .fix, .vergleich tfoot .fix { z-index: 4; background: #f5f5f5; }
.vergleich .fix-nr { left: 0; min-width: 3rem; }
.vergleich .fix-bez { left: 3rem; min-width: 14rem; max-width: 22rem; box-shadow: 2px 0 0 var(--rand); }
.vergleich th.abgelaufen { color: #8a4b00; }
/* Einfärbung relativ zum günstigsten Preis der Zeile: --h kommt aus dem
   Service (120 = grün, 0 = rot), hier nur noch in eine helle Fläche übersetzt. */
.vergleich td.preis { background: hsl(var(--h, 120), 55%, 91%); white-space: nowrap; }
.vergleich td.guenstigster { font-weight: 600; }
.vergleich td.guenstigster label { font-weight: 600; }
.vergleich td.preis label { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; cursor: pointer; }
.vergleich td.preis .tage { color: var(--muted); font-weight: 400; margin-left: 0.25rem; }
.vergleich td.leer { background: var(--bg); }
.vergleich-leiste { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0 0.75rem; flex-wrap: wrap; }
.vergleich-summe { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.ok-text { color: #2f6a1f; }

/* Admin: ERP-Konfiguration als Schlüssel/Wert-Tabelle */
.erp-konfig { max-width: 40rem; }
.erp-konfig th { text-align: left; width: 9rem; color: var(--muted); font-weight: normal; }
.aktionen button[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Admin: ERP-Lieferschein-Viewer */
.ls-kopf { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.75rem 2rem; max-width: 70rem; margin-bottom: 1.25rem; }
.ls-kopf dl { margin: 0; }
.ls-kopf dt { color: var(--muted); font-size: 0.85em; margin-top: 0.4rem; }
.ls-kopf dd { margin: 0; }
.ls-positionen tr.leer td { color: var(--muted); font-style: italic; }
.ls-positionen tfoot td { font-weight: 600; border-top: 2px solid var(--rand); }
.ls-hinweis { color: var(--muted); font-size: 0.85em; margin-top: 0.5rem; }
.uebersicht td code { white-space: nowrap; }

/* Admin-Benutzer: runder Avatar aus dem ERP-Ausweisbild (Hochformat 100×130) */
.uebersicht.benutzer td.avatar-zelle { width: 2.6rem; padding-right: 0; }
.avatar {
  display: inline-block;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;   /* Gesicht sitzt im oberen Drittel des Hochformats */
  vertical-align: middle;
  background: #dfe4ea;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c9d1da;
}
.avatar-leer {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 2.4rem;
  text-align: center;
  color: #4a5563;
  letter-spacing: 0.02em;
}

/* Spruch des Tages: Zusatz neben der Überschrift, Fußzeile eine Zeile tiefer */
.start-spruch h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 0.5rem; }
.start-spruch blockquote footer { margin-top: 1.5em; }

/* Avatar des Bestellers im Kalender (Eintrag und Tooltip) */
.fc-avatar, .tt-avatar {
  display: inline-block; vertical-align: middle; border-radius: 50%;
  object-fit: cover; object-position: 50% 18%;
  background: #dfe4ea; color: #4a5563; font-weight: 600; text-align: center; font-style: normal;
}
.fc-avatar { width: 1.75rem; height: 1.75rem; line-height: 1.75rem; font-size: 0.7rem; margin-right: 0.4rem; box-shadow: 0 0 0 1px rgba(255,255,255,0.7); flex: none; }
/* Balken wächst mit dem Avatar; etwas mehr Luft und Schrift */
.fc-daygrid-event { padding: 2px 5px; }
.fc-daygrid-block-event .fc-event-main { font-size: 0.8rem; }
.tt-avatar { width: 1.4rem; height: 1.4rem; line-height: 1.4rem; font-size: 0.55rem; margin-right: 0.35rem; }
.fc-event .fc-event-main { display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
#event-tooltip dd.tt-person { display: flex; align-items: center; }

/* Erfasser des Wareneingangs neben dem Positionsstatus (Bestell-Detail) */
td.status-zelle { white-space: nowrap; }
.we-erfasser { display: inline-flex; margin-left: 0.4rem; vertical-align: middle; }
.we-erfasser .person { gap: 0.3rem; color: var(--muted); font-size: 0.85em; }
.we-erfasser .person-avatar { width: 1.4rem; height: 1.4rem; line-height: 1.4rem; font-size: 0.55rem; }

/* Stornieren/Ändern nach Versand (SPEC 6.4) */
.pos-aktionen { white-space: nowrap; }
button.mini.loeschen-rand { border-color: var(--ueberfaellig-fg); color: var(--ueberfaellig-fg); }
button.mini.loeschen-rand:hover { background: var(--ueberfaellig-fg); color: #fff; }
table.positionen tr.storniert td { color: var(--muted); text-decoration: line-through; }
table.positionen tr.storniert td.status-zelle, table.positionen tr.storniert td.pos-aktionen { text-decoration: none; }
.aenderungs-hinweis { margin-left: 0.8rem; }
.modal label select, .modal label textarea { padding: 0.4rem; font-size: 1em; font: inherit; }
.modal .anmeldung-fehler { margin: 0; }
.tt-badge.tt-geaendert { background: #fff3cd; color: #7a5a00; }
#event-tooltip .tt-geaendert-grund { font-size: 0.85em; color: #7a5a00; margin-bottom: 0.4rem; }

/* Notizen im Detail: Zeilenumbrüche erhalten */
.notiz-text { white-space: pre-line; }
/* Kontextmenü „…" (details/summary) — Wareneingang: seltene Positionsaktionen */
details.menue { position: relative; display: inline-block; }
details.menue > summary { list-style: none; cursor: pointer; }
details.menue > summary::-webkit-details-marker { display: none; }
summary.we-btn.we-mehr { background: #fff; border: 1px solid var(--rand); color: var(--fg); font-weight: 700; letter-spacing: 0.1em; padding-left: 0.55rem; padding-right: 0.55rem; }
summary.we-btn.we-mehr:hover, details.menue[open] > summary.we-btn.we-mehr { background: var(--bg); border-color: var(--akzent); color: var(--akzent); }
.menue-liste {
  position: absolute; right: 0; top: calc(100% + 0.2rem); z-index: 30; min-width: 12rem;
  background: var(--karte); border: 1px solid var(--rand); border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14); padding: 0.25rem 0; text-align: left;
}
.menue-liste button, .menue-liste a {
  display: block; width: 100%; box-sizing: border-box; text-align: left;
  background: none; border: none; border-radius: 0; margin: 0;
  padding: 0.45rem 0.9rem; font: inherit; font-size: 0.88rem; color: var(--fg); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.menue-liste button:hover, .menue-liste a:hover { background: var(--bg); color: var(--akzent); }
td.we-aktionen details.menue { margin-left: 0.3rem; vertical-align: middle; }

/* „…" kompakt und innerhalb der Zelle; Abstände der Erfassungsknöpfe etwas enger */
td.we-aktionen button.we-btn + button.we-btn { margin-left: 0.25rem; }
td.we-aktionen details.menue { margin-left: 0.25rem; }
summary.we-btn.we-mehr { padding: 0.4rem 0.45rem; letter-spacing: 0.05em; min-width: 0; }

/* Zwischen 1250 und 1500px: kompaktere Knöpfe, damit die Tabelle ohne Scrollen passt */
@media (max-width: 1500px) {
  table.we-liste button.we-btn, table.we-liste summary.we-btn { padding: 0.35rem 0.5rem; font-size: 0.78em; }
  table.we-liste td.we-aktionen button.we-btn + button.we-btn, table.we-liste td.we-aktionen details.menue { margin-left: 0.2rem; }
}
/* Wareneingang unter 1250px (Tablet, halbes Fenster): jede Zeile eine Karte, Spaltenkopf als Beschriftung je Feld */
@media (max-width: 1250px) {
  table.we-liste { min-width: 0; display: block; }
  table.we-liste thead { display: none; }
  table.we-liste tbody { display: block; }
  table.we-liste tr {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.2rem 0.8rem;
    padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; border: 1px solid var(--rand); border-radius: 4px; background: var(--karte);
  }
  table.we-liste tr.we-ueberfaellig { background: var(--ueberfaellig-bg); }
  table.we-liste tr.prio-terminkritisch { border-left: 3px solid #b06000; }
  table.we-liste tr.prio-terminkritisch td:first-child { border-left: 0; }
  table.we-liste td { display: block; padding: 0.15rem 0; border: 0; width: auto !important; max-width: none; white-space: normal; }
  table.we-liste td::before { content: attr(data-label); display: block; font-size: 0.72em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
  table.we-liste td.rechts { text-align: left; }
  table.we-liste td.we-aktionen { grid-column: 1 / -1; text-align: left; margin-top: 0.3rem; padding-top: 0.5rem; border-top: 1px solid var(--rand); }
  table.we-liste td.we-aktionen::before { content: none; }
  table.we-liste td.lieferant-zelle strong, table.we-liste td.lieferant-zelle small { white-space: normal; overflow: visible; }
}

/* „Neu im Portal" ausklappbar (details/summary) */
details.start-notizen > summary { list-style: none; cursor: pointer; }
details.start-notizen > summary::-webkit-details-marker { display: none; }
details.start-notizen > summary h2 { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
details.start-notizen[open] > summary h2 { margin-bottom: 0.75rem; }
details.start-notizen .aufklappen { margin-left: auto; width: 0.6rem; height: 0.6rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; }
details.start-notizen[open] .aufklappen { transform: rotate(-135deg); }
details.start-notizen > summary:hover h2 { color: var(--akzent); }
.start-notizen .neu-badge { font-size: 0.7rem; text-transform: none; letter-spacing: 0; }

/* Lieferscheine (SPEC 13) */
table.uebersicht td code { white-space: nowrap; }

/* ---------- Lieferscheine: Übersicht und Detail (27.08.2026) ---------- */
.stamm-ansicht dl.stamm.einspaltig { grid-template-columns: 1fr; gap: 0.55rem; }
.ls-tabelle td.primaer .text { font-weight: 500; }
.ls-tabelle tr.entwurf td.primaer > a { color: var(--muted); font-weight: 500; }
.ls-tabelle td.primaer .kennung { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.03em; }
h1 .kennung { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.02em; font-size: 0.9em; }
h1 .entwurf-hinweis { font-size: 0.55em; font-weight: 400; color: var(--muted); }

.ls-leiste {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--rand); border-left: 4px solid var(--muted); border-radius: 4px; background: var(--karte);
}
.ls-leiste.ausgestellt { border-left-color: var(--erledigt-fg); }
.ls-leiste-status { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ls-leiste-text { color: var(--muted); font-size: 0.9rem; }
.ls-leiste-aktionen { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }
.ls-leiste-aktionen form { margin: 0; }
.ls-leiste-aktionen small.hinweis { font-size: 0.8rem; color: var(--muted); }
.ls-leiste-hinweis { margin: 0.4rem 0 0 0.9rem; font-size: 0.8rem; }

.ls-kopfraster { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0 2rem; margin-top: 1rem; }
.ls-kopfraster > .abschnitt { border-top: 1px solid var(--rand); }
.ls-kopfraster > .abschnitt:first-child { border-top: 1px solid var(--rand); padding-top: 0.9rem; }
@media (max-width: 900px) { .ls-kopfraster { grid-template-columns: 1fr; gap: 0; } .ls-kopfraster > .abschnitt + .abschnitt { border-top: 1px solid var(--rand); } }
.ls-empfaenger { line-height: 1.45; }
.ls-empfaenger-name { font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.ls-empfaenger-name:hover { text-decoration: underline; }
.ls-empfaenger-ort { color: var(--akzent); font-size: 0.9rem; }
.ls-empfaenger-adresse { margin-top: 0.25rem; }
.ls-empfaenger small.hinweis { display: block; margin-top: 0.35rem; }

.ls-detail { max-width: 80rem; }
.ls-positionen td.bezeichnung { font-weight: 500; width: 40%; }
.ls-positionen th.zahl, .ls-positionen td.zahl { width: auto; white-space: nowrap; }
.ls-positionen th { white-space: nowrap; }
table.stamm-tabelle .leer-wert { color: #aaa; }
.ls-positionen tfoot td { border-top: 2px solid var(--rand); padding-top: 0.5rem; }
.ls-positionen tfoot td.summe-label { color: var(--muted); font-size: 0.8rem; text-align: right; }
.ls-positionen tfoot td.summe { font-weight: 700; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---------- Bestellungen: Übersicht und Detail (27.08.2026) ---------- */
form.bst-filter { flex-direction: column; align-items: stretch; gap: 0.6rem; }
form.bst-filter .bst-filter-felder { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.9rem; }
form.bst-filter .bst-filter-felder label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--muted); }
form.bst-filter .bst-filter-felder input, form.bst-filter .bst-filter-felder select {
  padding: 0.38rem 0.5rem; font-size: 0.9rem; font-family: inherit; color: var(--fg);
  border: 1px solid var(--rand); border-radius: 3px; background: #fff; min-width: 9rem;
}
form.bst-filter .bst-filter-felder select[name="lieferant_id"] { min-width: 16rem; }
form.bst-filter .bst-filter-aktionen { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.chip.chip-rot input:checked + span { border-color: var(--ueberfaellig-fg); background: var(--ueberfaellig-bg); color: var(--ueberfaellig-fg); }
.chip.chip-rot input:checked + span::before { border-color: var(--ueberfaellig-fg); background-color: var(--ueberfaellig-fg); }

.bst-tabelle td.primaer .kennung { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.03em; }
.bst-tabelle td.primaer .text { font-weight: 500; }
.bst-tabelle tr.status-entwurf td.primaer > a { color: var(--muted); font-weight: 500; }
.bst-tabelle td.status form.inline { display: inline-block; margin-left: 0.4rem; }
.bst-tabelle td.pdf { width: 3rem; }
.bst-tabelle th a.sortlink { font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.bst-tabelle th a.sortlink-aktiv { color: var(--akzent); }
.zaehlzeile + .bst-tabelle, .zaehlzeile + .ls-tabelle { margin-top: 0; }

.bst-detail { max-width: 90rem; }
.ls-leiste.fehler { border-left-color: var(--fehler-fg); background: #fff8ee; }
.bst-versand-fehler { margin: 0.5rem 0 0; }
.bst-versand-fehler pre { margin: 0; white-space: pre-wrap; font-size: 0.8rem; }
.ls-leiste-aktionen .pdf-link { margin-left: 0.3rem; }
.bst-positionen td.bezeichnung { font-weight: 500; }
.bst-positionen th.zahl, .bst-positionen td.zahl, .bst-positionen td.datum { white-space: nowrap; }
.bst-positionen td.zahl { width: auto; }
.bst-positionen td.datum { font-variant-numeric: tabular-nums; }
.bst-positionen tr.storniert td { color: var(--muted); text-decoration: line-through; }
.bst-positionen tr.storniert td.pos-aktionen, .bst-positionen tr.storniert td.status-zelle { text-decoration: none; }
.bst-positionen td.status-zelle { white-space: nowrap; }
.bst-positionen td.pos-aktionen { display: table-cell; white-space: normal; min-width: 11rem; }
.bst-positionen td.pos-aktionen .mini { margin: 0.1rem 0.25rem 0.1rem 0; }
.bst-positionen td.bezeichnung { min-width: 14rem; }
.pos-status { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px; font-size: 0.85em; font-weight: 500; background: #eee; color: var(--fg); }
.pos-status-bestaetigt { background: #e0eaf5; color: #1f4a8a; }
.pos-status-teilgeliefert { background: #e0eaf5; color: #1f4a8a; }
.pos-status-geliefert { background: var(--erledigt-bg); color: var(--erledigt-fg); }
.pos-status-storniert { background: #fff; color: var(--muted); border: 1px dashed var(--muted); }
.pos-status-gesplittet { background: #fff; color: var(--muted); border: 1px solid var(--rand); }
.bst-positionen .pill.prio-terminkritisch { margin-left: 0.4rem; vertical-align: 1px; }
.stamm-ansicht .legende { margin-top: 1rem; }

/* ---------- Anfragen: Übersicht und Detail (27.08.2026) ---------- */
.chip.chip-abstand { margin-left: 0.6rem; }
.anf-tabelle td.primaer .kennung { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.03em; }
.anf-tabelle tr.entwurf td.primaer > a { color: var(--muted); font-weight: 500; }
.anf-tabelle td.notiz { max-width: 16rem; color: var(--muted); font-size: 0.85em; }
.anf-tabelle tr.anfrage-kopf td { border-top: 2px solid var(--rand); vertical-align: top; }
.anf-tabelle tr.anfrage-unterzeile td { border-top: 1px dotted var(--rand); }
.anf-tabelle td.firma { font-weight: 500; }
.anf-tabelle th a.sortlink { font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.anf-tabelle th a.sortlink-aktiv { color: var(--akzent); }
.ls-tabelle th a.sortlink { font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.ls-tabelle th a.sortlink-aktiv { color: var(--akzent); }
.ls-tabelle td.pdf, .bst-tabelle td.pdf, .anf-tabelle td.pdf { width: 3rem; text-align: center; }
.stamm-tabelle td.datum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.anf-detail { max-width: 90rem; }
.anf-positionen td.bezeichnung, .anf-lieferanten td.primaer { font-weight: 500; }
.anf-lieferanten td.pos-aktionen { display: table-cell; white-space: nowrap; }
.anf-lieferanten td.pos-aktionen form { display: inline-block; margin: 0 0 0 0.3rem; }
.anf-lieferanten td.pos-aktionen .btn-inline { margin-left: 0.3rem; }
.anf-lieferanten .fehlertext { max-width: 22rem; white-space: normal; }
.anf-lieferanten small.abgelaufen { color: var(--ueberfaellig-fg); }
.anf-anhaenge td.pos-aktionen { display: table-cell; }
.anf-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.anf-detail .vergleich-leiste { margin-bottom: 0.5rem; }

/* ---------- Wareneingang im Stil der Stammdaten-Ansichten (27.08.2026) ---------- */
.zaehlzeile .zaehl-rot { color: var(--ueberfaellig-fg); font-weight: 600; }
table.we-liste.stamm-tabelle th a.sortlink { font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
table.we-liste.stamm-tabelle th a.sortlink-aktiv { color: var(--akzent); }
table.we-liste.stamm-tabelle td.primaer .text { font-weight: 500; display: block; }
table.we-liste.stamm-tabelle td.lieferant-zelle .text { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.we-liste.stamm-tabelle td.primaer small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
table.we-liste.stamm-tabelle td.primaer .kennung { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.03em; }
table.we-liste.stamm-tabelle td.bestellpos-zelle a { font-size: 0.9rem; font-weight: 600; text-decoration: none; }
table.we-liste.stamm-tabelle td.bestellpos-zelle a:hover { text-decoration: underline; }
table.we-liste.stamm-tabelle td.material { font-weight: 500; }
table.we-liste.stamm-tabelle td.material .pill { margin-left: 0.4rem; vertical-align: 1px; font-weight: 500; }
table.we-liste.stamm-tabelle td.zahl { width: 1%; text-align: right; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
table.we-liste.stamm-tabelle td.zahl .einheit { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--muted); }
table.we-liste.stamm-tabelle td.datum { font-variant-numeric: tabular-nums; }
table.we-liste.stamm-tabelle tr.we-ueberfaellig td.datum strong { color: var(--ueberfaellig-fg); }
table.we-liste.stamm-tabelle th.we-aktionen-kopf { text-align: right; }
@media (max-width: 1250px) {
  table.we-liste.stamm-tabelle td.zahl { text-align: left; }
  table.we-liste.stamm-tabelle td.lieferant-zelle .text { white-space: normal; max-width: none; }
}

/* ---------- Liefertermine im Stil der Stammdaten-Ansichten (27.08.2026) ---------- */
.termin-filter .chips-inline { align-self: center; padding-bottom: 0.15rem; }
h2.eyebrow.rot { color: var(--ueberfaellig-fg); }
.termine-block.abschnitt { border-top: 1px solid var(--rand); padding: 0.9rem 0 0.6rem; margin: 0 0 0.6rem; }
.termine-block.abschnitt h2.eyebrow { margin: 0 0 0.6rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--akzent); }
.termine-block.abschnitt h2.eyebrow.rot { color: var(--ueberfaellig-fg); }
.termine-block.abschnitt h2.eyebrow small { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 0.5rem; font-size: 0.78rem; }
table.termine.stamm-tabelle td.datum { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.termine.stamm-tabelle td.datum .pill { margin-left: 0.35rem; vertical-align: 1px; }
table.termine.stamm-tabelle td.primaer .text { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.termine.stamm-tabelle td.primaer .kennung { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.03em; font-weight: 600; text-decoration: none; }
table.termine.stamm-tabelle td.primaer .kennung:hover { text-decoration: underline; }
table.termine.stamm-tabelle td.primaer small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
table.termine.stamm-tabelle td.material-zelle .material { font-weight: 500; }
table.termine.stamm-tabelle td.material-zelle .pill { margin-left: 0.4rem; vertical-align: 1px; }
table.termine.stamm-tabelle td.zahl { text-align: right; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: nowrap; }
table.termine.stamm-tabelle td.zahl .einheit { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--muted); }
table.termine.stamm-tabelle td.pos-aktionen { display: table-cell; white-space: nowrap; text-align: right; }
.termine-block.ueberfaellig table.termine.stamm-tabelle tr td.datum { font-weight: 600; color: var(--ueberfaellig-fg); }
table.termine.stamm-tabelle td.material-zelle .pill { display: inline-block; width: auto; max-width: none; overflow: visible; white-space: nowrap; }

/* Dieseltank-Kachel aus Home Assistant (SPEC 17) — eine Reihe, Akzentfarbe, ruhiges Gitter */
.start-diesel:empty { display: none; }
.start-diesel h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 0.5rem; }
/* Reihe: zwei Anzeigen fest, der Verlauf daneben höchstens halb so breit wie zuvor */
.diesel-reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .diesel-reihe { grid-template-columns: 1fr 1fr; } .diesel-verlauf { grid-column: 1 / -1; order: 3; } }
@media (max-width: 600px) { .diesel-reihe { grid-template-columns: 1fr; } }
/* Analoganzeige: Statusfarben wie im Portal (rot/gelb/grün), Nadel in Textfarbe */
.diesel-zeiger { text-align: center; }
.diesel-zeiger svg { width: 100%; max-width: 16rem; display: block; margin: 0 auto; overflow: visible; }
.diesel-zeiger .dz-seg { fill: none; stroke-width: 32; stroke-linecap: butt; }
.diesel-zeiger .dz-rot { stroke: var(--ueberfaellig-fg); }
.diesel-zeiger .dz-gelb { stroke: #d9a300; }
.diesel-zeiger .dz-gruen { stroke: var(--erledigt-fg); }
.diesel-zeiger .dz-nadel { stroke: var(--fg); stroke-width: 3; stroke-linecap: round; }
.diesel-zeiger .dz-nabe { fill: var(--fg); }
.diesel-zeiger .dz-min, .diesel-zeiger .dz-max { fill: var(--muted); font-size: 10px; }
.diesel-reihe .dz-titel { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; text-align: center; }
/* Doppelnadel: neutrale Skala, PV grün, Last rot (Grün/Blau war schwer zu unterscheiden), Werte als Text daneben */
.diesel-energie .dz-track { stroke: #e6ebf2; }
.diesel-energie .dz-strich { stroke: #444; stroke-width: 1.5; }
.diesel-energie .dz-strich-lang { stroke-width: 2.5; }
.diesel-energie .dz-nadel-pv { stroke: var(--erledigt-fg); }
.diesel-energie .dz-nadel-last { stroke: var(--ueberfaellig-fg); }
.diesel-energie .dz-legende { display: flex; justify-content: center; gap: 1rem; margin-top: -0.2rem; font-size: 0.95em; color: var(--muted); }
.diesel-energie .dz-legende strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.diesel-energie .dz-punkt-pv { background: var(--erledigt-fg); }
.diesel-energie .dz-punkt-last { background: var(--ueberfaellig-fg); }
.diesel-energie .dz-stufe { font-weight: 400; }
.diesel-zeiger .dz-zeit { font-size: 0.78em; margin-top: 0.15rem; }
.diesel-zeiger .dz-wert { margin-top: -0.2rem; color: var(--muted); }
.diesel-zeiger .dz-wert strong { font-size: 1.9em; color: var(--fg); font-variant-numeric: tabular-nums; margin-right: 0.2rem; }
.diesel-zeiger .dz-stufe { font-weight: 600; margin-top: 0.15rem; }
.diesel-zeiger .dz-punkt { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: middle; }
.diesel-zeiger-rot .dz-punkt { background: var(--ueberfaellig-fg); }
.diesel-zeiger-gelb .dz-punkt { background: #d9a300; }
.diesel-zeiger-gruen .dz-punkt { background: var(--erledigt-fg); }
.diesel-graph { position: relative; }
.diesel-graph svg { display: block; width: 100%; height: 10rem; }
.diesel-graph .dg-gitter { stroke: var(--rand); stroke-width: 1; }
.diesel-graph .dg-achse { fill: var(--muted); font-size: 10px; }
.diesel-graph .dg-flaeche { fill: var(--akzent); fill-opacity: 0.08; }
.diesel-graph .dg-linie { fill: none; stroke: var(--akzent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.diesel-graph .dg-kreuz { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.diesel-graph .dg-marke { fill: #fff; stroke: var(--akzent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.diesel-graph [hidden] { display: none; }
.diesel-graph .dg-tooltip {
  position: absolute; top: 0.2rem; transform: translateX(-50%); pointer-events: none;
  background: var(--karte); border: 1px solid var(--rand); border-radius: 3px; padding: 0.15rem 0.5rem;
  font-size: 0.82em; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
/* Haustür öffnen (SPEC 17): Knopf im Schnellstart wie die Links, Rückmeldung klein darunter */
button.start-aktion { width: 100%; background: var(--karte); font: inherit; cursor: pointer; text-align: left; }
button.start-aktion:disabled { opacity: 0.6; cursor: wait; }
.start-haustuer-status { font-size: 0.85em; color: var(--erledigt-fg); margin: 0.2rem 0 0 0.3rem; }
.start-haustuer-status.fehler { color: var(--ueberfaellig-fg); }
