/* Verwaltung im Stil des Shopify-Admins: dunkle Kopfleiste, graue Seitenleiste, weiße Karten, dichte Tabellen. Keine Bibliothek. */
:root {
  --bg: #f1f1f1; --surface: #fff; --hover: #f7f7f7; --pressed: #f1f1f1; --sunken: #f7f7f7;
  --nav: #ebebeb; --top: #1a1a1a; --top-field: #303030;
  --text: #303030; --text-2: #616161; --text-3: #8a8a8a; --line: #ebebeb; --line-2: #e3e3e3; --field: #8a8a8a;
  --focus: #005bd3; --critical: #8e0b21; --link: #005bd3;
  --card-shadow: 0 1px 0 rgba(26, 26, 26, .07), inset 0 1px 0 rgba(204, 204, 204, .5), inset 0 -1px 0 rgba(0, 0, 0, .17), inset 1px 0 0 rgba(0, 0, 0, .13), inset -1px 0 0 rgba(0, 0, 0, .13);
  --card-shadow: 0 1px 0 rgba(26, 26, 26, .07), 0 0 0 1px rgba(0, 0, 0, .08);
  --pop-shadow: 0 4px 6px -2px rgba(26, 26, 26, .2), 0 0 0 1px rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/20px var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.crit { color: var(--critical); }
.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { font-size: 16px; line-height: 1; vertical-align: -3px; }

/* Text-Stile (Tailwind-Stufen) */
.h-page { font-size: 20px; line-height: 28px; font-weight: 600; }
.h-card { font-size: 14px; line-height: 20px; font-weight: 600; }
.t-lg { font-size: 16px; line-height: 24px; }
.t-sm { font-size: 12px; line-height: 16px; }
.strong { font-weight: 600; }
.medium { font-weight: 500; }

/* ---------- Rahmen ---------- */
.skip { position: fixed; left: 16px; top: 8px; z-index: 100; transform: translateY(-64px); transition: transform .3s var(--ease); }
.skip:focus { transform: none; }
.top { position: fixed; inset: 0 0 auto; height: 56px; z-index: 40; background: var(--top); color: #e3e3e3; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: #fff; color: var(--top); display: grid; place-items: center; font-size: 16px; flex: none; }
.brand span:last-child { white-space: nowrap; }
.topsearch { flex: 1; display: flex; justify-content: center; }
.topsearch label { position: relative; width: min(100%, 560px); display: block; }
.topsearch .i { position: absolute; left: 12px; top: 8px; color: #b5b5b5; }
.topsearch input { width: 100%; height: 36px; border-radius: 12px; border: 1px solid #4a4a4a; background: var(--top-field); color: #fff; padding: 8px 12px 8px 36px; outline: none;
  transition: border-color .3s var(--ease), background-color .3s var(--ease); }
.topsearch input::placeholder { color: #b5b5b5; }
.topsearch input:focus { border-color: #8a8a8a; background: #3a3a3a; }
.toptools { display: flex; align-items: center; gap: 8px; }
.topbtn { height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: #e3e3e3; cursor: pointer;
  font-size: 12px; font-weight: 500; transition: background-color .3s var(--ease); }
.topbtn:hover { background: #303030; }
.topbtn .dot { width: 8px; height: 8px; border-radius: 9999px; background: #8a8a8a; }
.topbtn .dot.ok { background: #29845a; } .topbtn .dot.err { background: #e51c00; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: #36fba1; color: #0c5132; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.top .menubtn { display: none; }

.side { position: fixed; top: 56px; bottom: 0; left: 0; width: 240px; z-index: 30; background: var(--nav); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; color: var(--text); font-weight: 500; text-decoration: none;
  transition: background-color .2s var(--ease); }
.nav:hover { background: #f1f1f1; text-decoration: none; }
.nav .i { font-size: 20px; color: #4a4a4a; }
.nav[aria-current="page"] { background: #fafafa; font-weight: 600; box-shadow: 0 1px 0 rgba(0, 0, 0, .05); }
.nav[aria-current="page"] .i { color: var(--text); }
.nav .count { margin-left: auto; font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: #e3e3e3; }
.nav .count.hot { background: #fedad9; color: var(--critical); }
.side .grow { flex: 1; }
.side hr { border: 0; border-top: 1px solid #d4d4d4; margin: 8px; }

.main { margin: 56px 0 0 240px; padding: 24px 32px 96px; min-height: calc(100vh - 56px); }
.page { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; animation: enter .5s var(--ease) both; }
.page.wide { max-width: 1600px; }
.page.narrow { max-width: 960px; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* Kopf einer Seite */
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 32px; }
.phead .title { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.phead .title .i { font-size: 20px; }
.phead .sub { flex-basis: 100%; margin-top: -4px; color: var(--text-2); }
.back { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text); flex: none; }
.back:hover { background: #e3e3e3; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Karten und Raster ---------- */
.card { background: var(--surface); border-radius: 12px; box-shadow: var(--card-shadow); min-width: 0; }
.card > .pad { padding: 16px; }
.card .chead { display: flex; align-items: center; gap: 8px; padding: 16px 16px 0; }
.card .chead + .pad { padding-top: 12px; }
.card .chead .h-card { margin-right: auto; }
.card .cfoot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: background-color .2s var(--ease); }
a.kpi:hover { background: var(--hover); text-decoration: none; }
.kpi .label { color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.kpi .value { font-size: 24px; line-height: 32px; font-weight: 600; }
.kpi .delta { font-size: 12px; line-height: 16px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.kpi .delta.bad { color: var(--critical); }
.divide > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
a.list-row:hover, button.list-row:hover { background: var(--hover); text-decoration: none; }
button.list-row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.list-row .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #f1f1f1; flex: none; font-size: 16px; color: #4a4a4a; }
.ico.crit { background: #fedad9; color: var(--critical); } .ico.warn { background: #ffef9d; color: #4f4700; } .ico.info { background: #e0f0ff; color: #00527c; } .ico.ok { background: #cdfee1; color: #0c5132; }

/* ---------- Buttons ---------- */
.btn { height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 12px; border-radius: 8px; border: 0; cursor: pointer; white-space: nowrap;
  font-size: 12px; line-height: 16px; font-weight: 600; text-decoration: none; color: var(--text); background: #fff;
  box-shadow: inset 0 -1px 0 #b5b5b5, inset 0 0 0 1px rgba(0, 0, 0, .1), inset 0 1px 0 #fff;
  transition: background-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { background: #fafafa; text-decoration: none; }
.btn:active { background: #f7f7f7; transform: translateY(1px); box-shadow: inset 0 2px 1px rgba(26, 26, 26, .2), inset 0 0 0 1px rgba(0, 0, 0, .12); }
.btn .i { font-size: 16px; }
.btn.primary { background: #303030; color: #fff; box-shadow: inset 0 -1px 0 1px rgba(0, 0, 0, .8), inset 0 0 0 1px #303030, inset 0 1px 0 1px rgba(255, 255, 255, .25); }
.btn.primary:hover { background: #1a1a1a; }
.btn.primary:active { background: #1a1a1a; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .6); }
.btn.danger { background: #c70a24; color: #fff; box-shadow: inset 0 -1px 0 1px rgba(0, 0, 0, .3), inset 0 0 0 1px #a50b1f, inset 0 1px 0 1px rgba(255, 255, 255, .25); }
.btn.danger:hover { background: #a50b1f; }
.btn.plain { background: transparent; box-shadow: none; color: var(--link); padding: 4px 8px; height: 28px; }
.btn.plain:hover { background: #f1f1f1; }
.btn.tert { background: transparent; box-shadow: none; }
.btn.tert:hover { background: #ebebeb; }
.btn.icon { width: 28px; height: 28px; padding: 0; background: transparent; box-shadow: none; color: #4a4a4a; }
.btn.icon:hover { background: #ebebeb; }
.btn.icon .i { font-size: 18px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn.sm { height: 28px; padding: 4px 8px; }
.seg { display: inline-flex; padding: 2px; border-radius: 10px; background: #ebebeb; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 8px; height: 28px; padding: 4px 12px; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 4px; align-items: center;
  transition: background-color .2s var(--ease); }
.seg button[aria-pressed="true"] { background: #fff; font-weight: 600; box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .06); }

/* Menüs: Popover über <details> */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 220px; background: #fff; border-radius: 12px; box-shadow: var(--pop-shadow); padding: 6px;
  display: flex; flex-direction: column; animation: pop .2s var(--ease) both; }
.menu-pop.left { left: 0; right: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 0; background: none; color: var(--text); text-align: left;
  cursor: pointer; font-size: 14px; text-decoration: none; white-space: nowrap; }
.menu-pop a:hover, .menu-pop button:hover { background: #f1f1f1; text-decoration: none; }
.menu-pop .i { color: #4a4a4a; }
.menu-pop .hint { font-size: 12px; color: var(--text-2); padding: 4px 8px 2px; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu-pop .crit, .menu-pop .crit .i { color: var(--critical); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 2px 8px; border-radius: 8px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  background: #e3e3e3; color: #303030; }
.badge .i { font-size: 12px; }
.badge.info { background: #e0f0ff; color: #00527c; }
.badge.success { background: #cdfee1; color: #0c5132; }
.badge.success-strong { background: #29845a; color: #fff; }
.badge.warning { background: #ffd6a4; color: #5e4200; }
.badge.attention { background: #ffef9d; color: #4f4700; }
.badge.critical { background: #fedad9; color: #8e0b21; }
.badge.magic { background: #f2e6ff; color: #5700d1; }
.badge.quiet { background: transparent; box-shadow: inset 0 0 0 1px #e3e3e3; color: var(--text-2); }
/* Status als Auswahl, sieht aus wie ein Badge */
select.badge { appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; padding-right: 20px; height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23303030' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 12px; }

/* ---------- Tabellen (Index-Ansicht) ---------- */
.ibar { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: 12px; font-weight: 500; transition: background-color .2s var(--ease), color .2s var(--ease); }
.tab:hover { background: #f1f1f1; color: var(--text); }
.tab[aria-selected="true"] { background: #e3e3e3; color: var(--text); font-weight: 600; }
.tab .n { color: var(--text-3); font-weight: 500; }
.tab .n.hot { color: var(--critical); }
.isearch { position: relative; flex: 0 1 280px; min-width: 160px; }
.isearch .i { position: absolute; left: 8px; top: 6px; color: var(--text-2); }
.isearch input { width: 100%; height: 28px; border: 1px solid transparent; border-radius: 8px; background: #f1f1f1; padding: 4px 8px 4px 28px; font-size: 12px; outline: none;
  transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.isearch input:focus { background: #fff; border-color: var(--field); }
.tbl-wrap { overflow-x: auto; }
table.idx { width: 100%; border-collapse: collapse; }
.idx th { position: sticky; top: 0; background: var(--sunken); color: var(--text-2); font-size: 12px; line-height: 16px; font-weight: 500; text-align: left; padding: 8px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line); }
.idx th.num { text-align: right; }
.idx td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.idx tbody tr:last-child td { border-bottom: 0; }
.idx tbody tr[data-href] { cursor: pointer; transition: background-color .15s var(--ease); }
.idx tbody tr[data-href]:hover { background: var(--hover); }
.idx tbody tr.sel { background: #f1f1f1; }
.idx .cb { width: 32px; padding-right: 0; }
.idx .act { width: 1%; white-space: nowrap; text-align: right; }
.idx .firma { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.idx .firma .name { font-weight: 600; }
.sortbtn { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.sortbtn:hover { color: var(--text); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; object-position: top; background: #f1f1f1; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); flex: none;
  display: grid; place-items: center; color: var(--text-3); }
img.thumb { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: #303030; cursor: pointer; margin: 0; vertical-align: middle; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.ifoot { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12px; }
.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .i { font-size: 40px; color: var(--text-3); }
.empty p { max-width: 420px; color: var(--text-2); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-weight: 500; }
.field small { color: var(--text-2); font-size: 12px; line-height: 16px; }
.input, .select, .textarea { width: 100%; min-height: 32px; border-radius: 8px; border: 1px solid var(--field); border-top-color: #898f94; background: #fdfdfd; padding: 5px 12px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease); }
.input:hover, .select:hover, .textarea:hover { background: #fafafa; border-color: #616161; }
.input:focus, .select:focus, .textarea:focus { background: #fff; border-color: #303030; box-shadow: 0 0 0 1px #303030; }
.input[readonly], .textarea[readonly] { background: var(--sunken); border-color: var(--line-2); }
.input.bad, .textarea.bad { border-color: #e51c00; background: #fff4f4; }
.textarea { resize: vertical; min-height: 64px; line-height: 20px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 6.5l3-3 3 3M5 9.5l3 3 3-3' fill='none' stroke='%234a4a4a' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check input { margin-top: 2px; }
.check.done span { color: var(--text-2); text-decoration: line-through; }
.save { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.save.err { color: var(--critical); }
.banner { border-radius: 12px; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--card-shadow); background: #fff; }
.banner .i { font-size: 20px; flex: none; }
.banner.critical { background: #fff4f4; box-shadow: inset 0 0 0 1px #fedad9; }
.banner.critical .i { color: var(--critical); }
.banner.info { background: #f2f9ff; box-shadow: inset 0 0 0 1px #e0f0ff; }
.banner.info .i { color: #00527c; }
.banner ul { margin: 4px 0 0; padding-left: 16px; }

/* Zeitachse */
.timeline { list-style: none; margin: 0; padding: 0 16px 16px; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; padding: 8px 0; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 11px; top: 28px; bottom: -8px; width: 2px; background: #e3e3e3; }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 24px; height: 24px; border-radius: 8px; background: #e3e3e3; display: grid; place-items: center; font-size: 12px; color: #4a4a4a; }
.timeline .dot.beleg { background: #f2e6ff; color: #5700d1; }
.timeline .dot.anruf, .timeline .dot.besuch { background: #e0f0ff; color: #00527c; }
.timeline .when { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.timeline .txt { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Positionen */
.pos { width: 100%; border-collapse: collapse; }
.pos th { font-size: 12px; font-weight: 500; color: var(--text-2); text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.pos td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pos .w-num { width: 72px; } .pos .w-unit { width: 120px; } .pos .w-price { width: 120px; } .pos .w-sum { width: 112px; text-align: right; padding-top: 14px; }
.pos .input { min-height: 32px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; padding: 12px 16px 16px; margin-left: auto; max-width: 420px; }
.totals .sum { font-weight: 600; border-top: 1px solid var(--line); padding-top: 8px; }
.totals .sep { grid-column: 1 / -1; height: 4px; }

/* Einstellungen: Beschreibung links, Felder rechts */
.setgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 700px) { .setgrid { grid-template-columns: 1fr; } }

/* Website-Karten */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-shot { display: block; aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top; border-radius: 12px 12px 0 0; background: #f1f1f1; }

/* Dialoge */
dialog { border: 0; padding: 0; border-radius: 16px; box-shadow: 0 26px 80px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .06); width: min(560px, calc(100vw - 32px)); color: var(--text); }
dialog[open] { animation: pop .3s var(--ease) both; }
dialog::backdrop { background: rgba(0, 0, 0, .5); animation: fade .3s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.dlg-head .h-card { margin-right: auto; }
.dlg-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.dlg-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* Speicherleiste wie im Shopify-Admin */
.savebar { position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 45; background: #1a1a1a; color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  transform: translateY(-100%); transition: transform .3s var(--ease); }
.savebar.on { transform: none; }
.savebar .grow { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.savebar .btn:not(.primary) { background: #303030; color: #fff; box-shadow: inset 0 0 0 1px #4a4a4a; }
.savebar .btn.primary { background: #fff; color: #303030; box-shadow: none; }

/* Hinweis unten */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: #1a1a1a; color: #fff;
  border-radius: 12px; padding: 12px 16px; font-weight: 500; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px);
  transition: transform .3s var(--ease), opacity .3s var(--ease); }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast.err { background: #8e0b21; }

.skeleton { background: #ebebeb; border-radius: 8px; animation: sk 1.2s var(--ease) infinite alternate; }
@keyframes sk { to { opacity: .5; } }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .top .menubtn { display: inline-flex; }
  .side { top: 56px; width: 100%; background: rgba(235, 235, 235, .96); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); padding: 16px;
    transform: translateX(-100%); transition: transform .4s var(--ease); }
  .side.open { transform: none; }
  .side.open .nav { animation: navin .5s var(--ease) both; }
  .side.open .nav:nth-child(2) { animation-delay: 60ms; } .side.open .nav:nth-child(3) { animation-delay: 120ms; } .side.open .nav:nth-child(4) { animation-delay: 180ms; }
  .side.open .nav:nth-child(5) { animation-delay: 240ms; } .side.open .nav:nth-child(6) { animation-delay: 300ms; } .side.open .nav:nth-child(n+7) { animation-delay: 360ms; }
  .main { margin-left: 0; padding: 16px 16px 96px; }
  .topsearch { display: none; }
  .hide-md { display: none; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@keyframes navin { from { opacity: 0; transform: translateY(24px); } }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr) !important; }
  /* Positionen als Block: Beschreibung oben, Zahlen darunter */
  .pos thead { display: none; }
  .pos tr { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
  .pos td { border: 0; padding: 0; width: auto !important; }
  .pos td:first-child { grid-column: 1 / -1; }
  .pos .w-sum { padding-top: 6px; }
  .toptools .label { display: none; }
  .phead .actions { width: 100%; }
  .pos .w-unit, .pos .c-unit { display: none; }
  .idx .firma { min-width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print { .top, .side, .toast, .savebar { display: none; } .main { margin: 0; } }

/* Konten und Auswertung */
summary.avatar { cursor: pointer; list-style: none; }
summary.avatar::-webkit-details-marker { display: none; }
.sel-sm { width: auto; min-height: 28px; height: 28px; padding-top: 2px; padding-bottom: 2px; }
