/* Design angelehnt an das Broweg-Dashboard (Orchestrator): fast schwarzer
   Grund, dunkle Karten, Lime als Handlungs-Akzent. Hell ist ein eigener
   Entwurf, kein aufgehelltes Dunkel. */
:root, [data-thema="dunkel"] {
  --bg: #08090b; --bg-start: #101215;
  --surface: #0d1014; --surface-2: #1e2228; --surface-3: #2a2f36;
  --border: #2f353d; --border-strong: #566070;
  --brand-start: #c4f552; --brand-end: #7fd957; --on-brand: #0d1408;
  --accent: #c4f552; --focus: #c4f552;
  --success: #4ade80; --danger: #f2545b; --warning: #fbbf24; --info: #21d4fd; --violet: #a78bfa;
  --text: #ffffff; --text-2: #a0aec0; --text-3: #8f9eb4;
  --card: linear-gradient(155deg, rgba(30, 34, 40, .92), rgba(21, 24, 28, .92));
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-thema="hell"] {
  --bg: #eceff7; --bg-start: #f6f7fb;
  --surface: #ffffff; --surface-2: #f2f4fa; --surface-3: #e3e7f1;
  --border: #d9dfee; --border-strong: #64748b;
  --accent: #6d28d9; --focus: #6d28d9;
  --success: #15803d; --danger: #cf1124; --warning: #b45309; --info: #0e7490; --violet: #6d28d9;
  --text: #0f1115; --text-2: #475569; --text-3: #53637a;
  --card: linear-gradient(155deg, rgba(255, 255, 255, .95), rgba(246, 247, 251, .95));
  --shadow: 0 8px 24px rgba(15, 23, 42, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: linear-gradient(180deg, var(--bg-start), var(--bg)) fixed;
  font: 400 1rem/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Rahmen: Seitenleiste + Inhalt ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.leiste {
  position: sticky; top: 0; height: 100vh; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border); background: var(--surface);
}
.marke { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; }
.marke-icon {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end)); color: var(--on-brand); font-family: "Space Grotesk";
}
.marke b { display: block; font-family: "Space Grotesk"; font-size: 1rem; line-height: 1.1; }
.marke small { color: var(--text-3); font-size: .78rem; }
.leiste .reiter {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.leiste .reiter svg { width: 18px; height: 18px; flex: none; }
.leiste .reiter:hover { background: var(--surface-2); color: var(--text); }
.leiste .reiter.aktiv { background: linear-gradient(135deg, var(--brand-start), var(--brand-end)); color: var(--on-brand); }
.leiste .unten { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.themaknopf { background: none; border: 0; cursor: pointer; font: inherit; width: 100%; text-align: left; justify-content: flex-start; }

.inhalt { padding: 28px 32px 64px; max-width: 1320px; width: 100%; }
.kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.kicker { color: var(--text-3); font-size: .85rem; margin: 0 0 4px; }
.unterzeile { color: var(--text-2); margin: 6px 0 0; }
.abschnitt { margin: 28px 0 10px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-family: "Inter"; }

/* ---------- Flaechen ---------- */
.karte { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.karte + .karte { margin-top: 12px; }
.zahlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.zahl { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }
.zahl b { display: block; font: 600 1.5rem/1.2 "Space Grotesk"; font-variant-numeric: tabular-nums; }
.zahl span { color: var(--text-3); font-size: .85rem; }
.zahl.akzent b { color: var(--accent); }
.zusammenfassung { color: var(--text-2); margin: 0 0 12px; }

/* ---------- Listen / Tabellen ---------- */
.liste { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.liste .scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); }
tbody tr:hover td { background: var(--surface-2); }
td.weit { white-space: normal; min-width: 220px; }
td .leise, .leise { color: var(--text-3); font-size: .85rem; }
td a, .link { color: var(--text); text-decoration: none; font-weight: 500; }
td a:hover, .link:hover { color: var(--accent); }
.zahlspalte { text-align: right; font-variant-numeric: tabular-nums; }

/* Status: Punkt + Text wie im Orchestrator */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; color: var(--text-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.s-ausgegeben::before { background: var(--info); }
.s-eingestellt::before { background: var(--warning); }
.s-verkauft::before { background: var(--success); }
.s-ausgebucht::before { background: var(--danger); border-radius: 2px; transform: rotate(45deg); }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; background: var(--surface-3); color: var(--text-2); }
.offen { color: var(--warning); font-weight: 500; }
.ok { color: var(--success); }

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--text-2); font-weight: 500; }
label small { color: var(--text-3); font-weight: 400; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 11px; min-width: 0;
}
textarea { resize: vertical; width: 100%; font-family: ui-monospace, "Geist Mono", Consolas, monospace; font-size: .88rem; line-height: 1.55; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand-end); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
.knopf, button {
  font: 600 .92rem "Inter", sans-serif; cursor: pointer; border: 0; border-radius: 12px; padding: 10px 16px;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end)); color: var(--on-brand);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.knopf.zweit, button.zweit { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.knopf.zweit:hover, button.zweit:hover { background: var(--surface-3); }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.raster .voll { grid-column: 1 / -1; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter input { min-width: 200px; }
.aktionsleiste {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: .9rem;
}
.hinweis { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.fehler { color: var(--danger); }

/* Kopierfelder */
.kopier { margin: 0 0 14px; }
.kopier-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kopier-kopf span { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.kopier-kopf button { padding: 5px 12px; font-size: .8rem; border-radius: 10px; }
.kopier input, .kopier textarea { width: 100%; background: var(--surface); border-color: var(--border); }

/* Bilder */
.galerie { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 8px; scroll-snap-type: x mandatory; }
.galerie a { flex: none; scroll-snap-align: start; }
.galerie img { height: 240px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); display: block; }
.bild-leer { display: grid; place-items: center; height: 120px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--text-3); }
.mini { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: block; }
.mini-leer { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); }

/* Fakten */
.fakten { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 18px; margin: 4px 0 0; }
.fakten div span { display: block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.fakten div b { font-weight: 600; }

/* Helfer: Teile-Kacheln */
.reiterwahl { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin: 8px 0 14px; }
.reiterwahl a { padding: 7px 14px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 500; }
.reiterwahl a.an { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.kachel { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); text-decoration: none; }
.kachel:hover { border-color: var(--border-strong); }
.kachel img, .kachel .leer { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-3); }
.kachel b { display: block; font-weight: 600; line-height: 1.3; }
.zurueck { color: var(--text-3); text-decoration: none; font-size: .9rem; }
.zurueck:hover { color: var(--accent); }
.verlauf { list-style: none; padding: 0; margin: 0; }
.verlauf li { padding: 6px 0; color: var(--text-2); border-bottom: 1px solid var(--border); }
.verlauf li:last-child { border: 0; }
.zwei { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Anmeldung */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.anmeldung .karte { width: 100%; max-width: 380px; padding: 28px; }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .leiste {
    position: sticky; top: 0; height: auto; z-index: 10; flex-direction: row; align-items: center;
    padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .marke { padding: 0 8px 0 2px; }
  .marke span { display: none; }
  .leiste .reiter { padding: 8px 10px; white-space: nowrap; }
  .leiste .reiter span { display: none; }
  .leiste .reiter.aktiv span { display: inline; }
  .leiste .unten { margin: 0 0 0 auto; flex-direction: row; }
  .inhalt { padding: 18px 16px 48px; }
  h1 { font-size: 1.45rem; }
  .zwei { grid-template-columns: minmax(0, 1fr); }
  .zahlen { grid-template-columns: 1fr 1fr; }
  .zahl b { font-size: 1.25rem; }
  .galerie img { height: 200px; }
  input, textarea, select { font-size: 16px; }
}

/* Druck (Gutschrift) */
body.druck { background: #fff; color: #000; font-size: 13px; }
body.druck main { max-width: 820px; margin: 32px auto; padding: 0 24px; }
body.druck table { border: 1px solid #ccc; }
body.druck th { background: #f2f2f2; color: #333; }
body.druck td, body.druck th { border-bottom: 1px solid #ddd; }
@media print { .nicht-drucken { display: none; } body.druck main { margin: 0; } }
