/* rekerno Lager – Oberfläche */
:root {
  --brand: #0F8F7A; --brand-d: #0A6B5B; --mint: #E3F1EE; --accent: #3CCFB4;
  --ink: #14201E; --ink2: #45514E; --muted: #55625F; --line: #D9E0DE; --line2: #EEF2F1;
  --bg: #F2F5F4; --card: #FFFFFF; --warn-bg: #FFF3D6; --warn: #6B4A00; --err: #C0392B; --err-bg: #FBE6E4;
  --r: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-d); }
.boot { display: flex; align-items: center; justify-content: center; height: 100vh; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.boot b, .logo b { color: var(--brand); }

/* ---------- Grundgerüst ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; min-height: 58px; display: flex; align-items: center; gap: 20px; }
.logo { font-weight: 700; font-size: 20px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo span { font-weight: 500; font-size: 14px; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.nav { display: none; gap: 4px; flex: 1; }
.nav a { padding: 9px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; }
.nav a.on { background: var(--mint); color: var(--brand-d); font-weight: 600; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }
.live.off { background: #C9D3D0; }
main.page { max-width: 1280px; margin: 0 auto; padding: 18px 16px 110px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; color: var(--muted); text-decoration: none; }
.bottom a.on { color: var(--brand-d); font-weight: 600; }
.bottom svg { width: 22px; height: 22px; }
.fab { position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 21; width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(20,32,30,.28); text-decoration: none; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .bottom, .fab { display: none; }
  main.page { padding: 26px 24px 60px; }
}

/* ---------- Bausteine ---------- */
h1 { font-size: 26px; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 23px; border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.brand { background: var(--brand); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #C9D3D0; }
.btn.danger { background: #fff; color: var(--err); border: 1px solid #E8BDB8; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 6px 0; color: var(--brand-d); font-weight: 600; cursor: pointer; }
.chip { min-height: 42px; padding: 0 16px; border-radius: 21px; border: 1px solid #C9D3D0; background: #fff; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
.st-aufbereitung { background: #E7ECEA; color: var(--ink2); }
.st-online { background: var(--mint); color: var(--brand-d); }
.st-reserviert { background: var(--warn-bg); color: var(--warn); }
.st-versenden { background: var(--ink); color: #fff; }
.st-verkauft { background: #E7ECEA; color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.notice.ok { background: var(--mint); color: var(--brand-d); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.err { background: var(--err-bg); color: var(--err); }

/* Formulare */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.in { min-height: 48px; border: 1px solid #A9B5B2; border-radius: 12px; padding: 0 14px; background: #fff; font-size: 16px; font-weight: 400; width: 100%; }
textarea.in { padding: 12px 14px; min-height: 90px; resize: vertical; line-height: 1.45; }
.in:focus, .chip:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.unit { position: relative; }
.unit .in { padding-right: 38px; }
.unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 400; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 8px; background: var(--mint); color: var(--brand-d); }
.sect { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -4px; }
.checks { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.check { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line2); background: #fff; text-align: left; font-size: 15px; cursor: pointer; }
.check:last-child { border-bottom: 0; }
.box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #A9B5B2; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check.on .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 14px; padding: 12px 14px; min-height: 58px; background: #fff; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line) inset; cursor: pointer; }
.opt.on { background: var(--mint); border-color: var(--brand); box-shadow: none; }
.opt .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #A9B5B2; flex-shrink: 0; background: #fff; }
.opt.on .dot { border: 6px solid var(--brand); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; width: 100%; text-align: left; }
.toggle .t { flex: 1; font-weight: 600; }
.track { width: 48px; height: 28px; border-radius: 14px; background: #C9D3D0; position: relative; flex-shrink: 0; transition: background .15s; }
.track i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.toggle.on .track { background: var(--brand); }
.toggle.on .track i { left: 23px; }
.sticky-save { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; margin-top: 6px; z-index: 5; }
@media (min-width: 900px) { .sticky-save { bottom: 0; } }

/* Lager */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; text-align: left; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.dark span { color: #CFE9E2; }
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 46px; flex: 1 1 260px; }
.search input { border: 0; outline: 0; background: transparent; font-size: 16px; flex: 1; min-width: 0; }
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.item { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; text-decoration: none; color: inherit; }
.thumb { width: 56px; height: 56px; border-radius: 10px; background: #DCE6E3; flex-shrink: 0; object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.item .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow-x: auto; margin-top: 12px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #F7FAF9; }
.num { text-align: right; white-space: nowrap; }
.only-m { display: block; }
.only-d { display: none; }
@media (min-width: 900px) { .only-m { display: none; } .only-d { display: block; } }

/* Detail */
.detail { display: grid; gap: 16px; }
@media (min-width: 900px) { .detail { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.kv { display: flex; flex-direction: column; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.kv div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #DCE6E3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20,32,30,.7); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.addphoto { aspect-ratio: 1; border-radius: 12px; border: 1px dashed #A9B5B2; background: transparent; color: var(--brand-d); font-weight: 600; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tabs { display: flex; background: #E3E9E7; border-radius: 13px; padding: 3px; gap: 3px; }
.tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--ink2); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,32,30,.18); }
.copybox { background: #F7FAF9; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.rep { display: flex; gap: 12px; align-items: center; }
.ico { width: 42px; height: 42px; border-radius: 12px; background: var(--mint); color: var(--brand-d); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Overlays */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,32,30,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 900px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 22px; font-size: 14px; font-weight: 600; z-index: 70; box-shadow: 0 6px 18px rgba(0,0,0,.2); max-width: 90vw; text-align: center; }
@media (min-width: 900px) { .toast { bottom: 40px; } }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 28px 22px; }

.btn.topadd { display: none; }
@media (min-width: 900px) { .btn.topadd { display: inline-flex; } }
@media (min-width: 900px) { .detail .side { order: 2 !important; } }
