/* Lager – Stil «Klar»: nah an iOS, gruppierte Listen, Bestellungen als Spalten */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --fill: #e3e3e8;
  --ink: #1c1c1e;
  --sub: #8e8e93;
  --sub2: #636366;
  --sep: #e5e5ea;
  --blue: #0a7cff;
  --blue-hell: #e6f0ff;
  --green: #28a745;
  --green-hell: #e3f6e8;
  --red: #ff3b30;
  --red-hell: #ffe9e7;
  --orange-hell: #fff3da;
  --bin: #fff3c4;
  --bin-ink: #6b5100;
  --sbd: #1c1c1e;
  --fg24: #e5203b;
  --r: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 16px; line-height: 1.4; color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(10, 124, 255, .45); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
body:not(.is-admin) .admin-only { display: none !important; }

/* ---------- Leiste oben ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(242, 242, 247, .82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid rgba(0, 0, 0, .14); }
.bar-in { max-width: 1320px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand i { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 14px; }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg a { padding: 6px 13px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.seg a:hover { text-decoration: none; background: rgba(255, 255, 255, .5); }
.seg a.active { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.search { flex: 1; max-width: 380px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 36px; border: 0; border-radius: 10px; background: var(--fill); padding: 0 12px 0 34px; font: inherit; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: var(--sub); }
.search input:focus { outline: none; background: var(--card); box-shadow: 0 0 0 3px rgba(10, 124, 255, .3); }
.search svg { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; color: var(--sub); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(135deg, #5ac8fa, #0a7cff); color: #fff; font: 600 13px/1 inherit; font-family: inherit; display: grid; place-items: center; flex: none; }
.menu { position: absolute; right: 24px; top: 52px; background: var(--card); border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); min-width: 200px; overflow: hidden; }
.menu div { padding: 12px 16px; color: var(--sub); font-size: 14px; border-bottom: .5px solid var(--sep); }
.menu button { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; background: none; font: inherit; color: var(--red); cursor: pointer; }
.menu button:hover { background: var(--bg); }

/* ---------- Seite ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 72px; }
.date { color: var(--sub); font-weight: 600; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.022em; line-height: 1.12; margin: 2px 0 6px; }
.lead { color: var(--sub2); margin: 0 0 24px; font-size: 17px; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head > div:first-child { flex: 1; min-width: 260px; }
.head .lead { margin-bottom: 0; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.012em; margin: 0; }
.ghead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 32px 4px 8px; }
.ghead:first-child { margin-top: 0; }
.ghead a, .ghead button.link { font-size: 15px; }
.muted { color: var(--sub); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* Gruppierte Liste (wie iOS) */
.group { background: var(--card); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 11px 16px; min-height: 56px; position: relative; color: var(--ink); }
a.row:hover, .row.click:hover { text-decoration: none; background: #f9f9fb; cursor: pointer; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.row.indent + .row.indent::before { left: 66px; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .t.n { font-weight: 400; }
.row .s { color: var(--sub); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.row .v { color: var(--sub); white-space: nowrap; }
.row .q { font-weight: 600; font-size: 17px; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.chev { color: #c7c7cc; font-size: 20px; line-height: 1; margin-left: -4px; }
.row.empty { color: var(--sub); justify-content: center; min-height: 72px; }
.kv .row { min-height: 46px; }
.kv .row .k { flex: 1; color: var(--ink); }
.kv .row .v { color: var(--sub2); text-align: right; }

/* Zahlen */
.stat { background: var(--card); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--sub); font-size: 14px; }
.stat.blue b { color: var(--blue); }
.stat.red b { color: var(--red); }

/* Marken */
.ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: none; letter-spacing: -.01em; }
.ico.SBD { background: var(--sbd); } .ico.FG24 { background: var(--fg24); }
.ico.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 9px; }
.shopname { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.bin { display: inline-block; font: 600 13px/1 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; background: var(--bin); color: var(--bin-ink); padding: 6px 8px; border-radius: 7px; white-space: nowrap; letter-spacing: .01em; }
a.bin:hover { text-decoration: none; background: #ffe98a; }
.bin.none { background: var(--fill); color: var(--sub2); }
.bin.xl { font-size: 28px; padding: 10px 14px; border-radius: 12px; }
.bins { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--fill); color: var(--sub2); white-space: nowrap; vertical-align: 1px; }
.pill.red { background: var(--red-hell); color: #d70015; }
.pill.green { background: var(--green-hell); color: #1a7f37; }
.pill.orange { background: var(--orange-hell); color: #a35a00; }
.pill.blue { background: var(--blue-hell); color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }
.dot.off { background: #c7c7cc; } .dot.warn { background: #ff9f0a; }

/* ---------- Spalten (Bestellungen) ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: #e9e9ef; border-radius: 18px; padding: 10px; min-height: 180px; }
.col h3 { font-size: 15px; font-weight: 600; margin: 4px 6px 10px; display: flex; align-items: center; gap: 8px; }
.col h3 .c { background: var(--card); color: var(--sub2); font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; }
.col.alert h3 { color: #d70015; }
.ocard { display: block; background: var(--card); border-radius: 12px; padding: 12px 13px; margin-bottom: 8px; color: var(--ink); box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.ocard:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.ocard .top { display: flex; align-items: center; gap: 8px; }
.ocard .nm { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .cu { color: var(--sub); font-size: 14px; margin-top: 2px; }
.ocard .ft { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ocard .qty { margin-left: auto; color: var(--sub2); font-size: 14px; font-weight: 600; }
.ocard .warn { margin-top: 8px; background: var(--red-hell); color: #d70015; font-size: 13px; font-weight: 600; padding: 6px 9px; border-radius: 8px; }
.ocard .track { color: var(--green); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col .none { border: 1.5px dashed #cfcfd6; border-radius: 12px; padding: 18px 12px; text-align: center; color: var(--sub); font-size: 14px; }
.col.done .ocard { background: rgba(255, 255, 255, .7); }

/* ---------- Bedienelemente ---------- */
.btn { font: inherit; font-weight: 600; font-size: 15px; height: 40px; padding: 0 16px; border-radius: 10px; cursor: pointer; border: 0; background: var(--card); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: #fafafa; text-decoration: none; }
.btn.fill { background: var(--blue); color: #fff; }
.btn.fill:hover { background: #0068d9; }
.btn.tint { background: var(--blue-hell); }
.btn.danger { color: var(--red); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.lg { height: 50px; border-radius: 12px; font-size: 17px; width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search], .toolbar select, .field { height: 38px; border: 0; border-radius: 10px; background: var(--fill); padding: 0 12px; font: inherit; font-size: 15px; color: var(--ink); }
.toolbar input[type=search] { min-width: 280px; }
.toolbar input:focus, .toolbar select:focus, .field:focus { outline: none; background: var(--card); box-shadow: 0 0 0 3px rgba(10, 124, 255, .3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 7px 13px; border-radius: 99px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; }
.chips a:hover { text-decoration: none; background: #fafafa; }
.chips a.on { background: var(--ink); color: #fff; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #e9e9ea; border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .2s; }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(10, 124, 255, .45); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.note { background: var(--orange-hell); color: #6b4300; border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.note.red { background: var(--red-hell); color: #a1000f; }
pre.log { white-space: pre-wrap; background: var(--card); border-radius: 12px; padding: 12px 14px; max-height: 300px; overflow: auto; font: 13px/1.6 ui-monospace, "SF Mono", Consolas, monospace; color: var(--sub2); margin: 12px 0 0; }
.footnote { color: var(--sub); font-size: 13px; margin: 8px 16px 0; }

/* Blatt (Dialog) */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--bg); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(0, 0, 0, .32); }
dialog[open] { animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet { from { transform: translateY(16px) scale(.98); opacity: 0; } }
dialog form { padding: 20px; }
dialog h3 { font-size: 20px; font-weight: 700; margin: 0; text-align: center; }
dialog .hint { color: var(--sub); text-align: center; font-size: 14px; margin: 4px 0 16px; }
dialog .fields { background: var(--card); border-radius: 12px; overflow: hidden; }
dialog label { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 48px; position: relative; font-size: 15px; }
dialog label + label::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: .5px solid var(--sep); }
dialog label span { width: 120px; flex: none; color: var(--ink); }
dialog label input, dialog label select { flex: 1; min-width: 0; border: 0; background: none; height: 46px; font: inherit; color: var(--ink); text-align: right; padding: 0; }
dialog label input:focus, dialog label select:focus { outline: none; }
dialog .err { color: var(--red); font-size: 14px; text-align: center; min-height: 20px; margin: 8px 0; }
dialog .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: rgba(28, 28, 30, .92); color: #fff; padding: 12px 20px; border-radius: 99px; font-weight: 500; font-size: 15px; z-index: 60; animation: sheet .2s ease-out; backdrop-filter: blur(10px); }
.toast.bad { background: #d70015; }

/* ---------- Anmelden ---------- */
body.gate { display: grid; place-items: center; padding: 24px; }
.gatebox { width: min(360px, 100%); text-align: center; }
.gatebox .logo { width: 64px; height: 64px; border-radius: 16px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 700; margin: 0 auto 14px; }
.gatebox h1 { font-size: 28px; margin: 0; }
.gatebox p { color: var(--sub); margin: 4px 0 26px; }
.gatebox .fields { background: var(--card); border-radius: 12px; overflow: hidden; text-align: left; margin-bottom: 16px; }
.gatebox input { display: block; width: 100%; border: 0; height: 50px; padding: 0 16px; font: inherit; font-size: 17px; background: none; color: var(--ink); }
.gatebox input + input { border-top: .5px solid var(--sep); }
.gatebox input:focus { outline: none; background: #fafafa; }
.gatebox .err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 12px; }

/* ---------- Schmal ---------- */
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .bar-in { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .seg { order: 3; width: 100%; }
  .search { order: 2; max-width: none; flex-basis: 100%; }
  .brand { flex: 1; }
  .menu { right: 16px; }
  main { padding: 20px 16px 56px; }
  .grid2 { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
}
@media (max-width: 600px) {
  .board { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none !important; }
  .toolbar input[type=search] { min-width: 0; flex: 1; }
}
