:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #646d7e; --line: #dde1e8;
  --accent: #1f4e8c; --accent-text: #fff; --danger: #b3261e; --ok: #1d7a46;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }
.top { background: var(--accent); color: var(--accent-text); }
.top a, .top button.link { color: var(--accent-text); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.brand { font-weight: 700; text-decoration: none; font-size: 1.1rem; display: flex; align-items: center; gap: 12px; }
.brand img.logo { height: 42px; width: auto; max-width: 180px; background: #fff; border-radius: 6px; padding: 3px 6px; display: block; }
.logo-preview { max-height: 80px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.print-logo { max-height: 70px; width: auto; margin-bottom: 6px; }
nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 24px 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 6px; }
a { color: var(--accent); }
.lead { color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; }
.narrow { max-width: 520px; }
.notice { background: #fff6dc; border: 1px solid #ecd78d; border-radius: 10px; padding: 12px 16px; margin: 12px 0; white-space: pre-line; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; border: 1px solid; }
.flash.ok { background: #e7f5ec; border-color: #b6dfc5; color: var(--ok); }
.flash.error { background: #fdeceb; border-color: #f2b8b5; color: var(--danger); }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.items .card { margin: 0; }
.item { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.item > img, .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fafbfc; border-bottom: 1px solid var(--line); }
.gallery { border-bottom: 1px solid var(--line); background: #fafbfc; }
.gallery-main { position: relative; aspect-ratio: 4 / 3; }
.gallery-main img { display: none; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery-main img.active { display: block; }
.g-prev, .g-next { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .92); color: var(--text);
  font-size: 24px; line-height: 1; padding: 0 0 3px; cursor: pointer; }
.g-prev { left: 8px; } .g-next { right: 8px; }
.g-prev:hover, .g-next:hover { background: #fff; }
.g-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .6); color: #fff;
  font-size: .75rem; padding: 2px 9px; border-radius: 999px; }
.thumbs { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: #fff; border-top: 1px solid var(--line); }
.thumb { flex: 0 0 auto; width: 54px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 6px;
  overflow: hidden; background: #fafbfc; cursor: pointer; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--accent); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 10px 0 4px; }
.img-tile { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.img-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fafbfc; border-radius: 6px; }
.img-tile label.check { margin-top: 8px; font-size: .85rem; }
.img-tile.removing { opacity: .5; border-color: var(--danger); }
.noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.item .body { padding: 14px 16px 16px; }
.item.inactive { opacity: .55; }
.price { font-weight: 700; margin: 4px 0 10px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.size { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); }
.size input { width: 100%; text-align: center; }
.badge { font-size: .7rem; background: var(--line); color: var(--muted); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }

label { display: block; margin: 12px 0 0; font-weight: 600; font-size: .92rem; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid #c3c9d4; border-radius: 8px; background: #fff; color: inherit; width: 100%; margin-top: 4px; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px;
  padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; margin-top: 16px; width: auto; }
.btn.small { padding: 7px 14px; font-size: .9rem; margin-top: 0; }
.btn.secondary { background: #e8ecf3; color: var(--accent); }
.btn.danger { background: var(--danger); }
.btn:hover { filter: brightness(1.08); }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; width: auto; margin: 0; }
form.inline { display: inline; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 12px 0; }
.filters input, .filters select { width: auto; margin: 0; }
.filters label { margin: 0; }
.row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row select { width: auto; margin: 0; }
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-bottom: 0; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.list select { width: auto; margin: 0; padding: 4px 8px; font-size: .9rem; }
.st-neu { background: #fff6dc; } .st-bestellt { background: #e3eefc; }
.st-abholbereit { background: #e7f5ec; } .st-abgeholt { background: #eee; } .st-storniert { background: #fdeceb; }
.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); gap: 16px; }
.summary .card { margin: 0; min-width: 0; }
.summary .table-wrap { overflow-x: auto; }
.summary h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
table.compact td.sku { white-space: nowrap; }
table.compact th, table.compact td { padding: 4px 8px; }
.preview { max-width: 240px; border: 1px solid var(--line); border-radius: 8px; }
.badge.warn { background: #fdeceb; color: var(--danger); }
.badge.okb { background: #e7f5ec; color: var(--ok); }
.badge.mid { background: #fff6dc; color: #8a6100; }
.table-wrap.plain { border: 0; background: none; border-radius: 0; }
table.stock input { width: 84px; margin: 0; padding: 5px 8px; text-align: right; }
tr.missing td { background: #fff8f7; }
td.neg { color: var(--danger); font-weight: 700; }
.legend ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
fieldset.tiers { border: 1px solid var(--line); border-radius: 10px; margin: 16px 0 0; padding: 4px 14px 14px; }
fieldset.tiers legend { font-weight: 700; padding: 0 6px; }
.narrow.wide { max-width: 720px; }
td.sku { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.tier-head, .tier-row { display: grid; grid-template-columns: 100px 140px 1fr; gap: 8px; }
@media (max-width: 600px) {
  .tier-head { display: none; }
  .tier-row { grid-template-columns: 1fr 1fr; }
  .tier-row input:nth-child(3) { grid-column: 1 / -1; }
  .tier-row { margin-top: 12px; }
}
.tier-head { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 6px; }
.tier-row input { margin-top: 0; margin-bottom: 0; }
.tier-row { margin-top: 8px; }
.sprice { font-size: .75rem; color: var(--text); font-weight: 600; }
.summary-list { margin: 8px 0; padding-left: 20px; }
.summary-total { font-size: 1.2rem; margin: 8px 0 2px; }
.small { font-size: .85rem; }
h2.spaced { margin-top: 22px; }
.totalbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin: 16px -16px 0; padding: 12px 16px; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); }
.totalbar strong { font-size: 1.15rem; }
.totalbar .btn { white-space: nowrap; flex-shrink: 0; }
.print-only { display: none; }
.sign { margin-top: 36px; }

@media print {
  body { background: #fff; }
  .no-print, .top { display: none !important; }
  .print-only { display: block; }
  .card { border: 0; padding: 0; }
  .summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  table.compact { font-size: .85rem; }
  table.compact th, table.compact td { padding: 4px 4px; }
  table.compact th { letter-spacing: 0; font-size: .7rem; }
  .summary .card { padding: 12px; }
}

.g-zoom { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .92); color: var(--text); font-size: 18px; line-height: 1;
  padding: 0; cursor: zoom-in; }
.g-zoom:hover { background: #fff; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 22, .92); }
.lightbox[hidden] { display: none; }
.lightbox { overflow: auto; }
.lb-img { margin: auto; max-width: 94vw; max-height: 88vh; object-fit: contain; background: #fff; border-radius: 6px; cursor: zoom-in; }
.lightbox.zoomed .lb-img { max-width: none; max-height: none; width: min(1400px, 250vw); cursor: zoom-out; border-radius: 0; }
.lightbox.zoomed .lb-hint { display: none; }
.lb-hint { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; opacity: .75; font-size: .8rem; white-space: nowrap; }
.lb-close, .lb-prev, .lb-next { position: fixed; border: 0; border-radius: 50%; width: 46px; height: 46px; padding: 0 0 4px;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .32); }
.lb-close { top: 14px; right: 14px; font-size: 34px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: fixed; bottom: 14px; left: 14px; color: #fff; font-size: .9rem;
  background: rgba(0, 0, 0, .5); padding: 2px 12px; border-radius: 999px; }
.lb-count:empty { display: none; }
body.lb-open { overflow: hidden; }
@media print { .lightbox, .g-zoom { display: none !important; } }

/* Anmeldung */
h2.section { margin: 22px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 1.15rem; }
h2.section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.q { margin-top: 4px; }
.q.err input, .q.err select, .q.err textarea { border-color: var(--danger); }
.help { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.errmsg { color: var(--danger); font-size: .9rem; margin-top: 2px; font-weight: 600; }
.entry-hint { background: #e7f5ec; border: 1px solid #b6dfc5; color: var(--ok); border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-weight: 600; }
.entry-hint[hidden] { display: none; }
fieldset { border: 0; padding: 0; margin: 12px 0 0; }
legend { font-weight: 600; font-size: .92rem; padding: 0; }
.foot { padding-top: 12px; padding-bottom: 32px; display: flex; gap: 16px; font-size: .9rem; }
.nowrap { white-space: nowrap; }
tr.inactive td { opacity: .55; }
.badge.warn { background: #fdeceb; color: var(--danger); }
.badge.okb { background: #e7f5ec; color: var(--ok); }
@media print { .no-print { display: none !important; } }
