:root {
  --bg: #F5F6F7;
  --panel: #ffffff;
  --ink: #1F2328;
  --muted: #5C6670;
  --line: #DDE1E5;
  --accent: #6DB84A;
  --accent-dark: #4E9A2F;
  --accent-ink: #ffffff;
  --accent-soft: #EEF7E9;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --bad: #D6001C;
  --bad-soft: #fdeceb;
  --ok: #1e7a3c;
  --ok-soft: #e6f4ea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
[hidden] { display: none !important; }
a { color: var(--accent-dark); }
button, input, select, textarea { font-family: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fehler { color: var(--bad); }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--panel); padding: 32px; border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 380px; display: grid; gap: 14px; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.brand.big { font-size: 24px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 16px; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.spacer { flex: 1; }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { background: var(--bg); }
.nav a { font-weight: 700; }
.nav a.aktiv { background: var(--accent); color: #fff; }
.nav a.aktiv .count { background: #fff; color: var(--accent-dark); }
.nav-sep { margin: 14px 12px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 8px; min-width: 22px; text-align: center; }
.count:empty { display: none; }
.main { overflow: auto; padding: 20px; }
.only-mobile { display: none; }

.badge { font-size: 12px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.badge.aus { background: var(--warn-soft); color: var(--warn); }
.badge.test { background: #e8eefc; color: #2847a8; }
.badge.echt { background: var(--ok-soft); color: var(--ok); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

h1 { font-size: 22px; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.kopf h1 { margin: 0; }

/* Formulare */
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); }

.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 800; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.gefahr { color: var(--bad); }
.btn.klein { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.icon-btn { background: none; border: 0; font-size: 20px; cursor: pointer; }

/* Posteingang */
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 96px); }
.liste { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: grid; gap: 4px; }
.item:hover { border-color: #b9c6c2; }
.item.aktiv { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.item .z1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.item .z2 { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: var(--panel); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.leer { text-align: center; color: var(--muted); padding: 40px 16px; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; min-height: 0; }
.pdf { background: #e9ecea; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 400px; }
.pdf iframe { width: 100%; height: 100%; border: 0; display: block; }
.panel { overflow-y: auto; display: grid; gap: 12px; align-content: start; padding-right: 4px; }
.grund { font-size: 12px; color: var(--muted); }
.grund.unsicher { color: var(--warn); }
.empf { display: grid; gap: 6px; }
.empf .k { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.empf .k small { grid-column: 2; color: var(--muted); }
.empf .k.ohne { opacity: .65; }
.banner { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.protokoll { font-size: 13px; display: grid; gap: 4px; margin-top: 8px; }
.protokoll div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfb; }
tr.klick { cursor: pointer; }
tr.klick:hover td { background: #f7faf9; }
.tabelle { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.filter { display: grid; grid-template-columns: 2fr 1fr 1fr 150px 150px; gap: 8px; margin-bottom: 12px; }

/* Trigger-Bons */
.regel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 8px; }
.bon { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px 14px 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.45; color: #111; box-shadow: var(--shadow); width: 290px; }
.bon-titel { font-size: 18px; font-weight: 800; text-align: center; line-height: 1.25; margin-bottom: 10px; word-break: break-word; }
.bon-text { white-space: pre-wrap; word-break: break-word; }
.bon-qr { margin: 12px auto 0; width: 120px; padding: 30px 6px; border: 2px dashed #bbb; text-align: center; font-size: 13px; }
.bon-qr span { font-size: 9px; color: var(--muted); word-break: break-all; }
.bon-fuss { text-align: center; color: #444; margin-top: 12px; font-size: 11px; }
.bon-schnitt { border-top: 2px dashed #ccc; margin: 14px -14px 0; height: 8px; }

/* Dialog */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 25, 22, .4); }
dialog form { padding: 20px; display: grid; gap: 14px; }
.dlg-fuss { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.kontakt-zeile { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.kontakt-zeile .g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: 10px; border-radius: 8px; word-break: break-all; user-select: all; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #17201e; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }

@media (max-width: 1200px) {
  .detail { grid-template-columns: 1fr; }
  .pdf { height: 70vh; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; top: 56px; left: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .nav.offen { transform: none; box-shadow: var(--shadow); }
  .only-mobile { display: inline-block; }
  .main { padding: 12px 16px; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .liste { max-height: 40vh; }
  .grid2, .filter, .kontakt-zeile .g4, .regel-grid { grid-template-columns: 1fr; }
  #wer { display: none; }
}
#archivDetail .pdf { height: 80vh; }

.karte-schritt { justify-items: center; text-align: center; }
.karte-bild { width: 86px; height: 56px; border-radius: 8px; border: 2px solid var(--accent); position: relative; margin: 6px 0; animation: puls 1.8s ease-in-out infinite; }
.karte-bild span { position: absolute; left: 10px; top: 14px; width: 18px; height: 14px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--accent); }
@keyframes puls { 50% { box-shadow: 0 0 0 8px var(--accent-soft); } }
#kChip { text-align: center; }
.verdeckt { -webkit-text-security: disc; text-security: disc; }
.pin { font-size: 26px; letter-spacing: .5em; text-align: center; }

.hinweis-ausweis { display: flex; gap: 10px; align-items: center; margin: 6px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: 13px; line-height: 1.4; }
.karte-bild.klein { flex: none; width: 34px; height: 22px; border-width: 1.5px; border-radius: 4px; margin: 0; animation: none; }
.karte-bild.klein span { left: 4px; top: 5px; width: 8px; height: 7px; border-radius: 2px; }

/* Marke wie AlfredsLAB Signage: Wortmarke klein, Produktname zentriert darunter – über der Menüspalte */
.top .brand { width: 224px; flex: none; justify-content: center; }
.marke { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1; }
.marke .wortmarke { height: 15px; width: auto; display: block; }
.marke b { font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--ink); }
.marke b i { font-style: normal; color: #ef5a3c; font-weight: 900; }
.brand.big { justify-content: center; margin-bottom: 4px; }
.brand.big .marke .wortmarke { height: 22px; }
.brand.big .marke b { font-size: 16px; }
@media (max-width: 900px) { .top .brand { width: auto; } }
@media (min-width: 901px) { .top { padding-left: 0; } .top .brand { width: 240px; } }

.login-box .zentriert { text-align: center; }
.login-box > strong { font-size: 16px; }
.zf-qr { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.zf-qr .qr { width: 180px; height: 180px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.zf-qr .qr svg { width: 100%; height: 100%; display: block; }
.geheim { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

/* Freigaben (Änderungsvorschläge) */
.count.warn { background: var(--warn); }
.nav a.aktiv .count.warn { color: var(--warn); }
.vorschlag .kopfzeile { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.vorschlag .notiz { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; }
table.vergleich { border: 1px solid var(--line); border-radius: 8px; }
table.vergleich td, table.vergleich th { padding: 6px 8px; font-size: 13px; }
table.vergleich td:first-child { color: var(--muted); width: 26%; }
table.vergleich tr.geaendert td:last-child { background: var(--accent-soft); font-weight: 700; }
table.vergleich td.alt { color: var(--muted); }
table.vergleich input, table.vergleich textarea, table.vergleich select { padding: 5px 8px; font-size: 13px; }
table.vergleich textarea { min-height: 50px; }
.einmalig { display: grid; gap: 6px; }

/* Aktion & Liefertermin, Unterlagen, Aufteilen */
.lt-zeile { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 8px; }
.drop.klein { padding: 12px; font-size: 13px; }
.unterlagen { display: flex; flex-direction: column; gap: 4px; }
.u-zeile { display: grid; grid-template-columns: minmax(0, 1fr) 28px; column-gap: 8px; align-items: center; font-size: 14px; padding: 2px 0; }
.u-zeile > span.small { grid-column: 1; grid-row: 2; }
.u-zeile > button, .u-zeile > span:last-child:not(.small) { grid-column: 2; grid-row: 1 / span 2; }
.u-zeile a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aktion-belege { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.seite-zeile { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; }
@media (max-width: 600px) { .lt-zeile { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- alfredsdata */
h2 { font-size: 17px; margin: 24px 0 10px; }
.r { text-align: right; }
td.r, th.r { text-align: right; white-space: nowrap; }
.filterzeile { margin-bottom: 12px; }
.filterzeile select, .filterzeile input { width: auto; min-width: 180px; }
tr.klick { cursor: pointer; }
tr.klick:hover td { background: var(--accent-soft); }
tr.aus td { color: var(--muted); }
th.sort { cursor: pointer; user-select: none; white-space: nowrap; }
table.daten td { font-size: 13px; padding: 6px 8px; }
table.daten th { padding: 7px 8px; }
.blaettern { margin-top: 10px; justify-content: center; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kachel { text-decoration: none; color: inherit; display: grid; gap: 8px; }
.kachel:hover { border-color: var(--accent); }
.gross { font-size: 28px; font-weight: 800; }
table.kv { background: none; }
table.kv td { border: 0; padding: 4px 8px 4px 0; font-size: 14px; }
table.kv td:first-child { color: var(--muted); white-space: nowrap; width: 1%; padding-right: 16px; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 12.5px; }
.doku td:first-child { width: auto; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } .filterzeile select, .filterzeile input { width: 100%; } }

tr.unterzeile td { background: #fafbfb; font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
