/* ══════════════════════════════════════════════════════════════════
   Wagner Wehr- und Jagdtechnik – gemeinsames Design für alle Seiten
   Schriften liegen lokal in /fonts (keine Anfragen an Google).
   ══════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Rye'; src: url('/fonts/rye-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rye'; src: url('/fonts/rye-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-024F; }
@font-face { font-family: 'Lora'; src: url('/fonts/lora-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/lora-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/lora-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/lora-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-024F; }

:root {
  --dunkel: #3b2a1a; --messing: #b08d57; --papier: #f4ecd8; --hell: #fbf7ee;
  --rand: #d9c9a6; --rot: #8b2e2e; --gruen: #3d6b3a; --text: #2a1f14; --grau: #7a6a55;
  --schatten: 0 1px 2px rgba(59, 42, 26, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Lora', Georgia, serif; background: var(--papier); color: var(--text); font-size: 15px; line-height: 1.4; }
[hidden] { display: none !important; }
a { color: var(--dunkel); }

/* ── Kopfleiste ─────────────────────────────────────────────────── */
.kopf { background: var(--dunkel); color: var(--papier); border-bottom: 3px solid var(--messing); }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.marke { font-family: 'Rye', serif; font-size: 22px; letter-spacing: 1px; color: var(--papier); text-decoration: none; }
.marke small { display: block; font-family: 'Lora', serif; font-size: 11px; letter-spacing: 0; color: var(--messing); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--papier); text-decoration: none; padding: 7px 10px; border-radius: 4px; font-weight: 600; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a.aktiv { background: var(--messing); color: var(--dunkel); }
.wer { font-size: 13px; color: var(--messing); display: flex; gap: 8px; align-items: center; }
.wer button { color: var(--papier); border-color: var(--messing); padding: 4px 10px; font-size: 13px; }

/* ── Seiten-Layout ──────────────────────────────────────────────── */
.seite { max-width: 1200px; margin: 0 auto; padding: 16px; }
.schmal { max-width: 640px; }
.zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.seitenleiste { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .zwei, .seitenleiste { grid-template-columns: minmax(0, 1fr); } }

h1 { font-family: 'Rye', serif; font-weight: normal; font-size: 26px; margin: 4px 0 12px; color: var(--dunkel); }
h2 { font-family: 'Rye', serif; font-weight: normal; font-size: 16px; margin: 0 0 8px; color: var(--dunkel); }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--grau); margin: 12px 0 4px; }

.karte { background: var(--hell); border: 1px solid var(--rand); border-radius: 6px; padding: 12px; margin-bottom: 12px; box-shadow: var(--schatten); }
.klein { font-size: 12px; color: var(--grau); }
.leer { color: var(--grau); font-style: italic; font-size: 13px; margin: 4px 0; }
.rechts { text-align: right; }
.zahl { font-variant-numeric: tabular-nums; }
.rot, .warn, .warn .zahl { color: var(--rot); }
.gruen { color: var(--gruen); }

/* ── Formulare ──────────────────────────────────────────────────── */
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
label.haken { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; font-size: 13px; }
label.haken input { width: auto; margin: 2px 0 0; }
input, select, textarea {
  width: 100%; margin-top: 3px; padding: 8px; border: 1px solid #c8b48a; border-radius: 4px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--messing); outline-offset: 1px; }
input[type="checkbox"] { width: auto; }
button {
  font: inherit; font-size: 14px; cursor: pointer; border-radius: 4px; padding: 8px 12px;
  border: 1px solid var(--dunkel); background: transparent; color: var(--dunkel);
}
button:hover:not(:disabled) { background: rgba(59, 42, 26, .06); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primaer { background: var(--dunkel); color: var(--papier); font-weight: 700; }
.primaer:hover:not(:disabled) { background: #4d3825; }
.breit { width: 100%; }
.gefahr { border-color: var(--rot); color: var(--rot); }
.warnung, .warnung:hover:not(:disabled) { background: var(--rot) !important; border-color: var(--rot) !important; color: #fff !important; }
.link { border: none; background: none; padding: 0; color: var(--grau); font-size: 12px; text-decoration: underline; }
.reihe { display: flex; gap: 8px; align-items: flex-end; }
.reihe > label { margin-bottom: 0; }
.reihe > .wachsen { flex: 1; }
.knoepfe { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.knoepfe > button { flex: 1; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filter label { margin: 0; min-width: 140px; }
.filter .wachsen { flex: 1; min-width: 200px; }

/* ── Reiter ─────────────────────────────────────────────────────── */
.tabs { display: flex; margin-bottom: 12px; border: 1px solid var(--dunkel); border-radius: 6px; overflow: hidden; flex-wrap: wrap; background: var(--hell); }
.tab { flex: 1; border: none; border-radius: 0; font-weight: 600; font-size: 13px; padding: 9px 6px; white-space: nowrap; }
.tab.aktiv, .tab.aktiv:hover { background: var(--dunkel); color: var(--papier); }

/* ── Meldungen ──────────────────────────────────────────────────── */
.meldung { padding: 9px 10px; border-radius: 4px; margin: 10px 0; font-size: 14px; white-space: pre-line; }
.ok { background: #e3eedc; color: var(--gruen); }
.fehler { background: #f5dede; color: var(--rot); }

/* ── Tabellen ───────────────────────────────────────────────────── */
.tabelle-rahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--grau); font-weight: 600; padding: 6px 6px; border-bottom: 2px solid var(--rand); white-space: nowrap; }
td { padding: 6px; border-bottom: 1px dashed var(--rand); vertical-align: middle; }
th.rechts, td.rechts { text-align: right; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.storniert td { color: var(--rot); text-decoration: line-through; }
tr.storniert td.aktionen { text-decoration: none; }
td.aktionen { white-space: nowrap; text-align: right; }
td.einzeilig { white-space: nowrap; }
td.einzeilig button { padding: 3px 8px; font-size: 13px; }
td.aktionen button { padding: 3px 8px; font-size: 13px; }
.editor td { padding: 3px 4px; }
.editor input, .editor select { margin: 0; padding: 5px 6px; font-size: 13px; min-width: 70px; }
.editor input[type="checkbox"] { min-width: 0; }
.editor tr.neu td { background: rgba(176, 141, 87, .08); }
.editor tr.geaendert td { background: #fff7e0; }

/* ── Kennzahlen-Kacheln ─────────────────────────────────────────── */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kachel { background: var(--hell); border: 1px solid var(--rand); border-radius: 6px; padding: 10px 12px; }
.kachel .titel { font-size: 12px; color: var(--grau); }
.kachel .wert { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.balken { height: 8px; background: var(--messing); border-radius: 4px; min-width: 2px; }

/* ── Kasse ──────────────────────────────────────────────────────── */
.korb-zeile { display: grid; grid-template-columns: 1fr 60px 86px 26px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--rand); }
.korb-zeile input { margin: 0; padding: 4px; text-align: center; }
.korb-zeile input.korb-sn { grid-column: 1 / -1; text-align: left; padding: 6px 8px; font-size: 13px; }
.korb-zeile input.korb-sn.fehlt { border: 2px solid var(--rot); background: #fdf0f0; }
.korb-name { font-size: 14px; line-height: 1.25; }
.korb-name small { display: block; color: var(--grau); }
.korb-summe { text-align: right; font-variant-numeric: tabular-nums; }
.korb-menge-fest { text-align: center; color: var(--grau); }
.x { border: none; background: none; color: var(--rot); font-size: 16px; padding: 0; }
.summe-zeile { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.summe-zeile.gesamt { font-size: 22px; font-weight: 700; border-top: 2px solid var(--dunkel); margin-top: 6px; padding-top: 6px; }
.summe-zeile.klein { font-size: 12px; color: var(--grau); }
.gross { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
pre.beleg { background: #fff; border: 1px solid var(--rand); border-radius: 6px; padding: 14px; margin: 0;
  font: 13px/1.45 'Courier New', monospace; white-space: pre-wrap; color: var(--text); overflow-x: auto; }
pre.bericht { white-space: pre; min-height: 300px; max-height: 75vh; overflow: auto; }

/* ── Listen (Lager, Plan) ───────────────────────────────────────── */
.zeile { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--rand); align-items: center; }
.zeile small, .plan small { display: block; color: var(--grau); font-weight: normal; }
.zeile .zahl { font-weight: 700; text-align: right; }
.zeile .mindest { width: 80px; margin: 0; padding: 4px 6px; font-size: 13px; }
.plan { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 7px 0; border-bottom: 1px dashed var(--rand); align-items: center; }
.plan button { padding: 4px 9px; }
.plan .status-ok { color: var(--gruen); }
.plan .status-fehlt { color: var(--rot); }

/* ── Dialog (Beleg anzeigen, Storno-Grund …) ────────────────────── */
.dialog-hintergrund { position: fixed; inset: 0; background: rgba(42, 31, 20, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dialog { background: var(--papier); border-radius: 8px; max-width: 520px; width: 100%; max-height: 92vh; overflow: auto; padding: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }

/* ── Anmeldung ──────────────────────────────────────────────────── */
.anmelde-seite { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.anmelde-karte { width: 100%; max-width: 380px; }
.anmelde-karte .marke { display: block; text-align: center; color: var(--dunkel); margin-bottom: 12px; font-size: 32px; }
.anmelde-karte .marke small { color: var(--grau); font-size: 13px; }
.code { font-family: 'Courier New', monospace; letter-spacing: 2px; text-transform: uppercase; }

/* ── Drucken: nur den Beleg bzw. Bericht ────────────────────────── */
/* ── Discord-Anmeldung ──────────────────────────────────────────── */
a.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  padding: 10px 14px; border-radius: 6px; font-weight: 600; }
a.knopf.discord { background: #5865F2; color: #fff; margin: 4px 0 10px; }
a.knopf.discord:hover { background: #4752c4; }
a.knopf.aus { opacity: .45; pointer-events: none; }
.anmelde-karte .link { display: block; margin: 0 auto; }
.wer .avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--messing); }

/* ── Rechte-Matrix ──────────────────────────────────────────────── */
table.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--rand); padding: 5px 6px; text-align: left; vertical-align: middle; }
table.matrix th.rolle-kopf { min-width: 130px; vertical-align: bottom; }
table.matrix th.rolle-kopf input { width: 100%; font-weight: 600; }
table.matrix th.rolle-kopf small { display: block; font-weight: 400; }
table.matrix td:first-child { white-space: nowrap; position: sticky; left: 0; background: var(--hell); }
table.matrix tr.gruppe td { background: var(--papier); font-weight: 700; color: var(--dunkel); padding-top: 10px; position: static; }
table.matrix tr.einstell td { background: rgba(176, 141, 87, .08); }
table.matrix tr.einstell input, table.matrix tr.einstell select { width: 100%; min-width: 110px; }
table.matrix td.haken-zelle { text-align: center; }
table.matrix td.haken-zelle input { width: 18px; height: 18px; cursor: pointer; }

/* ── Einstellungen in Gruppen ───────────────────────────────────── */
.einstellungen-gruppen { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }
.einstellungen-gruppen .karte { margin: 0; }
#discordStatus code { word-break: break-all; }

@media print {
  body { background: #fff; }
  .kopf, .nicht-drucken, .tabs, .knoepfe, aside, .meldung { display: none !important; }
  body.drucke-dialog > *:not(.dialog-hintergrund) { display: none !important; }
  .dialog-hintergrund { position: static; background: none; padding: 0; }
  .dialog { box-shadow: none; max-height: none; padding: 0; }
  pre.beleg, pre.bericht { border: none; max-height: none; overflow: visible; }
  .seite { padding: 0; }
  .seitenleiste { display: block; }
}
