/* ═══════════════════════════════════════════════════════════════════════════
   Betreiber-Konsole - dieselbe Farbwelt wie Betriebsmeister (Graphit + Kupfer),
   damit klar ist: dasselbe Produkt, nur die Betreiber-Sicht statt der Kundensicht.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --grund: #f4f2ef; --flaeche: #ffffff; --flaeche-2: #faf9f7;
  --linie: #e3e0da; --linie-stark: #cfcbc3;
  --tinte: #1b1e22; --tinte-2: #4a5057; --gedaempft: #7d838a;
  --leiste: #1d2126; --leiste-2: #262b31; --leiste-text: #c9ced4; --leiste-aktiv: #ffffff;
  --akzent: #b4601f; --akzent-hell: #d17b34; --akzent-weich: rgba(180,96,31,.10); --akzent-linie: rgba(180,96,31,.28);
  --gut: #2c7a4b; --gut-weich: rgba(44,122,75,.11);
  --warn: #9a6b0f; --warn-weich: rgba(154,107,15,.12);
  --kritisch: #b3382c; --kritisch-weich: rgba(179,56,44,.11);
  --schatten: 0 1px 2px rgba(27,30,34,.05), 0 4px 12px rgba(27,30,34,.05);
  --radius: 10px; --radius-klein: 7px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #131619; --flaeche: #1b1f23; --flaeche-2: #21262b;
    --linie: #2d3339; --linie-stark: #3d444b;
    --tinte: #eef0f2; --tinte-2: #c3c8cd; --gedaempft: #8d949c;
    --akzent-weich: rgba(209,123,52,.16);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--grund); color: var(--tinte);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.leiste {
  background: var(--leiste); color: var(--leiste-text); display: flex; flex-direction: column;
}
.leiste-kopf { padding: 22px 20px 16px; }
.leiste-kopf .wort { font-size: 1.15rem; font-weight: 700; color: #fff; }
.leiste-kopf .wort span { color: var(--akzent-hell); }
.leiste-kopf .unter { font-size: .74rem; color: rgba(255,255,255,.4); margin-top: 2px; }
.leiste-menue { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.menue-knopf {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  background: none; border: none; color: var(--leiste-text); font-size: .92rem; text-align: left; cursor: pointer;
}
.menue-knopf:hover { background: var(--leiste-2); color: #fff; }
.menue-knopf.aktiv { background: var(--akzent); color: #fff; }
.leiste-fuss { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); display: flex; gap: 8px; align-items: center; }
.leiste-fuss button {
  background: none; border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.7);
  border-radius: 6px; padding: 5px 10px; font-size: .78rem; cursor: pointer;
}
.leiste-fuss button:hover { background: rgba(255,255,255,.09); color: #fff; }

.inhalt { padding: 26px 32px 60px; min-width: 0; }
.seiten-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.seiten-kopf h1 { margin: 0 0 4px; font-size: 1.5rem; }
.seiten-kopf .unter { color: var(--gedaempft); font-size: .92rem; }
.seiten-kopf .werkzeuge { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); margin-bottom: 16px; overflow: hidden; }
.karte-kopf { padding: 14px 18px; border-bottom: 1px solid var(--linie); display: flex; justify-content: space-between; align-items: center; }
.karte-kopf h2 { margin: 0; font-size: 1rem; }
.karte-koerper { padding: 18px; }

.knopf {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-klein);
  border: 1px solid var(--akzent); background: var(--akzent); color: #fff; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.knopf:hover { background: var(--akzent-hell); border-color: var(--akzent-hell); }
.knopf.leise { background: var(--flaeche); color: var(--tinte); border-color: var(--linie-stark); }
.knopf.leise:hover { border-color: var(--akzent); color: var(--akzent); }
.knopf.gefahr { background: var(--kritisch); border-color: var(--kritisch); }
.knopf.gefahr:hover { filter: brightness(1.1); }
.knopf.klein { padding: 5px 11px; font-size: .8rem; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }

table.liste { width: 100%; border-collapse: collapse; }
table.liste th { text-align: left; padding: 10px 14px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gedaempft); border-bottom: 1px solid var(--linie); }
table.liste td { padding: 12px 14px; border-bottom: 1px solid var(--linie); font-size: .9rem; vertical-align: top; }
table.liste tbody tr:last-child td { border-bottom: none; }
table.liste td.haupt { font-weight: 600; }
table.liste .neben { color: var(--gedaempft); font-size: .82rem; font-weight: 400; }
table.liste td.tat { text-align: right; white-space: nowrap; }
table.liste td.zahl { text-align: right; font-variant-numeric: tabular-nums; }

.marke { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 100px; font-size: .76rem; font-weight: 600; }
.marke.gut { background: var(--gut-weich); color: var(--gut); }
.marke.warn { background: var(--warn-weich); color: var(--warn); }
.marke.kritisch { background: var(--kritisch-weich); color: var(--kritisch); }
.marke.grau { background: var(--flaeche-2); color: var(--gedaempft); border: 1px solid var(--linie); }
.marke.akzent { background: var(--akzent-weich); color: var(--akzent); }
.marke .punkt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.leer { text-align: center; padding: 40px 20px; color: var(--gedaempft); }
.leer .titel { font-weight: 600; color: var(--tinte); margin-bottom: 4px; }

.feld { margin-bottom: 15px; }
.feld label { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gedaempft); margin-bottom: 5px; }
.feld input, .feld select, .feld textarea {
  width: 100%; padding: 9px 12px; background: var(--flaeche); border: 1px solid var(--linie-stark);
  border-radius: var(--radius-klein); font: inherit; color: var(--tinte);
}
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); }
.feld textarea { min-height: 70px; resize: vertical; }
.feld-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.dialog-grund { position: fixed; inset: 0; background: rgba(20,22,24,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.dialog { background: var(--flaeche); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.dialog-kopf { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--linie); }
.dialog-kopf h2 { margin: 0; font-size: 1.05rem; }
.dialog-kopf button { background: none; border: none; font-size: 1.3rem; color: var(--gedaempft); cursor: pointer; line-height: 1; }
.dialog-koerper { padding: 20px; }
.dialog-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--linie); }

#toast { position: fixed; bottom: 22px; right: 22px; z-index: 200; background: var(--tinte); color: var(--flaeche); padding: 11px 18px; border-radius: var(--radius-klein); font-size: .88rem; box-shadow: var(--schatten); max-width: 340px; }
#toast.fehler { background: var(--kritisch); }

.status-warnungen { margin: 0; padding-left: 18px; font-size: .84rem; color: var(--warn); }
.status-zeile { display: flex; justify-content: space-between; padding: 5px 0; font-size: .86rem; border-bottom: 1px dashed var(--linie); }
.status-zeile:last-child { border-bottom: none; }
.status-zeile span:first-child { color: var(--gedaempft); }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.kennzahl .wert { font-size: 1.5rem; font-weight: 700; }
.kennzahl .titel { font-size: .78rem; color: var(--gedaempft); }

.produkt-gruppe { margin-bottom: 24px; }
.produkt-gruppe h3 { font-size: .92rem; margin: 0 0 10px; }
.gewerk-zeile { padding: 10px 0; border-bottom: 1px solid var(--linie); font-size: .86rem; }
.gewerk-zeile:last-child { border-bottom: none; }
.gewerk-zeile b { display: inline; }
.gewerk-zeile .neben { color: var(--gedaempft); }
.chip { display: inline-block; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 100px; padding: 2px 9px; font-size: .74rem; margin: 2px 3px 0 0; }

/* Dashboard-Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kacheln.klein { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-left: 3px solid var(--linie-stark); border-radius: var(--radius); padding: 14px 16px; }
.kachel .wert { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.kachel .titel { font-size: .78rem; color: var(--gedaempft); margin-top: 3px; }
.kachel.kritisch { border-left-color: var(--kritisch); }
.kachel.warn { border-left-color: var(--warn); }
.kachel.gut { border-left-color: var(--gut); }
.kachel.akzent { border-left-color: var(--akzent); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: none; border: none; padding: 9px 14px; font-size: .9rem; color: var(--gedaempft); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--tinte); }
.tab.aktiv { color: var(--akzent); border-bottom-color: var(--akzent); font-weight: 600; }

.abschnitt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gedaempft); margin: 18px 0 8px; }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: var(--flaeche-2); }
.rechts { text-align: right; }
.akzent-text { color: var(--akzent); }

.warnliste { margin: 0 0 12px; padding-left: 18px; color: var(--warn); font-size: .86rem; }
.warnliste li { margin: 2px 0; }

/* Onboarding-Fortschritt + Checkliste */
.fortschritt { height: 8px; background: var(--flaeche-2); border-radius: 100px; overflow: hidden; border: 1px solid var(--linie); }
.fortschritt-balken { height: 100%; background: var(--gut); }
.checkliste { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.check-zeile { display: flex; align-items: flex-start; gap: 9px; padding: 6px 4px; font-size: .9rem; cursor: pointer; }
.check-zeile input { margin-top: 2px; }

.aktion-gitter { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 7px 0; border-bottom: 1px dashed var(--linie); font-size: .88rem; }
.log li:last-child { border-bottom: none; }
.log .neben { margin-right: 8px; }

.fehler-liste { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.fehler-eintrag { border: 1px solid var(--linie); border-radius: var(--radius-klein); padding: 10px 12px; background: var(--flaeche-2); }
.fehler-eintrag.erledigt { opacity: .55; }
.fehler-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.fehler-kopf code { background: var(--akzent-weich); color: var(--akzent); padding: 2px 7px; border-radius: 5px; font-size: .82rem; font-weight: 700; }
.fehler-kopf .neben { color: var(--gedaempft); font-size: .8rem; }
.fehler-kopf button { margin-left: auto; }
.fehler-text { font-size: .88rem; margin-bottom: 3px; }
.fehler-eintrag .neben { color: var(--gedaempft); font-size: .78rem; word-break: break-all; }
.menue-zeile input[type="text"] { flex: 1; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .leiste { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .leiste-menue { flex-direction: row; flex-wrap: wrap; }
  .inhalt { padding: 20px 16px 60px; }
  .feld-reihe { grid-template-columns: 1fr; }
}

/* ── Rechnungen / Portal ─────────────────────────────────────────────────── */
a.knopf { display: inline-block; text-decoration: none; }
.pos-zeile { display: grid; grid-template-columns: 1fr 90px 120px; gap: 6px; margin-bottom: 6px; }
.ticket-verlauf { display: flex; flex-direction: column; gap: 10px; }
.ticket-nachricht { border: 1px solid var(--linie); border-radius: var(--radius-klein); padding: 10px 13px; background: var(--flaeche-2); max-width: 85%; }
.ticket-nachricht.betreiber { align-self: flex-end; background: var(--akzent-weich); border-color: var(--akzent-linie); }
.ticket-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }

/* ── Betriebsprofil (Prüfansicht) ─────────────────────────────────────────── */
.profil-abschnitt { margin-bottom: 20px; }
.profil-abschnitt h3 { font-size: 1rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profil-abschnitt dl { margin: 0; }
.profil-zeile { display: grid; grid-template-columns: 240px 1fr; gap: 4px 16px; padding: 7px 8px; border-bottom: 1px solid var(--linie); }
.profil-zeile.diff { background: var(--akzent-weich); border-radius: 6px; }
.profil-zeile dt { color: var(--gedaempft); }
.profil-zeile dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profil-alt { color: var(--gedaempft); text-decoration: line-through; font-size: .85em; }
.profil-fehler { color: var(--kritisch); font-size: .85em; }
.profil-logo { max-width: 160px; max-height: 90px; margin-top: 6px; border: 1px solid var(--linie); border-radius: 6px; background: #fff; padding: 6px; }
.hinweis-betrug { border: 1px solid var(--warn); background: var(--warn-weich); color: var(--warn); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
@media (max-width: 720px) { .profil-zeile { grid-template-columns: 1fr; } }

/* ── Benutzer, Konto, Demo-Center ─────────────────────────────────────────── */
.geheim-box { font-family: ui-monospace, Consolas, monospace; background: var(--flaeche-2); border: 1px dashed var(--linie-stark); border-radius: var(--radius-klein); padding: 10px 12px; margin: 8px 0; word-break: break-all; user-select: all; }
.geheim-box code { display: inline-block; margin: 2px 6px 2px 0; }
.nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-suche { max-width: 360px; margin: 6px 0 14px; }
.demo-plaetze { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.demo-platz { border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; background: var(--flaeche-2); }
.demo-platz.belegt { border-color: var(--akzent-linie); background: var(--akzent-weich); }
.demo-aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.demo-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.demo-kachel { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); color: inherit; font: inherit; cursor: pointer; }
.demo-kachel:hover, .demo-kachel:focus-visible { border-color: var(--akzent); box-shadow: var(--schatten); outline: none; }
.demo-leitfaden { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.demo-platz .haupt { font-weight: 650; margin-bottom: 2px; }
