/* Farbordnung nach der Maximaltafel 2027 */
:root {
  --kopf: #1d4f66; --text: #1b2a33; --leise: #55666f; --rand: #b8c4cb; --grund: #f3f5f6; --weiss: #fff;
  --g8: #478c72;  --g8h: #e7f1ec;
  --g10: #3f8a90; --g10h: #e3f0f1;
  --g20: #2f86a0; --g20h: #e4eff5;
  --volk: #c99a2e; --volkh: #fcf0d8;
  --weit: #b9665f; --weith: #f6e7e4;
  --res: #c49e97; --resh: #f6efec;
  --ausw: #7b8690; --auswh: #eceef1;
  --ok: #1f7a4d; --nein: #a8322a; --warn: #8a5a00;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* «hidden» gilt auch fuer Elemente mit eigener display-Angabe (Kopfzeile) */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--text); background: var(--grund); font-size: 17px; line-height: 1.4; }
header { background: var(--weiss); border-bottom: 3px solid var(--kopf); padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.logo { height: 44px; width: auto; }
nav { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
nav a, nav button { font: inherit; font-size: .95rem; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--rand); background: var(--weiss); color: var(--kopf); text-decoration: none; cursor: pointer; }
nav a.aktiv { background: var(--kopf); color: #fff; border-color: var(--kopf); }
nav .rechts { margin-left: auto; }
main { padding: 14px 12px 60px; max-width: 1100px; margin: 0 auto; }
main.breit { max-width: none; }
h1 { font-size: 1.35rem; color: var(--kopf); margin: 4px 0 10px; }
h2 { font-size: 1.1rem; color: var(--kopf); margin: 18px 0 8px; }
.leise { color: var(--leise); font-size: .9rem; }
.karte { background: var(--weiss); border: 1px solid var(--rand); border-radius: 12px; padding: 14px; margin: 12px 0; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=email], input[type=text], select, textarea { font: inherit; width: 100%; max-width: 460px; padding: 12px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; }
input.code { font-size: 1.6rem; letter-spacing: .3em; max-width: 240px; text-align: center; }
.knopf { display: inline-block; font: inherit; font-size: 1.1rem; font-weight: 600; padding: 15px 20px; min-height: 54px; border-radius: 10px; border: 0; background: var(--kopf); color: #fff; cursor: pointer; margin: 12px 8px 0 0; text-decoration: none; }
.knopf.zweit { background: #fff; color: var(--kopf); border: 2px solid var(--kopf); }
.knopf.gefahr { background: var(--nein); }
.knopf.gut { background: var(--ok); }
.knopf:disabled { opacity: .45; cursor: default; }
.meldung { padding: 12px; border-radius: 8px; margin: 12px 0; font-weight: 600; }
.meldung.ok { background: #e3f3ea; color: var(--ok); }
.meldung.nein { background: #f9e4e2; color: var(--nein); }
.meldung.info { background: #e8eff3; color: var(--kopf); font-weight: 400; }
.demo { background: #fff3cd; color: #5c4400; text-align: center; padding: 8px; font-weight: 700; font-size: .9rem; border-bottom: 1px solid #e6cf87; }
.status { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: .85rem; font-weight: 700; border: 1px solid currentColor; }
.status.eingereicht { color: var(--warn); } .status.freigegeben { color: var(--ok); } .status.zurueckgewiesen, .status.zurueckgenommen { color: var(--nein); }
.zeile { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.werte { border-collapse: collapse; font-size: .92rem; margin: 8px 0; }
.werte th, .werte td { border: 1px solid var(--rand); padding: 5px 9px; text-align: left; vertical-align: top; }
.werte th { background: var(--auswh); font-weight: 600; white-space: nowrap; }
.schuesse { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.foto { max-width: 100%; max-height: 80vh; border: 1px solid var(--rand); border-radius: 8px; display: block; }
.zwei { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 820px) { .zwei { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.haken { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin: 14px 0 4px; }
.haken input { width: 26px; height: 26px; flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- Jahrestafel */
.tafelkopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.tafelkopf select { width: auto; padding: 8px 10px; }
.rollbar { overflow-x: auto; border: 1px solid #5d6b73; background: #fff; }
table.tafel { border-collapse: separate; border-spacing: 0; font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.tafel th, .tafel td { border-right: 1px solid #8e9aa1; border-bottom: 1px solid #8e9aa1; padding: 6px 5px; text-align: center; white-space: nowrap; min-width: 36px; }
.tafel thead th { color: #fff; font-weight: 700; }
.tafel .name { position: sticky; left: 0; z-index: 2; text-align: left; background: #f4f6f7; min-width: 150px; padding-left: 9px; font-weight: 500; box-shadow: 1px 0 0 #5d6b73; }
.tafel thead .name { background: var(--kopf); color: #fff; z-index: 3; font-size: 1rem; }
.tafel tbody tr:nth-child(even) .name { background: #fff; }
.tafel .hoch { writing-mode: vertical-rl; transform: rotate(180deg); padding: 8px 4px; height: 128px; font-size: .78rem; line-height: 1.15; white-space: normal; text-align: center; }
.c8 { background: var(--g8); } .c10 { background: var(--g10); } .c20 { background: var(--g20); } .cvolk { background: var(--volk); } .cweit { background: var(--weit); } .cres { background: var(--res); } .causw { background: var(--ausw); }
td.c8 { background: var(--g8h); } td.c10 { background: var(--g10h); } td.c20 { background: var(--g20h); } td.cvolk { background: var(--volkh); } td.cweit { background: var(--weith); } td.cres { background: var(--resh); } td.causw { background: var(--auswh); }
.tafel .grenze { border-left: 2px solid #5d6b73; }
.tafel td.streich { color: #5c6870; font-style: italic; font-weight: 400; }
.tafel td.zaehlt { font-weight: 700; }
.tafel td.total { font-weight: 700; }
.tafel td.rang { font-weight: 700; }
.tafel .inaktiv { color: var(--leise); }
.legende { font-size: .85rem; color: var(--leise); margin: 8px 0; }

/* Grossanzeige Schuetzenhaus */
body.gross header, body.gross #demo-hinweis { display: none; }
body.gross main { padding: 10px; }
/* Schrift waechst und schrumpft mit der Bildschirmbreite, damit die ganze Tafel ohne Rollen sichtbar bleibt */
body.gross table.tafel { font-size: clamp(.45rem, .98vw, 1.6rem); width: 100%; }
body.gross .tafel .name { min-width: 10.5em; }
body.gross .tafel .hoch { height: 12.5em; font-size: .8em; }
body.gross .legende { font-size: clamp(.6rem, .9vw, 1.1rem); }
body.gross .tafel th, body.gross .tafel td { padding: .32em .2em; min-width: 0; }
body.gross h1 { font-size: clamp(1.2rem, 2vw, 2.4rem); margin: 0; }
body.gross .rollbar { overflow-x: auto; }
body.gross .tafelkopf { align-items: center; margin-bottom: .4em; }
body.gross .tafellogo { height: clamp(2.2rem, 4.2vw, 5rem); width: auto; }
body.gross .tafel thead tr:nth-child(2) th, body.gross .tafel td:not(.name) { min-width: 2.3em; }

@media print {
  header, .demo, .knopf, nav { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .rollbar { overflow: visible; border: 0; }
  .tafel .name { position: static; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 landscape; margin: 8mm; }
}

@media (max-width: 600px) {
  header { padding: 6px 8px; gap: 6px; }
  .logo { height: 30px; }
  nav a, nav button { padding: 8px 9px; font-size: .85rem; }
}

.klein-link { margin-left: auto; font: inherit; font-size: .85rem; color: var(--kopf); background: #fff; border: 1px solid var(--rand); border-radius: 8px; padding: 6px 10px; text-decoration: none; cursor: pointer; }

.status.korrigiert { color: var(--kopf); }
table.liste { width: 100%; margin: 0; } table.liste td, table.liste th { white-space: nowrap; } table.liste tr.inaktiv td { color: var(--leise); }
table.liste select { width: auto; padding: 6px 8px; max-width: none; }
button.klein { font: inherit; font-size: .85rem; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--rand); background: #fff; color: var(--kopf); cursor: pointer; }

.nur-druck { display: none; }
.tafelkopf button.klein { margin-left: 4px; }
@media print {
  .nur-druck { display: block; font-size: 10px; margin: 0 0 4px; }
  .tafelkopf select, .tafelkopf label, .tafelkopf button, #stand, .klein-link { display: none !important; }
  main, main.breit { padding: 0; max-width: none; }
  h1 { font-size: 15px; margin: 0 0 2px; }
  table.tafel { font-size: 8.5px; width: 100%; }
  .tafel th, .tafel td { padding: 2px 1px; min-width: 0; }
  .tafel .name { min-width: 0; }
  .tafel .hoch { height: 80px; font-size: 7px; }
  .legende { font-size: 8px; }
}
