@font-face { font-family: "Geist"; src: url(fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #efeee7; --surface: #fff; --raise: #f1f0e9; --hover: #f8f7f2; --line: #e8e6dd; --line-2: #d3d1c6;
  --text: #14231c; --text-2: #43514a; --text-3: #61706a;
  --accent: #12402f; --accent-2: #0c3224; --on-accent: #fff; --accent-soft: #e2efd4; --accent-text: #12563e;
  --panel: #12402f; --panel-2: #0e3325; --lime: #c8f26b; --ink-on-lime: #14231c;
  --good-bg: #e2f3e0; --good: #166139; --warn-bg: #f9efd3; --warn: #7d5400; --bad-bg: #fbe5e0; --bad: #ab2c1c; --info-bg: #e4ecf8; --info: #2358a8;
  --s1: #1baf7a; --s2: #eb6834; --s3: #2a78d6; --s4: #eda100; --spark: #a3ad9f;
  --shadow: 0 1px 2px rgb(20 35 28 / .05);
  --tip-shadow: 0 8px 24px rgb(20 35 28 / .22);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b100d; --surface: #141b17; --raise: #1d2621; --hover: #19211c; --line: #26312b; --line-2: #37443c;
  --text: #eff4f0; --text-2: #bbc6bf; --text-3: #94a199;
  --accent: #c8f26b; --accent-2: #d8f88f; --on-accent: #14231c; --accent-soft: #222e22; --accent-text: #c8f26b;
  --panel: #173c2d; --panel-2: #123024; --lime: #c8f26b; --ink-on-lime: #14231c;
  --good-bg: #123022; --good: #7fe3ab; --warn-bg: #2e2510; --warn: #f0c866; --bad-bg: #351b18; --bad: #ffa597; --info-bg: #17263a; --info: #93bcf5;
  --s1: #199e70; --s2: #d95926; --s3: #3987e5; --s4: #c98500; --spark: #5f6d65;
  --shadow: none;
  --tip-shadow: 0 8px 24px rgb(0 0 0 / .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.45 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, p, ul, ol { margin: 0; padding: 0; font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: 0; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; letter-spacing: -.01em; white-space: nowrap; }
.muted { color: var(--text-3); margin-top: 2px; }
.nil { color: var(--text-3); }
.grow { flex: 1; min-width: 0; }

/* Rahmen */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 14px 12px; color: #fff; background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.side .brand { padding: 5px 8px; }
.brand img { display: block; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav p { padding: 14px 10px 6px; font-size: 12px; font-weight: 500; color: rgb(255 255 255 / .62); }
.side nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 14px; font-weight: 450; color: rgb(255 255 255 / .86); }
.side nav a:hover { background: rgb(255 255 255 / .09); color: #fff; }
.side nav a[aria-current] { background: var(--lime); color: var(--ink-on-lime); font-weight: 550; }
.side nav a b { margin-left: auto; min-width: 22px; padding: 0 6px; font-size: 12px; font-weight: 550; line-height: 20px; text-align: center; border-radius: 6px; background: rgb(255 255 255 / .16); color: #fff; }
.side nav a[aria-current] b { background: var(--ink-on-lime); color: var(--lime); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-brand { display: none; }
.top-r { display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; width: min(420px, 42vw); min-width: 0; height: 36px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--text-3); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; outline: 0; color: var(--text); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 500 11px "Geist Mono", monospace; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--text-3); }
.search.mini { width: 240px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 12px; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; }
.btn:hover { background: var(--raise); }
.btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--raise); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn span { display: grid; }
[data-theme="dark"] .for-light, [data-theme="light"] .for-dark { display: none; }

#view { width: 100%; max-width: 1600px; padding: 26px 28px 56px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.head h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.head p { margin-top: 4px; color: var(--text-3); }
.head-r { display: flex; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.pad { padding: 18px 20px; }
.card h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-h p { margin-top: 2px; color: var(--text-3); font-size: 13px; }
.pad-h { align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.count { font-size: 12px; font-weight: 550; line-height: 20px; min-width: 22px; text-align: center; border-radius: 6px; background: var(--raise); color: var(--text-2); }
.link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--accent-text); white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 14px; margin-top: 14px; }
.grid-conn { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Kennzahlen */
.tile { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 124px; padding: 15px 18px 14px; overflow: hidden; }
a.tile:hover { border-color: var(--line-2); background: var(--hover); }
.grid-4 > .tile:first-child, .blk.lead .tile {
  --surface: var(--panel); --raise: rgb(255 255 255 / .13); --line: rgb(255 255 255 / .14);
  --text: #fff; --text-2: rgb(255 255 255 / .86); --text-3: rgb(255 255 255 / .72);
  --s1: var(--lime); --spark: rgb(255 255 255 / .5);
  color: var(--text); background: var(--panel); border-color: var(--panel);
}
.tile-l { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.tile-l .ic { color: var(--text-3); }
.tile-v { font-size: 27px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; }
.tile-v small { font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--text-3); }
.tile-s { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: auto; font-size: 12.5px; color: var(--text-3); position: relative; }
.delta { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); font-weight: 500; }
.spark { position: absolute; right: 18px; bottom: 15px; width: 36%; height: 36px; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark path { fill: none; stroke: var(--spark); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark i { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--s1); box-shadow: 0 0 0 2px var(--surface); }
.meter { height: 6px; border-radius: 3px; background: var(--raise); overflow: hidden; }
.meter i { display: block; height: 100%; min-width: 0; border-radius: 3px; background: var(--s1); }

/* Linie */
.ch { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 236px 24px; margin-top: 16px; }
.ch-y { position: relative; }
.ch-y span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 12px; color: var(--text-3); }
.ch-plot { position: relative; }
.ch-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ch-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.ch-line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ch-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.ch-dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--s1); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.ch-dot.on, .ch-dot.hover { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.ch-dot.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px color-mix(in srgb, var(--s1) 30%, transparent); }
.ch-hit { position: absolute; top: 0; bottom: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.ch-hit:focus-visible { outline-offset: -2px; }
.ch-tip { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 1px; min-width: max-content; margin: -14px 0 0 14px; padding: 7px 10px; font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--tip-shadow); pointer-events: none; }
.ch-tip.flip { transform: translateX(-100%); margin-left: -14px; }
.ch-tip b { font-size: 14px; font-weight: 600; color: var(--text); }
.ch-x { position: relative; }
.ch-x span { position: absolute; top: 7px; transform: translateX(-50%); font-size: 12px; color: var(--text-3); }
.ch-x span:first-child { transform: none; }
.ch-x span:last-child { transform: translateX(-100%); }
.ch-x span.on { color: var(--text); font-weight: 550; }

/* Aufteilung */
.mix { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.seg { display: flex; gap: 2px; height: 8px; }
.seg i { display: block; min-width: 2px; }
.seg i:first-child { border-radius: 4px 0 0 4px; }
.seg i:last-child { border-radius: 0 4px 4px 0; }
.k-shop { background: var(--s1); } .k-amazon { background: var(--s2); } .k-none { background: var(--s3); } .k-private { background: var(--s4); }
.mix ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 18px; margin-top: 10px; }
.mix li { display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: center; gap: 1px 7px; font-size: 13px; color: var(--text-2); }
.mix li i { width: 8px; height: 8px; border-radius: 2px; }
.mix li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix li b { grid-column: 2; font-weight: 550; color: var(--text); }
.mix li em { margin-left: 5px; font-style: normal; font-weight: 400; color: var(--text-3); }
.mix-none { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }

/* Aufgaben */
.todo li + li { border-top: 1px solid var(--line); }
.todo a { display: flex; align-items: center; gap: 12px; padding: 13px 16px 13px 18px; color: var(--text-3); }
.todo a:hover { background: var(--hover); }
.todo-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.todo-t b { font-size: 14px; font-weight: 550; color: var(--text); }
.tint { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--raise); color: var(--text-2); }
.tint.warn { background: var(--warn-bg); color: var(--warn); }
.tint.bad { background: var(--bad-bg); color: var(--bad); }
.tint.info { background: var(--info-bg); color: var(--info); }
.grid-main #todo { display: flex; flex-direction: column; }
.grid-main .todo { flex: 1; display: flex; flex-direction: column; }
.grid-main .todo li { flex: 1; display: flex; }
.grid-main .todo a { flex: 1; }

/* Rangliste */
.rank li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 11px 18px 13px; font-size: 13.5px; }
.rank li + li { border-top: 1px solid var(--line); }
.rank li b { font-weight: 550; }
.rank li i { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: var(--s1); }
.clip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; overflow-wrap: anywhere; }

/* Reiter */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 12px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--raise); border-radius: 9px; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; font-size: 13.5px; font-weight: 500; color: var(--text-2); background: none; border: 0; border-radius: 6px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.tabs button b { font-size: 12px; font-weight: 500; padding: 0 5px; line-height: 18px; border-radius: 5px; color: var(--text-3); background: color-mix(in srgb, var(--text-3) 14%, transparent); }
.tabs.small button { height: 26px; font-size: 13px; padding: 0 9px; }
.select { position: relative; display: inline-flex; align-items: center; color: var(--text-3); }
.select .ic { position: absolute; right: 10px; pointer-events: none; }
.select select { height: 36px; padding: 0 30px 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; -webkit-appearance: none; appearance: none; cursor: pointer; }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { height: 40px; padding: 0 14px; text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl .r { text-align: right; }
.tbl .nw { white-space: nowrap; color: var(--text-2); }
.tbl .strong { font-weight: 550; }
.tbl .prod { width: 42%; max-width: 0; }
.tbl.compact .prod { width: 52%; }
.sub { display: block; margin-top: 1px; font-size: 12px; color: var(--text-3); width: fit-content; }
a.sub:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.more { color: var(--text-3); white-space: nowrap; }
.th { display: inline-flex; align-items: center; gap: 4px; padding: 0; font: inherit; color: inherit; background: none; border: 0; }
.th:hover { color: var(--text); }
.th .ic { opacity: .7; }
th.n .th { flex-direction: row-reverse; }
#order-table, #claim-table, #invoice-list { overflow-x: auto; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 18px; font-size: 13px; color: var(--text-3); border-top: 1px solid var(--line); }
.foot b { font-weight: 600; color: var(--text); }
.pager { display: flex; gap: 6px; }
.pager .icon-btn { width: 32px; height: 32px; }
.empty { padding: 28px 18px; text-align: center; color: var(--text-3); }
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--text-3); }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text-2); background: var(--raise); border-radius: 6px; }
.chip.good { color: var(--good); background: var(--good-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.bad { color: var(--bad); background: var(--bad-bg); }
.chip.info { color: var(--info); background: var(--info-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

.marks { display: inline-flex; gap: 4px; }
.mark { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; }
.mark:hover { background: var(--raise); color: var(--text); }
.mark.good[aria-pressed="true"] { color: var(--good); background: var(--good-bg); border-color: transparent; }
.mark.bad[aria-pressed="true"] { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.tbl.compact .mark span { display: none; }
.tbl.compact .mark { width: 28px; padding: 0; justify-content: center; }

.note { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; font-size: 13.5px; border-radius: 10px; }
.note p { flex: 1; }
.note.warn { color: var(--warn); background: var(--warn-bg); }
.note.warn .link { color: inherit; }

/* Verbindungen */
.ways li { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 18px; }
.ways li + li { border-top: 1px solid var(--line); }
.ways b { font-weight: 550; }
.ways p { margin-top: 1px; font-size: 13px; color: var(--text-3); }
.ways a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; padding: 26px 14px; text-align: center; font-size: 13.5px; color: var(--text-2); background: var(--hover); border: 1px dashed var(--line-2); border-radius: 10px; cursor: pointer; }
.drop:hover, .drop.over { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent); }
#your-data .btn { margin-top: 14px; width: 100%; }

/* Einkauf: Status in der Tabelle */
.bar-r { display: flex; gap: 8px; min-width: 0; }
.row-open { display: block; width: 100%; padding: 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; }
.row-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.src { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.stage { position: relative; display: inline-flex; align-items: center; color: var(--text-2); }
.stage .ic { position: absolute; right: 7px; pointer-events: none; }
.stage select { height: 28px; padding: 0 24px 0 9px; font-size: 12.5px; font-weight: 500; color: inherit; background: var(--raise); border: 0; border-radius: 6px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.stage[data-v="none"] { color: var(--text-3); }
.stage[data-v="shipped"] select { color: var(--info); background: var(--info-bg); }
.stage[data-v="arrived"] select, .stage[data-v="sent"] select { color: var(--good); background: var(--good-bg); }
.stage[data-v="problem"] select { color: var(--bad); background: var(--bad-bg); }
.mark.info[data-on="true"] { color: var(--info); background: var(--info-bg); border-color: transparent; }
.btn.danger { margin-right: auto; color: var(--bad); }

/* Einkauf: Seitenfeld */
#panel { position: fixed; inset: 0 0 0 auto; width: min(620px, 100vw); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; color: var(--text); background: var(--surface); border: 0; border-left: 1px solid var(--line); box-shadow: var(--tip-shadow); }
#panel::backdrop { background: rgb(8 14 11 / .55); }
#panel form { display: flex; flex-direction: column; height: 100%; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.panel-b { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.panel-b h3 { margin: 6px 0 -4px; font-size: 13px; font-weight: 600; }
.panel-f { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.panel-f .err { flex: 1 0 100%; font-size: 13px; color: var(--bad); }
.panel-f .err:empty { display: none; }
.f2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.f input, .f select, .f textarea { width: 100%; min-width: 0; height: 38px; padding: 0 10px; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; }
.f textarea { height: auto; padding: 8px 10px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#lines { display: flex; flex-direction: column; gap: 12px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 120px 76px 104px 36px; align-items: end; gap: 8px; }
.line:only-child [data-dropline] { visibility: hidden; }
.add-line { align-self: flex-start; gap: 5px; padding: 0; background: none; border: 0; cursor: pointer; }
.panel-items { border: 1px solid var(--line); border-radius: 10px; }
.panel-items li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; font-size: 13.5px; }
.panel-items li + li { border-top: 1px solid var(--line); }
.panel-items b { flex: none; font-weight: 550; }

/* Dashboard aus Bausteinen */
.board { --row: 58px; --gap: 14px; --cell: calc(var(--row) + var(--gap)); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--row); gap: var(--gap); }
.blk { position: relative; min-width: 0; min-height: 0; grid-column: calc(var(--x) + 1) / span var(--w); grid-row: calc(var(--y) + 1) / span var(--h); container-type: inline-size; }
.blk > .card, .blk-in > .card { height: 100%; min-height: 0; }
.blk .tile { min-height: 0; }
.blk .tile-s { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.blk .tile-s > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.blk .fill { display: flex; flex-direction: column; overflow: hidden; }
.blk .fill.pad { overflow: visible; }
.blk .ch { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) 24px; margin-top: 12px; }
.blk .fill > .todo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.blk .fill > .todo li { flex: 1; display: flex; min-width: 0; }
.blk .fill > .todo a { flex: 1; min-width: 0; }
.blk .rank { flex: 1; min-height: 0; }
.blk .pad-h { flex: none; }
.blk .pad-h p, .blk .todo-t > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix.in { margin: auto 0; padding: 14px 18px; border: 0; }
.mix.in .mix-none { margin: 0; padding: 0; border: 0; }
.mix ul { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.k-held { background: var(--good); } .k-requested { background: var(--info); } .k-open { background: var(--line-2); } .k-missing { background: var(--bad); }
.rows li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 18px; font-size: 13.5px; }
.rows li + li { border-top: 1px solid var(--line); }
.rows li > b { flex: none; font-weight: 550; }
.rows .mark { width: 28px; padding: 0; justify-content: center; }
.rows .mark span { display: none; }
.rows .sub { width: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .sub .mono { font-size: 12px; }
@container (max-width: 250px) { .spark { display: none; } .tile { padding: 14px 15px 12px; } .tile-v { font-size: 24px; } }
@container (max-width: 400px) { .rows .marks { display: none; } .rows li { gap: 10px; padding-left: 16px; padding-right: 16px; } }

/* Einstellungen */
.set + .set { margin-top: 30px; }
.set-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.set-h h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.set-h p { margin-top: 2px; color: var(--text-3); font-size: 13.5px; }
.preset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.preset { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.preset:hover { border-color: var(--line-2); background: var(--hover); }
.preset[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.preset-t { display: flex; flex-direction: column; gap: 1px; padding: 0 2px 2px; }
.preset-t b { font-size: 14px; font-weight: 600; }
.preset-t span { font-size: 12.5px; color: var(--text-3); }
.preset-on { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 20px; height: 20px; color: var(--ink-on-lime); background: var(--lime); border-radius: 50%; }
.mini { position: relative; display: block; height: 76px; background: var(--raise); border-radius: 7px; overflow: hidden; }
.mini i { position: absolute; background-clip: content-box; padding: 1.5px; box-sizing: border-box; background-color: color-mix(in srgb, var(--text-3) 34%, transparent); border-radius: 3px; }
.mini i.t { background-color: var(--accent-text); opacity: .75; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; gap: 5px; }

.board.edit { position: relative; display: block; height: calc(var(--rows) * var(--cell) - var(--gap)); user-select: none; -webkit-user-select: none; }
.board.edit.busy { background: linear-gradient(to right, color-mix(in srgb, var(--text-3) 6%, transparent) calc(100% - var(--gap)), transparent 0) 0 0 / calc((100% + var(--gap)) / 12) 100%; border-radius: 12px; }
.board.edit .blk { position: absolute; left: calc(var(--x) * (100% + var(--gap)) / 12); top: calc(var(--y) * var(--cell)); width: calc(var(--w) * (100% + var(--gap)) / 12 - var(--gap)); height: calc(var(--h) * var(--cell) - var(--gap)); cursor: grab; border-radius: 12px; }
.blk-in { height: 100%; }
.board.edit .blk:hover .blk-in > .card, .board.edit .blk:focus-visible .blk-in > .card { border-color: var(--accent); }
.blk.held { z-index: 6; cursor: grabbing; }
.blk.held .blk-in > .card { box-shadow: var(--tip-shadow); border-color: var(--accent); }
.blk-ghost { position: absolute; z-index: 1; left: calc(var(--x) * (100% + var(--gap)) / 12); top: calc(var(--y) * var(--cell)); width: calc(var(--w) * (100% + var(--gap)) / 12 - var(--gap)); height: calc(var(--h) * var(--cell) - var(--gap)); background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: 12px; }
.blk-tools { position: absolute; top: 7px; right: 7px; z-index: 3; display: flex; align-items: center; gap: 1px; padding: 2px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); }
.blk-grip { display: grid; place-items: center; width: 26px; height: 26px; touch-action: none; }
.blk-tools button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; color: inherit; background: none; border: 0; border-radius: 6px; }
.blk-tools button:hover { color: var(--bad); background: var(--bad-bg); }
.blk-size { position: absolute; right: 0; bottom: 0; z-index: 3; width: 30px; height: 30px; cursor: nwse-resize; touch-action: none; }
.blk-size::after { content: ""; position: absolute; right: 7px; bottom: 7px; width: 11px; height: 11px; border-right: 2.5px solid var(--accent-text); border-bottom: 2.5px solid var(--accent-text); border-radius: 0 0 4px 0; }
.blk.lead .blk-size::after { border-color: var(--lime); }
@media (hover: hover) {
  .blk-tools { opacity: 0; transition: opacity .1s; }
  .board.edit .blk:hover .blk-tools, .board.edit .blk:focus-visible .blk-tools, .blk-tools:focus-within { opacity: 1; }
}
body.dragging { cursor: grabbing; }
.flash .blk-in > .card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.ed-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ed-list li { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; }
.ed-list li + li { border-top: 1px solid var(--line); }
.ed-list b { font-weight: 550; overflow-wrap: anywhere; }
.ed-list .icon-btn { flex: none; }

.lib { display: flex; flex-direction: column; height: 100%; }
.lib .panel-b { gap: 6px; }
.lib .panel-b h3 { margin: 12px 0 2px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.lib .panel-b h3:first-child { margin-top: 0; }
.lib-list { border: 1px solid var(--line); border-radius: 10px; }
.lib-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.lib-list li + li { border-top: 1px solid var(--line); }
.lib-list b { font-weight: 550; }
.lib-list p { font-size: 13px; color: var(--text-3); }

/* Anmeldung und Meldung */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.gate form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.gate .brand { margin-bottom: 6px; }
.gate label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.gate input { height: 38px; padding: 0 10px; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; }
.gate input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate .err { min-height: 18px; font-size: 13px; color: var(--bad); }
.gate .btn { height: 38px; }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: calc(100vw - 32px); padding: 10px 14px; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--tip-shadow); }

@media (max-width: 1280px) {
  .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; }
  .tbl .act .mark span { display: none; }
  .tbl .act .mark { width: 28px; padding: 0; justify-content: center; }
}
@media (max-width: 1180px) {
  .grid-main, .grid-split { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl .prod .clip { min-width: 170px; }
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .side { padding: 14px 10px; align-items: center; }
  .side .brand { padding: 4px; }
  .side .brand span, .side nav p, .side nav a span, .side nav a b { display: none; }
  .side nav { gap: 4px; }
  .side nav a { justify-content: center; width: 44px; padding: 0; height: 40px; }
  .top { padding: 0 20px; }
  #view { padding: 22px 20px 48px; }
}
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; grid-auto-flow: dense; }
  .blk { grid-column: 1 / -1; grid-row: auto; }
  .blk.is-tile { grid-column: auto; }
  .blk .tile { height: 100%; min-height: 124px; }
  .blk .tile-s { flex-wrap: wrap; white-space: normal; }
  .blk .ch { flex: none; grid-template-rows: 214px 24px; }
  #order-table, #claim-table, #invoice-list { overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; width: 100%; }
  .tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 18px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl tbody tr:hover { background: none; }
  .tbl td, .tbl td:first-child, .tbl td:last-child { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 22px; padding: 0; border: 0; }
  .tbl td::before { content: attr(data-l); font-size: 13px; color: var(--text-3); }
  .tbl td.prod { grid-column: 1 / -1; order: -1; display: block; max-width: none; padding-bottom: 5px; font-weight: 550; }
  .tbl td[data-l="Reason"], .tbl td[data-l="Stage"], .tbl td[data-l="Back in stock?"] { grid-column: 1 / -1; }
  .tbl td[data-l="Expected"]:has(.nil) { display: none; }
  .tbl td.prod::before { content: none; }
  .tbl td.prod .sub { font-weight: 400; }
  .tbl td.act { grid-column: 1 / -1; justify-content: flex-end; padding-top: 5px; }
  .tbl td.act::before { content: none; }
  .tbl .act .mark span { display: inline; }
  .tbl .act .mark { width: auto; padding: 0 9px; }
  .tbl .prod .clip { min-width: 0; -webkit-line-clamp: 2; }
  .grid-conn { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .app { display: block; }
  .side { position: fixed; z-index: 30; left: 0; right: 0; top: auto; bottom: 0; height: auto; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .side .brand { display: none; }
  .side nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .side nav a { flex: 1 1 0; flex-direction: column; gap: 2px; width: auto; height: 50px; justify-content: center; position: relative; }
  .side nav a span { display: block; font-size: 11px; }
  .top { position: sticky; flex-wrap: wrap; height: auto; min-height: 54px; padding: 8px 16px; gap: 8px; }
  .top-brand { display: flex; }
  .top .btn span { display: none; }
  .top .btn { width: 36px; padding: 0; }
  .top .search { display: none; }
  .side nav a[data-go="settings"] { display: none; }
  .head { flex-wrap: wrap; }
  .head-r { width: 100%; }
  .head-r .select { flex: 1 1 0; min-width: 0; }
  .set-h { flex-direction: column; align-items: stretch; }
  .preset-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini { height: 60px; }
  [data-route="orders"] .top .search { display: flex; order: 3; width: 100%; }
  [data-route="orders"] .top .search kbd { display: none; }
  #view { padding: 18px 16px 96px; }
  .head h1 { font-size: 22px; }
  .tile { min-height: 116px; padding: 13px 14px 12px; }
  .tile-v { font-size: 22px; }
  .spark { display: none; }
  .search.mini { width: 100%; }
  .pad { padding: 16px; }
  .ch, .blk .ch { grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: 190px 24px; }
  .ch-x span { font-size: 11px; }
  .mix ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-h:has(.tabs) { flex-direction: column; }
  .bar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .bar > * { min-width: 0; max-width: 100%; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs.small { display: inline-flex; }
  .bar-r { width: 100%; }
  .bar-r .select { flex: 1 1 0; min-width: 0; }
  .select, .select select { width: 100%; }
  #panel { width: 100vw; border-left: 0; }
  .f input, .f select, .f textarea { font-size: 16px; }
  .line { grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1.1fr); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .line .wide { grid-column: 1 / -1; }
  .line [data-dropline] { grid-column: 1 / -1; justify-self: end; }
  .line:only-child [data-dropline] { display: none; }
  .ways li { flex-direction: column-reverse; gap: 6px; }
  .note { align-items: flex-start; }
  #toast { left: 16px; right: 16px; bottom: 76px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tabs button, .side nav a, .btn, .mark { transition: background-color .12s, color .12s; }
  .board.edit.busy .blk:not(.held), .blk-ghost { transition: left .16s, top .16s, width .16s, height .16s; }
}

/* Durchklicken: Rückweg, Raster für Detailseiten, Links in Listen */
.crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.crumb:hover { color: var(--accent-text); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.grid-2 > .wide { grid-column: 1 / -1; }
.grid-2 > .card, .grid-3 + .grid-2 > .card { overflow: hidden; }
.rows a.clip, .rank a.clip { color: inherit; }
.rows a.clip:hover, .rank a.clip:hover, a.row-open:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
a.row-open { display: block; }
.tile-v .chip { font-size: 13px; vertical-align: middle; }
.hint { padding: 0 18px 14px; font-size: 12.5px; color: var(--text-3); }
.mark.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.head p .link { font-size: inherit; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  #product-table { overflow: visible; }
  .tbl td[data-l="Needs you"] { grid-column: 1 / -1; }
  .tbl td[data-l="Needs you"]:has(.nil) { display: none; }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) { .tbl td[data-l="Stage"]:has(.chip.quiet) { display: none; } }
