:root {
  --bg: #050505; --card: #111112; --card2: #18181a; --text: #f2f2f3; --muted: #8e8e96; --line: #232326; --line2: #34343a;
  --side: #000; --side-text: #b9b9c0; --side-hover: #161618;
  --accent: #f59e0b; --accent-ink: #0a0a0a; --accent-soft: rgba(245,158,11,.14);
  --blue: #4f8cff; --green: #22c55e; --orange: #f59e0b; --red: #ef4444; --purple: #a78bfa; --gray: #9ca3af;
  --soft-blue: rgba(79,140,255,.14); --soft-green: rgba(34,197,94,.14); --soft-orange: rgba(245,158,11,.15); --soft-red: rgba(239,68,68,.15); --soft-purple: rgba(167,139,250,.15); --soft-gray: #1c1c1f;
  --radius: 12px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 var(--font); background: var(--bg); color: var(--text); display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .85em; background: var(--soft-gray); padding: .1em .35em; border-radius: 4px; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.b { font-weight: 700; }
.txt-red { color: var(--red); } .txt-green { color: var(--green); } .txt-orange { color: var(--orange); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.sidebar { background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 14px 10px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.brand-logo { max-width: 100%; max-height: 64px; object-fit: contain; display: block; }
.brand.has-logo { justify-content: center; }
.brand.has-logo .brand-text { display: none; }
.brand-mini .brand-logo { max-height: 30px; max-width: 140px; }
.login .brand-logo { max-height: 90px; margin: 0 auto; }
.brand strong { color: #fff; display: block; font-size: 1.05rem; }
.brand small { display: block; color: #8b93a0; font-size: .75rem; }
.brand.big { justify-content: center; margin-bottom: 1rem; }
.brand.big strong { color: var(--text); font-size: 1.3rem; }
.logo { background: var(--accent); color: var(--accent-ink); font-weight: 800; border-radius: 8px; width: 36px; height: 36px; display: inline-grid; place-items: center; font-size: .9rem; flex: none; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a { color: var(--side-text); padding: 8px 10px; border-radius: 7px; font-size: .93rem; }
.nav a:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 4px 14px var(--accent-soft); }
.nav a.nav-strong { font-weight: 600; color: #fff; }
.nav a.nav-strong.active { color: var(--accent-ink); }
.nav-sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6b7380; padding: 14px 10px 4px; }
.user-box { border-top: 1px solid var(--line); padding: 12px 8px 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; }
.topbar { display: none; }
main { padding: 24px 28px 60px; min-width: 0; max-width: 1500px; }
.nav-backdrop { display: none; }

body.bare, body.logged-out { grid-template-columns: 1fr; }
body.bare .sidebar, body.logged-out .sidebar, body.bare .topbar, body.logged-out .topbar { display: none; }
body.bare main { max-width: none; }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; background: var(--side); color: #fff; align-items: center; justify-content: space-between; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar .icon-btn { color: #fff; font-size: 1.3rem; }
  .brand-mini { display: flex; align-items: center; gap: 8px; font-weight: 700; }
  .brand-mini .logo { width: 28px; height: 28px; font-size: .75rem; }
  main { padding: 16px 16px 60px; }
  .hide-sm { display: none; }
}

/* ---------- Bausteine ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card.error { border-color: var(--red); color: var(--red); }
.card.late { border-left: 4px solid var(--red); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { margin: 2px 0 0; color: var(--muted); }
.back { font-size: .85rem; color: var(--muted); display: inline-block; margin-bottom: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-scan { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid-scan { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; } .gap { gap: 8px; } .wrap { flex-wrap: wrap; }
.loading, .empty { color: var(--muted); padding: 18px; text-align: center; }
.empty.small { padding: 6px; font-size: .85rem; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.alert.red { background: var(--soft-red); color: var(--red); border: 1px solid var(--red); }

.btn { transition: border-color .15s, background .15s; } .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost.danger { color: var(--red); border-color: transparent; background: transparent; }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: .85rem; }
.btn.big { padding: 11px 18px; font-size: 1rem; min-height: 46px; }
.user-box .btn { color: var(--side-text); border-color: #333a44; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--soft-gray); color: var(--text); }

input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid > .span-2 { grid-column: span 2; } .form-grid > .span-3 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid > .span-3, .form-grid > .span-2 { grid-column: 1 / -1; } }
.form-section { grid-column: 1 / -1; margin: 10px 0 -2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); min-width: 0; }
.fld > span em { font-style: normal; opacity: .7; }
.fld input, .fld select, .fld textarea { font-size: .95rem; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.form-grid > .check { align-self: end; min-height: 38px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: var(--card); padding: 12px 0 2px; border-top: 1px solid var(--line); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters select { width: auto; }

.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; vertical-align: middle; }
.b-gray { background: var(--soft-gray); color: var(--gray); } .b-blue { background: var(--soft-blue); color: var(--blue); }
.b-green { background: var(--soft-green); color: var(--green); } .b-orange { background: var(--soft-orange); color: var(--orange); }
.b-red { background: var(--soft-red); color: var(--red); } .b-purple { background: var(--soft-purple); color: var(--purple); }
.b-dark { background: #374151; color: #fff; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 7px 14px; border-radius: 99px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.tabs a.active { background: var(--text); color: var(--card); }
.tabs a:hover { text-decoration: none; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--soft-gray); }
.num { text-align: right; white-space: nowrap; }
td.acts { text-align: right; white-space: nowrap; }
tr.done td { opacity: .55; }
tr.conflict td { background: var(--soft-red); }
.inl { border: 1px solid transparent; background: transparent; padding: 4px 6px; min-height: 30px; }
.inl:hover { border-color: var(--line2); }
.inl.n { width: 5.5em; text-align: right; }
.inl.wide { min-width: 200px; font-weight: 500; }
.mini { width: auto; min-height: 30px; padding: 3px 6px; font-size: .82rem; }
.mini.n { width: 4.5em; text-align: right; }
.totals { margin-left: auto; max-width: 340px; margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { border-top: 2px solid var(--text); margin-top: 4px; padding-top: 8px; font-size: 1.15rem; }

/* Uebersicht */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.quick-btn { display: flex; flex-direction: column; padding: 20px; border-radius: 14px; color: #fff; font-size: 1.25rem; font-weight: 700; box-shadow: var(--shadow); }
.quick-btn:hover { text-decoration: none; filter: brightness(1.05); }
.quick-btn span { font-size: 1.8rem; line-height: 1; margin-bottom: 8px; }
.quick-btn small { font-weight: 400; opacity: .85; font-size: .85rem; }
.q-out { background: linear-gradient(135deg, #f59e0b, #ea7a0c); color: #14171c; }
.q-in { background: linear-gradient(135deg, #16a34a, #0f7a38); }
.q-find { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
@media (max-width: 760px) { .quick { grid-template-columns: 1fr; } .quick-btn { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; } .quick-btn span { margin: 0; } .quick-btn small { display: none; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--text); display: flex; flex-direction: column; border-left: 4px solid var(--line2); }
.tile:hover { text-decoration: none; border-color: var(--muted); }
.tile b { font-size: 1.5rem; } .tile span { color: var(--muted); font-size: .85rem; }
.tile.red { border-left-color: var(--red); } .tile.red b { color: var(--red); }
.tile.orange { border-left-color: var(--orange); } .tile.orange b { color: var(--orange); }
.tile.purple { border-left-color: var(--purple); }

/* Info-Listen */
.info { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 18px; margin: 0; }
.info dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.info dd { margin: 2px 0 0; font-weight: 500; }
.stock-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stock-row div { background: var(--soft-gray); border-radius: 8px; padding: 10px; text-align: center; }
.stock-row b { display: block; font-size: 1.4rem; } .stock-row span { font-size: .78rem; color: var(--muted); }
.av { font-size: 1.05rem; padding: 8px 12px; border-radius: 8px; margin: 10px 0; }
.av.ok { background: var(--soft-green); } .av.bad { background: var(--soft-red); color: var(--red); }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.where { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 1rem; }
.where.out { background: var(--soft-orange); } .where.home { background: var(--soft-green); }
.big-code { font-size: 1.2rem; padding: .2em .5em; }
.doc-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.steps { padding-left: 1.2em; } .steps li { margin-bottom: 4px; }

/* ---------- Scannen ---------- */
.scan-bar { border-top: 4px solid var(--accent); }
.scan-bar.in { border-top-color: var(--green); }
.scan-input-row { display: flex; gap: 8px; margin: 10px 0; }
.scan-input { font-size: 1.35rem; min-height: 56px; font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; flex: 1; }
.qty-box { display: flex; align-items: center; gap: 4px; font-size: 1.2rem; color: var(--muted); }
.qty-box input { width: 4.2em; min-height: 56px; font-size: 1.2rem; text-align: center; }
.target { padding: 12px 16px; border-radius: 10px; font-size: 1.1rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.target.in-case { background: var(--accent); color: var(--accent-ink); animation: pulse 2s infinite; }
.target.in-case code { background: rgba(0,0,0,.12); }
.target.loose { background: var(--soft-gray); }
.target .tw { margin-left: auto; font-weight: 600; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(245,158,11,.25); } }
.scan-log { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.log { padding: 7px 12px; border-radius: 8px; font-size: .92rem; opacity: .65; }
.log span { color: var(--muted); font-size: .8rem; margin-right: 6px; }
.log.latest { opacity: 1; font-size: 1.05rem; font-weight: 500; }
.log.ok { background: var(--soft-green); } .log.warn { background: var(--soft-orange); } .log.error { background: var(--soft-red); color: var(--red); } .log.note { background: var(--soft-blue); }
.log.latest.error { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.case-block { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.case-block.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.case-block.done { opacity: .7; }
.case-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--soft-gray); flex-wrap: wrap; }
.case-block.active .case-head { background: var(--accent-soft); }
.case-no { background: var(--text); color: var(--card); border-radius: 6px; padding: 1px 7px; font-size: .78rem; font-weight: 700; }
.case-block table.items td { padding: 6px 12px; }
table.items td { padding: 6px 8px; }
.pick-list { max-height: 55vh; overflow-y: auto; margin-top: 10px; }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.pick.added { background: var(--soft-green); }
.cam-reader { width: 100%; border-radius: 10px; overflow: hidden; background: #000; min-height: 240px; }
.cam-last { margin-top: 10px; font-size: 1.1rem; font-weight: 600; text-align: center; }

/* Kalender */
.cal { padding: 0; overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); }
.cal-hd { padding: 8px; font-size: .78rem; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 0; overflow: hidden; }
.cal-cell.other { background: var(--soft-gray); opacity: .6; }
.cal-cell.today .cal-day { background: var(--accent); color: var(--accent-ink); border-radius: 99px; }
.cal-day { font-size: .8rem; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; margin: 0 4px 2px; }
.cal-job { display: block; font-size: .75rem; padding: 2px 6px; margin: 1px 0; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-job:hover { text-decoration: none; filter: brightness(1.1); }
.s-angebot { background: #9ca3af; } .s-auftrag { background: var(--blue); } .s-unterwegs { background: var(--orange); } .s-zurueck { background: var(--green); } .s-abgeschlossen { background: #4b5563; }
.legend { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; } .legend .cal-job { border-radius: 4px; display: inline-block; }

/* Dialoge & Meldungen */
.modal-wrap { position: fixed; inset: 0; background: rgba(10,12,16,.5); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; width: min(520px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { margin: 0; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1.05rem; }
.modal-body { padding: 18px; }
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 10px; color: #fff; background: #1f2937; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .4s, transform .4s; font-weight: 500; }
.toast.t-ok { background: #15803d; } .toast.t-error { background: var(--red); } .toast.t-warn { background: var(--orange); }
.toast.out { opacity: 0; transform: translateY(10px); }
.login { max-width: 420px; margin: 10vh auto; }
.login h2 { text-align: center; }

/* ---------- Druckdokumente ---------- */
body.print-mode { background: #e5e7eb; }
body.print-mode .sidebar, body.print-mode .topbar { display: none; }
body.print-mode { grid-template-columns: 1fr; }
body.print-mode main { max-width: none; padding: 16px; }
.print-toolbar { display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.print-toolbar select { width: auto; }
.doc { background: #fff; color: #111; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 16mm 18mm 14mm 22mm; box-shadow: 0 4px 20px rgba(0,0,0,.15); font-size: 10pt; line-height: 1.4; display: flex; flex-direction: column; color-scheme: light; }
.doc code { background: #f1f1f1; color: #111; }
.doc-head { display: flex; justify-content: flex-end; margin-bottom: 8mm; }
.doc-brand { display: flex; gap: 10px; align-items: center; text-align: right; flex-direction: row-reverse; }
.doc-brand .logo { width: 44px; height: 44px; font-size: 1rem; }
.doc-brand b { font-size: 14pt; display: block; } .doc-brand small { display: block; color: #555; font-size: 8pt; }
.doc-sender { font-size: 7pt; color: #666; border-bottom: 1px solid #999; display: inline-block; margin-bottom: 2mm; }
.doc-top { display: flex; justify-content: space-between; gap: 10mm; margin-bottom: 10mm; }
.doc-address { min-height: 30mm; font-size: 10.5pt; }
.doc-meta td { padding: 1px 0 1px 10px; border: 0; font-size: 9pt; } .doc-meta td:first-child { color: #555; }
.doc-title { font-size: 15pt; margin: 0 0 5mm; }
.doc-table { margin: 3mm 0; font-size: 9pt; }
.doc-table th { color: #333; border-bottom: 1.5px solid #111; padding: 4px 5px; font-size: 7.5pt; }
.doc-table td { padding: 4px 5px; border-bottom: 1px solid #ddd; color: #111; }
.doc-table td.box { width: 18px; font-size: 12pt; }
.doc-sum { width: auto; margin: 4mm 0 4mm auto; min-width: 75mm; }
.doc-sum td { padding: 2px 5px; border: 0; } .doc-sum td:last-child { text-align: right; font-weight: 600; }
.doc-sum tr.grand td { border-top: 1.5px solid #111; font-size: 11pt; font-weight: 700; padding-top: 4px; }
.doc-case { border: 1.5px solid #111; border-radius: 4px; margin-bottom: 4mm; break-inside: avoid; }
.doc-case-head { background: #f1f1f1; padding: 5px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 9pt; }
.doc-case .doc-table { margin: 0; }
.doc-notes { background: #f7f7f7; padding: 8px 10px; border-left: 3px solid #f59e0b; white-space: pre-wrap; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 15mm; margin-top: 15mm; font-size: 8pt; color: #555; }
.signatures span { display: block; border-bottom: 1px solid #111; height: 12mm; margin-bottom: 3px; }
.doc-foot { margin-top: auto; padding-top: 6mm; border-top: 1px solid #bbb; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4mm; font-size: 7pt; color: #555; }
@media (max-width: 900px) { .doc { width: 100%; min-height: 0; padding: 18px; } }

/* Etiketten */
.label-pick { max-width: 900px; margin: 0 auto 16px; }
.labels { display: flex; flex-wrap: wrap; gap: 4mm; justify-content: center; }
.label { background: #fff; color: #111; border: 1px dashed #bbb; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 1.5mm 2mm; break-inside: avoid; text-align: center; }
.l-top { font-size: 6pt; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.l-name { font-size: 8.5pt; font-weight: 700; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.l-sub { font-size: 6.5pt; color: #444; }
.l-bc { max-width: 100%; height: auto; max-height: 60%; }
.size-62x29 .label { width: 62mm; height: 29mm; } .size-50x25 .label { width: 50mm; height: 25mm; }
.size-a4 .label { width: 70mm; height: 37mm; } .size-a4s .label { width: 48.5mm; height: 25.4mm; } .size-a4s .l-name { font-size: 7pt; }

@media print {
  @page { size: A4; margin: 0; }
  body, body.print-mode { background: #fff !important; display: block; }
  .no-print, .print-toolbar, .sidebar, .topbar, #toasts { display: none !important; }
  main, body.print-mode main { padding: 0 !important; }
  .doc { box-shadow: none; margin: 0; width: 210mm; min-height: 297mm; }
  .labels { gap: 0; justify-content: flex-start; }
  .label { border: 0; }
  .size-a4 { padding: 4.5mm 0 0 0; } .size-a4s { padding: 10.7mm 0 0 8.4mm; }
}
@media print { body:has(.size-62x29) .label, body:has(.size-50x25) .label { page-break-after: always; } }
.doc-case .doc-table { table-layout: fixed; }
.doc-case .doc-table th:nth-child(1) { width: 7mm; } .doc-case .doc-table th:nth-child(2) { width: 15mm; }
.doc-case .doc-table th:nth-child(4) { width: 52mm; } .doc-case .doc-table th:nth-child(5) { width: 20mm; }
.doc-case .doc-table th:nth-child(6), .doc-case .doc-table th:nth-child(7) { width: 22mm; }
.print-toolbar .check { color: #111; }
body.print-mode { color-scheme: light; }
@media (max-width: 600px) {
  .scan-input { font-size: 1.1rem; min-width: 0; }
  .qty-box input { width: 3em; }
  .qty-box { font-size: 1rem; }
  .page-head h1 { font-size: 1.3rem; }
}
.inl.n { width: 4.6em; } .inl.wide { min-width: 160px; }

/* ---------- Version 2: Sets, Packliste, Packmodus ---------- */
.pos-sub { font-size: .78rem; color: var(--muted); margin: 2px 6px; }
.pos-opt { margin: 4px 6px 0; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; font-size: .78rem; color: var(--muted); }
.chip { font: inherit; font-size: .78rem; border: 1px dashed var(--line2); background: transparent; color: var(--blue); border-radius: 99px; padding: 2px 9px; cursor: pointer; }
.chip:hover { background: var(--soft-blue); border-style: solid; }
.link-group + .link-group { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.packtable td { padding: 7px 8px; }
.packtable .pstate { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.ps-open .pstate { background: var(--soft-orange); color: var(--orange); }
.ps-over .pstate, .ps-extra .pstate { background: var(--soft-purple); color: var(--purple); }
.ps-done td { opacity: .5; } .ps-done .pstate { color: var(--green); }
.packtable.big td { font-size: 1.05rem; padding: 12px 10px; }

body.pack-mode main { padding: 0; max-width: none; }
.pack { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 96px; padding-top: max(10px, env(safe-area-inset-top)); min-height: 100vh; }
.pack-top { display: flex; align-items: center; gap: 10px; }
.pack-top b { display: block; font-size: 1.15rem; } .pack-top small { color: var(--muted); }
.pack-top .badge { margin-left: auto; }
.pack .target { font-size: 1.15rem; }
.pack-cam { border-radius: 12px; overflow: hidden; background: #000; max-height: 38vh; }
.pack-cam video { width: 100% !important; object-fit: cover; }
.pack .scan-input-row { margin: 0; }
.pack-last { border-radius: 12px; padding: 14px 16px; font-size: 1.3rem; font-weight: 700; min-height: 64px; background: var(--soft-gray); color: var(--muted); }
.pack-last:empty::before { content: 'Bereit zum Scannen'; font-weight: 500; }
.pack-last small { display: block; font-size: .95rem; font-weight: 600; margin-top: 4px; }
.pack-last.ok { background: var(--green); color: #fff; } .pack-last.warn { background: var(--orange); color: #fff; }
.pack-last.error { background: var(--red); color: #fff; animation: shake .3s; } .pack-last.note { background: var(--blue); color: #fff; }
.pack-progress { position: relative; height: 30px; background: var(--soft-gray); border-radius: 99px; overflow: hidden; }
.pack-progress #pbar { position: absolute; inset: 0 auto 0 0; background: var(--green); transition: width .3s; }
.pack-progress span { position: relative; display: block; text-align: center; line-height: 30px; font-weight: 700; }
.pack-list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pack-bottom { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); z-index: 20; }
.pack-bottom .btn { min-height: 56px; font-size: 1rem; }

/* ---------- Schwarz-Design Feinschliff ---------- */
.sidebar { border-right: 1px solid var(--line); }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); }
.btn { background: var(--card2); }
.btn.ghost { background: transparent; }
.tile { background: var(--card); }
.tabs a.active { background: var(--accent); color: var(--accent-ink); }
th { color: #75757d; }
tr[data-href]:hover td { background: #17171a; }
input, select, textarea { background: #0b0b0c; }
.modal { background: var(--card); border: 1px solid var(--line); }
.modal-head { background: var(--card); }
.q-out { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); color: var(--accent-ink); }
.q-in { background: linear-gradient(135deg, #16a34a, #0b5d2a); }
.q-find { background: linear-gradient(135deg, #2f6fe0, #173f8c); }
.logo-row { display: flex; gap: 16px; flex-wrap: wrap; }
.logo-box { flex: 1; min-width: 240px; border: 1px dashed var(--line2); border-radius: 12px; padding: 14px; }
.logo-prev { height: 90px; display: grid; place-items: center; border-radius: 8px; margin: 8px 0; }
.logo-prev.dark { background: #000; } .logo-prev.light { background: #fff; }
.logo-prev img { max-height: 76px; max-width: 90%; object-fit: contain; }
.doc-logo { max-height: 22mm; max-width: 70mm; object-fit: contain; }

/* ---------- Version 3: Lieferschein, Inhalt anpassen ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.stepper button { background: var(--card2); color: var(--text); border: 0; width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer; }
.stepper input { width: 3.6em; border: 0; border-radius: 0; text-align: center; min-height: 34px; padding: 0; }
tr.changed td { background: var(--accent-soft); }
.doc-h2 { font-size: 10.5pt; text-transform: uppercase; letter-spacing: .08em; color: #111; margin: 7mm 0 2mm; padding-bottom: 1.5mm; border-bottom: 2px solid var(--accent); }
.ls-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(32mm, 1fr)); gap: 3mm; margin: 2mm 0 4mm; }
.ls-summary div { border: 1px solid #ddd; border-left: 3px solid var(--accent); border-radius: 2mm; padding: 2.5mm 3mm; background: #fafafa; }
.ls-summary span { display: block; font-size: 7pt; text-transform: uppercase; letter-spacing: .06em; color: #666; }
.ls-summary b { display: block; font-size: 14pt; color: #111; line-height: 1.2; }
.ls-summary small { font-size: 7pt; color: #777; }
.ls-items, .ls-colli { font-size: 8.5pt; }
.ls-items tr.ls-group td { background: #f1f1f1; border-top: 1.5px solid #bbb; padding-top: 5px; }
.ls-items tr.ls-group.extra td { background: #fff7e6; }
.ls-items tr.ls-sub td { border-bottom: 1px dotted #ddd; color: #222; }
.ls-items tr.ls-sub td:nth-child(3) { padding-left: 14px; }
.ls-items tr.ls-sub td:nth-child(3)::before { content: '↳ '; color: #999; }
.ls-items tr.ls-single td { border-top: 1.5px solid #bbb; }
.ls-missing td { color: #b45309; font-style: italic; font-size: 8pt; }
.ls-tag { font-size: 6.5pt; font-weight: 700; text-transform: uppercase; background: #111; color: #fff; padding: 1px 5px; border-radius: 3px; vertical-align: middle; }
.ls-codes { font-family: ui-monospace, Consolas, monospace; font-size: 7.3pt; color: #333; word-break: break-word; }
.ls-sn { font-size: 7pt; color: #666; display: block; }
.ls-colli tfoot td { border-top: 2px solid #111; font-weight: 700; padding-top: 5px; }
.brand .brand-logo { width: 100%; height: 64px; max-height: 64px; }
.brand-mini .brand-logo { height: 30px; width: auto; max-width: 170px; }
.login .brand-logo { height: 84px; width: auto; max-width: 100%; }
.brand.big { border: 0; }
.cd-table { table-layout: fixed; }
.cd-table th:nth-child(2) { width: 5.5em; } .cd-table th:nth-child(3) { width: 9.5em; } .cd-table th:nth-child(4) { width: 3.5em; }
.cd-table td:first-child { overflow: hidden; text-overflow: ellipsis; }

.doc small { font-size: .85em; }
.doc-brand.with-logo { flex-direction: column; align-items: flex-end; gap: 1mm; }
.doc-brand.with-logo small { display: block; font-size: 7.5pt; color: #555; }
.doc-logo { max-height: 20mm; max-width: 75mm; margin-bottom: 1mm; }

/* ---------- QR-Etiketten ---------- */
.label.qr { flex-direction: row; align-items: center; justify-content: flex-start; gap: 2mm; text-align: left; padding: 1.5mm 2mm; }
.label.qr .l-qr { height: 100%; aspect-ratio: 1; flex: none; image-rendering: pixelated; }
.label.qr .l-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; overflow: hidden; }
.label.qr .l-brand { font-size: 5.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.label.qr .l-name { font-size: 8pt; max-height: 2.3em; }
.label.qr .l-code { font-family: ui-monospace, Consolas, monospace; font-size: 9pt; font-weight: 700; letter-spacing: .03em; }
.label.qr .l-bc { max-height: 6mm; width: 100%; }
.size-40x30 .label { width: 40mm; height: 30mm; } .size-25x25 .label { width: 25mm; height: 25mm; }
.size-40x30 .label.qr { flex-direction: column; } .size-40x30 .label.qr .l-qr { height: 17mm; } .size-40x30 .label.qr .l-text { align-items: center; text-align: center; }
.label.qr.mini { flex-direction: column; justify-content: center; gap: .8mm; padding: 1.5mm; }
.label.qr.mini .l-qr { height: 18mm; } .label.qr.mini .l-code { font-size: 6.5pt; }
@media print { body:has(.size-40x30) .label, body:has(.size-25x25) .label { page-break-after: always; } }

/* Lieferschein-Optionen */
.ls-opts { position: relative; }
.ls-opts summary { list-style: none; } .ls-opts summary::-webkit-details-marker { display: none; }
.ls-opts-box { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 300px; box-shadow: 0 12px 40px rgba(0,0,0,.5); color: var(--text); }
.ls-opts-box .check { color: var(--text) !important; }
.print-toolbar select, .print-toolbar .btn { color: var(--text); }

.lx-box { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.lx-box > b { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ls-opts-box { left: auto; right: 0; max-width: calc(100vw - 32px); }
@media (max-width: 700px) { .ls-opts-box { position: fixed; top: 70px; left: 16px; right: 16px; min-width: 0; } }
.user-box { flex-wrap: wrap; } .user-box .ver { width: 100%; color: var(--muted); font-size: .72rem; }

/* ================= v1.4 Design ================= */
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.btn .ic { width: 18px; height: 18px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.nav a .ic { opacity: .75; }
.nav a.active .ic, .nav a:hover .ic { opacity: 1; }
.nav-sep { padding-top: 18px; }
h2 .ic { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; color: var(--accent); }
.card { border-radius: 14px; }
.page-head h1, .hero h1 { font-weight: 800; letter-spacing: -.02em; }
.btn.primary.pulse { animation: btnpulse 2s infinite; }
@keyframes btnpulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 8px transparent; } }
.btn:disabled { opacity: .45; cursor: not-allowed; animation: none; }
.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; }
.seg a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.active { background: var(--accent); color: var(--accent-ink); }

/* Phasenfarben (Kalender, Zeitleiste, Uebersicht) */
:root { --ph-angebot: #6b7280; --ph-auftrag: #3b82f6; --ph-gepackt: #a855f7; --ph-unterwegs: #f59e0b; --ph-zurueck: #22c55e; --ph-abgeschlossen: #3f3f46; }
.s-angebot { --ph: var(--ph-angebot); } .s-auftrag { --ph: var(--ph-auftrag); } .s-gepackt { --ph: var(--ph-gepackt); }
.s-unterwegs { --ph: var(--ph-unterwegs); } .s-zurueck { --ph: var(--ph-zurueck); } .s-abgeschlossen { --ph: var(--ph-abgeschlossen); }
.cal-job { background: var(--ph); display: flex; align-items: center; gap: 4px; }
.cal-job .ic { width: 13px; height: 13px; }
.cal-job.first { border-radius: 6px 0 0 6px; margin-left: 4px; } .cal-job.last { border-radius: 0 6px 6px 0; margin-right: 4px; } .cal-job.first.last { border-radius: 6px; }
.s-unterwegs.cal-job, .s-unterwegs.gt-bar { color: #111; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--ph) 18%, transparent); color: color-mix(in srgb, var(--ph) 70%, #fff); border: 1px solid color-mix(in srgb, var(--ph) 45%, transparent); }
.legend .ic { width: 14px; height: 14px; }

/* Zeitleiste eines Jobs */
.tl-card { padding: 22px 22px 18px; }
.tl-card.slim { padding: 14px 18px; }
.tl { display: flex; align-items: flex-start; }
.tl-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; flex: 0 0 auto; width: 120px; }
.tl-dot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); border: 2px solid var(--line2); color: var(--muted); transition: all .3s; }
.tl-dot .ic { width: 22px; height: 22px; }
.tl-step.done .tl-dot { background: var(--green); border-color: var(--green); color: #fff; }
.tl-step.active .tl-dot { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); animation: tlpulse 2s infinite; }
@keyframes tlpulse { 50% { box-shadow: 0 0 0 10px transparent; } }
.tl-text b { display: block; font-size: .95rem; }
.tl-text small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.tl-text .tl-at { color: #6b6b73; font-size: .72rem; }
.tl-step.done .tl-text b { color: var(--green); } .tl-step.active .tl-text b { color: var(--accent); }
.tl-line { flex: 1; height: 3px; background: var(--line2); margin-top: 23px; border-radius: 3px; min-width: 16px; }
.tl-line.on { background: linear-gradient(90deg, var(--green), var(--green)); }
.tl.compact .tl-step { width: auto; flex-direction: row; gap: 6px; }
.tl.compact .tl-dot { width: 30px; height: 30px; } .tl.compact .tl-dot .ic { width: 16px; height: 16px; }
.tl.compact .tl-step.active .tl-dot { box-shadow: 0 0 0 3px var(--accent-soft); }
.tl.compact .tl-line { margin-top: 14px; }
.tl.compact .tl-text b { font-size: .82rem; }
.tl-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tl-actions:empty { display: none; }
@media (max-width: 760px) {
  .tl { overflow-x: auto; padding-bottom: 6px; }
  .tl-step { width: 84px; } .tl-dot { width: 40px; height: 40px; } .tl-line { margin-top: 19px; }
  .tl.compact .tl-text { display: none; }
  .tl-actions .btn { flex: 1 1 100%; }
}
.pack .tl { justify-content: center; }

/* Kalender-Zeitleiste (Gantt) */
.gt-wrap { padding: 0; overflow-x: auto; }
.gt { display: grid; grid-template-columns: 220px repeat(var(--days), minmax(30px, 1fr)); min-width: 1100px; position: relative; }
.gt-corner { grid-row: 1; grid-column: 1; padding: 10px 14px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); position: sticky; left: 0; background: var(--card); z-index: 3; }
.gt-day { grid-row: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .78rem; position: relative; }
.gt-day small { color: var(--muted); font-size: .65rem; } .gt-day b { font-size: .85rem; }
.gt-day em { position: absolute; top: -1px; left: 2px; font-style: normal; font-size: .6rem; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.gt-day.we { color: var(--muted); } .gt-day.today b { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; }
.gt-bgwrap { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--days), 1fr); z-index: 0; }
.gt-bg { grid-row: 1; border-left: 1px solid rgba(255,255,255,.03); }
.gt-bg.we { background: rgba(255,255,255,.025); }
.gt-bg.today { background: var(--accent-soft); border-left: 2px solid var(--accent); }
.gt-label { grid-column: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); position: sticky; left: 0; background: var(--card); z-index: 2; min-width: 0; }
.gt-label:hover { text-decoration: none; background: var(--card2); }
.gt-label b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .gt-label small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-bar { align-self: center; height: 30px; margin: 0 2px; border-radius: 8px; background: var(--ph); color: #fff; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: .8rem; font-weight: 700; z-index: 1; overflow: hidden; white-space: nowrap; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.gt-bar:hover { text-decoration: none; filter: brightness(1.12); }
.gt-bar .ic { width: 15px; height: 15px; flex: none; }
.gt-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; } .gt-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.gt-bar.late { background: repeating-linear-gradient(135deg, var(--red) 0 10px, #b91c1c 10px 20px); color: #fff; }
.gt-bar.s-angebot { background: transparent; border: 2px dashed var(--ph); color: #c4c4cc; }
.gt-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); }

/* Uebersicht */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { font-size: 2rem; }
.hero-date { margin: 0 0 2px; color: var(--muted); font-weight: 500; }
.pipeline { display: flex; align-items: stretch; gap: 0; margin-bottom: 14px; }
.stage { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--ph) 22%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--ph) 35%, var(--line)); color: var(--text); position: relative; }
.stage:hover { text-decoration: none; border-color: var(--ph); }
.stage-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--ph); color: #fff; margin-bottom: 6px; }
.stage-ic .ic { width: 20px; height: 20px; }
.stage.s-unterwegs .stage-ic { color: #111; }
.stage b { font-size: 2rem; line-height: 1; } .stage > span:last-child { color: var(--muted); font-size: .85rem; }
.pipe-arrow { width: 22px; align-self: center; height: 2px; background: var(--line2); position: relative; flex: none; }
.pipe-arrow::after { content: ''; position: absolute; right: 0; top: -4px; border: 5px solid transparent; border-left-color: var(--line2); border-right: 0; }
@media (max-width: 760px) { .pipeline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .pipe-arrow { display: none; } .hero h1 { font-size: 1.5rem; } }
.warn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.warn-chip { padding: 7px 14px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line2); color: var(--text); font-size: .88rem; }
.warn-chip:hover { text-decoration: none; border-color: var(--muted); }
.warn-chip.red { background: var(--soft-red); border-color: rgba(239,68,68,.4); } .warn-chip.red b { color: var(--red); }
.warn-chip.orange { background: var(--soft-orange); border-color: rgba(245,158,11,.4); } .warn-chip.orange b { color: var(--orange); }
.warn-chip.purple { background: var(--soft-purple); border-color: rgba(167,139,250,.4); }
.warn-chip.ok { background: var(--soft-green); border-color: rgba(34,197,94,.35); color: var(--green); }
.day-job { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--text); }
.day-job:last-child { border-bottom: 0; }
.day-job:hover { text-decoration: none; background: var(--card2); border-radius: 8px; }
.day-job .badge { grid-row: 1 / span 2; } .day-job small { color: var(--muted); }

/* Backups */
.bk-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0; }
.bk-status div { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.bk-status span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bk-status b { word-break: break-all; }
details summary { cursor: pointer; margin: 6px 0; }
/* Zeitleiste in Phasenfarben */
.tl-step { --c: var(--accent); }
.tl-step.k-geplant { --c: var(--ph-auftrag); } .tl-step.k-gepackt { --c: var(--ph-gepackt); } .tl-step.k-checkout { --c: var(--ph-unterwegs); }
.tl-step.k-checkin { --c: var(--ph-zurueck); } .tl-step.k-abgeschlossen { --c: #a1a1aa; }
.tl-step.done .tl-dot { background: var(--c); border-color: var(--c); color: #fff; }
.tl-step.k-checkout.done .tl-dot { color: #111; }
.tl-step.active .tl-dot { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); color: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent); }
.tl-step.done .tl-text b, .tl-step.active .tl-text b { color: var(--c); }
.tl-line.on { background: #3f3f46; }
.tl-step.done + .tl-line, .tl-line.on { background: linear-gradient(90deg, #52525b, #71717a); }
.gt { grid-template-columns: 200px repeat(var(--days), minmax(22px, 1fr)); min-width: 980px; }
.gt-day small { font-size: .6rem; } .gt-day b { font-size: .8rem; }
.pack-bottom .btn { padding: 8px 6px; min-width: 0; gap: 6px; font-size: .95rem; }

/* ================= v1.5: Fahrzeuge, Ladeplan ================= */
.vcard { color: var(--text); display: block; } .vcard:hover { text-decoration: none; border-color: var(--accent); }
.vsketch { width: 100%; height: auto; display: block; }
.vs-floor { fill: #1c1c20; stroke: #52525b; stroke-width: 2; }
.vs-arch { fill: url(#hatch); stroke: #71717a; }
.vs-wall { stroke: var(--accent); stroke-width: 4; }
.vs-t { fill: #a1a1aa; font-size: 12px; font-family: var(--font); }
.vs-n { fill: #fff; font: 700 14px var(--font); text-anchor: middle; }
.vs-up { fill: #fff; font: 600 10px var(--font); text-anchor: middle; opacity: .9; }
.iso { width: 100%; height: auto; max-height: 460px; display: block; }
.iso-floor { fill: #1c1c20; stroke: #52525b; stroke-width: 1.5; }
.iso-wall { fill: rgba(255,255,255,.03); stroke: #3f3f46; }
.iso-door { fill: none; stroke: #52525b; stroke-dasharray: 6 5; }
.iso-f { stroke: rgba(0,0,0,.45); stroke-width: .8; }
.iso-n { fill: #fff; font: 800 15px var(--font); text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: 3px; }
.iso g.hl .iso-f { stroke: #fff; stroke-width: 2.5; }
.lp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lp-sum span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .lp-sum b { font-size: 1.3rem; }
.lp-bar { position: relative; height: 26px; background: var(--card2); border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.lp-bar div { position: absolute; inset: 0 auto 0 0; background: var(--green); } .lp-bar div.orange { background: var(--orange); } .lp-bar div.red { background: var(--red); }
.lp-bar span { position: relative; display: block; text-align: center; line-height: 26px; font-weight: 700; font-size: .85rem; }
.lp-views { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .lp-views { grid-template-columns: 1fr; } }
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lp-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--card2); }
.lp-steps li:hover { outline: 1px solid var(--accent); }
.lp-steps small { display: block; color: var(--muted); }
.lp-no { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff; }
.lp-sec li { margin-bottom: 4px; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
@media print { .lp-veh { break-inside: avoid; } .lp-steps li { background: #f4f4f5; color: #111; } .lp-steps small { color: #444; } }
#vsk .vsketch, .vcard .vsketch { max-height: 240px; }

/* ================= v1.6 ================= */
.photo-pick { display: block; border: 2px dashed var(--line2); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted); font-weight: 600; }
.photo-pick:hover { border-color: var(--accent); color: var(--text); }
.photo-pick input { display: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; display: block; background: var(--card2); }
.photo-grid figure { margin: 0; position: relative; }
.photo-grid figcaption { font-size: .8rem; padding: 4px 2px; }
.photo-grid figcaption small { display: block; color: var(--muted); }
.photo-grid figcaption .icon-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; }
.crew-list { display: grid; gap: 8px; margin-bottom: 12px; }
.crew-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--card2); border-radius: 10px; }
.crew-chip > div { flex: 1; } .crew-chip small { display: block; color: var(--muted); } .crew-chip .ic { width: 14px; height: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; flex: none; }
.avatar.big { width: 52px; height: 52px; font-size: 1.1rem; }
.crew-card { display: flex; gap: 14px; align-items: center; color: var(--text); } .crew-card:hover { text-decoration: none; border-color: var(--accent); }
.crew-card small { display: block; color: var(--muted); }
.crew-add select { width: auto; flex: 1; min-width: 120px; }
.sig-canvas { width: 100%; height: auto; aspect-ratio: 3 / 1; background: #fff; border-radius: 10px; touch-action: none; cursor: crosshair; display: block; margin-bottom: 8px; }
.sig-img { height: 16mm; display: block; margin-bottom: -4mm; }
.signatures .sig-line { display: block; border-bottom: 1px solid #111; height: 0; margin-bottom: 3px; }
.doc-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.doc-photos figure { margin: 0; break-inside: avoid; } .doc-photos img { width: 100%; border-radius: 2mm; } .doc-photos figcaption { font-size: 8pt; color: #333; }
.mchart { width: 100%; height: auto; }
.mbar { fill: var(--accent); } .mbar:hover { filter: brightness(1.15); }
.mlab { fill: var(--muted); font-size: 11px; text-anchor: middle; } .mval { fill: var(--text); font-size: 10px; font-weight: 700; text-anchor: middle; }
.maxis { stroke: var(--line2); }
.ubar { position: relative; height: 20px; min-width: 110px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.ubar div { position: absolute; inset: 0 auto 0 0; background: var(--blue); } .ubar div.hot { background: var(--green); } .ubar div.cold { background: #52525b; }
.ubar span { position: relative; display: block; text-align: center; font-size: .75rem; line-height: 20px; font-weight: 700; }
/* v1.8 Kalender-Abschnitte */
.gt-bar.early, .cal-job.early { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ph) 55%, transparent) 0 8px, color-mix(in srgb, var(--ph) 30%, transparent) 8px 16px); color: #fff; }
.gt-bar.over, .cal-job.over { background: repeating-linear-gradient(135deg, #ef4444 0 10px, #b91c1c 10px 20px) !important; color: #fff !important; font-weight: 800; }
.gt-bar.early { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gt-bar.planned-late { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gt-bar.over { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.gt-label.late b { color: var(--red); }
.legend .lg-early { background: repeating-linear-gradient(135deg, rgba(245,158,11,.35) 0 6px, rgba(245,158,11,.15) 6px 12px); border: 1px solid rgba(245,158,11,.5); color: #fcd34d; }
.legend .lg-over { background: rgba(239,68,68,.2); border: 1px solid rgba(239,68,68,.6); color: #fca5a5; }

/* ===== v1.8 Case-Fuellstand & Packvorschlag ===== */
.meters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.meter { position: relative; display: inline-block; min-width: 150px; height: 18px; border-radius: 9px; background: rgba(255,255,255,.07); overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.meter.big { min-width: 200px; height: 22px; border-radius: 11px; }
.meter i { position: absolute; inset: 0 auto 0 0; background: #2f9e5b; transition: width .3s; }
.meter.warn i { background: #d99a1c; }
.meter.over i { background: #d64545; }
.meter em { position: relative; font-style: normal; font-size: 11px; padding: 0 8px; line-height: 16px; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.meter.big em { font-size: 12px; line-height: 20px; }
.target .tgt-main { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tgt-suggest { margin-top: 6px; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 12px; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.ap-case { border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 12px; background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 6px; }
.ap-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ap-meta { font-size: 12px; opacity: .7; }
.ap-case ul, .ap-left { margin: 4px 0; padding-left: 18px; }
.ap-case li { margin: 2px 0; }
.ap-case .btn { align-self: flex-start; margin-top: auto; }
.target .tgt-main, .target .meters, .target .tgt-suggest { flex: 1 1 100%; }
.target.in-case .meter { background: rgba(0,0,0,.18); border-color: rgba(0,0,0,.2); }
.target.in-case .chip { background: rgba(0,0,0,.15); }

/* ===== v1.8 Dokument-Design ===== */
.doc { font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; padding: 14mm 16mm 12mm 20mm; }
.doc-head { justify-content: space-between; align-items: flex-start; margin-bottom: 3mm; gap: 8mm; }
.doc-head .doc-brand, .doc-head .doc-brand.with-logo { align-items: flex-start; text-align: left; flex-direction: column; }
.doc-head .doc-brand:not(.with-logo) { flex-direction: row; }
.doc-kind { text-align: right; }
.doc-kind span { display: block; font-size: 20pt; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1; color: #111; }
.doc-kind b { display: inline-block; margin-top: 2mm; font-size: 10pt; font-weight: 600; color: #111; background: var(--accent); padding: 1mm 3mm; border-radius: 1.5mm; }
.doc-rule { height: 1.2mm; background: linear-gradient(90deg, var(--accent) 0 30%, #111 30% 100%); margin: 0 0 6mm; border-radius: 1mm; }
.doc-sender { margin-top: 2mm; }
.doc-top { align-items: flex-start; margin-bottom: 8mm; }
.doc-metabox { background: #f6f6f6; border-radius: 2mm; padding: 3mm 4mm; min-width: 72mm; border-top: 1mm solid var(--accent); }
.doc-meta td { padding: 1.2px 0 1.2px 8px; font-size: 8.5pt; } .doc-meta td:first-child { padding-left: 0; white-space: nowrap; }
.doc-meta td small { font-weight: 400; color: #666; }
.doc-title { font-size: 16pt; font-weight: 800; margin: 0 0 4mm; color: #111; }
.doc-title span { font-weight: 400; color: #555; font-size: 13pt; }
.doc-table thead th { background: #111; color: #fff; border: 0; padding: 5px 6px; text-transform: uppercase; letter-spacing: .05em; font-size: 7pt; }
.doc-table thead th:first-child { border-radius: 1.5mm 0 0 1.5mm; } .doc-table thead th:last-child { border-radius: 0 1.5mm 1.5mm 0; }
.doc-table tbody tr:nth-child(even) td { background: #fafafa; }
.doc-table td { border-bottom: 1px solid #e6e6e6; }
.doc-sum { background: #f6f6f6; border-radius: 2mm; padding: 2mm 3mm; border-collapse: separate; }
.doc-sum tr.grand td { border-top: 0; background: #111; color: #fff; padding: 6px 8px; }
.doc-sum tr.grand td:first-child { border-radius: 1.5mm 0 0 1.5mm; } .doc-sum tr.grand td:last-child { border-radius: 0 1.5mm 1.5mm 0; }
.doc-fine { font-size: 8.5pt; color: #444; margin: 2mm 0 3mm; }
.doc-greet { margin-top: 6mm; }
.doc-pay { display: flex; gap: 4mm; align-items: baseline; border: 1px solid #ddd; border-left: 1.2mm solid var(--accent); border-radius: 2mm; padding: 3mm 4mm; margin: 4mm 0; font-size: 9.5pt; }
.doc-pay > b { text-transform: uppercase; font-size: 7.5pt; letter-spacing: .08em; color: #666; }
.doc-case { border: 1px solid #bbb; border-radius: 2mm; overflow: hidden; }
.doc-case-head { background: #111; color: #fff; }
.doc-case-head code { background: rgba(255,255,255,.15); color: #fff; }
.doc-case .doc-table thead th { border-radius: 0 !important; background: #444; }
.doc-foot { border-top: 0; position: relative; padding-top: 5mm; }
.doc-foot::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: .6mm; background: linear-gradient(90deg, var(--accent) 0 30%, #ddd 30% 100%); }
.doc-foot > div:first-child { font-weight: 600; color: #333; }
.signatures span { border-bottom-width: 1.2px; }
@media print { .doc-table thead th, .doc-sum tr.grand td, .doc-case-head, .doc-kind b, .doc-rule, .doc-foot::before, .doc-metabox, .doc-table tbody tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.doc-sum { border-spacing: 0; } .doc-sum td { padding: 3px 8px; }
.meter { display: inline-flex; align-items: center; }
.meter em, .meter.big em { line-height: 1; }
.target.in-case .meter { background: rgba(0,0,0,.22); border-color: rgba(0,0,0,.35); }
.target.in-case .meter.ok i { background: rgba(0,0,0,.6); }
.target.in-case .meter.warn i { background: #b45309; }
.target.in-case .meter.over i { background: #b91c1c; }
.target.in-case .meter { background: rgba(255,255,255,.55); border-color: rgba(0,0,0,.25); }
.target.in-case .meter.ok i { background: rgba(0,0,0,.28); }
.target.in-case .meter.warn i { background: #f59e0b; }
.target.in-case .meter.over i { background: #ef4444; }
.target.in-case .meter em { color: #111; text-shadow: none; font-weight: 600; }
.target.in-case .chip { background: rgba(0,0,0,.14); color: #111; font-weight: 600; }
.target.in-case .tgt-suggest { color: #111; }
.after-co { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.after-co .btn { justify-content: center; }
