/* scan — ruhige, dichte Werkstattoberfläche.
   Dunkel, weil das Werkzeug oft neben der HERO-Oberfläche offen liegt und
   nicht um Aufmerksamkeit buhlen soll. */

:root {
  --grund:        #14161a;
  --flaeche:      #1b1e24;
  --flaeche-hoch: #22262e;
  --rand:         #2c313a;
  --schrift:      #e6e8ec;
  --schrift-leise:#8b929e;
  --akzent:       #4a9eff;
  --gruen:        #3fb950;
  --gelb:         #d29922;
  --rot:          #f85149;
  --radius:       10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.verborgen { display: none !important; }
.leise { color: var(--schrift-leise); }
.fehler { color: var(--rot); }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid var(--rand);
  background: var(--flaeche-hoch);
  color: var(--schrift);
  padding: 8px 14px;
  transition: background .12s, border-color .12s;
}
button:hover { background: #2b3039; border-color: #3a414d; }
button.haupt {
  background: var(--akzent); border-color: var(--akzent); color: #06121f;
  font-weight: 600;
}
button.haupt:hover { background: #62adff; }
button.schlicht { background: none; border-color: transparent; color: var(--schrift-leise); }
button.schlicht:hover { color: var(--schrift); background: var(--flaeche-hoch); }
button.verweis {
  background: none; border: none; color: var(--akzent);
  padding: 0; text-decoration: underline;
}
button:disabled { opacity: .5; cursor: not-allowed; }

input, select {
  font: inherit;
  background: var(--grund);
  color: var(--schrift);
  border: 1px solid var(--rand);
  border-radius: 7px;
  padding: 8px 10px;
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }

/* ------------------------------------------------------------- Anmeldung */
.anmeldung {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.anmelde-karte { width: min(380px, 100%); display: grid; gap: 14px; }
.anmelde-karte h1 { margin: 0; font-size: 30px; letter-spacing: -.5px; }
.anmelde-karte p { margin: 0; }
.anmelde-karte label { display: grid; gap: 6px; font-size: 13px; color: var(--schrift-leise); }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 22px;
}

/* ------------------------------------------------------------------ Kopf */
.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rand);
  background: var(--flaeche);
  position: sticky; top: 0; z-index: 10;
}
.marke { font-weight: 700; font-size: 17px; letter-spacing: -.3px; }
.kopf-rechts { display: flex; align-items: center; gap: 14px; font-size: 13px; }

.wimpel { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--rand); }
.wimpel.gut    { color: var(--gruen); border-color: #1e4d28; background: #11251699; }
.wimpel.warnung{ color: var(--gelb);  border-color: #4d3d12; background: #24200d99; }
.wimpel.schlecht{color: var(--rot);   border-color: #5c2220; background: #26121299; }

/* --------------------------------------------------------------- Aufbau */
.raster {
  display: grid;
  grid-template-columns: minmax(380px, 480px) 1fr;
  gap: 18px;
  padding: 18px 20px;
  align-items: start;
}
@media (max-width: 1000px) {
  .raster { grid-template-columns: 1fr; }
  .spalte-rechts { order: -1; }
}
.spalte-links { display: grid; gap: 14px; min-width: 0; }
.spalte-rechts { position: sticky; top: 74px; min-width: 0; }

/* ----------------------------------------------------------- Ablegezone */
.ablegezone {
  border: 2px dashed var(--rand);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  transition: border-color .15s, background .15s;
  background: var(--flaeche);
}
.ablegezone.aktiv { border-color: var(--akzent); background: #16273a; }
.ablegezone p { margin: 4px 0; }
.ablege-zeichen { font-size: 26px; color: var(--schrift-leise); }

.meldung {
  padding: 9px 12px; border-radius: 7px; margin-bottom: 7px; font-size: 13px;
  border: 1px solid var(--rand); background: var(--flaeche);
}
.meldung.gut     { border-color: #1e4d28; color: #7ee08c; }
.meldung.schlecht{ border-color: #5c2220; color: #ff8b83; }

/* ------------------------------------------------------------ Filter/Liste */
.filterleiste { display: grid; gap: 10px; }
.reiter { display: flex; gap: 6px; flex-wrap: wrap; }
.reiter button {
  padding: 5px 11px; font-size: 13px; border-radius: 999px;
  background: var(--flaeche); color: var(--schrift-leise);
}
.reiter button.gewaehlt {
  background: var(--flaeche-hoch); color: var(--schrift); border-color: #3f4753;
}
.reiter .zaehler {
  margin-left: 6px; font-size: 11px; opacity: .75;
}
.suchfeld { font-size: 14px; }

.liste { display: grid; gap: 8px; }

.beleg {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-left: 3px solid var(--rand);
  border-radius: 8px;
  background: var(--flaeche);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.beleg:hover { background: var(--flaeche-hoch); }
.beleg.gewaehlt { border-color: var(--akzent); border-left-color: var(--akzent); background: #1a2430; }
.beleg.st-zugeordnet { border-left-color: var(--gruen); }
.beleg.st-gelesen    { border-left-color: var(--akzent); }
.beleg.st-fehler     { border-left-color: var(--rot); }
.beleg.st-ocr_laeuft, .beleg.st-neu { border-left-color: var(--gelb); }
.beleg.st-verworfen  { opacity: .5; }

.beleg-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.beleg-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beleg-zeile { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--schrift-leise); }

.marke-nr {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; padding: 1px 7px; border-radius: 5px;
  background: #223145; color: #8fc4ff; border: 1px solid #2c435e;
}
.marke-nr.offen { background: #3a2d12; color: #e0b653; border-color: #55411a; }

/* --------------------------------------------------------- Prüfansicht */
.pruef-leer {
  border: 1px dashed var(--rand); border-radius: var(--radius);
  padding: 60px 20px; text-align: center; background: var(--flaeche);
}

.pruef { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1400px) { .pruef { grid-template-columns: 1fr; } }

.vorschau {
  border: 1px solid var(--rand); border-radius: var(--radius);
  overflow: hidden; background: #0f1114; height: min(78vh, 900px);
}
.vorschau iframe, .vorschau img { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; }

.pruef-daten { display: grid; gap: 14px; max-height: min(78vh, 900px); overflow-y: auto; padding-right: 4px; }

.block { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 15px; }
.block h3 { margin: 0 0 11px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--schrift-leise); }

.felder { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 14px; }
.felder dt { color: var(--schrift-leise); }
.felder dd { margin: 0; }

.kandidat {
  border: 1px solid var(--rand); border-radius: 8px; padding: 12px;
  margin-bottom: 9px; background: var(--flaeche-hoch);
}
.kandidat.top { border-color: var(--gruen); background: #16241a; }
.kandidat-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 5px; }
.kandidat-nr { font-weight: 700; font-family: ui-monospace, Menlo, monospace; }
.sicherheit { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #1f2937; color: var(--schrift-leise); }
.sicherheit.hoch { background: #12341a; color: #7ee08c; }
.begruendung { font-size: 12.5px; color: var(--schrift-leise); margin: 7px 0 10px; font-style: italic; }

.hinweis {
  padding: 10px 12px; border-radius: 7px; font-size: 13px;
  background: #24200d; border: 1px solid #4d3d12; color: #e0b653;
}

table.positionen { width: 100%; border-collapse: collapse; font-size: 13px; }
table.positionen th {
  text-align: left; color: var(--schrift-leise); font-weight: 500;
  border-bottom: 1px solid var(--rand); padding: 5px 7px; font-size: 12px;
}
table.positionen td { padding: 5px 7px; border-bottom: 1px solid #23272f; }
table.positionen td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
table.positionen tr:last-child td { border-bottom: 0; }

.suchergebnis { max-height: 240px; overflow-y: auto; display: grid; gap: 6px; margin-top: 9px; }
.tat-leiste { display: flex; gap: 9px; flex-wrap: wrap; }

.ocr-text {
  white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; color: var(--schrift-leise);
  max-height: 260px; overflow-y: auto;
  background: var(--grund); padding: 11px; border-radius: 7px;
}
details summary { cursor: pointer; color: var(--schrift-leise); font-size: 13px; }
