/* Boxenstopp – Mockup-Styles. Dunkel als Standard, hell über [data-theme="light"]. */
:root {
  --bg: #0e1014;
  --bg-2: #12151b;
  --surface: #171a21;
  --surface-2: #1e222b;
  --surface-3: #262b36;
  --border: #2a303c;
  --border-strong: #3a4150;
  --text: #e8eaef;
  --muted: #9aa3b2;
  --faint: #6b7383;
  /* Akzent: je Farbtheme ein Wert für Dunkel (-d) und Hell (-l) */
  --accent-d: #f59e0b; --accent-l: #c2410c; --accent-ink-d: #1a1204; --accent-ink-l: #ffffff;
  --accent: var(--accent-d);
  --accent-2: var(--accent);
  --accent-ink: var(--accent-ink-d);
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  /* Glass (Design V2) – werden per JS gesetzt */
  --glass: 62%;
  --blur: 16px;
  --dim: .25;
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .14);
  --warn: #eab308;
  --warn-soft: rgba(234, 179, 8, .15);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, .14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .15);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #eceef2;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceff3;
  --border: #e1e4ea;
  --border-strong: #cdd2db;
  --text: #171a21;
  --muted: #5d6676;
  --faint: #8b93a1;
  --accent: var(--accent-l);
  --accent-ink: var(--accent-ink-l);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --ok: #16a34a;
  --warn: #ca8a04;
  --bad: #dc2626;
  --info: #2563eb;
  --violet: #7c3aed;
  --shadow: 0 10px 30px rgba(20, 24, 33, .12);
  color-scheme: light;
}
/* Farbthemes */
:root[data-accent="ocean"]   { --accent-d: #38bdf8; --accent-l: #0369a1; --accent-ink-d: #04212f; }
:root[data-accent="emerald"] { --accent-d: #34d399; --accent-l: #047857; --accent-ink-d: #052e1f; }
:root[data-accent="rose"]    { --accent-d: #fb7185; --accent-l: #be123c; --accent-ink-d: #3b0a14; }
:root[data-accent="indigo"]  { --accent-d: #818cf8; --accent-l: #4338ca; --accent-ink-d: #111338; }
:root[data-accent="racing"]  { --accent-d: #f87171; --accent-l: #b91c1c; --accent-ink-d: #2b0707; }
:root[data-accent="lime"]    { --accent-d: #a3e635; --accent-l: #4d7c0f; --accent-ink-d: #1a2e05; }
:root[data-accent="mono"]    { --accent-d: #e5e7eb; --accent-l: #27272a; --accent-ink-d: #111111; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Mockup-Banner ---------- */
.mock-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 6px 16px; font-size: 12px;
  background: repeating-linear-gradient(135deg, #f59e0b 0 14px, #e08e00 14px 28px);
  color: #1a1204; font-weight: 600;
}
.mock-banner select { font: inherit; padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(0,0,0,.3); background: rgba(255,255,255,.85); color: #1a1204; }
.mock-banner .spacer { flex: 1; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 14px 10px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; min-width: 0; }
.brand > div:last-child { min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark.img { background: transparent; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark.lg { width: 64px; height: 64px; border-radius: 14px; }
.brand-mark.lg svg { width: 34px; height: 34px; }
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.brand-firm { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group { margin-top: 12px; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 6px 10px; font-weight: 650; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px;
  color: var(--muted); font-weight: 500;
}
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11px; background: var(--surface-3); color: var(--text); padding: 0 6px; border-radius: 10px; }
.nav a.active .count { background: var(--accent); color: var(--accent-ink); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.search {
  flex: 1; max-width: 480px; position: relative;
}
.search input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.search-results a { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; }
.search-results a:hover { background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 700; }
.duty-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
}
.duty-btn .led { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.duty-btn.on { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-soft); }
.duty-btn.on .led { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.duty-btn .ic { display: none; }
.duty-btn .ic svg { width: 16px; height: 16px; }
@media (max-width: 900px) { .duty-btn .ic { display: inline-flex; } }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.user-chip .who { font-size: 12px; line-height: 1.15; }
.user-chip .who small { display: block; font-size: 11px; }
#menuToggle { display: none; }

.content { padding: 22px clamp(14px, 2vw, 32px) 60px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.page-head .crumbs a:hover { color: var(--text); }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Bausteine ---------- */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 14px; flex: 1; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-body { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .delta { font-size: 12px; margin-top: 2px; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--bad); }
.kpi.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 550; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-tag { font-size: 11.5px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); white-space: nowrap; }

.plate {
  font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .06em; white-space: nowrap;
  padding: 1px 7px 1px 12px; border-radius: 4px; background: #f6f6f2; color: #111; border: 1px solid #c9c9c0; position: relative;
}
.plate::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 3px 0 0 3px; background: var(--accent); }
.plate.lg { font-size: 18px; padding: 3px 12px 3px 18px; }
.plate.lg::before { width: 8px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--surface-3);
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }
.person { display: inline-flex; align-items: center; gap: 8px; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tr.clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table .sub { display: block; font-size: 12px; color: var(--muted); }
.table tr.dim td { opacity: .55; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a .count { font-size: 11px; background: var(--surface-3); padding: 0 6px; border-radius: 10px; margin-left: 4px; color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a, .seg button { padding: 6px 12px; color: var(--muted); font: inherit; font-weight: 550; background: none; border: 0; cursor: pointer; border-right: 1px solid var(--border); }
.seg a:last-child, .seg button:last-child { border-right: 0; }
.seg .active { background: var(--accent-soft); color: var(--accent); }

/* Formulare */
.form { display: grid; gap: 14px; }
.form.cols-2 { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--faint); }
input.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit;
}
textarea.input { min-height: 80px; resize: vertical; }
input.input:focus, select.input:focus, textarea.input:focus, .search input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.switch:last-child { border-bottom: 0; }
.switch .txt small { display: block; }
.toggle { width: 38px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; cursor: pointer; border: 1px solid var(--border); flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .15s; }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { left: 18px; background: var(--accent-ink); }

/* Listen */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { font-size: 12px; color: var(--muted); }
a.list-item:hover { background: var(--surface-2); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Hinweise */
.note { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.note.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.note.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.note.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

/* Fortschritt / Balken */
.bar { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.meter { display: grid; grid-template-columns: 90px 1fr 42px; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; }

/* Status-Stepper */
.stepper { display: flex; gap: 0; overflow-x: auto; }
.step { flex: 1; min-width: 110px; padding: 10px 12px; border-top: 3px solid var(--surface-3); font-size: 12px; color: var(--faint); }
.step b { display: block; font-size: 12.5px; color: var(--muted); }
.step.done { border-top-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.step.done b { color: var(--text); }
.step.current { border-top-color: var(--accent); }
.step.current b { color: var(--accent); }

/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl-item.muted::before { border-color: var(--faint); }
.tl-item .when { font-size: 12px; color: var(--muted); }
.tl-item .what { font-weight: 600; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 300px; }
.kcol.drop { border-color: var(--accent); background: var(--accent-soft); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 650; font-size: 13px; }
.kcol-head .count { margin-left: auto; font-size: 11.5px; color: var(--muted); background: var(--surface-2); padding: 0 7px; border-radius: 10px; }
.kcol-head .d { width: 8px; height: 8px; border-radius: 50%; }
.kcol-body { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; cursor: grab; display: block; }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: .4; }
.kcard .top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kcard .no { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.kcard .veh { font-weight: 600; margin: 7px 0 2px; }
.kcard .cust { font-size: 12px; color: var(--muted); }
.kcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; font-size: 12px; }
.kcard .due.late { color: var(--bad); font-weight: 600; }

/* Matrix */
.matrix th, .matrix td { text-align: center; padding: 7px 8px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix th:first-child { background: var(--surface-2); }
.lvl { display: inline-block; min-width: 92px; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; cursor: pointer; border: 1px solid transparent; user-select: none; }
.lvl-0 { background: var(--surface-3); color: var(--faint); }
.lvl-1 { background: var(--violet-soft); color: var(--violet); }
.lvl-2 { background: var(--info-soft); color: var(--info); }
.lvl-3 { background: var(--ok-soft); color: var(--ok); }
.lvl-4 { background: var(--accent-soft); color: var(--accent); }
.lvl.locked { cursor: default; opacity: .9; }
.qdot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; }
.qdot.ok { background: var(--ok); }
.qdot.warn { background: var(--warn); }
.qdot.bad { background: var(--bad); }
.qdot.none { background: transparent; border: 2px dashed var(--border-strong); }
.qdot.req { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Wochenplan */
.week { display: grid; grid-template-columns: 130px repeat(7, minmax(110px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.week > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; min-height: 74px; }
.week .wh { background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--muted); min-height: 0; }
.week .wh.today { color: var(--accent); }
.week .bay { background: var(--surface-2); font-weight: 650; font-size: 12.5px; }
.week .cell.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.appt { display: block; font-size: 11.5px; padding: 5px 7px; border-radius: 6px; background: var(--info-soft); border-left: 3px solid var(--info); margin-bottom: 5px; }
.appt.order { background: var(--accent-soft); border-left-color: var(--accent); }
.appt b { display: block; font-size: 11.5px; }

/* Rechnung / Druckansicht */
.paper { background: #fff; color: #16181d; border-radius: 6px; padding: 40px 44px; box-shadow: var(--shadow); max-width: 820px; }
.paper .muted { color: #6b7280; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.paper th, .paper td { padding: 8px 6px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 13px; }
.paper th { font-size: 11px; text-transform: uppercase; color: #6b7280; letter-spacing: .05em; }
.paper .tot td { border: 0; padding: 4px 6px; }
.paper .grand td { font-size: 17px; font-weight: 800; border-top: 2px solid #16181d; padding-top: 10px; }
.paper .brand-mark { width: 46px; height: 46px; border-radius: 10px; }
.paper .stamp { display: inline-block; border: 3px solid #16a34a; color: #16a34a; font-weight: 800; padding: 4px 12px; border-radius: 6px; transform: rotate(-6deg); letter-spacing: .1em; }
.paper .stamp.open { border-color: #d97706; color: #d97706; }
.paper .stamp.cancel { border-color: #dc2626; color: #dc2626; }
.paper .plate { background: #f6f6f2; }
.paper h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; margin: 22px 0 4px; }

/* Preisliste Kundenansicht */
.pl-cat { margin-top: 22px; }
.pl-cat h3 { border-bottom: 2px solid #16181d; padding-bottom: 6px; color: #16181d; font-size: 14px; }
.pl-row { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dotted #d1d5db; }
.pl-row .n { flex: 1; }
.pl-row .n small { display: block; color: #6b7280; }
.pl-row .p { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Diagramme */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; flex: 1; min-width: 160px; }
.donut-legend div { display: flex; gap: 8px; align-items: center; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Modal & Toast */
.overlay { position: fixed; inset: 0; background: rgba(5, 6, 9, .6); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
.toast-host { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13px; max-width: 360px; display: flex; gap: 8px; align-items: center; animation: tin .2s ease-out; }
.toast .d { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 300px; z-index: 40; padding: 6px; }
.dropdown .list-item { padding: 9px 10px; border-radius: 6px; border: 0; }
.dropdown .list-item:hover { background: var(--surface-2); }
.rel { position: relative; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; padding-bottom: 22px; }

/* ---------- Darstellung: Auswahl-Kacheln ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.choice { border: 2px solid var(--border); border-radius: 12px; padding: 10px; cursor: pointer; background: var(--surface-2); text-align: left; color: var(--text); font: inherit; }
.choice:hover { border-color: var(--border-strong); }
.choice.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice b { display: block; margin-top: 8px; }
.choice small { color: var(--muted); }
.preview { height: 92px; border-radius: 8px; overflow: hidden; position: relative; display: grid; grid-template-columns: 26% 1fr; gap: 5px; padding: 6px; background: #0e1014; }
.preview i { display: block; border-radius: 5px; background: #1e222b; }
.preview .pv-main { display: grid; grid-template-rows: 14px 1fr 1fr; gap: 5px; }
.preview.glass { background: linear-gradient(135deg, #1e1b4b, #9d174d 55%, #f59e0b); }
.preview.glass i { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); position: relative; }
.swatch.active { box-shadow: 0 0 0 2px var(--text); }
.swatch.active::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.bg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.bg-tile { height: 74px; border-radius: 10px; border: 2px solid var(--border); cursor: pointer; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.bg-tile span { position: absolute; left: 6px; bottom: 5px; font-size: 11px; font-weight: 650; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.bg-tile.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.range { display: grid; grid-template-columns: 150px 1fr 56px; gap: 12px; align-items: center; padding: 8px 0; }
.range input { width: 100%; accent-color: var(--accent); }
.range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.logo-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-pick { cursor: pointer; border: 2px solid transparent; border-radius: 12px; padding: 2px; background: none; }
.logo-pick.active { border-color: var(--accent); }

/* ---------- Design V2 „Glass“ ---------- */
#bg { position: fixed; inset: 0; z-index: -1; display: none; background-size: cover; background-position: center; }
#bg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--dim)); }
:root[data-theme="light"] #bg::after { background: rgba(255, 255, 255, var(--dim)); }
:root[data-ui="v2"] #bg { display: block; }
:root[data-ui="v2"] body { background: transparent; }
:root[data-ui="v2"] {
  --glass-surface: color-mix(in srgb, var(--surface) var(--glass), transparent);
  --glass-surface-2: color-mix(in srgb, var(--surface-2) calc(var(--glass) * .7), transparent);
  --glass-border: rgba(255, 255, 255, .13);
}
:root[data-ui="v2"][data-theme="light"] { --glass-border: rgba(255, 255, 255, .55); }
:root[data-ui="v2"] .card,
:root[data-ui="v2"] .sidebar,
:root[data-ui="v2"] .topbar,
:root[data-ui="v2"] .kcol,
:root[data-ui="v2"] .week,
:root[data-ui="v2"] .page-head,
:root[data-ui="v2"] .tabs,
:root[data-ui="v2"] .login .card {
  background: var(--glass-surface);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  border-color: var(--glass-border);
}
:root[data-ui="v2"] .card .card { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-surface-2); }
:root[data-ui="v2"] .page-head { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--glass-border); }
:root[data-ui="v2"] .tabs { border-radius: var(--radius); padding: 0 6px; border: 1px solid var(--glass-border); }
:root[data-ui="v2"] .sidebar { border-right-color: var(--glass-border); }
:root[data-ui="v2"] .kcard, :root[data-ui="v2"] .week > div, :root[data-ui="v2"] .rule-link, :root[data-ui="v2"] .tune-opt, :root[data-ui="v2"] .pkg, :root[data-ui="v2"] .fleet-chip, :root[data-ui="v2"] .dash-tools, :root[data-ui="v2"] .leg, :root[data-ui="v2"] .table th, :root[data-ui="v2"] .table tfoot td,
:root[data-ui="v2"] .btn, :root[data-ui="v2"] .seg, :root[data-ui="v2"] .icon-btn, :root[data-ui="v2"] .user-chip, :root[data-ui="v2"] .duty-btn,
:root[data-ui="v2"] .search input, :root[data-ui="v2"] input.input, :root[data-ui="v2"] select.input, :root[data-ui="v2"] textarea.input, :root[data-ui="v2"] .note {
  background: var(--glass-surface-2); border-color: var(--glass-border);
}
:root[data-ui="v2"] .btn.primary { background: var(--accent); border-color: var(--accent); }
:root[data-ui="v2"] .matrix td:first-child, :root[data-ui="v2"] .matrix th:first-child { background: transparent; }
:root[data-ui="v2"] .modal, :root[data-ui="v2"] .dropdown, :root[data-ui="v2"] .search-results {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-color: var(--glass-border);
}
:root[data-ui="v2"] .nav a svg { opacity: 1; }
:root[data-ui="v2"] .content > p, :root[data-ui="v2"] .legend { text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
:root[data-ui="v2"][data-theme="light"] .content > p, :root[data-ui="v2"][data-theme="light"] .legend { text-shadow: 0 1px 3px rgba(255, 255, 255, .8); }
@media (max-width: 900px) {
  :root[data-ui="v2"][data-mobile-blur="off"] * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  :root[data-ui="v2"][data-mobile-blur="off"] { --glass: 88%; }
}


/* ---------- 0.3.0: Dashboard-Raster ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-mod { grid-column: span var(--span, 4); min-width: 0; position: relative; }
.dash-mod > .card { height: 100%; }
.dash-grid.editing .dash-mod { outline: 2px dashed var(--border-strong); outline-offset: 4px; border-radius: var(--radius); cursor: grab; }
.dash-grid.editing .dash-mod.dragging { opacity: .4; }
.dash-mod.drop-before { box-shadow: -6px 0 0 -2px var(--accent); }
.dash-mod.drop-after { box-shadow: 6px 0 0 -2px var(--accent); }
.dash-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.dash-tools .grip { color: var(--muted); display: inline-grid; place-items: center; padding: 0 4px; cursor: grab; }
.dash-tray { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.dash-tray .grow { flex: 1; min-width: 220px; }
.kpi-grid { gap: 16px; }
.seg-sm button { padding: 3px 8px; font-size: 12px; }
@media (max-width: 1200px) { .dash-mod[style*="--span:4"] { grid-column: span 6; } .dash-mod[style*="--span:8"] { grid-column: span 12; } }
@media (max-width: 900px) { .dash-mod { grid-column: span 12 !important; } }

/* ---------- Interaktive Diagramme ---------- */
.chart-tip { position: fixed; z-index: 300; pointer-events: none; display: none; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.45; box-shadow: var(--shadow); max-width: 260px; font-variant-numeric: tabular-nums; }
.chart-tip b { display: block; margin-bottom: 2px; }
.chart .col .guide { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .col:hover .guide { opacity: 1; }
.chart .col:hover .dot { r: 5; }
.chart .dot { transition: r .1s; }
.chart-bar .bar { transition: opacity .12s; }
.chart-bar:hover .bar-group .bar { opacity: .45; }
.chart-bar:hover .bar-group:hover .bar { opacity: 1; }
.chart-legend { margin-top: 8px; gap: 6px; }
.leg { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.leg.off { opacity: .45; text-decoration: line-through; }
.donut .seg { transition: opacity .12s, stroke-width .12s; cursor: default; }
.donut text { pointer-events: none; }
.donut .seg.dim { opacity: .3; }
.donut .seg:hover { stroke-width: 22; }
.donut-legend .leg-row { cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.donut-legend .leg-row.hl { background: var(--surface-2); }
.donut-legend .leg-row.off { opacity: .4; text-decoration: line-through; }
.spark g:hover rect:last-child { fill: var(--accent); }

/* ---------- Bilder, Galerie ---------- */
.img-ph { display: grid; place-items: center; gap: 6px; background: var(--surface-2); color: var(--faint); }
.gallery .gal-main { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); padding: 0; background: var(--surface-2); cursor: zoom-in; }
.gallery .gal-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gal-thumb { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--surface-2); }
.gal-thumb.active { border-color: var(--accent); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #000a; }
.lightbox { position: relative; background: #000; border-radius: 10px; overflow: hidden; display: grid; place-items: center; min-height: 240px; }
.lightbox img { max-width: 100%; max-height: 70vh; display: block; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: #0009; color: #fff; font-size: 26px; cursor: pointer; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.veh-hero { display: flex; gap: 16px; align-items: center; }
.veh-hero-img { width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: grid; }

/* ---------- Fahrzeug-Katalog ---------- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.model-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, border-color .12s; }
.model-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.model-card.inactive { opacity: .55; }
.mc-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: grid; }
.mc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Fuhrpark ---------- */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fleet-card { overflow: hidden; }
.fc-img { display: block; }
.fc-img img, .fc-img .img-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: grid; }
.fc-body { padding: 12px 14px 14px; }
.fleet-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.fleet-chip { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.fleet-chip:hover { border-color: var(--border-strong); }
.fleet-chip .thumb { width: 72px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; flex: none; display: grid; }
.fleet-chip .meta { font-size: 12px; color: var(--muted); }

/* ---------- Tuning ---------- */
.tune-img { width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; flex: none; display: grid; }
.tune-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.tune-row:last-child { border-bottom: 0; }
.tr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tr-head b { min-width: 90px; }
.stages { display: flex; gap: 3px; }
.stages span { width: 26px; height: 7px; border-radius: 3px; background: var(--surface-3); }
.stages span.have { background: var(--muted); }
.stages span.new { background: var(--accent); }
.tune-opt { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.tune-opt b { color: var(--accent); }
.tune-opt small { color: var(--muted); font-size: 11px; }
.tune-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--accent-soft); }
.tune-opt[disabled] { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.pkg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pkg { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pkg.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sticky { position: sticky; top: 76px; align-self: start; }

/* ---------- Regelwerk ---------- */
.rule-page { grid-template-columns: 260px minmax(0, 1fr); }
.rule-nav { display: flex; flex-direction: column; gap: 4px; }
.rule-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.rule-link.active { border-color: var(--accent); background: var(--accent-soft); }
.rule-link .rule-move { display: none; }
.rule-link:hover .rule-move { display: inline-flex; }
.rule-layout { grid-template-columns: 220px minmax(0, 1fr); }
.rule-toc { position: sticky; top: 76px; align-self: start; }
.rule-toc a { display: block; padding: 4px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.rule-toc a:hover { color: var(--accent); }
.rule-toc .toc-l3 { padding-left: 12px; font-size: 12px; }
.md h2 { font-size: 22px; margin: 6px 0 14px; } .md h3 { font-size: 17px; margin: 22px 0 8px; } .md h4 { font-size: 15px; margin: 16px 0 6px; } .md h5 { font-size: 14px; margin: 12px 0 6px; }
.md p, .md li { line-height: 1.65; }
.md ul, .md ol { padding-left: 22px; margin: 6px 0 12px; }
.md blockquote { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.md .md-table { margin: 8px 0 14px; }
.rule-doc { max-width: 820px; }
details.version { padding: 10px 0; border-bottom: 1px solid var(--border); }
details.version summary { cursor: pointer; }
@media (max-width: 1024px) { .rule-page, .rule-layout { grid-template-columns: 1fr; } .rule-toc { position: static; } .sticky { position: static; } .veh-hero { flex-direction: column; align-items: flex-start; } .tune-img, .veh-hero-img { width: 100%; } }

/* Responsiv */
@media (min-width: 1900px) {
  .g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .g-side { grid-template-columns: minmax(0, 1fr) 420px; }
}
@media (max-width: 1400px) {
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: 1fr; }
  .app { grid-template-columns: 220px 1fr; }
}
/* Tablet: Seitenleiste als Schublade, zweispaltige Raster bleiben */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: 100vh; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; }
  #menuToggle { display: inline-grid; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 > .span-2 { grid-column: 1 / -1; }
  .nav a { padding: 10px 12px; }
  .btn { padding: 9px 14px; }
  .btn.sm { padding: 6px 10px; }
  .kanban { grid-auto-columns: minmax(260px, 46vw); }
}
@media (max-width: 900px) {
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid[style*="300px"] { grid-template-columns: 1fr !important; }
  .span-2, .span-3 { grid-column: auto; }
  .topbar { padding: 10px 14px; }
  .content { padding: 18px 14px 60px; }
  .user-chip .who, .duty-btn .lbl { display: none; }
}
@media (max-width: 640px) {
  .g-4, .g-6 { grid-template-columns: 1fr 1fr; }
  .form.cols-2 { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
  input.input, select.input, textarea.input, .search input { font-size: 16px; }
  .search { max-width: none; min-width: 0; }
  .topbar { gap: 6px; }
  .topbar .spacer, .topbar [data-action="theme"] { display: none; }
  .duty-btn { padding: 7px 10px; }
  table.table:not(.no-stack) thead { display: none; }
  table.table:not(.no-stack), table.table:not(.no-stack) tbody, table.table:not(.no-stack) tr, table.table:not(.no-stack) td { display: block; width: 100%; }
  table.table:not(.no-stack) tr { border-bottom: 1px solid var(--border); padding: 6px 0; }
  table.table:not(.no-stack) td { border: 0; padding: 4px 14px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.table:not(.no-stack) td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; font-weight: 600; }
  table.table:not(.no-stack) td[data-label=""]::before { content: none; }
  table.table:not(.no-stack) tfoot { display: block; }
  .paper { padding: 22px 18px; }
  .kanban { grid-auto-columns: 84vw; scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .range { grid-template-columns: 1fr 56px; }
  .range label { grid-column: 1 / -1; }
  .page-head .actions { width: 100%; }
  .week { grid-template-columns: 90px repeat(7, 140px); overflow-x: auto; }
}
@media print {
  .mock-banner, .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .paper { box-shadow: none; }
}
