/* Verwaltung. Zuerst fürs Tablet im Laden, geht aber auch am Rechner. */

:root {
  --grund: #f6f2ed;
  --flaeche: #ffffff;
  --text: #2b1d16;
  --leise: #76655a;
  --linie: #e5dbd0;
  --akzent: #b3261e;
  --akzent-text: #ffffff;
  --gut: #2e7d32;
  --warn: #b26a00;
  --neu: #fff3d6;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #17120f;
    --flaeche: #231c17;
    --text: #f4ece4;
    --leise: #b4a395;
    --linie: #3b3129;
    --akzent: #e4574b;
    --akzent-text: #17120f;
    --gut: #81c784;
    --warn: #ffb74d;
    --neu: #3a2c12;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
a { color: var(--akzent); }
.leise { color: var(--leise); }
.mitte { text-align: center; padding: 48px 16px; }
.zahl { font-variant-numeric: tabular-nums; }

/* ── Leiste ─────────────────────────────────────────────────────── */
.leiste {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.navi { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.navi a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); white-space: nowrap;
}
.navi a.aktiv { background: var(--grund); font-weight: 600; }
.navi .trenner { width: 1px; background: var(--linie); margin: 4px 8px; }
.leiste-rechts { display: flex; gap: 8px; align-items: center; }

.inhalt { max-width: 1280px; margin: 0 auto; padding: 16px; }
.kopfzeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kopfzeile h1 { flex: 1; }

/* ── Knöpfe und Felder ──────────────────────────────────────────── */
button, .knopf {
  font: inherit; cursor: pointer; border-radius: 10px; padding: 10px 16px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button.haupt, .knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
button.gefahr { color: var(--akzent); border-color: var(--akzent); }
button.klein, .klein { padding: 6px 10px; font-size: .9rem; border-radius: 8px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); text-decoration: none; }
button:disabled { opacity: .5; cursor: default; }
button.gross { padding: 14px 20px; font-size: 1.05rem; }

label.feld { display: block; margin: 0 0 12px; font-size: .9rem; color: var(--leise); }
label.feld > input, label.feld > select, label.feld > textarea,
input.eingabe, select.eingabe {
  display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 9px 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.zeile { display: flex; gap: 12px; flex-wrap: wrap; }
.zeile > * { flex: 1; min-width: 140px; }
.zeile > .schmal { flex: 0 0 110px; min-width: 0; }
.haken { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; color: var(--text); font-size: .95rem; }
.haken input { width: 18px; height: 18px; accent-color: var(--akzent); }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.karte > h2 { margin-bottom: 12px; }
.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); font-weight: 600; }
td.r, th.r { text-align: right; }
.tabelle-huelle { overflow-x: auto; }

.marke { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.marke.gut { color: var(--gut); }
.marke.warn { color: var(--warn); }
.marke.aus { color: var(--leise); }
.marke.akzent { color: var(--akzent); }

.meldung {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--grund); padding: 12px 18px; border-radius: 10px; max-width: calc(100% - 32px);
}
.meldung.fehler { background: var(--akzent); color: var(--akzent-text); }

.dialog {
  border: none; padding: 0; border-radius: var(--radius); width: min(720px, calc(100% - 24px));
  max-height: calc(100% - 24px); background: var(--flaeche); color: var(--text);
}
.dialog::backdrop { background: rgb(0 0 0 / .5); }
.dialog form { padding: 20px; }
.dialog h2 { margin-bottom: 16px; }
.dialog-fuss { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.dialog-fuss .links { margin-right: auto; }
.geheim { font-family: ui-monospace, Menlo, monospace; background: var(--grund); padding: 10px 12px; border-radius: 8px; user-select: all; word-break: break-all; }

/* ── Anmeldung ──────────────────────────────────────────────────── */
.anmeldung { max-width: 380px; margin: 10vh auto 0; }
.anmeldung img { display: block; margin: 0 auto 16px; }
.anmeldung h1 { text-align: center; margin-bottom: 20px; }
.fehlertext { color: var(--akzent); min-height: 1.4em; }

/* ── Bestellungen ───────────────────────────────────────────────── */
.spalten { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .spalten { grid-template-columns: 1fr; } }
.spalte > h2 { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 1rem; }
.leer { color: var(--leise); border: 1px dashed var(--linie); border-radius: var(--radius); padding: 20px; text-align: center; }
.bestellung { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.bestellung.neu { background: var(--neu); border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn); }
.bestellung-kopf { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.bestellung-kopf .nr { font-size: 1.3rem; font-weight: 800; }
.bestellung-kopf .zeit { margin-left: auto; color: var(--leise); font-size: .9rem; }
.kunde { font-size: .95rem; margin: 6px 0; }
.kunde .hinweis { display: block; margin-top: 4px; padding: 6px 8px; background: var(--grund); border-radius: 6px; }
.posten { list-style: none; padding: 0; margin: 8px 0; border-top: 1px solid var(--linie); }
.posten li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--linie); }
.posten li .menge { font-weight: 700; min-width: 2.2em; }
.posten li .was { flex: 1; }
.posten li small { display: block; color: var(--leise); }
.summe-zeile { display: flex; justify-content: space-between; font-weight: 700; margin: 6px 0 10px; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.aktionen .haupt { flex: 1; }
.zusage { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.zusage button { flex: 1; min-width: 56px; padding: 12px 6px; font-weight: 600; }
.zusage button.vorschlag { border-color: var(--akzent); color: var(--akzent); }
.abgeschlossen summary { cursor: pointer; padding: 8px 0; color: var(--leise); }
.pause-an { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.band { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--akzent); background: var(--flaeche); }

/* ── Karte ──────────────────────────────────────────────────────── */
.kategorie-kopf { display: flex; align-items: center; gap: 8px; margin: 24px 0 8px; }
.kategorie-kopf h2 { flex: 1; }
tr.inaktiv td { opacity: .5; }
.preise { color: var(--leise); font-size: .9rem; }
.auswahl-gitter { display: flex; flex-wrap: wrap; gap: 4px 0; margin-bottom: 12px; }
.matrix input { width: 80px; padding: 6px 8px; font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; text-align: right; }
.matrix td, .matrix th { padding: 4px 6px; }

/* ── Übersicht ──────────────────────────────────────────────────── */
.kacheln { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px; }
.kachel .wert { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kachel .name { color: var(--leise); font-size: .85rem; }

/* ── Bon ────────────────────────────────────────────────────────── */
.bon { display: none; }
@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body.drucke-bon > *:not(#bon) { display: none !important; }
  body.drucke-bon { background: #fff; color: #000; }
  body.drucke-bon #bon { display: block; font: 12pt/1.3 ui-monospace, Menlo, monospace; color: #000; width: 72mm; }
  #bon h1 { font-size: 16pt; text-align: center; margin: 0 0 2mm; }
  #bon .gross { font-size: 22pt; font-weight: 800; text-align: center; margin: 2mm 0; }
  #bon hr { border: none; border-top: 1px dashed #000; margin: 2mm 0; }
  #bon .z { display: flex; justify-content: space-between; gap: 2mm; }
  #bon .einzug { padding-left: 6mm; font-size: 10pt; }
  #bon .fett { font-weight: 800; }
}
