/* Metallbau Verwaltung – Stylesheet (eigenes, abhängigkeitsfreies Komponenten-CSS)
   Design: Stahlblau #3F6E93, Signalgelb #F2B705, Seitenleiste #1B2125. Hell/Dunkel, einstellbare Schriftgröße. */

:root {
  --primary: #3F6E93;
  --primary-dark: #335a79;
  --primary-soft: #e3edf4;
  --accent: #F2B705;
  --accent-dark: #d9a304;
  --side: #1B2125;
  --side-2: #262e33;
  --bg: #eef0f2;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --text: #1b2125;
  --text-2: #4a555c;
  --muted: #6a757c;
  --border: #d9dee2;
  --border-2: #e8ebee;
  --green: #1f7a3d; --green-bg: #e3f4e8;
  --red: #b3261e; --red-bg: #fbe7e5;
  --orange: #b45309; --orange-bg: #fdf0dc;
  --yellow-bg: #fff4cc; --yellow: #7a5b00;
  --blue-bg: #e3edf4; --purple: #6b3fa0; --purple-bg: #efe7f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,30,40,.06), 0 1px 3px rgba(20,30,40,.05);
  --font: 'Barlow', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-cond: 'Barlow Semi Condensed', 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --tap: 44px;
}
html[data-theme="dark"] {
  --primary: #6fa3c9; --primary-dark: #8fb8d6; --primary-soft: #22333f;
  --bg: #121618; --surface: #1b2125; --surface-2: #232b30; --text: #e9edf0; --text-2: #c2cad0; --muted: #98a3aa;
  --border: #36424a; --border-2: #2b353b; --side: #0d1114; --side-2: #1b2125;
  --green: #6fd48d; --green-bg: #17301f; --red: #ff9b93; --red-bg: #3a1c1a; --orange: #f5b571; --orange-bg: #3a2a14;
  --yellow-bg: #3a3112; --yellow: #f2d36b; --blue-bg: #22333f; --purple: #c9a8f0; --purple-bg: #2d2140;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --primary: #6fa3c9; --primary-dark: #8fb8d6; --primary-soft: #22333f;
    --bg: #121618; --surface: #1b2125; --surface-2: #232b30; --text: #e9edf0; --text-2: #c2cad0; --muted: #98a3aa;
    --border: #36424a; --border-2: #2b353b; --side: #0d1114; --side-2: #1b2125;
    --green: #6fd48d; --green-bg: #17301f; --red: #ff9b93; --red-bg: #3a1c1a; --orange: #f5b571; --orange-bg: #3a2a14;
    --yellow-bg: #3a3112; --yellow: #f2d36b; --blue-bg: #22333f; --purple: #c9a8f0; --purple-bg: #2d2140;
    --shadow: none; color-scheme: dark;
  }
}
html { font-size: 16px; }
html[data-fs="s"] { font-size: 15px; }
html[data-fs="l"] { font-size: 18px; }
html[data-fs="xl"] { font-size: 20px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-family: var(--font-cond); font-weight: 650; line-height: 1.2; letter-spacing: .005em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre { background: var(--surface-2); padding: .75rem; border-radius: 8px; overflow: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.ic { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.ic-sm { width: 1rem; height: 1rem; }
.ic-lg { width: 1.6rem; height: 1.6rem; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; }
.side { position: fixed; top: 0; bottom: 0; left: 0; width: 15.5rem; background: var(--side); color: #dfe5e9; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 0 1rem; height: 3.8rem; border-bottom: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.side-logo { width: 2.2rem; height: 2.2rem; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-family: var(--font-cond); font-weight: 700; flex: 0 0 auto; border-bottom: 3px solid var(--accent); }
.side-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.side-name { font-family: var(--font-cond); font-weight: 600; font-size: 1rem; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.side-nav { flex: 1; overflow-y: auto; padding: .5rem .6rem 1rem; }
.nav-group { margin-top: .9rem; }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: #8d9aa2; padding: 0 .7rem .3rem; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; min-height: 2.5rem; border-radius: 8px; color: #cdd5da; font-weight: 500; font-size: .95rem; text-decoration: none; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-badge { margin-left: auto; background: var(--accent); color: #1b2125; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; min-width: 1.3rem; text-align: center; }
.side-user { border-top: 1px solid rgba(255,255,255,.08); padding: .8rem 1rem; display: flex; align-items: center; gap: .7rem; flex: 0 0 auto; }
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; font-size: .95rem; }
.side-user .who { min-width: 0; flex: 1; font-size: .9rem; }
.side-user .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who small { color: #8d9aa2; }
.side-user a.icon-link { color: #a9b4bb; padding: .4rem; border-radius: 8px; }
.side-user a.icon-link:hover { background: rgba(255,255,255,.1); color: #fff; }

.main { flex: 1; min-width: 0; margin-left: 15.5rem; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); height: 3.4rem; display: flex; align-items: center; gap: .5rem; padding: 0 1rem; }
.topbar .spacer { flex: 1; }
.topbar-title { font-family: var(--font-cond); font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { position: relative; width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--text-2); border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; min-width: 1.15rem; height: 1.15rem; border-radius: 999px; display: grid; place-items: center; padding: 0 .25rem; }
.content { padding: 1.25rem 1.5rem 3rem; max-width: 84rem; width: 100%; margin: 0 auto; flex: 1; }
.menu-btn { display: none; }
.bottom-nav { display: none; }
.overlay { display: none; }

@media (max-width: 1023px) {
  .side { transform: translateX(-100%); width: min(19rem, 86vw); }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .content { padding: 1rem 1rem 6rem; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 3.5rem; padding: .3rem .2rem; font-size: .72rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; text-decoration: none; cursor: pointer; font-family: inherit; }
  .bottom-nav .active { color: var(--primary); box-shadow: inset 0 3px 0 var(--accent); }
}

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-title { margin: 0; font-size: 1.6rem; }
.page-sub { color: var(--muted); margin: .15rem 0 0; font-size: .95rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: .35rem; }
.breadcrumb a { color: var(--muted); }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 1.1rem; }
.card-b { padding: 1.1rem; }
.card-f { padding: .8rem 1.1rem; border-top: 1px solid var(--border-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.card.flush .card-b { padding: 0; }
.card.accent-top { border-top: 3px solid var(--accent); }

/* ---------- Raster ---------- */
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3, .g4, .g-side { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--tap); padding: .45rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
html[data-theme="dark"] .btn-primary { color: #0d1114; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1b2125; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
html[data-theme="dark"] .btn-danger { color: #1b2125; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 2.25rem; padding: .25rem .7rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 3.5rem; font-size: 1.1rem; padding: .6rem 1.5rem; }
.btn-icon { padding: .45rem; width: var(--tap); }
.btn-sm.btn-icon { width: 2.25rem; }
.fab { display: none; }
@media (max-width: 1023px) {
  .fab { display: grid; place-items: center; position: fixed; right: 1rem; bottom: 4.9rem; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--accent); color: #1b2125; box-shadow: 0 4px 14px rgba(0,0,0,.3); z-index: 25; border: 0; text-decoration: none; }
  .fab .ic { width: 1.7rem; height: 1.7rem; }
  .fab:hover { text-decoration: none; background: var(--accent-dark); }
}

/* ---------- Formulare ---------- */
.field { margin-bottom: .9rem; min-width: 0; }
.field > label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; color: var(--text-2); }
.req::after { content: ' *'; color: var(--red); }
.input, .select, .textarea { width: 100%; min-height: var(--tap); padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.textarea { min-height: 6rem; resize: vertical; line-height: 1.4; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.input[readonly] { background: var(--surface-2); }
.input-sm { min-height: 2.25rem; padding: .25rem .5rem; }
.input-num { text-align: right; font-variant-numeric: tabular-nums; }
.help { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.error-text { font-size: .85rem; color: var(--red); margin-top: .2rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-3 { grid-column: span 3; } .form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); } .form-grid .span-2, .form-grid .span-3 { grid-column: auto; } }
.check { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); cursor: pointer; font-weight: 500; }
.check input { width: 1.4rem; height: 1.4rem; accent-color: var(--primary); flex: 0 0 auto; }
.input-group { display: flex; } .input-group .input { border-radius: 8px 0 0 8px; } .input-group .addon { display: grid; place-items: center; padding: 0 .75rem; border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--muted); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; padding-top: .5rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: .7rem 1rem; margin: 1rem -1.1rem -1.1rem; display: flex; gap: .6rem; flex-wrap: wrap; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 1023px) { .sticky-actions { bottom: 3.5rem; } }
input[type=color].input { padding: .2rem; min-width: 3.5rem; }
input[type=file].input { padding: .55rem .6rem; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .6rem .8rem; border-bottom: 2px solid var(--border); white-space: nowrap; background: var(--surface); }
.tbl td { padding: .65rem .8rem; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl tr.row-link { cursor: pointer; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
.tbl-sort a { color: inherit; } .tbl-sort a:hover { text-decoration: none; color: var(--text); }
@media (max-width: 720px) {
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards thead { display: none; }
  .tbl-cards tr { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin: 0 0 .7rem; padding: .35rem .8rem; box-shadow: var(--shadow); }
  .tbl-cards td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .tbl-cards td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .82rem; text-align: left; flex: 0 0 38%; }
  .tbl-cards td[data-label=""]::before, .tbl-cards td:not([data-label])::before { display: none; }
  .tbl-cards td.title { font-weight: 700; font-size: 1.05rem; text-align: left; display: block; padding-top: .45rem; }
  .tbl-cards td.title::before { display: none; }
  .tbl-cards td.actions { justify-content: flex-end; }
  .tbl-cards tbody tr:hover { background: var(--surface); }
  .tbl-cards tfoot { display: block; } .tbl-cards tfoot tr { background: transparent; border: 0; box-shadow: none; }
  .card.flush .tbl-cards { padding: .7rem; }
}

/* ---------- Badges, Tabs, Hinweise ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-blue { background: var(--blue-bg); color: var(--primary); border-color: transparent; }
.badge-green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge-red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.badge-orange { background: var(--orange-bg); color: var(--orange); border-color: transparent; }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border-color: transparent; }
.badge-purple { background: var(--purple-bg); color: var(--purple); border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 2px solid var(--border); margin-bottom: 1rem; scrollbar-width: thin; }
.tab { padding: .6rem 1rem; min-height: var(--tap); display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; text-decoration: none; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; font-size: .95rem; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.tab .count { background: var(--surface-2); border-radius: 999px; padding: 0 .5rem; font-size: .78rem; border: 1px solid var(--border); }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; font-size: .95rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.alert-error { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.alert-warn { background: var(--orange-bg); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.alert-info { background: var(--blue-bg); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ic { width: 2.4rem; height: 2.4rem; margin: 0 auto .6rem; opacity: .6; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .strong { font-weight: 700; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-orange { color: var(--orange); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .hide-mobile { display: none !important; } }
@media (min-width: 721px) { .show-mobile { display: none !important; } }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); border-left: 4px solid var(--primary); display: block; color: inherit; }
a.stat:hover { text-decoration: none; background: var(--surface-2); }
.stat-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-cond); font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .82rem; color: var(--muted); }
.stat.warn { border-left-color: var(--red); } .stat.warn .stat-value { color: var(--red); }
.stat.ok { border-left-color: var(--green); } .stat.yellow { border-left-color: var(--accent); }

/* ---------- Werkzeugleiste / Seiten ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .search { flex: 1 1 14rem; max-width: 26rem; position: relative; }
.toolbar .search .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search .input { padding-left: 2.4rem; }
.toolbar .select { width: auto; min-width: 9rem; }
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; padding: 1rem 0 0; align-items: center; }
.pagination a, .pagination span { min-width: 2.4rem; height: 2.4rem; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; padding: 0 .6rem; font-weight: 600; font-size: .9rem; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .gap { border: 0; background: none; }
.kv { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .9rem; } .kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: .5rem; } }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .6rem 0; border-bottom: 1px solid var(--border-2); display: flex; gap: .7rem; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 .9rem 1rem; }
.timeline li::before { content: ''; position: absolute; left: -1.38rem; top: .4rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.progress { height: .6rem; border-radius: 999px; background: var(--border-2); overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--primary); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(36rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,15,20,.55); }
dialog .dlg-h { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border-2); }
dialog .dlg-h h3 { margin: 0; } dialog .dlg-b { padding: 1.1rem; overflow-y: auto; max-height: calc(100vh - 12rem); } dialog .dlg-f { padding: .8rem 1.1rem; border-top: 1px solid var(--border-2); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(135deg, var(--side) 0%, #2d3a42 100%); }
.auth-card { width: 100%; max-width: 26rem; background: var(--surface); border-radius: 16px; padding: 2rem 1.6rem; box-shadow: 0 20px 60px rgba(0,0,0,.4); border-top: 6px solid var(--accent); }
.auth-brand { text-align: center; margin-bottom: 1.4rem; }
.auth-brand .side-logo { width: 3.4rem; height: 3.4rem; margin: 0 auto .6rem; font-size: 1.3rem; }

/* ---------- Stempeluhr / Dashboard ---------- */
.clock-card { text-align: center; }
.clock-time { font-family: var(--font-cond); font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock-state { font-weight: 600; color: var(--muted); margin-bottom: .8rem; }
.clock-state.on { color: var(--green); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(16rem, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: .8rem; align-items: start; scroll-snap-type: x proximity; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 8rem; scroll-snap-align: start; }
.kanban-col > h3 { margin: 0; padding: .7rem .9rem; font-size: .95rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: var(--radius) var(--radius) 0 0; }
.kanban-list { padding: .6rem; display: grid; gap: .6rem; min-height: 4rem; }
.kanban-col.drag-over { outline: 3px dashed var(--accent); }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .7rem .8rem; box-shadow: var(--shadow); cursor: grab; display: block; color: inherit; }
.kanban-card:hover { text-decoration: none; border-color: var(--primary); }
.kanban-card.dragging { opacity: .4; }
.kanban-card .t { font-weight: 650; margin-bottom: .25rem; }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-h { padding: .45rem; text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-d { min-height: 6.2rem; border-right: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); padding: .3rem; font-size: .8rem; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.other { background: var(--surface-2); color: var(--muted); }
.cal-d.today .cal-n { background: var(--primary); color: #fff; }
.cal-d.holiday { background: var(--yellow-bg); }
.cal-n { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; font-weight: 700; }
.cal-ev { display: block; background: var(--primary-soft); color: var(--primary); border-left: 3px solid var(--primary); border-radius: 4px; padding: 1px 5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; text-decoration: none; }
@media (max-width: 720px) { .cal-d { min-height: 3.6rem; font-size: .7rem; } .cal-ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; } }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 11rem); min-height: 22rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.msg { max-width: min(34rem, 85%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; padding: .5rem .8rem; align-self: flex-start; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--primary-soft); border-radius: 12px 12px 3px 12px; }
.msg .meta { font-size: .75rem; color: var(--muted); margin-bottom: .1rem; }
.chat-form { display: flex; gap: .5rem; padding: .7rem; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); }
@media (max-width: 1023px) { .chat { height: calc(100vh - 14rem); } }

/* ---------- Beleg-Editor / Vorschau ---------- */
.doc-editor { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 1rem; align-items: start; }
@media (max-width: 1280px) { .doc-editor { grid-template-columns: minmax(0, 1fr); } }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; padding: .4rem .3rem; letter-spacing: .04em; }
.items-table td { padding: .3rem; vertical-align: top; }
.item-row { border-bottom: 1px solid var(--border-2); }
.totals { margin-left: auto; width: min(22rem, 100%); font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; padding: .25rem 0; }
.totals .grand { border-top: 2px solid var(--text); font-weight: 800; font-size: 1.15rem; margin-top: .3rem; padding-top: .4rem; }
.paper { background: #fff; color: #111; border: 1px solid var(--border); box-shadow: 0 4px 18px rgba(0,0,0,.12); padding: 1.4rem; font-size: .78rem; line-height: 1.35; border-radius: 4px; }
@media (max-width: 760px) {
  .items-table thead { display: none; }
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; }
  .items-table tr.item-row { border: 1px solid var(--border); border-radius: 10px; padding: .6rem; margin-bottom: .7rem; background: var(--surface); }
  .items-table td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
}

/* ---------- Unterschrift ---------- */
.sig-pad { border: 2px dashed var(--border); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 12rem; display: block; cursor: crosshair; }

/* ---------- Sonstiges ---------- */
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 1.2rem; text-align: center; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .6rem; }
.thumb { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.color-swatch { display: inline-block; width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 1px solid var(--border); vertical-align: middle; }
.gantt-bar { height: 1.5rem; border-radius: 5px; background: var(--primary); color: #fff; font-size: .75rem; padding: 0 .4rem; overflow: hidden; white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); background: var(--side); color: #fff; padding: .7rem 1.2rem; border-radius: 10px; z-index: 90; box-shadow: 0 6px 24px rgba(0,0,0,.35); max-width: 90vw; }
.installer-note { font-size: .85rem; color: var(--muted); }

@media print {
  .side, .topbar, .bottom-nav, .fab, .page-actions, .toolbar, .no-print, .overlay { display: none !important; }
  .main { margin: 0; } .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
