/* Eine Datei für Verwaltung und Bestellseite.
   Bestellseite: alle Klassen mit „bs-“, damit der freie HTML-Teil oben
   eigene Stile mitbringen kann, ohne mit unseren zu kollidieren. */
:root {
  --bg: #f4f6f8;
  --karte: #ffffff;
  --rand: #e2e6ea;
  --text: #1f2933;
  --grau: #6b7683;
  --akzent: #1d4ed8;
  --akzent-hell: #eef3ff;
  --gruen: #157347;
  --rot: #b02a37;
  --gelb: #b7791f;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
a { color: var(--akzent); }

/* ---------- Verwaltung ---------- */
body.verwaltung a { text-decoration: none; }
body.verwaltung a:hover { text-decoration: underline; }
header.kopf {
  background: var(--karte); border-bottom: 1px solid var(--rand);
  padding: 0.9rem 1.5rem; display: flex; justify-content: space-between; align-items: center;
}
header.kopf .titel { font-weight: 600; }
header.kopf .titel a { color: var(--text); }
header.kopf nav a, header.kopf nav .grau { margin-left: 1.2rem; font-size: 0.95rem; }
main { max-width: 980px; margin: 1.5rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
h3 { font-size: 0.95rem; margin: 0 0 0.6rem; color: var(--grau); }
h3.abstand { margin-top: 1.2rem; }
.karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; margin-bottom: 1rem;
}
.karte.breit { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--grau); }
td.rechts, th.rechts { text-align: right; }
table.posten td { border: none; padding: 0.2rem 0.5rem; font-size: 0.9rem; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; }
.badge.ok { background: #e6f4ea; color: var(--gruen); }
.badge.neutral { background: #eef1f4; color: var(--grau); }
.badge.warn { background: #fdf3e0; color: var(--gelb); }
input, button, select, textarea {
  font: inherit; padding: 0.5rem 0.7rem; border: 1px solid var(--rand);
  border-radius: 7px; background: #fff;
}
textarea.voll { width: 100%; margin-bottom: 0.6rem; }
button, .btn {
  background: var(--akzent); color: #fff; border: none; cursor: pointer;
  font-weight: 500; padding: 0.5rem 1rem; border-radius: 7px; display: inline-block;
}
button.sekundaer, .btn.sekundaer { background: #eef1f4; color: var(--text); }
button.gefahr { background: var(--rot); }
button:disabled { opacity: 0.4; cursor: default; }
.zeile { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.aktionen { margin-bottom: 1rem; }
form.inline { display: inline; }
.feld { margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.feld > label { font-size: 0.85rem; color: var(--grau); }
.hinweis { color: var(--grau); font-size: 0.88rem; }
.grau { color: var(--grau); font-size: 0.88rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.leer { color: var(--grau); font-style: italic; }
.beschreibung { white-space: pre-wrap; color: var(--grau); }
.zentriert { max-width: 380px; margin: 4rem auto; }
.fehler-box { background: #fdecea; color: var(--rot); border-radius: 7px; padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.fehler-box ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.ok-box { background: #e6f4ea; color: var(--gruen); border-radius: 7px; padding: 0.6rem 0.8rem; font-size: 0.9rem; }
ul.bilder { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.8rem; }
ul.bilder li { display: flex; flex-direction: column; gap: 0.3rem; }
ul.bilder img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rand); }
ul.bilder .mono { font-size: 0.72rem; word-break: break-all; }

/* ---------- Bestellseite ---------- */
body.seite { background: #f2f4f7; padding-bottom: 6rem; }
.bs-vorschau { background: #fdf3e0; color: var(--gelb); text-align: center; padding: 0.5rem; font-size: 0.9rem; }
.bs-angebot { width: 100%; }
.bs-bestellteil { max-width: 1040px; margin: 2rem auto 0; padding: 0 1rem; }
.bs-schmal { max-width: 760px; margin: 2.5rem auto; padding: 0 1rem; }
.bs-karte, .bs-bestellteil {
  background: var(--karte); border-radius: 14px; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .06);
}
.bs-karte { padding: 1.8rem; }
.bs-bestellteil { padding: 1.6rem 1.6rem 0.4rem; }
.bs-karte h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.bs-kopfzeile h2 { font-size: 1.4rem; margin: 0; }
.bs-meta { color: var(--grau); margin: 0.2rem 0 1.2rem; }
.bs-info { background: var(--akzent-hell); border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.bs-fehler { background: #fdecea; color: var(--rot); border-radius: 8px; padding: 0.4rem 0.9rem; margin-bottom: 1rem; font-weight: 500; }
.bs-fehler p { margin: 0.3rem 0; }
.bs-liste { width: 100%; border-collapse: collapse; }
.bs-liste th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grau); padding: 0.5rem; border-bottom: 2px solid var(--rand); }
.bs-liste td { padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--rand); vertical-align: middle; }
.bs-liste .r { text-align: right; }
.bs-liste tr.bs-gruppe th {
  text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text);
  padding-top: 1.3rem; border-bottom: 1px solid var(--rand);
}
.bs-artnr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; color: var(--grau); white-space: nowrap; }
.bs-einheit { color: var(--grau); font-size: 0.85rem; }
.bs-preis, .bs-zeile { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bs-zeile { font-weight: 600; min-width: 6rem; }
.bs-menge input {
  width: 5.5rem; text-align: right; font-size: 1.05rem; padding: 0.45rem 0.6rem;
  border: 1px solid #cfd6de; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.bs-menge input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: var(--akzent); }
tr.bs-gewaehlt td { background: var(--akzent-hell); }
.bs-nurmobil { display: none; }
.bs-feld { margin: 1.4rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.bs-feld label { color: var(--grau); font-size: 0.9rem; }
.bs-feld textarea { width: 100%; font: inherit; padding: 0.6rem; border: 1px solid #cfd6de; border-radius: 8px; }
.bs-leiste {
  position: sticky; bottom: 0; margin: 0 -1.6rem; padding: 0.9rem 1.6rem;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--rand); border-radius: 0 0 14px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.bs-klein { color: var(--grau); font-size: 0.85rem; }
.bs-leiste .bs-klein { display: block; }
.bs-summe { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-knopf {
  background: var(--akzent); color: #fff; border: none; border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 1.05rem; padding: 0.85rem 1.6rem; cursor: pointer;
}
.bs-knopf:disabled { opacity: 0.5; cursor: default; }
.bs-knoepfe { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.4rem 0 1rem; }
.bs-zurueck { color: var(--grau); }
.bs-uebersicht tfoot td { border-bottom: none; padding-top: 0.9rem; font-size: 1.1rem; }
.bs-bemerkung { background: #f6f7f9; border-radius: 8px; padding: 0.7rem 0.9rem; white-space: pre-wrap; }
.bs-fuss { text-align: center; padding: 2rem 1rem 0; font-size: 0.85rem; }
.bs-fuss a { color: var(--grau); margin: 0 0.6rem; }

@media (max-width: 640px) {
  .bs-bestellteil { margin-top: 1rem; border-radius: 0; padding: 1.2rem 1rem 0.4rem; }
  .bs-leiste { margin: 0 -1rem; padding: 0.8rem 1rem; border-radius: 0; }
  #stueckliste thead { display: none; }
  #stueckliste tr.bs-position {
    display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.8rem;
    padding: 0.8rem 0; border-bottom: 1px solid var(--rand);
  }
  #stueckliste tr.bs-position td { border: none; padding: 0; }
  #stueckliste .bs-bez { grid-column: 1 / -1; grid-row: 1; font-weight: 600; }
  #stueckliste .bs-artnr { grid-column: 1; grid-row: 2; }
  #stueckliste .bs-preis { grid-column: 1; grid-row: 3; text-align: left; }
  #stueckliste .bs-menge { grid-column: 2; grid-row: 2 / span 2; }
  #stueckliste .bs-zeile { grid-column: 1 / -1; grid-row: 4; text-align: left; font-size: 0.9rem; }
  #stueckliste .bs-zeile output:empty { display: none; }
  tr.bs-gewaehlt { background: var(--akzent-hell); }
  .bs-uebersicht th:nth-child(1), .bs-uebersicht td:nth-child(1),
  .bs-uebersicht th:nth-child(4), .bs-uebersicht td:nth-child(4) { display: none; }
  .bs-uebersicht tfoot td[colspan] { display: table-cell; }
  .bs-summe { font-size: 1.3rem; }
  .bs-knopf { padding: 0.8rem 1.1rem; }
}

/* Kontakte */
.abstand-oben { margin-top: 0.8rem; }
button.klein { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.reiter { gap: 0.4rem; }
.reiter-link { padding: 0.35rem 0.8rem; border-radius: 999px; background: #eef1f4; color: var(--text); font-size: 0.92rem; }
.reiter-link.aktiv { background: var(--akzent); color: #fff; }
body.verwaltung .reiter-link:hover { text-decoration: none; }
.vorschau-liste { list-style: none; padding: 0; margin: 0 0 1rem; }
.vorschau-liste li { padding: 0.35rem 0; border-bottom: 1px solid var(--rand); }
.vorschau-liste summary { cursor: pointer; }
.vorschau-liste td.mono { width: 7rem; }

/* Versand */
.warn-box { background: #fdf3e0; color: var(--gelb); border-radius: 7px; padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.auftrag { padding: 0.8rem 0 1rem; border-bottom: 1px solid var(--rand); }
.auftrag:last-of-type { border-bottom: none; }
.fortschritt { height: 8px; background: #eef1f4; border-radius: 999px; overflow: hidden; margin: 0.6rem 0 0.3rem; }
.fortschritt span { display: block; height: 100%; background: var(--akzent); }
.zahlen { margin: 0.2rem 0 0.5rem; }

/* Tags */
.tag-chip { display: inline-flex; align-items: center; gap: 0.25rem; background: #eef3ff; color: var(--akzent);
  border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.82rem; margin: 0.1rem 0.15rem 0.1rem 0; }
a.tag-chip.aktiv { background: var(--akzent); color: #fff; }
body.verwaltung a.tag-chip:hover { text-decoration: none; }
button.tag-weg { background: none; color: var(--akzent); padding: 0 0.1rem; font-size: 0.95rem; line-height: 1; }
.tag-neu input { padding: 0.15rem 0.4rem; font-size: 0.82rem; border-style: dashed; }
.tags-zelle { max-width: 18rem; }
fieldset.empfaenger { border: 1px solid var(--rand); border-radius: 8px; padding: 0.6rem 0.9rem 0.8rem; margin: 0 0 1rem; }
fieldset.empfaenger legend { font-size: 0.85rem; color: var(--grau); padding: 0 0.3rem; }
.checkbox-zeile { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 1rem; }
.checkbox-zeile input { width: auto; padding: 0; }

/* Auswertung */
.kpi-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.kpi { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.15rem; }
.kpi-name { color: var(--grau); font-size: 0.82rem; }
.kpi-wert { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.kpi-fuss { color: var(--grau); font-size: 0.82rem; }
.diagramm { width: 100%; height: auto; display: block; --reihe-1: #2a78d6; --reihe-2: #eb6834; }
.diagramm .reihe-1 { fill: var(--reihe-1); }
.diagramm .reihe-2 { fill: var(--reihe-2); }
.diagramm path:hover { opacity: 0.8; }
.diagramm .gitter { stroke: #eef0f2; stroke-width: 1; }
.diagramm .grundlinie { stroke: #c9cfd6; }
.diagramm .achse { fill: var(--grau); font-size: 11px; font-variant-numeric: tabular-nums; }
.legende { display: flex; gap: 1.2rem; font-size: 0.85rem; color: var(--grau); margin-bottom: 0.4rem; }
.legende .punkt { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; }
.legende .reihe-1 { background: #2a78d6; }
.legende .reihe-2 { background: #eb6834; }
tr.summe td { font-weight: 600; border-top: 2px solid var(--rand); }
button.link-knopf { background: none; color: var(--akzent); padding: 0; font-weight: 400; font-size: 0.95rem; margin-left: 1.2rem; }
button.link-knopf:hover { text-decoration: underline; }

/* ---------- Verwaltung im UBMT-Auftritt (design-system/design-konzept.md) ----------
   Gold nur als Akzent, dunkle Flächen als Navy-Verlauf, Georgia für
   Überschriften, Arial für Bedienung. Nur body.verwaltung — die öffentliche
   Bestellseite trägt den Auftritt des Kunden. */
body.verwaltung {
  --gold: #E8A020; --gold-hell: #f0b030; --gold-soft: rgba(232, 160, 32, 0.12);
  --navy: #1A3C6E; --navy-dunkel: #0D2448;
  --text: #1A1A2E; --grau: #6A7487; --rand: #DDE2EC; --bg: #F0F2F7;
  --akzent: var(--navy); --akzent-hell: #e8eef7;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg); color: var(--text);
}
body.verwaltung h1, body.verwaltung h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: var(--navy-dunkel); }
body.verwaltung h1 { font-size: 1.7rem; }
body.verwaltung .rahmen { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
body.verwaltung main { max-width: 1060px; width: 100%; margin: 0; padding: 2rem 2.5rem 3rem; }
.seitenleiste {
  background: linear-gradient(160deg, var(--navy), var(--navy-dunkel)); color: #fff;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 1.4rem 1rem; box-shadow: 2px 0 12px rgba(26, 60, 110, .15);
}
.seitenleiste .marke { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; padding: 0 .4rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12); }
body.verwaltung .seitenleiste a.marke:hover { text-decoration: none; }
.seitenleiste .marke img { border-radius: 6px; box-shadow: 0 0 0 2px rgba(232, 160, 32, .6); }
.seitenleiste .marke b { display: block; font-family: Georgia, serif; font-size: 1.1rem; }
.seitenleiste .marke small { display: block; color: var(--gold); font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; margin-top: .15rem; }
.menue { display: flex; flex-direction: column; gap: .2rem; margin-top: 1.2rem; }
.menue a { color: rgba(255, 255, 255, .82); padding: .65rem .8rem; border-radius: 3px; border-left: 3px solid transparent; font-size: .95rem; }
body.verwaltung .menue a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.menue a.aktiv { color: #fff; background: rgba(232, 160, 32, .14); border-left-color: var(--gold); font-weight: 700; }
.seitenleiste .nutzer { margin-top: auto; padding: 1rem .8rem 0; border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; justify-content: space-between; align-items: center; font-size: .88rem; color: rgba(255, 255, 255, .7); }
.seitenleiste button.link-knopf { color: var(--gold); margin: 0; font-size: .88rem; }

/* Bedienelemente nach Konzept */
body.verwaltung a { color: var(--navy); }
body.verwaltung button, body.verwaltung .btn {
  background: var(--gold); color: var(--text); border-radius: 3px; font-family: Arial, sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; padding: .7rem 1.3rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
body.verwaltung button:hover:not(:disabled), body.verwaltung .btn:hover { background: var(--gold-hell); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 60, 110, .15); opacity: 1; text-decoration: none; }
body.verwaltung button.sekundaer, body.verwaltung .btn.sekundaer { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--rand); }
body.verwaltung button.sekundaer:hover, body.verwaltung .btn.sekundaer:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--navy), 0 4px 12px rgba(26, 60, 110, .1); }
body.verwaltung button.gefahr { background: var(--rot); color: #fff; }
body.verwaltung button.klein { padding: .35rem .7rem; font-size: .7rem; letter-spacing: .06em; }
body.verwaltung button.link-knopf, body.verwaltung button.tag-weg { background: none; box-shadow: none; text-transform: none; letter-spacing: 0;
  padding: 0; font-weight: 400; transform: none; }
body.verwaltung button.tag-weg { color: var(--navy); font-size: .95rem; }
body.verwaltung .karte { border-color: var(--rand); border-radius: 8px; box-shadow: 0 1px 2px rgba(26, 60, 110, .05); }
body.verwaltung th { font-family: Arial, sans-serif; color: var(--grau); }
body.verwaltung .badge.warn { background: var(--gold-soft); color: #9a6408; }
body.verwaltung .reiter-link.aktiv, body.verwaltung a.tag-chip.aktiv { background: var(--navy); color: #fff; }
body.verwaltung .tag-chip { background: var(--akzent-hell); color: var(--navy); }
body.verwaltung .kpi { border-top: 3px solid var(--gold); }
body.verwaltung .kpi-wert { font-family: Georgia, serif; color: var(--navy-dunkel); }
body.verwaltung .fortschritt span { background: linear-gradient(90deg, var(--navy), var(--gold)); }
body.verwaltung input:focus, body.verwaltung textarea:focus, body.verwaltung select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
body.verwaltung .zentriert { margin: 6rem auto; }

@media (max-width: 860px) {
  body.verwaltung .rahmen { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .8rem 1rem; }
  .seitenleiste .marke { border: none; padding: 0; }
  .menue { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .menue a { border-left: none; border-bottom: 3px solid transparent; padding: .4rem .6rem; }
  .menue a.aktiv { border-bottom-color: var(--gold); }
  .seitenleiste .nutzer { margin: 0 0 0 auto; border: none; padding: 0; gap: .8rem; }
  body.verwaltung main { padding: 1.2rem 1rem 2rem; }
}
/* Menü-Links nicht von der allgemeinen Linkfarbe überschreiben lassen */
body.verwaltung .menue a { color: rgba(255, 255, 255, .82); }
body.verwaltung .menue a.aktiv { color: #fff; }
/* Kennzahlen in Arial: Georgia hat Mediävalziffern, die in Zahlenreihen springen */
body.verwaltung .kpi-wert { font-family: Arial, sans-serif; font-variant-numeric: tabular-nums; }

/* Einstellungen und Rechtstexte */
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.2rem; }
h2.abstand { margin-top: 1.4rem; }
.bs-text h2 { font-size: 1.1rem; margin: 1.4rem 0 .4rem; }
.bs-text p, .bs-text li { line-height: 1.6; }
.bs-text ul { padding-left: 1.2rem; }
