*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1a3a5c;
  --primary-hover: #14304d;
  --accent:        #2e7d32;
  --accent-hover:  #256a2a;
  --bg:            #f5f7fa;
  --surface:       #ffffff;
  --text:          #1a2332;
  --text-muted:    #5a6678;
  --border:        #dce3eb;
  --error:         #c0392b;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(0,0,0,.08);
  --tabbar-h:      82px;
  --safe-bot:      env(safe-area-inset-bottom, 0px);
  --safe-top:      env(safe-area-inset-top, 0px);
}

html, body {
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'DM Sans', Roboto, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  background: var(--bg);
}

/* ── Header ── */
.app-header {
  background: var(--primary);
  color: #fff;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.app-header h1 { font-size: 18px; font-weight: 600; }
.app-header .user-chip {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.app-header .user-chip:active { background: rgba(255,255,255,.28); }
.user-chip-caret { font-size: 10px; opacity: .7; }

/* ── Offline-Banner ── */
.offline-banner {
  background: #fff3cd;
  color: #7a5b00;
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  display: none;
}
.offline .offline-banner { display: block; }

/* ── AVV-Re-Sign-Banner (Stufe B) ── */
.avv-banner {
  background: #fff7ed;
  color: #9a3412;
  border-bottom: 1px solid #fed7aa;
  padding: 10px 16px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.avv-banner[hidden] { display: none !important; }
.avv-banner-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #c2410c;
}
.avv-banner-text { flex: 1 1 auto; line-height: 1.4; }
.avv-banner-link {
  color: #9a3412;
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}
.avv-banner-link:hover { color: #7c2d12; }

/* ── Main ── */
.app-main {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + 16px);
}

.view { display: none; padding: 16px; }
.view.active { display: block; }
.view h2 { font-size: 22px; margin-bottom: 16px; font-weight: 700; }
.view .hint {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}

/* ── Tab-Bar (position: fixed — pinnt an visuellen Viewport-Unterrand) ── */
.tabbar {
  position: fixed;
  bottom: calc(var(--tab-offset, 0px) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  height: var(--tabbar-h);
  padding: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -2px 8px rgba(0,0,0,.04);
  z-index: 100;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 0 calc(6px + var(--safe-bot));
  min-height: 0;
}
.tab svg { width: 28px; height: 28px; }
.tab.active { color: var(--primary); }
@media (max-width: 360px) {
  .tab { font-size: 10px; }
  .tab svg { width: 24px; height: 24px; }
}

/* ── Install-Hint (iOS) ── */
.install-hint {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-bot) + 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  font-size: 14px;
  z-index: 200;
  display: none;
}
.install-hint.visible { display: block; }
@media (max-height: 500px) {
  .install-hint { display: none !important; }
}
.install-hint strong { display: block; margin-bottom: 4px; }
.install-hint .close {
  position: absolute;
  top: 4px; right: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* ── View-Header (Titel + Refresh) ── */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.view-header h2 { margin: 0; }
.btn-refresh {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}
.btn-refresh:active { transform: rotate(120deg); transition: transform .3s; }

/* ── Such-Input ── */
.suche-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 12px;
  -webkit-appearance: none;
  appearance: none;
}
.suche-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

/* ── Großer QR-Button (Ausgabe) ── */
.btn-qr-big {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 18px 16px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-qr-big:active { background: var(--primary-hover); }
.btn-qr-big .qr-icon { font-size: 24px; line-height: 0; }

.annahme-trenn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.annahme-trenn::before,
.annahme-trenn::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ── QR-Scanner-Modal (Vollbild) ── */
.qr-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 700;
  display: flex;
  flex-direction: column;
}
.qr-modal[hidden] { display: none; }
.qr-modal-head {
  flex-shrink: 0;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
}
.qr-close {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
#qr-reader {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}
#qr-reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.qr-fehler {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + var(--safe-bot));
  background: var(--error);
  color: #fff;
  text-align: center;
  font-size: 14px;
  display: none;
}
.qr-fehler.visible { display: block; }

/* ── Auftrag-Liste ── */
.auftrag-liste { display: flex; flex-direction: column; gap: 10px; }

.auftrag-karte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(26,58,92,.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auftrag-karte:active { background: #f0f4f8; }
.auftrag-karte .k-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.auftrag-karte .k-kunde { font-weight: 600; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auftrag-karte .k-meta { font-size: 13px; color: var(--text-muted); }
.auftrag-karte .k-beschreibung {
  font-size: 14px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Status-Badge ── */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.badge-geplant    { background: #ede7f6; color: #4a148c; }
.badge-angenommen { background: #fff3cd; color: #7a5b00; }
.badge-in_arbeit  { background: #cfe8fc; color: #0d4a7a; }
.badge-fertig     { background: #d4edda; color: #155724; }
.badge-abgeholt   { background: #e2e3e5; color: #383d41; }
.badge-teile      { background: #ffe0b2; color: #7a4a00; align-self: flex-start; }
.badge-sammel     { background: #d4eaf7; color: #0d4d6f; align-self: flex-start; margin-right: 4px; }

/* Bestand-Status-Badges */
.badge-bestellt     { background: #e2e3e5; color: #383d41; }
.badge-angekommen   { background: #fff3cd; color: #8a6d3b; }
.badge-montage      { background: #cfe8fc; color: #0d4a7a; }
.badge-vormontiert  { background: #d1ecf1; color: #0c5460; }
.badge-transport    { background: #ede7f6; color: #4a148c; }
.badge-eingebucht   { background: #d4edda; color: #155724; }
.badge-verkauft     { background: #f8d7da; color: #721c24; }

/* Rollen-Gating für Tabs — eine Quelle, kein JS-Duplikat */
body[data-role="warenannahme"] .tab:not(.tab-lager):not(.tab-mehr)  { display: none; }
body[data-role="warenannahme"] .tab-rechnung          { display: none; }
body[data-role="warenannahme"] .tab.tab-einkauf       { display: none; }
/* warenannahme: nur vormontage + einbuchung + mehr */

body[data-role="mitarbeiter"]  .tab.tab-lager         { display: none; }
body[data-role="mitarbeiter"]  .tab.tab-samochat      { display: none; }
body[data-role="mitarbeiter"]  .tab.tab-rechnung      { display: none; }
body[data-role="mitarbeiter"]  .tab.tab-einkauf       { display: none; }
/* mitarbeiter: annahme/werkstatt/ausgabe/kalender/mehr — samochat/rechnung/einkauf nur im Mehr-Popover */

body[data-role="theke"]        .tab.tab-lager         { display: none; }
body[data-role="theke"]        .tab.tab-samochat      { display: none; }
body[data-role="theke"]        .tab.tab-einkauf       { display: none; }
/* theke: kein samochat, kein einkauf direkt — beides im Mehr-Popover */

/* Mehr-Tab: alle Rollen sehen ihn (außer wenn keine Inhalte dahinter) */
body:not([data-role]) .tab.tab-mehr                   { display: none; }
/* admin / verwaltung: kein explizites Hide, Mehr-Tab erscheint */

/* einkauf: nur admin / verwaltung / mitarbeiter haben Einkauf im Mehr-Menü */
/* (theke + warenannahme: Mehr-Eintrag Einkauf wird per JS ausgeblendet) */

/* ── Mehr-Popover (Drop-Up Sheet) ── */
.mehr-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,.45);
  animation: fadeIn .15s ease-out;
}
.mehr-overlay[hidden] { display: none; }

.mehr-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 8px 0 calc(8px + var(--safe-bot));
  animation: slideUp .2s ease-out;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}

.mehr-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 4px auto 12px;
}

.mehr-sheet-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 20px 8px;
}

.mehr-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  -webkit-tap-highlight-color: rgba(26,58,92,.08);
}
.mehr-item:active { background: #f0f4f8; }
.mehr-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
}
.mehr-item-badge {
  margin-left: auto;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Einbuchung-Item: nur für mitarbeiter/warenannahme/verwaltung/admin sichtbar */
.mehr-item-einbuchung { display: none; }
body[data-role="mitarbeiter"]  .mehr-item-einbuchung { display: flex; }
body[data-role="warenannahme"] .mehr-item-einbuchung { display: flex; }
body[data-role="verwaltung"]   .mehr-item-einbuchung { display: flex; }
body[data-role="admin"]        .mehr-item-einbuchung { display: flex; }

/* Einkauf-Item: nur für mitarbeiter/verwaltung/admin */
.mehr-item-einkauf { display: none; }
body[data-role="mitarbeiter"]  .mehr-item-einkauf { display: flex; }
body[data-role="verwaltung"]   .mehr-item-einkauf { display: flex; }
body[data-role="admin"]        .mehr-item-einkauf { display: flex; }

/* Rechnung-Item: alle außer warenannahme */
.mehr-item-rechnung { display: flex; }
body[data-role="warenannahme"] .mehr-item-rechnung { display: none; }

/* samoChat-Item: alle Rollen sehen samoChat im Mehr-Menü */
.mehr-item-samochat { display: flex; }

.auftrag-karte.karte-teile  { border-left: 4px solid #ff9800; }
.auftrag-karte.karte-sammel { border-left: 4px solid #2196f3; }

.am-teile-box {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #5a3a00;
}

/* ── Leer-State ── */
.leer-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 500;
  animation: fadeIn .15s ease-out;
}
.modal-overlay[hidden] { display: none; }

.modal-card {
  background: var(--surface);
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - env(safe-area-inset-bottom, 0px) - 40px);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px calc(20px + var(--safe-bot));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  animation: slideUp .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-close {
  position: absolute;
  top: 10px; right: 14px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  width: 44px; height: 44px;
}

.modal-head { margin-bottom: 14px; padding-right: 36px; }
.am-kunde { font-size: 20px; font-weight: 700; }
.am-tel { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.am-tel a { color: var(--primary); text-decoration: none; }

.am-beschreibung-box {
  background: #f5f7fa;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.am-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.am-text { font-size: 16px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

.am-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  font-size: 14px;
  margin-bottom: 20px;
}
.am-grid dt { color: var(--text-muted); }
.am-grid dd { word-break: break-word; }

.am-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Sammel-Annahme-Box im Modal ── */
.am-sammel-box {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.am-sammel-titel {
  font-size: 13px;
  font-weight: 700;
  color: #0d4d6f;
  margin-bottom: 2px;
}
.am-sammel-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.am-sammel-liste { display: flex; flex-direction: column; gap: 4px; }
.am-sammel-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.am-sammel-zeile.aktiv { box-shadow: 0 0 0 1.5px var(--primary) inset; cursor: default; }
.am-sammel-pos { font-weight: 700; color: var(--primary); min-width: 30px; }
.am-sammel-rad { flex: 1; }

/* ── Preis-Modal (Reparatur-Items beim Fertig-Markieren) ── */
.pm-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
.pm-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-radius: 14px 14px 0 0;
}
.pm-title { font-weight: 700; font-size: 16px; }
.pm-header .modal-close {
  position: static;
  color: rgba(255, 255, 255, 0.85);
  width: 32px; height: 32px;
}
.pm-body {
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.pm-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.pm-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-option {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .15s, background .15s;
}
.pm-option.gewaehlt {
  border-color: var(--accent);
  background: #f0f7ee;
}
.pm-opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.pm-opt-row input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 20px; height: 20px;
}
.pm-opt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pm-opt-name { font-size: 15px; font-weight: 700; }
.pm-opt-sub { font-size: 12px; color: var(--text-muted); }
.pm-opt-preis {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.pm-item-schieber {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.pm-item-range {
  width: 100%;
  accent-color: var(--accent);
  margin-bottom: 4px;
}
.pm-item-extra-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.pm-item-extra { color: var(--accent); font-weight: 600; }
.pm-item-sub { font-weight: 700; color: var(--text); }
.pm-footer {
  padding: 14px 18px calc(14px + var(--safe-bot, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.pm-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  min-height: 24px;
}
.pm-total-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.pm-total { font-size: 18px; font-weight: 800; color: var(--text); }
.pm-link {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
}

/* ── Sammel-Annahme: Liste bereits hinzugefügter Räder ── */
.wiz-raeder-liste {
  background: #f0f7ee;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wiz-raeder-liste-titel {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.wiz-rad-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
}
.wiz-rad-zeile-info { flex: 1; min-width: 0; }
.wiz-rad-zeile-titel { font-size: 13px; font-weight: 700; }
.wiz-rad-zeile-sub  { font-size: 11px; color: var(--text-muted); }
.wiz-rad-zeile-rm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.wiz-rad-form-titel {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-top: 4px;
}

/* ── Adress-Autocomplete (Annahme-Wizard) ── */
.wiz-adress-vorschlaege {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  max-height: 240px;
  overflow-y: auto;
}
.wiz-adress-vorschlaege.aktiv { display: flex; }
@media (max-height: 600px) {
  .wiz-adress-vorschlaege { max-height: 160px; }
}
.wiz-adress-vorschlaege.lade::after {
  content: 'Suche …';
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.wiz-adress-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f3f7;
  font-size: 13px;
  line-height: 1.4;
}
.wiz-adress-item:last-child { border-bottom: none; }
.wiz-adress-item:hover,
.wiz-adress-item:active { background: #f0f7ee; }
.wiz-adress-item-haupt { font-weight: 700; color: var(--text); }
.wiz-adress-item-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wiz-adress-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f7ee;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 4px 0 12px;
}
.wiz-adress-chip-text { flex: 1; font-size: 13px; line-height: 1.4; }
.wiz-adress-chip-text strong { display: block; font-size: 14px; }
.wiz-adress-chip-text small { color: var(--text-muted); }
.wiz-adress-chip-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ── Kalender (Monat + Tagesansicht) ── */
.kal-monat { padding-bottom: 8px; }
.kal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 6px;
}
.kal-month-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.kal-nav-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kal-nav-btn:active { background: #f5f7fa; }
.kal-today-row {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.kal-today-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
}
.kal-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding: 0 2px;
}
.kal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 2px;
}
.kal-tag-cell {
  aspect-ratio: 1 / 1.05;
  border-radius: 8px;
  border: 1.5px solid transparent;
  padding: 4px 5px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: #f5f7fa;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.kal-tag-cell.kal-other-month { opacity: 0.35; }
.kal-tag-cell.kal-zu { background: #ececec; cursor: default; opacity: 0.55; }
.kal-tag-cell.kal-frei   { background: #e6f4e6; }
.kal-tag-cell.kal-niedrig { background: #d4f0d4; }
.kal-tag-cell.kal-mittel { background: #fff4cc; }
.kal-tag-cell.kal-hoch   { background: #ffd9b3; }
.kal-tag-cell.kal-voll   { background: #ffcccc; }
.kal-tag-cell.kal-heute {
  border-color: var(--primary);
  box-shadow: 0 0 0 1.5px var(--primary) inset;
}
.kal-tag-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.kal-tag-frac {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  line-height: 1.1;
  letter-spacing: -0.3px;
}
.kal-tag-cell.kal-zu .kal-tag-frac { display: none; }
.kal-legende {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 14px 4px 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.kal-leg-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.kal-leg-frei   { background: #d4f0d4; }
.kal-leg-mittel { background: #fff4cc; }
.kal-leg-voll   { background: #ffcccc; }
.kal-leg-zu     { background: #ececec; }

/* Tagesansicht */
.kal-tag-head {
  display: grid;
  grid-template-columns: 38px 1fr 38px 38px;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 12px;
}
.kal-tag-titel { text-align: center; }
.kal-tag-datum { font-size: 17px; font-weight: 700; }
.kal-tag-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kal-tag-kapa {
  background: #f5f7fa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kal-tag-kapa-bar {
  flex: 1;
  height: 8px;
  background: #dce3eb;
  border-radius: 4px;
  overflow: hidden;
}
.kal-tag-kapa-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}
.kal-tag-kapa-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.kal-tag-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kal-termin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.kal-termin-card.kal-typ-abholung { border-left-color: var(--primary); }
.kal-termin-card.kal-typ-manuell  { border-left-color: #b08fc6; }
.kal-termin-titel { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.kal-termin-meta  { font-size: 12px; color: var(--text-muted); }
.kal-tag-leer {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  background: #f5f7fa;
  border-radius: 8px;
  font-size: 14px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bot) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 600;
  max-width: 92vw;
  text-align: center;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--error); }
@media (max-height: 400px) {
  .toast { bottom: 60px; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:active { background: #f0f4f8; }
.btn-block { width: 100%; }

/* ── Annahme-Wizard ── */
.wiz-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.wiz-dot {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wiz-dot span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.wiz-dot.aktiv { border-color: var(--primary); color: var(--primary); }
.wiz-dot.aktiv span { background: var(--primary); color: #fff; }
.wiz-dot.fertig { background: #d4edda; border-color: #2e7d32; color: #155724; }
.wiz-dot.fertig span { background: var(--accent); color: #fff; }

.wiz-panel { display: flex; flex-direction: column; gap: 10px; }

.wiz-kunde-liste { display: flex; flex-direction: column; gap: 6px; }
.wiz-kunde-zeile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
}
.wiz-kunde-zeile:active { background: #f0f4f8; }
.wiz-kunde-zeile .kz-name { font-weight: 600; }
.wiz-kunde-zeile .kz-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.wiz-kunde-chip {
  background: #d4edda;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  color: #155724;
  margin-bottom: 8px;
}
.wiz-kunde-chip strong { display: block; font-size: 16px; margin-bottom: 2px; }

.wiz-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.wiz-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
.wiz-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
textarea.wiz-input { resize: vertical; min-height: 60px; }

.wiz-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.wiz-nav { display: flex; gap: 8px; margin-top: 8px; }
.wiz-nav .btn { flex: 1; }

.wiz-termin-liste { display: flex; flex-direction: column; gap: 8px; }
.wiz-termin-karte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.wiz-termin-karte:active { background: #f0f4f8; }
.wiz-termin-karte .tk-datum { font-weight: 600; font-size: 16px; }
.wiz-termin-karte .tk-wt { font-size: 13px; color: var(--text-muted); }
.wiz-termin-karte .tk-frei {
  background: #d4edda;
  color: #155724;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.wiz-erfolg { align-items: center; text-align: center; padding: 24px 8px; }
.wiz-erfolg-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.wiz-erfolg h3 { font-size: 22px; font-weight: 700; margin: 8px 0; }
.wiz-erfolg-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ── FullCalendar-Tab ── */
#kalender-container { margin-top: 4px; }
#kalender-container .fc {
  font-size: 14px;
}
#kalender-container .fc-list-event-title { font-weight: 500; }
#kalender-container .fc-list-day-cushion { background: #f0f4f8 !important; }
#kalender-container .fc-toolbar-title { font-size: 16px !important; }
#kalender-container .fc-button {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  font-size: 13px !important;
  padding: 6px 10px !important;
}
#kalender-container .fc-button:disabled { opacity: .5; }
#kalender-container .fc-event { cursor: pointer; }

/* Monat-Raster (dayGridMonth) — touch-freundlich */
#kalender-container .fc-daygrid-day { min-height: 60px; cursor: pointer; }
#kalender-container .fc-daygrid-day:active { background: #eef3f8; }
#kalender-container .fc-daygrid-day-number { padding: 4px 6px !important; font-size: 13px; }
#kalender-container .fc-daygrid-event {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  font-size: 11px;
  padding: 2px 4px !important;
  border-radius: 4px;
}
#kalender-container .fc-daygrid-day.fc-day-today { background: #fff8e1 !important; }

/* ── Account-Drawer ── */
.acct-drawer { position: fixed; inset: 0; z-index: 300; }
.acct-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.acct-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px calc(28px + var(--safe-bot));
  text-align: center;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.acct-avatar { color: var(--primary); margin-bottom: 10px; display: flex; justify-content: center; }
.acct-dname  { font-size: 21px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.acct-drolle { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

/* ── Rechnung ── */
.rech-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.rech-card-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 12px;
}
.rech-chip {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; margin-top: 8px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.rech-chip-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 0 4px;
}
.rech-pos-row {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.rech-pos-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.rech-pos-top .wiz-input { flex: 1; margin: 0; }
.rech-pos-del {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; cursor: pointer; color: var(--error); font-size: 13px; flex-shrink: 0;
}
.rech-pos-del:disabled { opacity: .3; cursor: default; }
.rech-pos-bottom { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.rech-pos-label { font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.rech-pos-label .wiz-input { margin: 0; }
.rech-pos-sum { font-weight: 600; font-size: 15px; text-align: right; padding-bottom: 6px; white-space: nowrap; }
.rech-summen { margin-top: 12px; }
.rech-summen-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; font-size: 14px; border-top: 1px solid var(--border);
}
.rech-summen-row:first-child { border-top: none; }
.rech-summen-brutto { font-weight: 700; font-size: 17px; color: var(--primary); }

/* ── Rechnung-Vorschau ──────────────────────────────────────────────── */
.rech-prev-card { border: 2px solid var(--primary-light, #a5d6a7); }
.rech-prev-section { margin: 10px 0; }
.rech-prev-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 4px; }
.rech-prev-value { font-size: 15px; font-weight: 500; }
.rech-prev-pos-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; border-top: 1px solid var(--border); }
.rech-prev-pos-row:first-child { border-top: none; }
.rech-prev-totals { margin-top: 12px; border-top: 2px solid var(--border); padding-top: 8px; }

#kalender-container .fc-col-header-cell-cushion { font-size: 12px; padding: 6px 4px !important; }

/* ── samoChat-Tab ───────────────────────────────────────────────────── */
.tab-samochat { position: relative; }
.tab-badge {
  position: absolute; top: 4px; right: 10px;
  background: #c62828; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.samochat-filter {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px;
}
.sc-filter {
  background: #fff; border: 1px solid #d0d7de; border-radius: 16px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; color: #555;
  font-family: inherit; min-height: 44px;
}
.sc-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.samochat-liste { display: flex; flex-direction: column; gap: 10px; }
.sc-karte {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.sc-karte:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sc-karte.erledigt { opacity: .6; }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.sc-betreff { font-weight: 600; font-size: 14px; color: #1a1a2e; }
.sc-status-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
  white-space: nowrap;
}
.sc-status-offen { background: #fee2e2; color: #c62828; }
.sc-status-in_arbeit { background: #fef3c7; color: #92400e; }
.sc-status-erledigt { background: #d1fae5; color: #065f46; }
.sc-frage { font-size: 13px; color: #555; line-height: 1.4; margin-bottom: 8px; white-space: pre-wrap; }
.sc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #777; }
.sc-meta a { color: #1565c0; text-decoration: none; }
.sc-meta a:hover { text-decoration: underline; }
.sc-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.sc-antwort {
  width: 100%; box-sizing: border-box; margin-top: 8px; font-family: inherit;
  border: 1px solid #d0d7de; border-radius: 6px; padding: 8px 10px; font-size: 13px; resize: vertical;
  min-height: 60px;
}
.sc-kontext {
  margin-top: 10px; background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 6px;
  padding: 10px; font-size: 12px; white-space: pre-wrap; max-height: 200px; overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}
.sc-leer { text-align: center; padding: 40px 16px; color: #777; font-size: 14px; }

/* ── Marketplace-Tab ── */
.sc-liste { display: flex; flex-direction: column; gap: 10px; }
.mp-karte { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 14px 16px; transition: box-shadow .15s; }
.mp-karte:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sc-karte-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.sc-karte-name { font-weight: 600; font-size: 14px; }
.sc-karte-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #666; margin-bottom: 4px; }
.mp-filter { background: #fff; border: 1px solid #d0d7de; border-radius: 16px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: #555; font-family: inherit; }
.mp-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.mp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.badge-gruen { background: #d1fae5; color: #065f46; }
.badge-gelb  { background: #fef3c7; color: #92400e; }
.badge-rot   { background: #fee2e2; color: #c62828; }
.badge-grau  { background: #e5e7eb; color: #555; }
.badge-blau  { background: #dbeafe; color: #1e40af; }
.btn-success { background: #059669; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-success:hover { background: #047857; }
.btn-success:disabled { opacity: .6; cursor: not-allowed; }
.btn-danger  { background: #dc2626; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { opacity: .6; cursor: not-allowed; }
.tab-marketplace { position: relative; }

/* ── Rechnung-Tab (Walk-In, Phase B v1.22.6) ── */
.rech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.rech-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rech-kunde-suche-wrap { position: relative; margin-bottom: 8px; }
.rech-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); max-height: 220px; overflow-y: auto;
}
.rech-dropdown-item {
  padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f0f0;
}
.rech-dropdown-item:last-child { border-bottom: none; }
.rech-dropdown-item:hover { background: #f0f7ff; }
.rech-dropdown-item .rech-dd-name { font-weight: 600; color: #1a1a2e; }
.rech-dropdown-item .rech-dd-sub  { font-size: 11px; color: #888; margin-top: 1px; }
.rech-kunde-banner {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 8px;
  padding: 8px 12px; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #2e7d32;
}
.rech-neuer-kunde-btn {
  background: none; border: none; color: #888; font-size: 12px; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; font-family: inherit;
}
.rech-neuer-kunde-btn:hover { background: #f5f5f5; color: #c00; }
.rech-felder-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.rech-feld-wrap { display: flex; flex-direction: column; gap: 3px; }
.rech-feld-full  { width: 100%; }
.rech-feld-half  { width: calc(50% - 4px); }
.rech-feld-third { width: calc(33.333% - 6px); }
.rech-feld-2third{ width: calc(66.666% - 6px); }
.rech-feld-3q    { width: calc(75% - 4px); }
.rech-feld-1q    { width: calc(25% - 4px); }
@media (max-width: 420px) {
  .rech-feld-half, .rech-feld-third, .rech-feld-2third, .rech-feld-3q, .rech-feld-1q { width: 100%; }
}
.rech-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.rech-input {
  padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s; width: 100%; box-sizing: border-box;
}
.rech-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.rech-input[readonly] { background: #f8f9fa; color: #888; cursor: default; }

/* Positions-Tabelle */
.rech-pos-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.rech-pos-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.rech-pos-table th {
  text-align: left; padding: 6px 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.rech-th-zahl { text-align: right; }
.rech-pos-table td { padding: 6px 8px; border-bottom: 1px dotted #eee; vertical-align: middle; }
.rech-pos-table td input {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; width: 100%; box-sizing: border-box;
}
.rech-pos-table td input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.rech-td-bezeichnung { min-width: 160px; }
.rech-td-menge    { width: 60px; }
.rech-td-ep       { width: 90px; }
.rech-td-summe    { width: 80px; text-align: right; font-weight: 600; white-space: nowrap; }
.rech-td-del      { width: 36px; text-align: center; }
.rech-pos-del-btn {
  background: none; border: none; color: #ccc; font-size: 16px; cursor: pointer;
  padding: 4px; border-radius: 4px; line-height: 1;
}
.rech-pos-del-btn:hover { color: #c00; background: #ffeaea; }
.rech-pos-add-btn { width: 100%; margin-top: 4px; font-size: 13px; }

/* Artikel-Autocomplete */
.rech-art-wrap { position: relative; }
.rech-art-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); max-height: 180px; overflow-y: auto;
}
.rech-art-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f0f0;
}
.rech-art-item:last-child { border-bottom: none; }
.rech-art-item:hover { background: #f0f7ff; }
.rech-art-item .art-name  { font-weight: 600; }
.rech-art-item .art-preis { font-size: 11px; color: #888; }

/* Footer */
.rech-footer-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rech-summen {
  background: #f8f9fa; border-radius: 8px; padding: 10px 14px;
  margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px;
}
.rech-summen-zeile {
  display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted);
}
.rech-summen-gesamt {
  font-size: 15px; font-weight: 700; color: var(--text);
  border-top: 1.5px solid var(--border); padding-top: 6px; margin-top: 4px;
}
.rech-fehler {
  background: #fee2e2; border: 1px solid #fca5a5; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: #c62828; margin-bottom: 10px;
}
.rech-erstellen-btn {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 700;
  background: #2e7d32; color: #fff; border: none; border-radius: 10px;
  cursor: pointer; font-family: inherit; transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.rech-erstellen-btn:hover { background: #1b5e20; }
.rech-erstellen-btn:disabled { opacity: .65; cursor: not-allowed; }

/* ── Feature 2: Ausgewählter Kunde mit Abwählen-Button (Annahme-Wizard Step 1) ── */
.wiz-kunde-gewaehlt {
  margin-top: 10px;
  background: #e8f5e9;
  border: 1.5px solid #a5d6a7;
  border-radius: var(--radius);
  padding: 12px 14px;
}
.wiz-kunde-gewaehlt-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wiz-kunde-gewaehlt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text);
}
.wiz-kunde-gewaehlt-info strong { font-weight: 700; }
.wiz-kunde-gewaehlt-info span { font-size: 12px; color: var(--text-muted); }
.wiz-kunde-gewaehlt-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Kleiner Icon-Button (Edit / X) */
.btn-icon-sm {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon-sm:active { background: #f0f0f0; }
.btn-icon-danger { border-color: #fca5a5; color: #c62828; }
.btn-icon-danger:active { background: #fee2e2; }

/* Chip in Step 2: mit Edit-Icon inline */
.wiz-kunde-chip {
  display: flex; align-items: center; justify-content: space-between;
  background: #e8f5e9; border: 1.5px solid #a5d6a7;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px; color: #1a2332; gap: 8px;
}
.wiz-kunde-chip-name { flex: 1; }
.wiz-kunde-chip-edit {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid #a5d6a7;
  background: transparent; color: #2e7d32; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.wiz-kunde-chip-edit:active { background: #c8e6c9; }

/* Kunden-Name im Auftrag-Modal → clickable für Edit (Feature 3) */
.am-kunde-clickable {
  cursor: pointer;
  text-decoration: underline dotted;
}
.am-kunde-clickable:hover { color: var(--primary); }

/* ── Feature 1: Zeiterfassung-View ── */
.zeit-notiz-wrap {
  margin-bottom: 20px;
}

.zeit-timer-block {
  text-align: center;
  padding: 32px 16px 16px;
}
.zeit-display {
  font-size: 52px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
  font-family: -apple-system, 'SF Mono', 'Menlo', monospace;
}
.zeit-status {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.zeit-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 20px 0 8px;
}
.zeit-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, box-shadow .12s;
}
.zeit-btn:active { transform: scale(.92); }
.zeit-btn-play {
  width: 88px; height: 88px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(46,125,50,.35);
}
.zeit-btn-play:active { background: var(--accent-hover); }
.zeit-btn-pause {
  width: 68px; height: 68px;
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 3px 10px rgba(245,158,11,.3);
}
.zeit-btn-pause:active { background: #d97706; }
.zeit-btn-stop {
  width: 68px; height: 68px;
  background: #dc2626;
  color: #fff;
  box-shadow: 0 3px 10px rgba(220,38,38,.3);
}
.zeit-btn-stop:active { background: #b91c1c; }

.zeit-confirm {
  text-align: center;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin: 8px 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: #065f46;
}

.zeit-heute-titel {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 16px 0 8px;
}
.zeit-heute-liste {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zeit-eintrag-zeile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.zeit-eintrag-zeile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.zeit-eintrag-zeit { font-size: 13px; font-weight: 600; color: var(--text); }
.zeit-eintrag-notiz { font-size: 12px; color: var(--text-muted); }
.zeit-eintrag-dauer {
  font-size: 13px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ── Mehr-Popover: Zeiterfassung-Item ── */
.mehr-item-zeiterfassung { color: #1a3a5c; }
