/* Holzwerkstatt Königsdorf · Dashboard */

@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --tanne: #1E3A32;
  --tanne-2: #2A4C42;
  --tanne-deep: #142924;
  --pappel: #E8D3B0;
  --pappel-hell: #F3E7D3;
  --span: #F4F3F0;
  --card: #FFFFFF;
  --nuss: #6E4424;
  --ink: #1B2420;
  --ink-2: #44514B;
  --ink-3: #6B776F;
  --line: rgba(30, 58, 50, .12);
  --line-strong: rgba(30, 58, 50, .26);
  --ok: #2F6B3F;   --ok-bg: #E4F0E4;
  --warn: #8A520F; --warn-bg: #F8ECD6;
  --err: #A33A2A;  --err-bg: #F7E3DE;
  --info: #24566E; --info-bg: #E2EEF3;
  --f-display: "Bricolage", "Figtree", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 12px;
  --r-s: 8px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --shadow: 0 1px 2px rgba(20, 41, 36, .05), 0 3px 10px rgba(20, 41, 36, .05);
  --side: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--span); color: var(--ink); font: 400 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--tanne); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--nuss); }
::selection { background: var(--pappel); color: var(--tanne-deep); }
:focus-visible { outline: 2px solid var(--nuss); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); color: var(--tanne); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; font-weight: 700; margin-bottom: .9rem; }
h3 { font-size: .98rem; font-weight: 700; margin-bottom: .5rem; }
p { margin: 0 0 .8rem; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--pappel-hell); padding: .08em .35em; border-radius: 4px; word-break: break-all; }
.icon { flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.visually-hidden:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100; background: #fff; padding: .5rem 1rem; }
.muted { color: var(--ink-3); }
.small, small { font-size: .84rem; }
.mt { margin-top: 1rem; }
.right { text-align: right; }
.pre { white-space: pre-line; }
.neg { color: var(--err); }
.r { text-align: right; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* ---------- Gerüst ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--tanne); color: var(--pappel-hell);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 30; padding: 18px 12px 14px;
  transition: transform .32s var(--ease-out);
}
.side-brand { display: block; padding: 4px 10px 18px; }
.side-brand img { width: 150px; height: auto; }
.side-group { font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: rgba(243, 231, 211, .55); padding: 12px 10px 3px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-s);
  color: var(--pappel-hell); text-decoration: none; font-size: .93rem; transition: background-color .15s;
}
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a[aria-current="page"] { background: var(--pappel); color: var(--tanne-deep); font-weight: 600; }
.side nav a span { flex: 1; }
.count { background: #C8642B; color: #fff; font-size: .72rem; border-radius: 99px; padding: 0 .5em; min-width: 1.6em; text-align: center; line-height: 1.55; }
.side-foot { margin-top: auto; padding: 16px 10px 0; display: grid; gap: 8px; font-size: .88rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-foot a, .side-foot .link { color: rgba(243, 231, 211, .85); display: flex; align-items: center; gap: 8px; text-decoration: none; }
.side-foot form { margin: 0; }
.main { margin-left: var(--side); min-height: 100vh; }
.top { display: flex; align-items: center; gap: 12px; padding: 22px 32px 6px; }
.top h1 { font-size: 1.65rem; font-weight: 800; flex: 1; }
.who { color: var(--ink-3); font-size: .88rem; }
.side-toggle { display: none; }
.content { padding: 14px 32px 64px; max-width: 1320px; }
.content > * + * { margin-top: 18px; }
.stack > * + * { margin-top: 18px; }

/* ---------- Karten, Raster ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card.dashed { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-strong); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.card-head a, .card-head .link { font-size: .88rem; }
.card-head.pad { padding: 18px 22px 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.order-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split.narrow-left { grid-template-columns: 280px minmax(0, 1fr); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.fields-grid > .switch-row, .fields-grid > label.field:has(textarea) { grid-column: 1 / -1; }
.intro-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lead { font-size: 1.02rem; color: var(--ink-2); margin: 0; }
.empty { color: var(--ink-3); padding: 18px 22px; margin: 0; }
.card:not(.flush) > .empty { padding: 0; }
.crumbs { margin: 0; font-size: .9rem; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; text-decoration: none; color: var(--ink); display: grid; gap: 2px; transition: transform .2s var(--ease-out), box-shadow .2s; }
a.kpi:hover { color: var(--ink); box-shadow: 0 2px 4px rgba(20, 41, 36, .06), 0 10px 24px rgba(20, 41, 36, .09); }
.kpi span { font-size: .84rem; color: var(--ink-3); }
.kpi strong { font-family: var(--f-display); font-size: 1.7rem; font-weight: 800; color: var(--tanne); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.neg strong { color: var(--err); }
.kpi small { color: var(--ink-2); }
.warn-card { background: var(--warn-bg); box-shadow: none; }
.warn-card h2 { color: var(--warn); }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo a { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; padding: 4px 0; }
.todo a:hover { color: var(--nuss); }
.todo a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }

.meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; margin-top: .7rem; }
.meter-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 10px; background: var(--pappel-hell); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter.thin { height: 6px; }
.meter i { display: block; height: 100%; background: var(--tanne); border-radius: inherit; transform-origin: left; animation: grow .7s var(--ease-out) both; }
.meter.warm i { background: #C98A1B; }
.meter.hot i { background: var(--err); }
@keyframes grow { from { transform: scaleX(0); } }

.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 180px; align-items: end; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar-pair i { width: 42%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 1px 1px; transform-origin: bottom; animation: rise .6s var(--ease-out) both; }
.bar-col span { font-size: .74rem; color: var(--ink-3); }
i.in { background: var(--tanne); }
i.out { background: var(--pappel); }
@keyframes rise { from { transform: scaleY(0); } }
.legend { display: flex; gap: 18px; font-size: .82rem; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Tabellen ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .78rem; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFAF6; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { padding-left: 22px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 22px; }
.card:not(.flush) .tbl th:first-child, .card:not(.flush) .tbl td:first-child { padding-left: 0; }
.card:not(.flush) .tbl th:last-child, .card:not(.flush) .tbl td:last-child { padding-right: 0; }
.card:not(.flush) .tbl th { background: none; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; }
.tbl.compact td { padding-top: 6px; padding-bottom: 6px; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.muted td { color: var(--ink-3); }
.tbl tr.off td { opacity: .5; }
.rowlink { cursor: pointer; transition: background-color .12s; }
.rowlink:hover { background: #FBF7EF; }
.tbl a { text-decoration: none; }
.qty { font-family: var(--f-display); font-weight: 700; color: var(--tanne); width: 3.2em; }
.size { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; }
.wish { display: inline-block; background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 1px 7px; font-size: .86rem; margin-top: 3px; }
.thumb { width: 60px; }
.thumb img, .noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.noimg { display: grid; place-items: center; background: var(--pappel-hell); color: var(--ink-3); }
.sums { width: 100%; max-width: 340px; margin: 14px 0 0 auto; border-collapse: collapse; font-size: .92rem; }
.sums td { padding: 3px 0; }
.sums td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sums .grand td { border-top: 1.5px solid var(--tanne); padding-top: 7px; font-family: var(--f-display); font-weight: 800; color: var(--tanne); font-size: 1.1rem; }
.sums .open td { color: var(--warn); font-weight: 600; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.plain li:last-child { border-bottom: 0; }
.plain a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.plain b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .88rem; display: grid; gap: 8px; }
.timeline li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.timeline time { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 8.5em; }
.timeline small { flex-basis: 100%; padding-left: 9em; }

/* ---------- Plaketten ---------- */
.pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: 1px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.6; vertical-align: 1px; }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.amber { background: var(--warn-bg); color: var(--warn); }
.pill.red { background: var(--err-bg); color: var(--err); }
.pill.blue { background: var(--info-bg); color: var(--info); }
.pill.grey { background: #EEEBE4; color: var(--ink-2); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }

/* ---------- Meldungen ---------- */
.alert { padding: 12px 16px; border-radius: var(--r-s); font-size: .94rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; animation: drop .35s var(--ease-out); }
.alert.ok { background: var(--ok-bg); color: #1F4B2A; }
.alert.err { background: var(--err-bg); color: #7A2619; }
.alert.warn { background: var(--warn-bg); color: #6E420C; }
.alert.info { background: var(--info-bg); color: #1B4255; display: block; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.warn-text { color: var(--warn); font-size: .88rem; font-weight: 600; }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > span:first-child { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field.inline { margin: 0; }
.help { color: var(--ink-3); font-size: .82rem; font-weight: 400; }
.help a { color: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="hidden"]), select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--r-s); padding: 8px 11px; min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]), select { height: 40px; }
input.mini, .bulk select { height: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tanne); box-shadow: 0 0 0 3px rgba(30, 58, 50, .14); }
input[type="color"] { width: 64px; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 3px; background: #fff; }
input[type="file"] { font: inherit; font-size: .88rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--tanne); width: 17px; height: 17px; margin: 0; flex: none; }
input.mini { width: 84px !important; min-height: 34px; padding: 5px 8px; font-variant-numeric: tabular-nums; }
input.wide-mini { width: 120px !important; }
.input-unit { display: flex; align-items: stretch; }
.input-unit input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-unit em { font-style: normal; display: grid; place-items: center; padding: 0 10px; background: var(--pappel-hell); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--ink-2); font-size: .88rem; }
.input-unit.pre-unit em { order: -1; border-left: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r-s) 0 0 var(--r-s); }
.input-unit.pre-unit input { border-radius: 0 var(--r-s) var(--r-s) 0 !important; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: .93rem; margin-bottom: 12px; cursor: pointer; }
.check input { margin-top: 2px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.field.radios { display: grid; gap: 6px; }
.field.radios legend { font-weight: 600; margin-bottom: 6px; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer; }
.radio-row:has(input:checked) { border-color: var(--tanne); background: var(--pappel-hell); }
.radio-row input { margin-top: 3px; accent-color: var(--tanne); }
legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.seg legend { width: 100%; }
.seg label { display: flex; gap: 7px; align-items: center; font-size: .93rem; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.checks-grid legend { grid-column: 1 / -1; }
.row-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.row-form .field { flex: 1; min-width: 160px; }
.row-form > .btn, .row-form > .check { margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type="search"] { width: 280px; }
.filters select { width: auto; }
.del { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); cursor: pointer; }
.del:has(input:checked) { color: var(--err); }
.inline-form { display: inline; margin: 0; }
.tokens { line-height: 2; }
.hint { background: var(--pappel-hell); border-radius: var(--r-s); padding: 10px; font-size: .82rem; margin: 0; white-space: pre-wrap; font-family: var(--f-body); }
details summary { cursor: pointer; font-weight: 600; color: var(--tanne); font-size: .93rem; }
details[open] summary { margin-bottom: 12px; }

/* Schalter */
.switch-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; cursor: pointer; }
.switch-row > span:last-child { display: grid; gap: 2px; font-size: .94rem; }
.switch-row.tight { margin: 0; align-items: center; font-size: .88rem; }
.switch { position: relative; display: inline-flex; flex: none; width: 42px; height: 24px; }
.switch input[type="checkbox"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .knob { position: absolute; inset: 0; background: #CFC8BA; border-radius: 99px; transition: background-color .2s var(--ease-out); }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .22s var(--ease-out); }
.switch input:checked + .knob { background: var(--tanne); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--nuss); outline-offset: 2px; }
.switch.big { width: 52px; height: 30px; }
.switch.big .knob::after { width: 24px; height: 24px; }
.switch.big input:checked + .knob::after { transform: translateX(22px); }

/* Zahlungs-Karten */
.pay-head { display: flex; align-items: center; gap: 14px; margin-bottom: .6rem; }
.pay-head h2 { margin: 0; }
.pay-card .pay-body { transition: opacity .25s var(--ease-out); }
.pay-card.is-off .pay-body { opacity: .5; }
.pay-card.is-off .pay-body:focus-within { opacity: 1; }
.steps { margin: 0 0 16px; padding-left: 1.3em; display: grid; gap: 4px; font-size: .92rem; color: var(--ink-2); background: var(--pappel-hell); border-radius: var(--r-s); padding: 12px 14px 12px 2.1em; }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--tanne); }
.tabs a[aria-current="page"] { color: var(--tanne); border-bottom-color: var(--tanne); }
.nav-list { list-style: none; margin: 0; padding: 6px; }
.nav-list a { display: block; padding: 9px 12px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); font-size: .93rem; }
.nav-list a:hover { background: #FBF7EF; }
.nav-list a[aria-current="page"] { background: var(--pappel-hell); font-weight: 600; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span { padding: 4px 10px; border-radius: 6px; text-decoration: none; font-size: .9rem; }
.pager span { background: var(--tanne); color: #fff; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 600 .93rem/1 var(--f-body);
  background: var(--tanne); color: #fff; border: 1px solid var(--tanne); border-radius: var(--r-s); padding: 10px 16px; min-height: 40px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s, transform .16s var(--ease-out), box-shadow .15s;
}
.btn:hover { background: var(--tanne-2); color: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--tanne); border-color: var(--line-strong); }
.btn.ghost:hover { background: #FBF7EF; border-color: var(--tanne); }
.btn.small { padding: 6px 11px; min-height: 32px; font-size: .86rem; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--err); border-color: var(--err); }
.btn.danger:hover { background: #8A2E20; }
.btn[disabled], .btn.busy { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-col { display: grid; gap: 8px; margin: 4px 0 14px; }
.btn-col form { margin: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--tanne); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.side-foot button.link { text-decoration: none; }
.icon-link { display: inline-flex; padding: 4px; border-radius: 6px; color: var(--ink-2); }
.icon-link:hover { background: var(--pappel-hell); color: var(--tanne); }
.sticky-save { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: linear-gradient(to top, var(--span) 70%, rgba(246, 241, 231, 0)); }

/* ---------- Einzelne Seiten ---------- */
.order-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.order-head p { margin: 0; }
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.addr-grid p { margin: 0 0 .5rem; }
.action-box { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px 2px; margin-bottom: 12px; }
.action-box h3 { display: flex; align-items: center; gap: 7px; }
.action-box .btn { margin-bottom: 14px; }
.card.danger details summary { color: var(--err); }
.pick { list-style: none; padding: 0; margin: 0; }
.pick li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pick li:last-child { border-bottom: 0; }
.pick .check { margin: 0; }
.pick li > span { display: flex; align-items: flex-start; gap: 4px; }
.photos { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photos li { position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); }
.photos .pill { position: absolute; top: 8px; left: 8px; }
.photo-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.photo-actions .icon-only { min-width: 30px; padding-inline: 8px; font-size: 16px; }
.photo-actions label.btn { cursor: pointer; }
.photo-actions form { margin: 0; }
.photo-tag { display: grid; gap: 4px; margin-top: 6px; }
.photo-tag label { display: grid; grid-template-columns: 4.5em 1fr; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.photo-tag select { height: 30px; min-height: 0; padding: 0 6px; font-size: 12px; width: 100%; }
.dropzone { display: flex; align-items: center; gap: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 18px; cursor: pointer; color: var(--ink-2); transition: border-color .15s, background-color .15s; position: relative; }
.dropzone:hover, .dropzone.over { border-color: var(--tanne); background: #FBF7EF; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; background: var(--pappel-hell); border-radius: var(--r-s); margin-bottom: 12px; font-size: .9rem; }
.bulk select { width: auto; min-height: 34px; padding: 5px 8px; }
.variants td { vertical-align: middle; }
.preview-pane { position: sticky; top: 16px; }
.preview-pane iframe { width: 100%; height: calc(100vh - 120px); min-height: 560px; border: 0; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-row img { height: 48px; width: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.mail-preview { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px; font-size: .92rem; background: #FCFAF6; }
.mail-preview .subj { font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.msg.unread { box-shadow: inset 4px 0 0 var(--tanne), var(--shadow); }

/* ---------- Anmeldung & Installation ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--tanne); }
.auth-card { background: #fff; border-radius: 18px; padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.auth-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.auth-card h2 { margin-top: 1.4rem; }
.auth-logo { height: 52px; width: auto; margin-bottom: 1.4rem; }
.auth-card form > label:not(.field):not(.check), .auth-card .row2 > label { display: grid; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.auth-card .alert { margin-bottom: 14px; }
.auth-card .btn { margin-top: 6px; }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; font-size: .88rem; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--err); font-weight: 600; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-grid, .split, .split.narrow-left, .grid-2, .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); }
  .preview-pane { position: static; }
  .preview-pane iframe { height: 80vh; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(20, 41, 36, .4); z-index: 20; }
  .main { margin-left: 0; }
  .side-toggle { display: inline-flex; background: none; border: 0; padding: 6px; margin-left: -6px; color: var(--tanne); cursor: pointer; }
  .top { padding: 14px 16px 4px; }
  .top h1 { font-size: 1.3rem; }
  .who { display: none; }
  .content { padding: 10px 16px 48px; }
  .card { padding: 16px; }
  .card-head.pad { padding: 14px 16px 6px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
  .hide-s { display: none; }
  .row3, .fields-grid, .addr-grid { grid-template-columns: minmax(0, 1fr); }
  .filters input[type="search"] { width: 100%; }
  .filters .spacer { display: none; }
  .timeline small { padding-left: 0; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi strong { font-size: 1.45rem; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .checks { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .side, .top .side-toggle, .sticky-save, .btn, form.filters { display: none !important; }
  .main { margin: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* Zugänge & Rechte */
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.roles legend, .perms legend { grid-column: 1 / -1; }
.role-opt { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 10px 12px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.role-opt span { display: grid; gap: 2px; font-size: .92rem; }
.role-opt small { color: var(--ink-3); }
.role-opt:has(input:checked) { border-color: var(--tanne); background: #FBF7EF; box-shadow: inset 0 0 0 1px var(--tanne); }
.role-opt input { margin-top: 2px; }
.perms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.perms:disabled { opacity: .55; }
@media (max-width: 860px) { .perms { grid-template-columns: minmax(0, 1fr); } }

/* Kärtchen-Listen und Auswahl zum Anklicken */
.flabel { display: block; font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: #fff; cursor: text; transition: border-color .15s ease; }
.chips:focus-within { border-color: var(--tanne); box-shadow: 0 0 0 3px rgba(30, 58, 50, .12); }
.chips.bad { border-color: var(--err); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.chips input:not([type="checkbox"]) { flex: 1 1 180px; border: 0 !important; box-shadow: none !important; height: 30px !important; min-height: 0; padding: 0 4px; background: transparent; outline: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--pappel-hell); color: var(--tanne-deep); font-size: 13px; font-weight: 600; }
.chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }
.chip button:hover { background: rgba(30, 58, 50, .12); }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; background: #fff; transition: background-color .15s ease, color .15s ease; }
.pick input:checked + span { background: var(--tanne); border-color: var(--tanne); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--tanne); outline-offset: 2px; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { display: grid; gap: 6px; justify-items: center; cursor: pointer; font-size: 13px; font-weight: 600; }
.swatch input { position: absolute; opacity: 0; }
.swatch .sw { position: relative; width: 120px; height: 80px; border-radius: 10px; border: 2px solid var(--line-strong); overflow: hidden; }
.swatch .sw i { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 28px; border-radius: 6px; }
.swatch .sw b { position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--tanne); }
.swatch input:checked + .sw { border-color: var(--tanne); box-shadow: 0 0 0 3px rgba(30, 58, 50, .18); }
.swatch input:focus-visible + .sw { outline: 2px solid var(--tanne); outline-offset: 3px; }
.counter { display: block; text-align: right; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.counter.over { color: var(--err); font-weight: 600; }

/* Postausgang */
.mail-view { overflow: hidden; background: #F3F1ED; }
.mail-view iframe { display: block; width: 100%; height: 78vh; min-height: 560px; border: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--ink-3); font-size: .88rem; }
.facts dd { margin: 0; word-break: break-word; }

/* Statistik */
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--err); }
.chart { position: relative; padding-left: 0; }
.chart svg { display: block; width: 100%; height: 246px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .b path { fill: var(--tanne); transition: fill .15s ease; }
.chart .b .hit { fill: transparent; }
.chart .b:hover path, .chart .b.on path { fill: var(--nuss); }
.chart .axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: -18px; }
.chart .ymax { position: absolute; top: -4px; left: 4px; font-size: 11px; color: var(--ink-3); background: var(--card); padding: 0 4px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--tanne-deep); color: #fff; font-size: 12.5px; line-height: 1.35; padding: 7px 10px; border-radius: 8px; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.chart .tip b { display: block; font-weight: 700; }
.ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ranks li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 6px; font-size: .92rem; isolation: isolate; }
.ranks .bar { position: absolute; inset: 0 auto 0 0; background: var(--pappel-hell); border-radius: 6px; z-index: -1; }
.ranks .n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--tanne); }
.ranks a { color: inherit; }
h3.sub { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; }
.devices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dev { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border-radius: var(--r-s); background: var(--span); color: var(--tanne); }
.dev strong { font-family: var(--f-display); font-size: 1.6rem; }
.dev span { font-size: .84rem; color: var(--ink-2); }
.opt-editor { display: grid; gap: 10px; margin: 10px 0 14px; justify-items: start; }
.opt-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: start; width: 100%; }
.opt-row .opt-name { font-weight: 600; }
.opt-row .chip { cursor: pointer; }
.opt-row .chip .t:hover { text-decoration: underline; }
@media (max-width: 700px) { .opt-row { grid-template-columns: 1fr auto; } .opt-row .chips { grid-column: 1 / -1; grid-row: 2; } }

/* Texteditor */
.rte { border: 1px solid var(--line-strong); border-radius: var(--r-s); background: #fff; overflow: hidden; }
.rte:focus-within { border-color: var(--tanne); box-shadow: 0 0 0 3px rgba(30, 58, 50, .12); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: #FAFAF8; position: sticky; top: 0; z-index: 1; }
.rte-bar button { font: inherit; font-size: .84rem; border: 0; background: none; color: var(--ink-2); padding: 5px 9px; border-radius: 6px; cursor: pointer; min-width: 32px; transition: background-color .15s var(--ease-out); }
.rte-bar button:hover { background: rgba(30, 58, 50, .07); color: var(--ink); }
.rte-bar button.on { background: var(--tanne); color: #fff; }
.rte-bar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.rte-area { padding: 12px 16px; outline: none; line-height: 1.6; font-size: .95rem; max-height: 70vh; overflow-y: auto; }
.rte-area > :first-child { margin-top: 0; }
.rte-area p { margin: 0 0 .8em; }
.rte-area h2 { font-family: var(--f-display); font-size: 1.2rem; margin: 1.1em 0 .4em; color: var(--tanne); }
.rte-area h3 { font-size: 1rem; margin: 1em 0 .3em; color: var(--tanne); }
.rte-area ul { margin: 0 0 .8em; padding-left: 1.3em; }
.rte-area a { color: var(--tanne); text-decoration: underline; }
.token-bar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: -4px 0 14px; }
.token { font: inherit; font-size: .78rem; border: 1px solid var(--line-strong); background: #fff; color: var(--tanne); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.token:hover { background: var(--tanne); color: #fff; border-color: var(--tanne); }
.mail-subj { margin: 0 0 10px; }
.mail-frame { display: block; width: 100%; height: 680px; border: 1px solid var(--line); border-radius: var(--r-s); background: #F3F1ED; }

/* Google-Vorschau */
.seo-box { border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 14px; margin-top: 14px; background: #FCFCFB; }
.seo-box > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--tanne); display: flex; gap: 8px; align-items: center; list-style: none; }
.seo-box > summary::-webkit-details-marker { display: none; }
.seo-box[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.serp { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; font-family: Arial, sans-serif; max-width: 640px; }
.serp-url { font-size: 13px; color: #202124; }
.serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin: 4px 0 3px; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; }
td .seo-box { margin-top: 8px; font-size: .9rem; }
.howto { margin-top: 12px; }
.howto > summary { cursor: pointer; font-weight: 600; color: var(--tanne); margin-bottom: 8px; }
