/* Verwaltung -- Artikel pflegen, Kassen ausgeben, auswerten.
   Wird am Schreibtisch benutzt, nicht am Stand: normale Groessen, aber die
   gleiche Farbwelt wie die Verkaufsansicht. */

:root {
  color-scheme: light dark;
  --akzent: #0067d6;
  --akzent-druck: #0058b8;
  --akzent-text: #0067d6;
  --grund: #f2f2f7;
  --flaeche: #ffffff;
  --flaeche-2: #f2f2f7;
  --linie: #e0e0e6;
  --text: #1c1c1e;
  --leise: #6c6c70;
  --rot: #d70015;
  --hinweis-grund: #e6f0fb;
  --fehler-grund: #fdecee;
  --support-grund: #fde68a;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --akzent: #0a6fd6;
    --akzent-druck: #0a84ff;
    --akzent-text: #4da3ff;
    --grund: #000000;
    --flaeche: #1c1c1e;
    --flaeche-2: #2c2c2e;
    --linie: #38383a;
    --text: #f2f2f7;
    --leise: #a1a1a6;
    --rot: #ff453a;
    --hinweis-grund: #10243d;
    --fehler-grund: #3a1d1f;
    --support-grund: #5c4a12;
  }
}

/* Schriftgroesse folgt unter iOS der Einstellung "Textgroesse". */
html { font-size: 100%; }
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}
/* Ein ueberlanges Wort (Name ohne Leerzeichen) bricht um, statt die Seite seitlich aufzuschieben. */
body { overflow-wrap: anywhere; }
/* Tabellen nicht: dort wuerden Spalten schmaler und Codes mitten im Wort brechen. */
table, code { overflow-wrap: break-word; }

a { color: var(--akzent-text); }
.leise { color: var(--leise); font-size: 0.938rem; }
.rechts { text-align: right; }
.zurueck { text-decoration: none; font-size: 0.938rem; }
/* Verweise zwischen den Seiten: am Finger brauchen sie eine Tippflaeche,
   die groesser ist als die Schrift. */
.zurueck, .leise > a { display: inline-block; padding: 12px 0; }

.kopf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  color: var(--text);
  position: sticky; top: 0; z-index: 10;
}
.kopf a { color: var(--akzent-text); text-decoration: none; }
.kopf .zurueck { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kopf-titel { font-size: 1rem; text-align: center; }
.kopf form { margin: 0; }

/* Reiter unten wie an der Kasse; am breiten Schirm links am Rand. */
.reiter {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--flaeche); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.reiter a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; color: var(--leise); text-decoration: none;
  font-size: .68rem; font-weight: 600;
}
.reiter svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.reiter a[aria-current="page"] { color: var(--akzent-text); }
body.mit-reiter { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }

/* Listen wie in den Einstellungen der Kasse */
.liste-gruppe { list-style: none; margin: 20px 0 0; padding: 0; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste-gruppe li + li { border-top: 1px solid var(--linie); }
.liste-gruppe a { display: flex; justify-content: space-between; align-items: center;
  min-height: 52px; padding: 0 16px; color: var(--text); text-decoration: none; }
.liste-gruppe .pfeil { color: var(--leise); font-size: 1.3rem; }
.liste-gruppe a .leise { margin-left: auto; padding: 0 10px; font-size: .875rem; }
.abmelden { margin-top: 28px; }
.abmelden button, .abmelden button:hover { width: 100%; min-height: 52px; color: var(--rot); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); font-weight: 600; }

.huelle { max-width: 900px; margin: 0 auto; padding: 24px 20px 64px; }
.schmal { max-width: 420px; margin: 40px auto; }

h1 { font-size: 1.625rem; margin: 0 0 6px; }
h2 { font-size: 1.188rem; margin: 32px 0 12px; }
h1, h2 { overflow-wrap: anywhere; }

button, .knopf-verweis {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
button.gross, .knopf-verweis {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #fff;
}
@media (hover: hover) {
  button.gross:hover, .knopf-verweis:hover { background: var(--akzent-druck); }
  button.flach:hover { background: var(--flaeche-2); }
}

/* select wie input: sonst bleibt die Auswahl am Handy ein 19 Pixel hoher
   Strich, den man kaum trifft. */
input, select {
  font: inherit;
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
}

.formular { display: grid; gap: 8px; margin: 12px 0; }
.formular label { font-size: 0.938rem; color: var(--leise); }
.formular.reihe {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}
.formular.reihe button { grid-column: auto; }

.meldung {
  background: var(--hinweis-grund);
  border-left: 4px solid var(--akzent);
  padding: 10px 14px;
  border-radius: 6px;
}
.meldung-fehler { background: var(--fehler-grund); border-left-color: var(--rot); }

.liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.liste a {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}

/* Artikelzeilen: je Zeile ein eigenes Formular. */
.zeilen { display: grid; gap: 8px; }
.zeile {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 100px auto auto;
  gap: 8px;
  align-items: center;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 10px;
  margin: 0;
}
.zeile.inaktiv { opacity: .55; }
.preisfeld { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .zeile .preisfeld { grid-column: 1 / -1; }
}

/* Breite Tabellen scrollen in sich, nicht die ganze Seite. */
.tabellenrahmen { overflow-x: auto; }
.tabelle {
  width: 100%;
  border-collapse: collapse;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}
.tabelle th, .tabelle td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--linie);
  text-align: left;
}
.tabelle th { font-size: 0.875rem; color: var(--leise); font-weight: 600; }
.tabelle tr:last-child td { border-bottom: none; }
.code {
  font: 600 1.125rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  background: var(--flaeche-2);
  padding: 4px 8px;
  border-radius: 6px;
}

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.kachel {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.kachel strong { font-size: 1.75rem; font-variant-numeric: tabular-nums; }

/* Mehrere Formulare in einer Tabellenzelle sollen nicht auseinanderlaufen. */
.formular.schmal-reihe { grid-template-columns: auto auto; gap: 6px; margin: 0; }
.formular.schmal-reihe input[type=file] { min-height: 40px; font-size: 0.875rem; border: none; padding: 0; }
.formular.schmal-reihe button { min-height: 40px; }
ul.eng { margin: 6px 0 0; padding-left: 20px; font-size: 0.938rem; }

/* Am Handy nur, was man zum Anmelden eines Platzes braucht: Name, Code und
   der Knopf. Sonst liegt "Zum Platz" hinter einem seitlichen Wischen. */
@media (max-width: 600px) {
  .tabelle .breit { display: none; }
  .tabelle th, .tabelle td { padding: 10px 8px; }

  /* Haendler: sechs Spalten samt Datei-Upload passen nicht nebeneinander.
     Jede Zeile wird eine Karte, die Spaltenkoepfe wandern an die Werte. */
  .tabelle.karten thead { display: none; }
  .tabelle.karten tr {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px;
    padding: 12px 10px; border-bottom: 1px solid var(--linie);
  }
  .tabelle.karten tr:last-child { border-bottom: none; }
  .tabelle.karten td { padding: 0; border: none; text-align: left; }
  .tabelle.karten td:nth-child(2) { grid-column: span 2; }
  .tabelle.karten td.voll { grid-column: 1 / -1; }
  .tabelle.karten td[data-titel]::before {
    content: attr(data-titel); display: block; font-size: 0.812rem; color: var(--leise);
  }
  .tabelle.karten .formular.schmal-reihe { grid-template-columns: 1fr auto; }
}

/* Haken mit Text daneben. Ohne das erbt das Kaestchen die volle Breite und
   Hoehe der Eingabefelder und steht als Riesenhaken allein in der Zeile. */
.schalter { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.schalter input { width: 24px; height: 24px; min-height: 0; flex: none; }

/* Impressum und Datenschutz: lesbare Zeilenlaenge. */
.rechtstext { max-width: 680px; }
.rechtstext h2 { font-size: 1.062rem; margin: 24px 0 6px; }
.rechtstext p, .rechtstext li { font-size: 0.938rem; }
.fusszeile { max-width: 900px; margin: 0 auto; padding: 0 20px 32px; font-size: 0.875rem; color: var(--leise); }
.fusszeile a { color: var(--leise); display: inline-block; padding: 10px 0; }
/* In der App kein Verweis auf andere Plattformen (App Review 2.3.10). */
.in-app .nur-browser { display: none; }

/* Abrechnung: ausgezahltes Geld, das nicht zur Rechnung passt. */
.fehler { color: var(--rot); font-weight: 600; }
.klein { font-size: 0.812rem; }

/* Betraege nicht zwischen Zahl und Euro umbrechen; die Tabelle scrollt lieber. */
.tabelle td.rechts:not(:has(a, button)) { white-space: nowrap; }

/* Registrieren: Haken neben dem Text, Honigtopf unsichtbar fuer Menschen. */
.haken { display: flex; gap: 10px; align-items: flex-start; font-size: 0.938rem; }
.haken input { width: 22px; min-height: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.honigtopf { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button.gefahr { background: var(--rot); border-color: var(--rot); color: #fff; }

/* Hilfe */
ol.schritte, ul.schritte { padding-left: 22px; display: grid; gap: 8px; }
.hilfe { max-width: 720px; }
.hilfe h2 { margin-top: 36px; }
.hilfe h3 { font-size: 1.062rem; margin: 24px 0 8px; }
.hilfe .inhalt-liste { padding-left: 20px; }

/* Verweise unter Anmelde- und Kontoformularen: am Tablet ein Fingerziel,
   keine 17 Pixel hohe Textzeile. */
.schmal p a { display: inline-block; padding: 12px 0; }

/* Kopfleiste: Fingerziele statt 24 Pixel hoher Textzeilen. */
.kopf a { display: inline-block; padding: 10px 0; }

/* Betreiber */
.support { display: flex; gap: 12px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 8px 20px; background: var(--support-grund); color: var(--text); }
.support form { margin: 0; }
.zugaenge { display: grid; gap: 8px; }
.zugang { background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; }
.zugang .aktionen { display: flex; flex-wrap: wrap; gap: 6px; }
.zugang .aktionen form { margin: 0; }
.umbruch { overflow-wrap: anywhere; }

/* Abmelden steht im Kopf zwischen Verweisen und soll auch so aussehen. */
.kopf button.flach { border: none; background: none; padding: 0; min-height: 44px;
  color: var(--akzent-text); font-weight: 400; }

.kopf-links { display: flex; align-items: center; min-width: 0; }
/* Grundversion und Freischalten */
.freischalten { margin: 16px 0 8px; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 16px 18px; }
.freischalten h2 { margin-top: 0; }
.freischalten .haken { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 14px; }
.freischalten .haken input { margin-top: 4px; }
.freigeschaltet { margin: 4px 0 0; }
