/* Verwaltung (Stufe „Werkzeug“): kompakt, weiß und schwarz, Grün als Akzent, harte Kanten. */

body.werkzeug { font-size: 14.5px; line-height: 1.5; background: var(--grund); }
.werkzeug h1 { font-size: 22px; text-transform: none; letter-spacing: 0; font-weight: 700; }
.werkzeug h2 { font-size: 18px; text-transform: none; letter-spacing: 0; font-weight: 700; }
.werkzeug h3 { font-size: 15px; }
.app:focus { outline: none; }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.warnung { color: var(--warn); }

.laden { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.laden img { width: 148px; height: auto; }

.linkknopf {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--gruen); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.linkknopf:hover { text-decoration-color: currentColor; }
.knopf.breit { width: 100%; }
.knopf.mini { min-height: 30px; min-width: 30px; padding: 0 6px; }
.knopf.mini svg { width: 16px; height: 16px; }

.hinweisleiste { background: var(--gruen-flaeche); border-left: 3px solid var(--gruen); padding: 10px 14px; margin: 0 0 16px; }

/* Anmeldung */
.anmelde-seite { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--flaeche); }
.anmelde-buehne {
  position: relative; overflow: hidden; background: var(--schwarz); color: #fff;
  padding: clamp(32px, 6vw, 72px); display: flex; flex-direction: column; justify-content: flex-end;
}
.anmelde-buehne::after { content: ""; position: absolute; top: 0; right: 0; width: 45%; height: 8px; background: var(--gruen); }
.anmelde-zahnrad { position: absolute; right: -30%; top: -10%; width: 110%; height: auto; opacity: .45; pointer-events: none; }
.anmelde-logo { position: absolute; top: clamp(32px, 6vw, 72px); left: clamp(32px, 6vw, 72px); width: 140px; height: auto; }
.anmelde-buehne .ueberzeile { color: #fff; position: relative; }
.anmelde-gross { position: relative; font-size: clamp(40px, 6vw, 72px); line-height: 1; text-transform: uppercase; font-weight: 500; margin: 0 0 20px; }
.anmelde-text { position: relative; color: #d0d0d0; max-width: 420px; font-size: 16px; margin: 0; }
.anmelde-karte { padding: clamp(32px, 6vw, 72px); display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; justify-self: center; }
.anmelde-titel { font-size: 28px !important; text-transform: uppercase !important; font-weight: 500 !important; letter-spacing: .02em !important; }
.anmelde-form { margin: 8px 0 24px; }
.anmelde-form .knopf { margin-top: 8px; }
.anmelde-fuss { margin-top: 24px; font-size: 14px; }
@media (max-width: 800px) {
  .anmelde-seite { grid-template-columns: minmax(0, 1fr); }
  .anmelde-buehne { min-height: 260px; }
  .anmelde-gross { font-size: 40px; }
}

/* Kopf */
.wz-kopf { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--linie); }
@supports (backdrop-filter: blur(10px)) { .wz-kopf { background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); } }
.wz-kopf-innen { max-width: 1480px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wz-marke { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; }
.wz-marke img { width: 84px; height: auto; flex: none; }
.wz-titel { font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; border-left: 1px solid var(--schwarz); padding-left: 16px; }
.wz-titel-zusatz { font-weight: 400; color: var(--sub); }
.wz-nutzer { display: flex; align-items: center; gap: 8px; flex: none; }
.wz-name { font-weight: 700; margin-right: 6px; }
.reiter { border-top: 1px solid var(--linie-2); }
.reiter-innen { max-width: 1480px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; }
.reiter-knopf {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px 10px; cursor: pointer;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); white-space: nowrap;
}
.reiter-knopf:hover { color: var(--schwarz); }
.reiter-knopf[aria-current="page"] { color: var(--schwarz); border-bottom-color: var(--gruen); }
@media (max-width: 760px) {
  .wz-titel-zusatz, .wz-name, .nur-weit { display: none; }
  .wz-kopf-innen { padding: 10px 16px; }
  .reiter-innen { padding: 0 12px; }
  .wz-titel { font-size: 13px; padding-left: 12px; }
  .wz-marke { gap: 12px; }
  .wz-marke img { width: 70px; }
}
@media (max-width: 420px) { .wz-titel { display: none; } }

.haupt { max-width: 1480px; margin: 0 auto; padding: 24px 24px 64px; }
.haupt:focus { outline: none; }
@media (max-width: 760px) { .haupt { padding: 16px 16px 48px; } }

/* Kennzahlen */
.kennzahlen {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 0;
  background: var(--flaeche); border: 1px solid var(--linie); margin-bottom: 16px;
}
.kennzahl { padding: 16px 20px 14px; border-right: 1px solid var(--linie-2); display: grid; gap: 2px; }
.kennzahl-wert { font-size: 30px; font-weight: 500; line-height: 1.1; }
.kennzahl-text { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.kennzahl-zusatz { color: var(--schwarz); white-space: nowrap; }
.kennzahl.betont { border-top: 3px solid var(--gruen); padding-top: 13px; }
.leiste { grid-column: 1 / -1; height: 6px; background: var(--s10); }
.leiste-wert { height: 100%; width: var(--wert, 0%); background: var(--gruen); transition: width .6s var(--kurve-weich); }

/* Werkzeugleiste */
.werkzeugleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.werkzeugleiste select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 14px; max-width: 220px; }
.suchfeld { position: relative; flex: 1 1 260px; min-width: 0; max-width: 420px; }
.suchfeld svg { position: absolute; left: 11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--sub); pointer-events: none; }
.suchfeld input { min-height: 38px; padding: 6px 12px 6px 36px; font-size: 14px; }
.werkzeugleiste-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@media (max-width: 1100px) { .werkzeugleiste-knoepfe { margin-left: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px;
  background: var(--flaeche); border: 1px solid var(--linie); cursor: pointer; font-size: 13px; font-weight: 700;
}
.chip:hover { border-color: var(--schwarz); }
.chip[aria-pressed="true"] { background: var(--schwarz); color: #fff; border-color: var(--schwarz); }
.chip-zahl { font-weight: 400; opacity: .75; }

.auswahl-leiste { display: none; }
.auswahl-leiste.aktiv {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 12px;
  background: var(--nacht); color: #fff; border-left: 4px solid var(--gruen);
  position: sticky; top: 108px; z-index: 5;
}
.auswahl-zahl { font-weight: 700; margin-right: 8px; }
.auswahl-leiste .knopf:not(.primaer) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.auswahl-leiste .knopf:not(.primaer):hover { background: #fff; color: var(--schwarz); }
.auswahl-leiste .knopf.flach { border-color: transparent; }

/* Tabellen */
.tabellen-huelle { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  position: sticky; top: 0; background: var(--flaeche-2); text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sub);
  padding: 10px 12px; border-bottom: 1px solid var(--schwarz);
}
.tabelle td { padding: 10px 12px; border-bottom: 1px solid var(--linie-2); vertical-align: middle; }
.tabelle tbody tr:hover { background: var(--flaeche-2); }
.tabelle tr.gewaehlt { background: var(--gruen-flaeche); }
.tabelle tr.gewaehlt:hover { background: var(--gruen-flaeche); }
.tabelle tr.inaktiv td:not(.spalte-wahl):not(.spalte-aktion) { color: var(--dim); }
.tabelle.kompakt td, .tabelle.kompakt th { padding: 7px 10px; }
.spalte-wahl { width: 40px; }
.spalte-aktion { width: 44px; text-align: right; }
.spalte-name { min-width: 180px; }
.name-knopf { font-weight: 700; }
.unterzeile { display: block; font-size: 12.5px; color: var(--sub); overflow-wrap: anywhere; }
.fehler-klein { color: var(--fehler); }
.spalte-code { white-space: nowrap; }
.code { font-size: 14px; font-weight: 700; margin-right: 2px; }
.status + .status { margin-left: 6px; }

.kapitel-reihe { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kasten { width: 16px; height: 16px; border: 1px solid var(--s40); background: var(--flaeche); }
.kasten.gestartet { border-color: var(--gruen); background: linear-gradient(135deg, var(--gruen) 50%, var(--flaeche) 50%); }
.kasten.bestanden { border-color: var(--gruen); background: var(--gruen); }
.kapitel-zahl { margin-left: 6px; font-size: 12.5px; color: var(--sub); }

.leer { background: var(--flaeche); border: 1px solid var(--linie); padding: 48px 24px; text-align: center; color: var(--sub); }
.leer-titel { font-size: 17px; font-weight: 700; color: var(--text); }
.leer p { max-width: 560px; margin-left: auto; margin-right: auto; }
.leer-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.stand { margin-top: 12px; }

.bereich-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bereich-kopf h1 { margin: 0; }

@media (max-width: 760px) {
  .tabellen-huelle { border: 0; background: transparent; overflow: visible; }
  .tabelle thead { display: none; }
  .tabelle, .tabelle tbody, .tabelle tr, .tabelle td { display: block; width: 100%; }
  .tabelle tr {
    position: relative; background: var(--flaeche); border: 1px solid var(--linie); margin-bottom: 10px; padding: 12px 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px;
  }
  .tabelle td { border: 0; padding: 0; width: auto; min-width: 0; }
  .tabelle td.spalte-name { grid-column: 1 / -1; }
  .tabelle td[data-l]::before {
    content: attr(data-l); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sub);
  }
  .tabelle td.spalte-name::before { display: none; }
  .tabelle td:empty { display: none; }
  .tabelle td.spalte-wahl { position: absolute; top: 12px; right: 12px; width: auto; padding: 0; }
  .tabelle td.spalte-aktion { position: absolute; bottom: 10px; right: 10px; width: auto; padding: 0; }
  .spalte-name { padding-right: 36px !important; }
}

/* Dialoge */
.dlg.breit { width: min(860px, calc(100vw - 32px)); }
.dlg form { display: contents; }
.dialog-kopf h2 { margin: 0 0 6px; font-size: 19px; text-transform: uppercase; font-weight: 500; letter-spacing: .02em; }
.dialog-status { display: flex; gap: 6px; margin-bottom: 4px; }
.dlg-zwischen { font-size: 12px !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sub); margin: 20px 0 8px; }
.dialog-inhalt > .dlg-zwischen:first-child { margin-top: 4px; }
.code-block { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; border: 2px solid var(--gruen); padding: 12px 18px; }
.code-gross { font-size: 30px; font-weight: 700; letter-spacing: .16em; }
.detail-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 32px; }
.angaben { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.angaben dt { color: var(--sub); font-size: 13px; }
.angaben dd { margin: 0; overflow-wrap: anywhere; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.feld-paar { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0 16px; }
.feld-hilfe { font-size: 13px; color: var(--sub); margin: 0; }
.checkzeile { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.import-vorschau { margin-top: 4px; }
.import-vorschau .tabellen-huelle { max-height: 260px; overflow: auto; }
.fehlerliste { margin: 0; padding-left: 20px; max-height: 240px; overflow: auto; }
.post-vorschau { border: 1px solid var(--linie); padding: 10px 14px; margin-top: 8px; }
.post-vorschau summary { cursor: pointer; font-weight: 700; }
.vorschau-betreff { margin: 8px 0; }
.vorschau-text {
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: Arial, sans-serif; font-size: 14px;
  background: var(--flaeche-2); border-left: 3px solid var(--gruen); padding: 12px 14px; margin: 0; max-height: 300px; overflow: auto;
}

/* Druck: nur die Code-Zettel */
.druck { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.werkzeug { background: #fff; font-size: 11pt; }
  .app, .sprunglink, dialog, .toast { display: none !important; }
  .druck { display: block; color: #000; }
  .druck-kopf p { font-size: 9pt; margin: 0 0 6mm; color: #333; }
  .zettel-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .zettel { border: 1px dashed #666; padding: 6mm 7mm; break-inside: avoid; page-break-inside: avoid; min-height: 62mm; }
  .zettel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 4mm; border-bottom: 1px solid #000; padding-bottom: 3mm; margin-bottom: 3mm; }
  .zettel-kopf img { width: 24mm; height: auto; }
  .zettel-titel { font-size: 8pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .zettel-name { font-size: 13pt; font-weight: 700; margin: 0; }
  .zettel-abt { font-size: 9pt; margin: 0; color: #333; }
  .zettel-code-titel { font-size: 8pt; text-transform: uppercase; letter-spacing: .1em; margin: 3mm 0 0; }
  .zettel-code { font-size: 22pt; font-weight: 700; letter-spacing: .18em; margin: 0 0 2mm; border-left: 2mm solid #00aca0; padding-left: 3mm; }
  .zettel-text { font-size: 8.5pt; margin: 0; }
}
