/* packalarm OrderHub – dunkles Theme */
:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-2: #0d0f12;
  --panel: #121419;
  --panel-2: #171a20;
  --hover: #1b1f26;
  --ink: #eceef2;
  --ink-2: #c3c8d1;
  --muted: #858d9b;
  --line: #22262e;
  --line-2: #2d323c;
  --brand: #ff3131;
  --brand-2: #ff5a4f;
  --brand-soft: rgba(255, 49, 49, .12);
  --ok: #3ddc84;
  --ok-soft: rgba(61, 220, 132, .12);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .12);
  --err: #ff5c64;
  --err-soft: rgba(255, 92, 100, .12);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, .12);
  --violet: #b18cff;
  --violet-soft: rgba(177, 140, 255, .13);
  --teal: #3fd6c2;
  --teal-soft: rgba(63, 214, 194, .12);
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px rgba(0, 0, 0, .35);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 49, 49, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(106, 168, 255, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(255, 49, 49, .35); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: #ff8a80; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 14px; color: var(--ink); }
h3 { font-size: 13px; font-weight: 650; margin: 20px 0 10px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
b { font-weight: 650; }
code, pre, textarea.code { font-family: "JetBrains Mono", Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2d323c transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2f38; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* Layout */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: rgba(10, 11, 14, .85); backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { padding: 4px 10px 22px; display: flex; align-items: center; }
.logo .brandmark { display: flex; flex-direction: column; gap: 5px; }
.logo .brandmark img { height: 17px; width: auto; display: block; }
.logo .brandmark small { color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .32em; }
.logo .brandmark small b { color: var(--brand); font-weight: 800; }
.logo .brandmark.switchable { cursor: pointer; border-radius: 10px; margin: -6px; padding: 6px; transition: background .15s; }
.logo .brandmark.switchable:hover { background: var(--hover); }
.logo .brandmark .swi { margin-left: 8px; color: var(--muted); letter-spacing: 0; font-weight: 600; }
.shop-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.shop-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel-2); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.shop-tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.shop-tile.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.shop-tile img { height: 22px; width: auto; max-width: 100%; }
.shop-tile span { font-weight: 650; }
.plan { display: grid; gap: 8px; margin-top: 10px; }
.plan-pkg { background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 8px 10px; }
.plan-head { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 3px; }
.plan-head span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
body[data-profile="tragetaschenwerk"] .logo .brandmark img { height: auto; width: 100%; max-width: 180px; }
body[data-profile="tragetaschenwerk"] .mobilebar .logo .brandmark img { max-width: 150px; }
.nav a {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); padding: 9px 12px; border-radius: 10px; margin-bottom: 2px; font-weight: 550;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--ink); box-shadow: inset 2px 0 0 var(--brand); }
.nav .count { background: var(--brand); color: #fff; border-radius: 20px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; }
.nav .sep { border-top: 1px solid var(--line); margin: 12px 6px; }
.main { padding: 28px 34px 70px; min-width: 0; max-width: 1600px; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.topbar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Panels */
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; overflow-x: auto;
}
.panel .panel { background: var(--bg-2); box-shadow: none; border-color: var(--line); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 49, 49, .14), transparent 70%);
}
.kpi:first-child { border-color: rgba(255, 49, 49, .35); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 28px; font-weight: 750; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.up { color: var(--ok); } .down { color: var(--err); } .warn { color: var(--warn); }

/* Auswertung */
.periodbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.periodbar .tabs { width: auto; }
.kpi-link { cursor: pointer; color: inherit; transition: border-color .15s, transform .1s; }
.kpi-link:hover { border-color: rgba(255, 49, 49, .55); color: inherit; }
.kpi-link:active { transform: scale(.99); }
.sharebar { height: 4px; background: rgba(255, 255, 255, .06); border-radius: 4px; margin-top: 6px; overflow: hidden; min-width: 80px; }
.sharebar span { display: block; height: 100%; background: linear-gradient(90deg, #ff3131, #ff7a6e); border-radius: 4px; }
.split { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .06); gap: 2px; }
.split-new { background: var(--teal); } .split-ret { background: var(--brand); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot-new { background: var(--teal); } .dot-ret { background: var(--brand); }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid rgba(255, 49, 49, .35); }

/* To-do */
.todo a {
  display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 10px;
  color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 8px; transition: border-color .15s, background .15s;
}
.todo a:hover { border-color: rgba(255, 49, 49, .5); background: var(--brand-soft); color: var(--ink); }
.todo .n { font-weight: 750; font-variant-numeric: tabular-nums; background: var(--brand-soft); color: var(--brand-2); padding: 1px 10px; border-radius: 20px; }
.todo a.zero { opacity: .45; }
.todo a.zero .n { background: transparent; color: var(--muted); }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
td b { color: var(--ink); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td, tbody tr:hover td { background: rgba(255, 255, 255, .02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: rgba(255, 255, 255, .06); color: var(--ink-2); border: 1px solid rgba(255, 255, 255, .06); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.b-neu, .b-entwurf, .b-vorbereitet, .b-info { background: var(--info-soft); color: var(--info); border-color: rgba(106, 168, 255, .2); }
.b-in_bearbeitung, .b-gesendet, .b-angemeldet, .b-bestellt, .b-teilversendet, .b-offen { background: var(--warn-soft); color: var(--warn); border-color: rgba(255, 181, 71, .2); }
.b-versendet, .b-bestaetigt, .b-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(61, 220, 132, .2); }
.b-pruefen, .b-fehler, .b-storniert, .b-kein_smtp, .b-error { background: var(--err-soft); color: var(--err); border-color: rgba(255, 92, 100, .22); }
.b-historisch { background: rgba(255, 255, 255, .05); color: var(--muted); border-color: var(--line-2); }
.b-testmodus, .b-warn { background: var(--violet-soft); color: var(--violet); border-color: rgba(177, 140, 255, .2); }
.src-own { background: var(--teal-soft); color: var(--teal); border-color: rgba(63, 214, 194, .2); }
.src-supplier { background: var(--violet-soft); color: var(--violet); border-color: rgba(177, 140, 255, .2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--hover); border-color: #3a404b; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #ff4a3d, #e8242a); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(255, 49, 49, .28); }
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn.danger { color: var(--err); border-color: rgba(255, 92, 100, .3); background: transparent; }
.btn.danger:hover { background: var(--err-soft); }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .4; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Formulare */
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; font-weight: 400; line-height: 1.45; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; font: inherit;
  background: var(--bg-2); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #5d6573; }
input:disabled, textarea:disabled, select:disabled { opacity: .6; }
select option { background: var(--panel); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
textarea.code { min-height: 260px; white-space: pre; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 49, 49, .18); }
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 12px; color: var(--ink-2); }
.check input { margin-top: 2px; flex: none; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { width: auto; }
details summary { cursor: pointer; color: var(--muted); margin: 10px 0; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; background: var(--bg-2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 14px; color: var(--muted); border-radius: 9px; font-weight: 600; font-size: 13px; }
.tabs a.active { color: var(--ink); background: var(--panel-2); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 2px 8px rgba(0, 0, 0, .4); }
.tabs a.active::after { content: ""; display: block; height: 2px; background: var(--brand); border-radius: 2px; margin-top: 4px; }
.tabs a:hover { color: var(--ink); }

/* Artikelbilder */
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--bg-2); border: 1px solid var(--line); flex: none; }
.thumb-empty { display: inline-block; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 14px; color: var(--ink-2); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.img-card { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.img-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; display: block; }
.img-main { position: absolute; top: 8px; left: 8px; }
.img-actions { display: flex; gap: 6px; justify-content: center; padding: 8px; }

/* Massenbearbeitung */
.bulkbar { position: sticky; top: 10px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  background: rgba(255, 49, 49, .12); border: 1px solid rgba(255, 49, 49, .4); border-radius: 12px; backdrop-filter: blur(8px); }
tr.selected td { background: rgba(255, 49, 49, .06); }
tr.inactive td { opacity: .5; }
.bulk-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 2px; margin-bottom: 10px; background: var(--bg-2); }
.bulk-sec.on { border-color: rgba(255, 49, 49, .45); }
.bulk-body { padding-top: 6px; }

/* Sonstiges */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.mt { margin-top: 14px; }
.nowrap { white-space: nowrap; }
.addr { line-height: 1.6; color: var(--ink-2); }
.empty { color: var(--muted); padding: 26px; text-align: center; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; line-height: 1.5; }
.alert.warn { background: var(--warn-soft); color: #ffd699; border-color: rgba(255, 181, 71, .25); }
.alert.err { background: var(--err-soft); color: #ffb3b7; border-color: rgba(255, 92, 100, .28); }
.alert.info { background: var(--info-soft); color: #bcd6ff; border-color: rgba(106, 168, 255, .22); }
.alert.ok { background: var(--ok-soft); color: #a8f0c8; border-color: rgba(61, 220, 132, .22); }
.alert a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.codebox, pre.codebox { background: var(--bg); border: 1px solid var(--line); padding: 12px; border-radius: 10px; overflow-x: auto; color: var(--ink-2); }
pre { color: var(--ink-2); }

/* Diagramm */
.chart { width: 100%; height: 200px; }
.chart rect.bar { fill: url(#barGrad); }
.chart rect.bar:hover { fill: var(--brand-2); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart line.grid { stroke: var(--line); stroke-dasharray: 3 4; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; animation: fade .15s ease; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; width: 100%; max-width: 820px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .18s ease; }
.modal.wide { max-width: 1100px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.x { background: var(--panel-2); border: 1px solid var(--line-2); width: 32px; height: 32px; border-radius: 9px; font-size: 18px; cursor: pointer; color: var(--muted); }
.x:hover { color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); padding: 12px 16px; border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); max-width: 440px; animation: pop .18s ease; }
.toast.err { border-left-color: var(--err); }

/* Login */
.login { max-width: 400px; margin: 14vh auto; padding: 30px; }
.login .logo { padding: 0 0 18px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.placeholder-list code, .md code { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; margin: 2px; display: inline-block; color: #ffb3ad; }

/* Anleitung */
.md { line-height: 1.65; color: var(--ink-2); max-width: 980px; }
.md h1 { font-size: 26px; margin: 6px 0 18px; color: var(--ink); }
.md h2 { font-size: 19px; margin: 32px 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.md h3 { font-size: 13px; margin: 20px 0 8px; }
.md pre { background: var(--bg); border: 1px solid var(--line); padding: 14px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; margin: 0; color: var(--ink-2); display: inline; }
.md li { margin-bottom: 5px; }
.md table { margin: 12px 0; }
.md blockquote { border-left: 3px solid var(--brand); margin: 0; padding: 4px 16px; background: var(--brand-soft); }
.md strong, .md b { color: var(--ink); }

/* ---------- Handy & Tablet ---------- */
.mobilebar, .bottomnav, .nav-overlay { display: none; }
.iconbtn { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); width: 42px; height: 42px; border-radius: 12px; font-size: 20px; cursor: pointer; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .main { padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); }

  /* Kopfzeile mit Menü-Knopf */
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 30; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: rgba(8, 9, 11, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .mobilebar .logo { padding: 0; font-size: 16px; }
  .mobilebar .logo .brandmark img { height: 15px; }
  .mobilebar .logo .brandmark small { font-size: 9.5px; }

  /* Menü als Schublade von links */
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); height: 100%; z-index: 50;
    transform: translateX(-102%); transition: transform .22s ease; border-right: 1px solid var(--line-2);
    background: var(--bg-2); padding-top: calc(20px + env(safe-area-inset-top));
  }
  body.nav-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .nav-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); }
  body.nav-open .nav-overlay { display: block; }
  .nav a { padding: 12px 14px; font-size: 15px; }

  /* Schnellleiste unten */
  .bottomnav {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(13, 15, 18, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; }
  .bottomnav a .bi { font-size: 19px; line-height: 1; }
  .bottomnav a.active { color: var(--brand-2); background: var(--brand-soft); }
  .bottomnav .count { position: absolute; top: 2px; right: 18%; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 10px; font-weight: 800; }

  /* Kopfzeilen, Knöpfe, Eingaben */
  h1 { font-size: 20px; }
  .topbar { margin-bottom: 14px; }
  .topbar .right { width: 100%; }
  .topbar .right .btn { flex: 1 1 auto; justify-content: center; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 34px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { font-size: 16px; } /* verhindert Zoom auf dem iPhone */
  .inline { flex-wrap: wrap; }
  .inline input[type=search] { width: 100% !important; }
  .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
  .panel { padding: 14px; border-radius: 12px; }

  /* Kennzahlen 2 nebeneinander */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 22px; }
  .kpi .label { font-size: 11px; }

  /* Fenster als Vollbild */
  .modal-bg { padding: 0; align-items: stretch; }
  .modal, .modal.wide { max-width: none; min-height: 100%; border-radius: 0; border: 0; padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); }
  .modal-head { position: sticky; top: 0; background: var(--panel); z-index: 2; padding: calc(4px + env(safe-area-inset-top)) 0 8px; }
  .bulkbar { top: 72px; }
  #toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .img-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tabellen mit class="cards" als Karten */
@media (max-width: 700px) {
  table.cards, table.cards tbody { display: block; }
  table.cards tr:first-child:has(th) { display: none; }
  table.cards tr { display: block; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
  table.cards tr.click:active { background: var(--hover); }
  table.cards td { display: block; padding: 6px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  table.cards td::after { content: ""; display: block; clear: both; }
  table.cards td.num { text-align: right; }
  table.cards td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
  table.cards td:not([data-label]) { text-align: left; }
  table.cards td:first-child { font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
  table.cards td.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  table.cards td .inline { justify-content: flex-end; }
  table.cards td input[type=checkbox] { width: 22px; height: 22px; }
  table.cards tr:hover td { background: transparent; }
  table.cards .empty { justify-content: center; }
}

/* Auswertung nach Kategorien */
.an-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.an-tree { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 14px; }
.an-tree-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.an-tree input[type=search] { margin-bottom: 8px; }
.an-tree-body { overflow: auto; margin: 0 -6px; }
.an-node { display: flex; align-items: center; gap: 6px; padding-top: 5px; padding-bottom: 5px; padding-right: 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.an-node:hover { background: var(--hover); }
.an-node.sel { background: var(--brand-soft); }
.an-node.sel .an-name { color: var(--ink); font-weight: 650; }
.an-node.zero .an-name, .an-node.zero .an-val { color: var(--muted); opacity: .6; }
.an-caret { width: 14px; flex: none; color: var(--muted); text-align: center; }
.an-check { width: 16px; height: 16px; flex: none; border: 1px solid var(--line-2); border-radius: 4px; font-size: 11px; line-height: 14px; text-align: center; color: #fff; }
.an-node.sel .an-check { background: var(--brand); border-color: var(--brand); }
.an-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.an-val { flex: none; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); line-height: 1.15; }
.an-val small { display: block; color: var(--muted); font-size: 10.5px; }
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); border: 1px solid var(--brand); color: var(--ink); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 550; }
.chip button { background: none; border: 0; color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.chip button:hover { color: var(--brand); }
a.active-sort { color: var(--ink); }
@media (max-width: 900px) {
  .an-layout { grid-template-columns: 1fr; }
  .an-tree { position: static; max-height: 420px; }
}
.an-node.anc .an-name { color: var(--ink); }
.an-node.anc .an-check { border-color: var(--brand); }
@media (max-width: 1500px) { .an-g2 { grid-template-columns: 1fr; } }

/* JTL-API */
ol.steps { padding-left: 20px; margin: 0 0 14px; display: grid; gap: 6px; color: var(--ink-2); }
ol.steps code, .alert code { background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 5px; }

/* Lager: „Heute packen“ – ein großer Knopf, große Karten (auch am Handy/Tablet) */
.bigbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 96px; font-size: 1.35em; font-weight: 700; margin-bottom: 18px; }
.bigbtn span { font-size: .62em; font-weight: 500; opacity: .85; }
.lager-list { display: flex; flex-direction: column; gap: 10px; }
.lager-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.lager-card.printed { border-color: var(--ok-soft); }
.lager-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lager-head { font-size: 1.05em; }
.lager-actions { display: flex; gap: 8px; flex-shrink: 0; }
.lager-actions .btn.primary { min-width: 120px; min-height: 44px; }
@media (max-width: 700px) {
  .lager-card { flex-direction: column; align-items: stretch; }
  .lager-actions { justify-content: space-between; }
}

/* Versand-Schritte in der Bestellung */
.steps { display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.step { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 90px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--muted); font-size: .85em; }
.step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.step.done { color: var(--ink); border-color: rgba(61, 220, 132, .3); background: var(--ok-soft); }
.step.done .dot { background: var(--ok); }
.b-gepackt { background: var(--teal-soft); color: var(--teal); border-color: rgba(63, 214, 194, .22); }
.kpi-alert .value { color: var(--warn); }

/* Navigation in Gruppen */
.nav .nav-h { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .75; }
.nav .nav-h:first-child { margin-top: 2px; }
/* Einstellungen: Untergliederung */
.setnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.setgrp { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); padding: 10px 12px; }
.setgrp-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.setgrp-items { display: flex; flex-wrap: wrap; gap: 4px; }
.setgrp-items a { padding: 5px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.setgrp-items a:hover { background: var(--hover); color: var(--ink); }
.setgrp-items a.active { background: var(--brand-soft); color: var(--ink); box-shadow: inset 2px 0 0 var(--brand); }
.setgrp-items .count { background: var(--brand); color: #fff; border-radius: 20px; padding: 0 6px; font-size: 11px; font-weight: 700; }
