/* «📊 Mein Dashboard» (18.10.2026) – Corporate Design wie Pipeline (pipeline-erp-look.css): Navy #002B57, Karten #fff/#dfe5ec.
   Diagrammfarben: validierte Kategorie-Slots 1/2 (Blau = aktuelles Jahr, Orange = Vorjahr); Text nie in Datenfarbe. */
.md-root {
  --md-surface: #fff;
  --md-page: #f6f8fb;
  --md-border: #dfe5ec;
  --md-text: #1d2b3a;
  --md-text-2: #344c67;
  --md-muted: #64748b;
  --md-grid: #e8edf3;
  --md-axis: #94a3b8;
  --md-navy: #002B57;
  --md-s1: #2a78d6;
  --md-s2: #eb6834;
  --md-good: #15803d;
  --md-bad: #b91c1c;
  --md-sel: #eef4fc;
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--md-text);
  padding: 8px;
  width: 100%;
  max-width: 1400px;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
}
/* Die Pipeline hat (noch) keinen Dunkelmodus; die Stufen stehen bereit, falls ein Umschalter data-theme="dark" setzt. */
:root[data-theme="dark"] .md-root {
  color-scheme: dark;
  --md-surface: #1a1a19; --md-page: #121212; --md-border: #33332f; --md-text: #f0efec; --md-text-2: #c3c2b7;
  --md-muted: #a3a29a; --md-grid: #2c2c29; --md-axis: #7d7c75; --md-s1: #3987e5; --md-s2: #d95926;
  --md-good: #4ade80; --md-bad: #f87171; --md-sel: #1f2a3a;
}
.md-root *, .md-root *::before, .md-root *::after { box-sizing: border-box; }
.md-kopf { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 12px; }
.md-kopf-text { flex: 1 1 260px; min-width: 0; }
.md-kopf h2 { margin: 0 0 2px; font-size: 20px; font-weight: 600; color: var(--md-navy); }
.md-leise { color: var(--md-muted); font-size: 12.5px; margin: 0; }
.md-gut { color: var(--md-good); font-size: 13px; margin: 4px 0 8px; }
.md-steuer { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.md-feld { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--md-muted); }
.md-feld select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--md-border); border-radius: 7px; background: var(--md-surface); color: var(--md-text); font: inherit; font-size: 13px; max-width: 200px; }
.md-neu { min-height: 34px; }
.md-hinweis { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px; }

.md-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.md-kachel { background: var(--md-surface); border: 1px solid var(--md-border); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.md-k-titel { font-size: 12.5px; color: var(--md-text-2); font-weight: 600; }
.md-k-wert { font-size: 22px; font-weight: 600; margin: 4px 0 2px; color: var(--md-text); overflow-wrap: anywhere; }
.md-k-zeile { font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.md-delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.md-delta.md-auf { color: var(--md-good); }
.md-delta.md-ab { color: var(--md-bad); }
.md-delta.md-gleich { color: var(--md-muted); }

.md-karte { background: var(--md-surface); border: 1px solid var(--md-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; min-width: 0; }
.md-karte h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--md-navy); }
.md-unter { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--md-text-2); }
.md-karte-kopf { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.md-karte-kopf h3 { margin: 0; }
.md-umschalter { display: inline-flex; border: 1px solid var(--md-border); border-radius: 999px; overflow: hidden; }
.md-umschalter button { border: 0; background: var(--md-surface); color: var(--md-text-2); padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 32px; }
.md-umschalter button[aria-pressed="true"] { background: var(--md-navy); color: #fff; font-weight: 600; }
.md-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--md-text-2); margin: 8px 0 4px; align-items: center; }
.md-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.md-sw.md-s1 { background: var(--md-s1); }
.md-sw.md-s2 { background: var(--md-s2); }
.md-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; max-width: 100%; }
.md-dia svg { display: block; font-family: inherit; }
.md-dia .md-grid { stroke: var(--md-grid); stroke-width: 1; }
.md-dia .md-basis { stroke: var(--md-axis); stroke-width: 1; }
.md-dia .md-ax { fill: var(--md-muted); font-size: 11px; }
.md-dia path.md-s1 { fill: var(--md-s1); }
.md-dia path.md-s2 { fill: var(--md-s2); }
.md-dia .md-linie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.md-dia .md-linie.md-s1 { stroke: var(--md-s1); }
.md-dia .md-linie.md-s2 { stroke: var(--md-s2); }
.md-dia .md-punkt { stroke: var(--md-surface); stroke-width: 2; }
.md-dia .md-punkt.md-s1 { fill: var(--md-s1); }
.md-dia .md-punkt.md-s2 { fill: var(--md-s2); }
.md-dia .md-ende { fill: var(--md-text-2); font-size: 11.5px; }
.md-dia .md-ende.md-stark { fill: var(--md-text); font-weight: 600; }
.md-dia .md-kreuz { stroke: var(--md-axis); stroke-width: 1; }
.md-dia .md-auswahl { fill: var(--md-sel); }
.md-dia .md-hit { fill: transparent; cursor: pointer; }
.md-dia .md-hit:focus-visible { outline: none; fill: var(--md-sel); fill-opacity: .6; }
.md-tip { position: absolute; z-index: 30; pointer-events: none; background: var(--md-surface); color: var(--md-text); border: 1px solid var(--md-border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 4px 16px #0f172a1f; max-width: 260px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.md-tabelle { margin-top: 8px; font-size: 13px; }
.md-tabelle summary { cursor: pointer; color: var(--md-text-2); }
.md-tab { border-collapse: collapse; width: 100%; max-width: 520px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.md-tab th, .md-tab td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--md-grid); }
.md-tab th:first-child, .md-tab td:first-child { text-align: left; }
.md-tab caption { text-align: left; }

.md-drill { margin-top: 10px; border-top: 1px solid var(--md-border); padding-top: 8px; }
.md-drill-kopf { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.md-x { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--md-muted); min-width: 32px; min-height: 32px; }
.md-liste { display: flex; flex-direction: column; max-height: 340px; overflow: auto; }
.md-zeile { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: baseline; padding: 7px 4px; border-top: 1px solid var(--md-grid); color: var(--md-text); text-decoration: none; font-size: 13px; }
.md-zeile:first-child { border-top: 0; }
.md-zeile:hover, .md-zeile:focus-visible { background: #f6f9fd; }
.md-z-id { font-weight: 600; color: var(--md-navy); }
.md-z-kunde { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-z-kunde small { color: var(--md-muted); }
.md-z-datum { color: var(--md-muted); font-size: 12px; white-space: nowrap; }
.md-z-betrag { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.md-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.md-raster > .md-karte { margin-bottom: 0; }
.md-raster { margin-bottom: 12px; }
.md-tr { display: grid; grid-template-columns: 130px minmax(0, 1fr) 11em; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 7px 4px; cursor: pointer; font: inherit; font-size: 13px; color: var(--md-text); text-align: left; border-radius: 6px; }
.md-tr:hover, .md-tr:focus-visible { background: #f6f9fd; }
.md-tr-label { color: var(--md-text-2); }
.md-tr-balken { height: 12px; background: var(--md-grid); border-radius: 4px; overflow: hidden; }
.md-tr-balken i { display: block; height: 100%; background: var(--md-s1); border-radius: 0 4px 4px 0; }
.md-tr-wert { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.md-tr-wert small { display: block; color: var(--md-muted); font-size: 11px; }
.md-hb-pend { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.md-pend { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--md-border); background: var(--md-surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: 13px; color: var(--md-text); text-align: left; min-height: 36px; }
.md-pend:hover, .md-pend:focus-visible { background: #f6f9fd; border-color: #b8cde4; }
.md-hb-gruppe { margin: 6px 0 8px; }
.md-hb-titel { font-size: 13px; margin-bottom: 4px; }
.md-link { border: 0; background: none; color: var(--md-navy); cursor: pointer; padding: 6px 0; font: inherit; font-size: 13px; text-decoration: underline; }

/* Ziel (18.10.2026): Ziel-Linie gestrichelt in Textfarbe – keine Datenfarbe, keine Statusfarbe als Serienfarbe */
.md-dia .md-ziellinie { stroke: var(--md-text-2); stroke-dasharray: 5 4; stroke-width: 1.5; }
.md-sw.md-ziel-sw { background: none; border-top: 2px dashed var(--md-text-2); height: 0; width: 14px; border-radius: 0; vertical-align: 3px; }
.md-kachel.md-ziel { border-left: 4px solid var(--md-navy); }
.md-kachel.md-ziel-gut { border-left: 4px solid var(--md-good); }
.md-netto { margin: 4px 2px 12px; }
.md-tr-summe { margin: 8px 4px 0; }

/* 🎯 Verkaufsziele (Kennzahlen › Ziele) – gleiche Karten/Tokens wie das Dashboard */
.vz-root .md-feld input { min-height: 34px; padding: 4px 8px; border: 1px solid var(--md-border); border-radius: 7px; background: var(--md-surface); color: var(--md-text); font: inherit; font-size: 13px; width: 120px; }
.vz-tab { max-width: none; min-width: 1040px; }
.vz-tab th, .vz-tab td { white-space: nowrap; vertical-align: top; }
.vz-tab th { font-weight: 600; color: var(--md-text-2); }
.vz-tab td.vz-name { white-space: normal; min-width: 170px; text-align: left; }
.vz-name small { color: var(--md-muted); }
.vz-hinw { font-size: 11.5px; color: var(--md-muted); max-width: 240px; }
.vz-hinw.vz-neu { color: #9a3412; }
.vz-root input.vz-in { max-width: none !important; min-width: 72px; min-height: 32px; padding: 4px 8px; border: 1px solid var(--md-border); border-radius: 6px; font: inherit; font-size: 13px; text-align: right; width: 116px; background: var(--md-surface); color: var(--md-text); font-variant-numeric: tabular-nums; }
.vz-root input.vz-in:focus { outline: 2px solid #2a78d6; outline-offset: 0; }
.vz-root input.vz-notiz, .vz-root input.vz-tname, .vz-root input.vz-mit { text-align: left; width: 170px; }
.vz-root input.vz-gew { width: 72px; }
.vz-delta { font-weight: 600; color: var(--md-text-2); }
.vz-delta.vz-hoch { color: #9a3412; }
.vz-delta.vz-tief { color: var(--md-muted); }
.vz-arten { text-align: left !important; }
.vz-arten label { display: block; font-size: 12px; color: var(--md-text-2); white-space: nowrap; }
.vz-info td { color: var(--md-muted); font-style: italic; }
.vz-saison { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.vz-saison label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--md-muted); gap: 2px; }
/* Ziele 2 (18.10.2026): Saison-Vergleich gedämpft, Eingang gestapelt, Formel-Tooltips, Firmen-Zeile, erste Spalte fix beim Wischen */
.vz-klein { font-size: 11px; color: var(--md-muted); font-weight: 400; }
.vz-saisonw { color: var(--md-muted); }
.vz-tip { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.vz-tab tfoot .vz-firma td { border-top: 2px solid var(--md-border); font-weight: 600; background: var(--md-surface); }
.vz-tab .vz-firma .vz-hinw { white-space: normal; font-weight: 600; }
.vz-tab th.vz-name, .vz-tab td.vz-name { position: sticky; left: 0; z-index: 1; background: var(--md-surface); }
.vz-formeln { margin-top: 8px; font-size: 12.5px; color: var(--md-text-2); }
.vz-formeln summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.vz-formeln ul { margin: 4px 0 6px 18px; padding: 0; }
.vz-formeln li { margin: 2px 0; }
/* 💰 Gewinn & Break-even (nur berechtigte Benutzer) */
.md-kachel.md-gewinn { grid-column: span 2; }
.vz-gw-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 12px; margin: 6px 0; font-size: 12.5px; }
.vz-gw-raster > div { display: flex; flex-direction: column; }
.vz-gw-raster span { color: var(--md-muted); font-size: 11.5px; }
.vz-gw-steuer { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--md-text-2); margin-top: 4px; }
.vz-gw-steuer input.vz-in { width: 100px; min-height: 30px; }
.vz-gw-form .md-feld input { min-height: 32px; }
.vz-ampel-gruen { color: #15803d; } .vz-ampel-gelb { color: #a16207; } .vz-ampel-rot { color: #b91c1c; }
.md-k-wert small { font-size: 11.5px; font-weight: 500; color: var(--md-muted); }
.vz-saison input { min-height: 32px; border: 1px solid var(--md-border); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px; width: 100%; text-align: right; }

@media (max-width: 640px) {
  .md-root { padding: 4px 0; }
  .md-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .md-kachel { padding: 10px; }
  .md-k-wert { font-size: 17px; }
  .md-k-zeile { font-size: 11.5px; }
  .md-steuer { width: 100%; }
  .vz-root .md-feld input { width: 100%; }
  .vz-saison { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vz-tab td.vz-name, .vz-tab th.vz-name { min-width: 120px; max-width: 150px; }
  .vz-hinw { max-width: 150px; }
  .md-kachel.md-gewinn { grid-column: 1 / -1; }
  .md-feld { flex: 1 1 40%; }
  .md-feld select { max-width: none; width: 100%; }
  .md-karte { padding: 10px; }
  .md-tr { grid-template-columns: 92px minmax(0, 1fr) 9.5em; gap: 6px; }
  .md-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .md-z-id { grid-column: 1; grid-row: 1; }
  .md-z-betrag { grid-column: 2; grid-row: 1; }
  .md-z-kunde { grid-column: 1 / -1; grid-row: 2; }
  .md-z-datum { grid-column: 1 / -1; grid-row: 3; }
}
@media print { .md-steuer, .md-umschalter, .md-tip { display: none !important; } }
