:root {
  --schwarz: #111; --text: #1a1a1a; --leise: #666; --linie: #d9d9d9; --flaeche: #f4f4f4;
  --weiss: #fff; --warn: #8a5a00; --warn-bg: #fff6e0; --fehler: #a40000; --fehler-bg: #fdecec;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
       color: var(--text); background: var(--flaeche); }
button, input, textarea, select { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.leise { color: var(--leise); font-size: 13px; }
.logo { height: 22px; display: block; }

/* Kopfzeile */
.kopf { background: var(--weiss); border-bottom: 1px solid var(--linie); }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 16px; }
.kopf .titel { font-weight: 600; border-left: 1px solid var(--linie); padding-left: 16px; }
.kopf .nutzer { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.banner { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 6px 16px; font-size: 13px; }

main.seite { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; }
.karte + .karte { margin-top: 16px; }
.schmal { max-width: 380px; margin: 12vh auto 0; }
.anmelden .logo { height: 26px; margin-bottom: 24px; }
.anmelden form { margin-top: 16px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
label input, label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
input, textarea { border: 1px solid #bbb; border-radius: 4px; padding: 8px 10px; background: var(--weiss); }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--schwarz); outline-offset: 1px; }
textarea { resize: vertical; min-height: 54px; }

button { border: 1px solid var(--schwarz); background: var(--weiss); border-radius: 4px; padding: 7px 14px;
         cursor: pointer; white-space: nowrap; }
button:hover { background: var(--flaeche); }
button.primaer { background: var(--schwarz); color: var(--weiss); }
button.primaer:hover { background: #333; }
button.klein { padding: 3px 9px; font-size: 13px; }
button.text { border: 0; background: none; text-decoration: underline; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
.breit { width: 100%; }
.fehlermeldung { background: var(--fehler-bg); color: var(--fehler); padding: 8px 12px; border-radius: 4px; font-size: 14px; }

/* Hochladen */
.ablage { border: 2px dashed #aaa; border-radius: var(--radius); padding: 28px 16px; text-align: center;
          background: var(--weiss); cursor: pointer; transition: background .15s, border-color .15s; }
.ablage.aktiv { border-color: var(--schwarz); background: #ececec; }
.ablage strong { display: block; font-size: 16px; margin-bottom: 4px; }

/* Liste */
.leiste { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.leiste h2 { margin: 0; margin-right: auto; }
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--leise); font-weight: 600; }
tbody tr.zeile { cursor: pointer; }
tbody tr.zeile:hover { background: #fafafa; }
tbody tr.gewaehlt { background: #efefef; }
td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.leer { text-align: center; color: var(--leise); padding: 32px; }

.status { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--linie); }
.status.fertig { background: var(--schwarz); color: var(--weiss); border-color: var(--schwarz); }
.status.freigegeben { background: var(--weiss); border-color: var(--schwarz); font-weight: 600; }
.status.fehler { background: var(--fehler-bg); color: var(--fehler); border-color: var(--fehler-bg); }
.status.laeuft::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
                         border: 2px solid #999; border-top-color: transparent; animation: dreh 1s linear infinite; vertical-align: -1px; }
@keyframes dreh { to { transform: rotate(360deg); } }
.markierung { font-size: 12px; color: var(--warn); white-space: nowrap; }

/* Detail */
.detail-kopf { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.detail-kopf .wer { flex: 1 1 280px; }
.ergebnis { display: flex; gap: 10px; flex-wrap: wrap; }
.kachel { background: var(--flaeche); border-radius: var(--radius); padding: 10px 14px; min-width: 110px; text-align: center; }
.kachel b { display: block; font-size: 20px; }
.kachel span { font-size: 12px; color: var(--leise); }
.hinweise { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; margin: 14px 0; font-size: 14px; }
.hinweise ul { margin: 4px 0 0; padding-left: 18px; }

table.bereiche td { vertical-align: top; }
table.bereiche input[type=number] { width: 64px; text-align: center; }
table.bereiche { table-layout: fixed; }
table.bereiche textarea { width: 100%; min-height: 38px; font-size: 14px; overflow: hidden; }
table.bereiche .feldname { font-size: 12px; font-weight: 600; color: var(--leise); margin: 2px 0; }
table.bereiche .bereich { font-weight: 600; min-width: 150px; }
table.bereiche tfoot td { font-weight: 600; background: var(--flaeche); }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.knopfreihe .rechts { margin-left: auto; }

details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; }
table.kriterien td, table.kriterien th { font-size: 13px; padding: 6px 8px; }
.abzug { font-weight: 700; }
.unsicher { color: var(--warn); font-size: 12px; }

.meldung { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--schwarz); color: var(--weiss);
           padding: 10px 18px; border-radius: var(--radius); font-size: 14px; max-width: calc(100% - 32px); z-index: 10; }
.meldung.fehler { background: var(--fehler); }

@media (max-width: 720px) {
  .kopf .titel { display: none; }
  .kopf #nutzername { display: none; }
  .kopf .logo { height: 18px; }
  table.bereiche thead, table.bereiche colgroup { display: none; }
  table.bereiche { table-layout: auto; }
  table.bereiche td:nth-child(3), table.bereiche td:nth-child(4) { display: inline-block; width: 48%; }
  table.bereiche tr, table.bereiche td { display: block; border: 0; }
  table.bereiche tr { border-bottom: 1px solid var(--linie); padding: 8px 0; }
}
