/* Plateline-Bausatz, Schicht 3: Werkzeug. Festes Plateline-Design aller Inhaber-Werkzeuge (Preisrechner, Dashboard,
   Passwort festlegen, jedes neue Modul), bei jedem Restaurant gleich. Bausteine: Arbeitsfläche, Titel mit Reitern,
   Anmeldung („Tor“), Meldungen, Textknopf, Inhalt, Hinweise, Leer- und Ladezustand, Kasten, Aufklappen, Felder,
   Kennzahlen, Karten, Tabelle, Zeitraum-Pillen, Diagrammfarben. Übersicht: test/oberflaeche/musterseite.html.
   Werkzeug-CSS (preisrechner.css, dashboard.css, Module) nutzt nur diese Variablen, keine eigenen Farben (test/bausatz.test.js). */

:root {
  --pl-papier: #ffffff;         /* Tabellen, Karten, Felder */
  --pl-ebene: #e6ebe9;          /* zweite Ebene: Tabellenköpfe */
  --pl-ebene-leicht: #f7f9f8;   /* Gruppen, Hover */
  --pl-linie: #d3dbd8;
  --pl-linie-leicht: #e8edeb;
  --pl-feldrand: #a9b6b3;
  --pl-leise: #4d5c59;          /* Nebentext (7,1:1 auf Weiß) */
  --pl-pfirsich-hell: #fff1e9;  /* Hinweise */
  --pl-pfirsich-rand: #ffc9ae;
  --pl-achtung: #9a3412;        /* „fehlt“, Hinweis-Schrift (7:1 auf Weiß) */
  --pl-fehler: #b42318;
  --pl-zeile-offen: #fbfcfc;     /* aufgeklappte Zeile */
  --pl-platzhalter: #6b7976;
  --pl-fehler-hell: #fdecea;
  --pl-fehler-rand: #f0b4ac;
  --pl-fehler-text: #7a1a12;
  --pl-ok-hell: #e8f1e8;
  --pl-ok-rand: #8fae94;
  --pl-ok-text: #173d20;
  --pl-schatten-karte: 0 1px 2px rgba(14, 27, 26, .05), 0 10px 24px -16px rgba(14, 27, 26, .25);
  --pl-schatten-hinweis: 0 4px 14px -6px rgba(14, 27, 26, .3);
  --pl-schatten-tipp: 0 8px 20px -6px rgba(14, 27, 26, .35);
  /* Diagramme (mit dem dataviz-Prüfer kontrolliert: Kontrast ≥ 3:1 auf Weiß, Farbsehschwäche ΔE 11,4) */
  --pl-diagramm-1: #008a78;      /* Speisen */
  --pl-diagramm-1-tief: #006b5d;
  --pl-diagramm-2: #d9541f;      /* Getränke */

  /* Namen, die preisrechner.css und dashboard.css verwenden (früher aus style.css) */
  --papier: var(--pl-flaeche);
  --karte: var(--pl-papier);
  --tinte: var(--pl-nacht);
  --grau: var(--pl-leise);
  --bordeaux: var(--pl-nacht);
  --bordeaux-dunkel: #000;
  --gold: var(--pl-orange);
  --linie: var(--pl-linie);
  --serif: var(--pl-schrift);
  --sans: var(--pl-schrift);
}

body.pr { margin: 0; font-family: var(--pl-schrift); font-size: 1rem; line-height: 1.5; color: var(--pl-nacht); background: var(--pl-flaeche); caret-color: var(--pl-orange); }
.pr h1, .pr h2, .pr h3, .pr h4, .pr h5 { margin: 0; font-family: var(--pl-schrift); line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.pr button, .pr input, .pr select, .pr textarea { font: inherit; }
.pr a { color: var(--pl-nacht); text-underline-offset: 3px; }
.pr ::selection { background: var(--pl-pfirsich); color: var(--pl-nacht); }
.pr input, .pr select, .pr textarea { accent-color: var(--pl-orange); }

/* Titel des Werkzeugs, darunter die Reiter (bleibt beim Scrollen oben) */
.pl-unterkopf { position: sticky; top: 0; z-index: 10; background: var(--pl-flaeche); border-bottom: 1px solid var(--pl-linie); }
.pl-titel { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .3rem 1.5rem; max-width: 72rem; margin: 0 auto; padding: 1.4rem 1.25rem 0; }
.pl-titel h1 { font-size: 2rem; letter-spacing: -0.03em; }
.pl-stand { margin: 0; padding-bottom: .3rem; font-size: .92rem; color: var(--pl-leise); }
@media (max-width: 40rem) {
  .pl-unterkopf { position: static; }
  .pl-titel { padding: 1.1rem 1rem 0; }
  .pl-titel h1 { font-size: 1.6rem; }
}

/* ---------- Grundlage, Anmeldung, Reiter, Inhalt, Hinweise (früher in preisrechner.css) ---------- */
body.pr { background: var(--papier); caret-color: var(--bordeaux); }
.pr a { text-underline-offset: 3px; }
.pr button { font: inherit; }

/* ---------- Anmeldung und Passwort-Seite ---------- */
.pr-tor { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; padding: 2rem 1rem; background: var(--pl-nacht); }
.pr-tor > .pl-lockup { justify-content: center; gap: 1.1rem; }
.pr-tor .pr-laden { color: #a7b4b1; }
.pr-tor > .pl-lockup .pl-zeichen { width: 3.4rem; height: 1.8rem; }
.pr-tor > .pl-lockup .pl-wort { font-size: 1.65rem; }
.pr-tor > .pl-lockup .pl-strich { height: 2.4rem; }
.pr-tor > .pl-lockup .pl-haus { height: 2.4rem; max-width: 15rem; }
@media (max-width: 30rem) {
  .pr-tor > .pl-lockup .pl-zeichen { width: 2.5rem; height: 1.3rem; }
  .pr-tor > .pl-lockup .pl-wort { font-size: 1.25rem; }
  .pr-tor > .pl-lockup .pl-strich { height: 1.8rem; }
  .pr-tor > .pl-lockup .pl-haus { height: 1.8rem; max-width: 10rem; }
}
.pr-tor-karte {
  width: min(26rem, 100%); padding: 1.8rem 1.6rem 1.6rem; text-align: left; background: var(--pl-papier);
  border-radius: 16px; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .55);
}
.pr-tor-karte h1 { font-size: 1.6rem; letter-spacing: -0.025em; }
.pr-tor-karte h1:focus { outline: none; }
.pr-tor-text { margin: .5rem 0 1.2rem; color: var(--grau); }
.pr-tor-karte label { display: block; text-align: left; margin: .9rem 0 .3rem; font-family: var(--sans); font-size: .88rem; font-weight: 600; }
.pr-tor-karte input[type="email"], .pr-tor-karte input[type="password"], .pr-tor-karte input[type="text"] {
  width: 100%; padding: .75rem .85rem; border: 1px solid var(--pl-feldrand); border-radius: 10px; background: #fff; color: var(--tinte); font: 1rem var(--sans);
}
.pr-tor-karte .primaer { margin-top: 1.3rem; }
.pr-tor-karte .sekundaer { margin-top: .55rem; }
.pr-tor-karte .pr-textknopf { margin-top: .5rem; }
.pr-tor-link { margin: 1rem 0 0; font-family: var(--sans); font-size: .9rem; }
.pr-code { text-align: center; font-size: 1.6rem !important; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.pr-zeigen { display: flex !important; align-items: center; gap: .5rem; margin: .7rem 0 0 !important; font-weight: 400 !important; cursor: pointer; }
.pr-zeigen input { width: 1.1rem; height: 1.1rem; }
.pr-tor-karte .pr-hinweis { text-align: left; }

.pr-meldung { text-align: left; margin: 1rem 0 0; padding: .65rem .8rem; font-family: var(--sans); font-size: .9rem; border: 1px solid var(--linie); border-radius: 10px; background: #fff; }
.pr-meldung.fehler-meldung { border-color: var(--pl-fehler-rand); background: var(--pl-fehler-hell); color: var(--pl-fehler-text); }
.pr-meldung.ok-meldung { border-color: var(--pl-ok-rand); background: var(--pl-ok-hell); color: var(--pl-ok-text); }

/* Schlichter Textknopf (Abmelden, Abbrechen, Löschen) */
.pr-textknopf {
  min-height: 2.75rem; padding: .4rem .3rem; background: none; border: 0; color: var(--grau); cursor: pointer;
  font-family: var(--sans); font-size: .88rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.pr-textknopf:hover { color: var(--bordeaux); }

/* ---------- Reiter (unter dem Titel, Kopfleiste siehe plateline-rahmen.css) ---------- */
.pr-reiter { display: flex; gap: .25rem; max-width: 72rem; margin: 0 auto; padding: .7rem 1rem 0; overflow-x: auto; scrollbar-width: none; }
.pr-reiter::-webkit-scrollbar { display: none; }
.pr-reiter button {
  flex: none; min-height: 2.9rem; padding: .55rem .85rem .7rem; margin-bottom: -1px; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  color: var(--grau); cursor: pointer; font-family: var(--sans); font-size: 1rem; font-weight: 500;
}
.pr-reiter button:hover { color: var(--pl-nacht); }
.pr-reiter button[aria-pressed="true"] { color: var(--pl-nacht); font-weight: 600; border-bottom-color: var(--pl-orange); }

.pr-fehler-leiste { max-width: 69.5rem; margin: 1rem auto 0; padding: .7rem 1rem; border: 1px solid var(--pl-fehler-rand); border-radius: 10px; background: var(--pl-fehler-hell); color: var(--pl-fehler-text); font-family: var(--sans); font-size: .92rem; font-weight: 600; }

/* ---------- Inhalt ---------- */
.pr-inhalt { max-width: 72rem; margin: 0 auto; padding: 1.8rem 1.25rem 3rem; }
.pr-laden { text-align: center; color: var(--grau); padding: 3rem 0; }
.pr-inhalt h2 { font-size: 1.55rem; letter-spacing: -0.02em; }
.pr-inhalt h2:focus, .pr-inhalt h3:focus { outline: none; }
.pr-lead { max-width: 70ch; margin: .45rem 0 1.4rem; color: var(--grau); }
.pr-text { margin: .4rem 0 1rem; max-width: 68ch; }
.pr-hinweis { margin: .3rem 0 .6rem; font-family: var(--sans); font-size: .84rem; line-height: 1.45; color: var(--grau); max-width: 68ch; }
.pr-hinweis-zeile { margin: .6rem 0; font-family: var(--sans); font-size: .88rem; color: var(--grau); }
.pr-leer { margin: 1.5rem 0; padding: 1.4rem 1.2rem; text-align: center; color: var(--grau); background: var(--pl-papier); border: 1px dashed var(--pl-feldrand); border-radius: 12px; }
.pr-fussnote { margin: 2rem 0 0; padding-top: .8rem; border-top: 1px solid var(--linie); font-family: var(--sans); font-size: .8rem; line-height: 1.5; color: var(--grau); }

/* Hinweiskasten (fehlende Angaben) */
.pr-kasten { margin: 1rem 0 1.5rem; padding: 1rem 1.15rem 1.1rem; border: 1px solid var(--pl-pfirsich-rand); border-radius: 12px; background: var(--pl-pfirsich-hell); }
.pr-kasten h3 { font-family: var(--sans); font-size: .95rem; font-weight: 700; }
.pr-kasten ul { margin: .5rem 0 .9rem; padding-left: 1.2rem; font-family: var(--sans); font-size: .9rem; }
.pr-kasten li + li { margin-top: .3rem; }
.pr-kasten p { margin: .45rem 0 0; font-family: var(--sans); font-size: .9rem; }
.pr-kasten-ruhig { border-color: var(--linie); background: var(--pl-papier); margin-top: 2rem; }

/* Aufklappbare Bereiche: Pfeil aus zwei Linien statt Zeichen */
.pr details > summary { list-style: none; cursor: pointer; }
.pr details > summary::-webkit-details-marker { display: none; }
.pr details > summary::before {
  content: ""; flex: none; width: .5rem; height: .5rem; margin: 0 .2rem 0 .1rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease-out; color: var(--grau);
}
.pr details[open] > summary::before { transform: rotate(45deg); }

/* ---------- Felder ---------- */
.pr-eingabe { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.pr-einheit { flex: none; min-width: 1.1rem; font-family: var(--sans); font-size: .88rem; color: var(--grau); }
.pr-wert {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: .5rem .7rem; border: 1px solid var(--pl-feldrand); border-radius: 10px; background: #fff; color: var(--tinte);
  font-family: var(--sans); font-size: 1rem; text-align: right; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.pr-wert-text { text-align: left; }
.pr-wert:hover { border-color: var(--tinte); }
.pr-wert::placeholder { color: var(--pl-platzhalter); }
.pr-wert[aria-invalid="true"] { border-color: var(--pl-fehler); box-shadow: inset 0 0 0 1px var(--pl-fehler); }
.pr-auswahl {
  min-height: 2.75rem; max-width: 100%; padding: .45rem .6rem; border: 1px solid var(--pl-feldrand); border-radius: 10px; background: #fff; color: var(--tinte);
  font-family: var(--sans); font-size: 1rem; cursor: pointer;
}
.pr-feldfehler { margin: .3rem 0 0; font-family: var(--sans); font-size: .84rem; font-weight: 600; color: var(--pl-fehler); }

.pr-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: .9rem 1.2rem; margin: 1rem 0 0; }
.pr-feld { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.pr-feld > label { font-family: var(--sans); font-size: .86rem; font-weight: 600; }
.pr-feld .pr-hinweis { margin: 0; }
.pr-feld.breit { grid-column: 1 / -1; }

/* ---------- Kennzahlen, Karten, Tabelle, Zeitraum-Pillen (früher in dashboard.css) ---------- */
/* Kennzahlen */
.dz-kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 1.2rem; background: var(--pl-papier); border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.dz-kachel { padding: 1rem 1.15rem .95rem; border-left: 1px solid var(--pl-linie-leicht); }
.dz-kachel:first-child { border-left: 0; }
.dz-k-titel { margin: 0; font-family: var(--sans); font-size: .86rem; font-weight: 500; color: var(--grau); }
.dz-k-wert { margin: .3rem 0 .3rem; font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--tinte); font-variant-numeric: tabular-nums; }
.dz-vergleich { display: block; font-family: var(--sans); font-size: .82rem; color: var(--grau); }
.dz-k-zusatz { margin: .2rem 0 0; font-family: var(--sans); font-size: .8rem; color: var(--grau); }

/* Karten */
.dz-karte { background: var(--pl-papier); border: 1px solid var(--linie); border-radius: 12px; padding: 1.1rem 1.25rem 1rem; margin-bottom: 1.2rem; }
.dz-karte h2 { font-size: 1.12rem; }
.dz-unter { margin: .15rem 0 .9rem; font-family: var(--sans); font-size: .85rem; color: var(--grau); }

/* Tabelle (Zugang ohne Diagramm) */
.dz-details { margin-top: .9rem; font-family: var(--sans); font-size: .88rem; }
.dz-details summary { cursor: pointer; color: var(--grau); width: max-content; }
.dz-details summary:hover { color: var(--pl-nacht); }
.dz-tabelle { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.dz-tabelle th, .dz-tabelle td { padding: .3rem .4rem; border-bottom: 1px solid var(--pl-linie-leicht); text-align: left; font-weight: 400; }
.dz-tabelle thead th { font-weight: 600; color: var(--grau); }
.dz-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* Zeitraum (oben) und Filter „Alle / Speisen / Getränke“: Pillen wie im Plateline-Entwurf */
.dz-zeit { display: flex; flex-wrap: wrap; gap: .4rem; max-width: 72rem; margin: 0 auto; padding: .9rem 1.25rem 1rem; }
.dz-zeit button, .dz .k-segment button {
  min-height: 2.5rem; padding: .4rem 1rem; border: 1px solid var(--pl-linie); border-radius: 999px; background: var(--pl-papier); color: var(--pl-nacht);
  font: 500 .95rem var(--pl-schrift); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.dz-zeit button:hover, .dz .k-segment button:hover { border-color: var(--pl-feldrand); background: var(--pl-ebene-leicht); }
.dz-zeit button[aria-pressed="true"], .dz .k-segment button[aria-pressed="true"] { background: var(--pl-nacht); border-color: var(--pl-nacht); color: var(--pl-flaeche); }
.dz .k-segment { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
@media (max-width: 40rem) { .dz-zeit { padding: .7rem 1rem .9rem; } .dz-zeit button { padding: .35rem .8rem; font-size: .9rem; } }
.dz-details summary { list-style: none; }
.dz-details summary::-webkit-details-marker { display: none; }
.dz-details summary::before { content: "▸"; display: inline-block; margin-right: .4rem; transition: transform .18s var(--ease-out); }
.dz-details[open] summary::before { transform: rotate(90deg); }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 600px) {
  .pr-inhalt { padding-top: 1.3rem; }
  .pr-inhalt { padding-left: 1rem; padding-right: 1rem; }
  .pr-inhalt h2 { font-size: 1.4rem; }
  .pr-reiter { padding: .5rem .5rem 0; }
  .pr-reiter button { padding: .55rem .55rem .7rem; font-size: .95rem; }
}
@media (max-width: 48rem) {
  .dz-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dz-kachel:nth-child(3) { border-left: 0; }
  .dz-kachel:nth-child(n + 3) { border-top: 1px solid var(--pl-linie-leicht); }
  .dz-k-wert { font-size: 1.4rem; }
}
