/* Stall-App – Grundgestaltung (gleiche Farben wie die bisherige lokale App) */
:root {
  --bg: #f6f4ef; --card: #fff; --text: #2b2a27; --muted: #6f6a60;
  --accent: #7a4e2d; --accent-2: #a8743f; --line: #e2ddd2; --danger: #b3261e;
  --bad: #b3261e; --warn: #9a5b00; --good: #2e7d32; --info-bg: #efe9df;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1b19; --card: #26241f; --text: #ece8df; --muted: #a39d90;
          --accent: #d39a63; --accent-2: #e8b583; --line: #3a372f; --danger: #f2817a;
          --bad: #f2817a; --warn: #e0a84a; --good: #7cc47f; --info-bg: #2f2c26; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }

/* Kopf */
header.kopf { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: space-between; background: var(--card); }
header.kopf h1 { font-size: 18px; margin: 0; }
header.kopf .wer { font-size: 13px; color: var(--muted); }
nav.reiter { display: flex; flex-wrap: wrap; gap: 4px; }
nav.reiter a { border: 1px solid var(--line); color: var(--text); padding: 6px 12px; border-radius: 6px; text-decoration: none; }
nav.reiter a.aktiv { background: var(--accent); color: #fff; border-color: var(--accent); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.klein { font-size: 13px; }
label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 3px; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); min-height: 42px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
button { font: inherit; cursor: pointer; }
button.primaer { background: var(--accent); color: #fff; border: 0; padding: 10px 16px; border-radius: 6px; min-height: 42px; }
button.zweit { background: none; border: 1px solid var(--line); color: var(--text); padding: 8px 12px; border-radius: 6px; }
button.link { background: none; border: 0; color: var(--accent); padding: 4px; text-decoration: underline; }
button.gefahr { color: var(--danger); }
button:disabled { opacity: .6; cursor: wait; }
.formular { display: grid; gap: 12px; }
.formular.raster { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meldung { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.meldung.fehler { background: #fbe9e7; color: #8c1d18; }
.meldung.ok { background: #e6f2e7; color: #1f5d2a; }
.meldung.info { background: var(--info-bg); color: var(--text); }
@media (prefers-color-scheme: dark) {
  .meldung.fehler { background: #4a1f1c; color: #ffd9d5; }
  .meldung.ok { background: #1f3a22; color: #cdebd0; }
}
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--line); }
.badge.gut { background: #d7ecd9; color: #1f5d2a; }
.badge.schlecht { background: #f6d5d2; color: #8c1d18; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Anmeldung */
.anmeldung { max-width: 380px; margin: 10vh auto 0; padding: 0 16px; }
.anmeldung h1 { font-size: 20px; margin: 0 0 4px; }
.anmeldung .untertitel { color: var(--muted); margin-bottom: 18px; }
.anmeldung button.primaer { width: 100%; }
.code-eingabe { font-size: 24px; letter-spacing: 6px; text-align: center; }

label.haken { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
label.haken input { min-height: 0; width: 20px; height: 20px; }
dialog.dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
  padding: 16px; width: min(360px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(0, 0, 0, .4); }

/* Verbindung */
.verbindung { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bad); color: #fff; text-align: center;
  padding: 10px; font-weight: 600; z-index: 10; }
