/* Pillipp Dashboard. Farben der Lebküchnerei: Braun als Marke, Gold nur für die eine Hauptaktion je Seite. */
:root {
  --bg: #f4f3f0; --card: #ffffff; --ink: #1c1a17; --muted: #6a665f; --line: #e3e0da;
  --brand: #56462e; --brand-deep: #2f261a; --on-brand: #f6efe2; --gold: #dcaa45; --gold-ink: #2f261a;
  --ok: #2f6b3f; --ok-bg: #e4f1e6; --warn: #8a5a00; --warn-bg: #fbefd2; --bad: #8b2420; --bad-bg: #f6e3df; --info-bg: #ece8df;
  --radius: 14px; --nav-w: 15rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; line-height: 1.5; font-size: 1rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.03em; line-height: 1.15; }
h2 { font-size: 1.125rem; letter-spacing: -0.01em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.boot { padding: 3rem 1.25rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ── Gerüst: links Navigation (Desktop), unten Leiste (Handy) ── */
.shell { display: grid; min-height: 100svh; }
.side { display: none; }
.main { min-width: 0; padding: 1.25rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); max-width: 70rem; width: 100%; margin-inline: auto; display: grid; gap: 1.25rem; align-content: start; }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: grid; justify-items: center; gap: 0.15rem; padding: 0.55rem 0.25rem 0.5rem; font-size: 0.6875rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current] { color: var(--brand); font-weight: 700; }
.tabbar svg, .side svg { width: 1.4rem; height: 1.4rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar img { height: 2.25rem; width: auto; }
.topbar a { font-size: 0.875rem; }
@media (min-width: 60em) {
  .shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 0.25rem; position: sticky; top: 0; height: 100svh; padding: 1.25rem 0.9rem; background: var(--brand-deep); color: var(--on-brand); }
  .side__logo { display: block; padding: 0.5rem 0.6rem 1.25rem; }
  .side__logo img { height: 2.75rem; width: auto; filter: brightness(0) invert(0.93) sepia(0.2); }
  .side a.nav { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.75rem; border-radius: 10px; color: #d2c4aa; text-decoration: none; font-weight: 500; }
  .side a.nav:hover { background: rgb(255 255 255 / 0.07); color: var(--on-brand); }
  .side a.nav[aria-current] { background: rgb(255 255 255 / 0.13); color: #fff; }
  .side__foot { margin-top: auto; display: grid; gap: 0.35rem; padding: 0.75rem; font-size: 0.875rem; color: #d2c4aa; }
  .side__foot a, .side__foot button { color: inherit; background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 0.2em; }
  .tabbar, .topbar { display: none; }
  .main { padding: 2rem 2rem 3rem; }
}

/* ── Bausteine ── */
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.75rem 1rem; }
.head p { color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(28 26 23 / 0.04); padding: 1.1rem; display: grid; gap: 0.9rem; min-width: 0; }
.card--flush { padding: 0; gap: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1.1rem; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #3f3322; }
.btn--gold { background: var(--gold); color: var(--gold-ink); }
.btn--gold:hover { background: #cc9a35; }
.btn--quiet { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px #cfcbc3; }
.btn--quiet:hover { background: var(--bg); }
.btn--danger { background: var(--card); color: var(--bad); box-shadow: inset 0 0 0 1px #e0b8b3; }
.btn--danger:hover { background: var(--bad-bg); }
.btn--small { min-height: 2.25rem; padding: 0 0.8rem; font-size: 0.875rem; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--block { width: 100%; }
.field { width: 100%; min-height: 2.75rem; padding: 0.55rem 0.8rem; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px #cfcbc3; }
.field:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
textarea.field { resize: vertical; min-height: 5rem; }
.fld { display: grid; gap: 0.35rem; min-width: 0; align-content: start; }
.fld > span { font-size: 0.875rem; font-weight: 600; }
.fld small { color: var(--muted); }
.grid2 { display: grid; gap: 0.9rem; }
@media (min-width: 36em) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .wide { grid-column: 1 / -1; } }
.check { display: flex; align-items: center; gap: 0.7rem; min-height: 2.75rem; padding: 0.6rem 0.8rem; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.check:has(input:checked) { background: #faf6ec; box-shadow: inset 0 0 0 2px var(--brand); }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); flex: none; }
.error { padding: 0.75rem 0.9rem; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 500; }
.empty { padding: 1.5rem 1.1rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; background: var(--info-bg); color: var(--brand-deep); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chips { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.15rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 2.5rem; padding: 0 0.95rem; border: 0; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 0.875rem; }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: none; }
.toolbar { display: grid; gap: 0.75rem; }
@media (min-width: 48em) { .toolbar { grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem); align-items: center; } }
.toast { position: fixed; left: 50%; bottom: calc(5rem + env(safe-area-inset-bottom)); translate: -50% 1rem; z-index: 50; max-width: calc(100vw - 2rem); padding: 0.7rem 1rem; border-radius: 10px; background: var(--brand-deep); color: #fff; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s, translate 0.2s; }
.toast.is-on { opacity: 1; translate: -50% 0; }
.toast.is-bad { background: var(--bad); }
@media (min-width: 60em) { .toast { bottom: 2rem; } }

/* ── Start ── */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (min-width: 48em) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: grid; gap: 0.2rem; padding: 1rem; background: var(--card); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); text-decoration: none; }
a.kpi:hover { box-shadow: 0 0 0 2px var(--brand); }
.kpi strong { font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 0.875rem; color: var(--muted); }
.kpi--todo strong { color: var(--brand); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-radius: var(--radius); background: var(--brand); color: var(--on-brand); }
.cta p { color: #d9ccb4; }

/* ── Listen ── */
.rows { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; padding: 0.85rem 1.1rem; border-top: 1px solid var(--line); text-decoration: none; }
.row:first-child { border-top: 0; }
a.row:hover { background: #faf9f6; }
.row__title { font-weight: 600; overflow-wrap: anywhere; }
.row__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.875rem; color: var(--muted); }
.more { display: flex; justify-content: center; padding: 0.9rem; border-top: 1px solid var(--line); }

/* ── Bestellung ── */
.detail { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 60em) { .detail { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.note { padding: 0.9rem 1rem; border-radius: 10px; background: var(--warn-bg); color: #4d3600; white-space: pre-wrap; overflow-wrap: anywhere; }
.note--alert { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.lines { width: 100%; border-collapse: collapse; }
.lines td, .lines th { padding: 0.55rem 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.lines th { border-top: 0; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.lines td.num, .lines th.num { text-align: right; padding-left: 0.75rem; }
.lines tfoot td { font-weight: 600; }
.lines .qty { width: 3rem; font-weight: 700; }
.actions { display: grid; gap: 0.6rem; }
.addr { font-style: normal; line-height: 1.45; }

/* ── Telefonauftrag ── */
.phone { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 64em) { .phone { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } .phone__sum { position: sticky; top: 1.5rem; } }
.step-n { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-right: 0.5rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.875rem; font-weight: 700; }
.pick { display: grid; max-height: 22rem; overflow-y: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.pick button { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.pick button:first-child { border-top: 0; }
.pick button:hover { background: #faf6ec; }
.pick img, .pick .noimg { width: 2.75rem; height: 2.75rem; border-radius: 8px; object-fit: cover; background: var(--bg); }
.pick small { color: var(--muted); }
.cartline { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.cartline:first-child { border-top: 0; }
.stepper { display: inline-flex; align-items: center; border-radius: 10px; box-shadow: inset 0 0 0 1px #cfcbc3; }
.stepper button { width: 2.5rem; height: 2.5rem; border: 0; background: none; font-size: 1.15rem; font-weight: 700; }
.stepper input { width: 2.75rem; height: 2.5rem; border: 0; background: none; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sumrows { display: grid; gap: 0.4rem; }
.sumrows div { display: flex; justify-content: space-between; gap: 1rem; }
.sumrows .total { padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 1.25rem; font-weight: 700; }
.custcard { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border-radius: 10px; background: #faf6ec; box-shadow: inset 0 0 0 2px var(--brand); }

/* ── Artikel ── */
.prod { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0.75rem 0.9rem; padding: 0.85rem 1.1rem; border-top: 1px solid var(--line); align-items: center; }
.prod:first-child { border-top: 0; }
.prod img, .prod .noimg { width: 3.25rem; height: 3.25rem; border-radius: 8px; object-fit: cover; background: var(--bg); }
.prod__edit { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; align-items: end; }
.prod--variant { padding-left: 2rem; background: #fbfaf8; }
.prod.is-off .row__title { color: var(--muted); }
@media (min-width: 48em) {
  .prod { grid-template-columns: 3.25rem minmax(0, 1fr) auto; }
  .prod__edit { grid-column: auto; grid-template-columns: 7rem 6rem auto auto; }
}
.switch { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.switch input { width: 1.15rem; height: 1.15rem; accent-color: var(--ok); }

/* ── Anmeldung ── */
.login { min-height: 100svh; display: grid; place-items: center; padding: 1.25rem; }
.login form { width: min(100%, 24rem); display: grid; gap: 1rem; padding: 1.75rem; background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 20px 50px -30px rgb(47 38 26 / 0.5); }
.login img { height: 3.5rem; width: auto; justify-self: start; }

/* ── Packliste drucken: je Bestellung ein Blatt, nichts drumherum ── */
.pack { display: grid; gap: 1rem; }
.pack__sheet { break-inside: avoid; }
.pack__head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.pack__box { width: 1.4rem; height: 1.4rem; border: 2px solid var(--ink); border-radius: 4px; display: inline-block; vertical-align: middle; }
@media print {
  .side, .tabbar, .topbar, .noprint, .toast { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 1px solid #999; border-radius: 0; }
  .pack__sheet { break-after: page; }
  .pack__sheet:last-child { break-after: auto; }
}
