/* ============================================================
   style.css – Material-App V3.7
   ============================================================
   INHALTSVERZEICHNIS  (Ctrl+G / Cmd+G = Zeile springen)
   ────────────────────────────────────────────────────────────
   GRUNDLAGEN
     :root CSS-Variablen                              →  L.38
     Sidebar Layout + App-Layout                      →  L.56
     2-Spalten-Grid (Erfassen Desktop)                →  L.183
     Legacy Layout (Login + Mobile .screen)           →  L.197
     Topbar (Mobile + Login)                          →  L.206

   KOMPONENTEN
     Typography                                       →  L.260
     Inputs (big-input, big-select)                   →  L.267
     Material Autocomplete                            →  L.293
     Baustelle Box                                    →  L.330
     Action Toggle (Bezug / Rückgabe)                 →  L.343
     Buttons                                          →  L.360
     Modal / Dialog                                   →  L.416
     Login Box                                        →  L.477
     Capture Action Row                               →  L.488
     Mic Button (einheitlich rund, Icon-only)         →  L.498
     Entry List (Einträge)                            →  L.536
     Edit Entry Modal                                 →  L.598
     Toast                                            →  L.635
     Filter Box (Rapport)                             →  L.675
     Mengen-Leiste (Desktop)                          →  L.755
     Bauholz-Rückgabe-Panel                           →  L.808
     Plausibility Dialog                              →  L.835

   RESPONSIVE / NAVIGATION
     Hamburger-Menü (Sidebar-Toggle)                  →  L.855
     Responsive Base (Sidebar hide, touch)            →  L.877
     Help Screen                                      →  L.908

   SCREENS – MOBILE
     Mobile Capture Screen (Redesign)                 →  L.1057
     Heutige Einträge (Mobile)                        →  L.1485
     Mobile Bottom Navigation                         →  L.1757

   SCREENS – DESKTOP/SHARED
     Kontrolle Dashboard                              →  L.1534
     Erfassungen-Screen                               →  L.1592
     Kontrolle – Sections Layout (Page Cards)         →  L.1883

   WIZARDS
     Bauholz-Wizard (bauholz-wizard.js)               →  L.1907

   FEATURES
     Preischeck-System (holzpreise.js / preischeck.js) → L.2078
     Rüstliste – Planer-Screen                        →  L.2176
     Rüstliste – Runner (Rüster-Ansicht, mobile-first) → L.2281
     Rüstliste Mobile Screen V2                       →  L.2483
     Rüstliste Mikrofon-Button                        →  L.2889
     Rüstliste Desktop-Modus (Overlay neben Sidebar)  →  L.2912
     Rapport – Preispanel (nur Projektleiter)         →  L.2977

   GLOBAL / ÜBERGREIFEND
     Touch-Targets – min. 44px                        →  L.3175
     CSS-Variablen Utility-Klassen (.rw-btn, .rw-card) → L.3226
   ============================================================ */

:root {
  /* Farben */
  --primary:        #0078d4;
  --primary-dark:   #005a9e;
  --success:        #107c10;
  --success-dark:   #0d5f0d;
  --danger:         #d13438;
  --danger-dark:    #a52a2d;
  --recording:      #e81123;
  --warning:        #ffc107;
  --warning-bg:     #fff3cd;
  --bg-body:        #f0f0f3;
  --bg-white:       #ffffff;
  --bg-card:        #ffffff;
  --text-primary:   #333333;
  --text-secondary: #999999;
  --text-muted:     #666666;
  --border:         #dddddd;
  --border-focus:   #0078d4;
  /* Radius + Schatten */
  --border-radius:       8px;
  --border-radius-large: 12px;
  --shadow:        0 2px 8px rgba(0,0,0,0.1);
  --shadow-large:  0 8px 16px rgba(0,0,0,0.15);
  /* Sidebar */
  --sidebar-width:  240px;
  --sidebar-bg:     #1a1a2e;
  --sidebar-active: #6c5ce7;
  --sidebar-hover:  rgba(255,255,255,0.08);
  /* Touch */
  --touch-target:   44px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-body); color: var(--text-primary); min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Sidebar Layout
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.3px;
  line-height: 1.3;
}
.sidebar-logo .logo-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: white;
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: white;
  font-weight: 600;
}
.sidebar-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 16px;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.version-info {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  margin-top: 8px;
  font-family: monospace;
  letter-spacing: 0.03em;
  user-select: all;
}
.screen-center .version-info {
  margin-top: 24px;
  color: rgba(255,255,255,0.25);
}
.sidebar-user {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
}
.sidebar-logout {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.15); color: white; }

/* Main content area (neben Sidebar) */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  align-self: stretch;
  background: var(--bg-body);
}
.main-inner {
  flex: 1;
  padding: 30px 40px;
  max-width: 1200px;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.page-card {
  background: white;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow);
  padding: 30px 36px;
}

/* ============================================================
   Erfassen: 2-Spalten-Grid (Desktop)
   ============================================================ */
.capture-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
}
.capture-col-left { display: flex; flex-direction: column; gap: 16px; }
.capture-col-right { display: flex; flex-direction: column; gap: 0; }
@media (max-width: 900px) {
  .capture-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Legacy Layout (Login + Mobile)
   ============================================================ */
.screen { display: none; min-height: 100vh; padding: 0; }
.screen.active { display: flex; flex-direction: column; align-items: center; }
.screen-center { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 600px; padding: 20px; margin: 0 auto; }
.screen-center.capture { justify-content: center; }
.screen-center.report { justify-content: flex-start; padding-top: 15px; }

/* ============================================================
   Header bar (Mobile + Login)
   ============================================================ */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #0078d4; color: white; position: relative; width: 100%; align-self: stretch; }
.topbar h1 { font-size: 1.1rem; font-weight: 600; }
.topbar-info { font-size: 0.85rem; opacity: 0.85; margin-top: 2px; }
.topbar-center { position: absolute; left: 50%; transform: translateX(-50%); }
.topbar-logo { height: 40px; width: auto; margin-right: 15px; }
.topbar-btn {
  background: rgba(255,255,255,0.2); border: none; color: white;
  padding: 8px 14px; border-radius: 8px; font-size: 0.85rem; cursor: pointer;
  font-weight: 600;
}
.topbar-btn:active { background: rgba(255,255,255,0.3); }

.help-btn-round {
  width: 32px; height: 32px; border-radius: 50%;
  padding: 0 !important; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}

.rapport-btn {
  background: #ff8c00 !important; color: white !important;
  padding: 12px 24px !important; border-radius: 10px !important;
  font-size: 1rem !important; font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.4) !important;
  border: 2px solid #ff8c00 !important;
  min-width: 150px !important;
  transition: all 0.3s ease !important;
}
.rapport-btn:hover {
  background: #ff7700 !important; transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(255, 140, 0, 0.5) !important;
}
.rapport-btn:active {
  background: #e66800 !important; transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.4) !important;
}

.kontrolle-btn {
  background: #dc3545 !important; color: white !important;
  padding: 12px 24px !important; border-radius: 10px !important;
  font-size: 1rem !important; font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
  border: 2px solid #dc3545 !important;
  min-width: 150px !important;
  transition: all 0.3s ease !important;
}
.kontrolle-btn:hover {
  background: #c82333 !important; transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.5) !important;
}
.kontrolle-btn:active {
  background: #bd2130 !important; transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4) !important;
}

/* ============================================================
   Typography
   ============================================================ */
.title { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 8px; color: #0078d4; }
.subtitle { font-size: 1rem; text-align: center; color: #666; margin-bottom: 30px; }
.label { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 8px; display: block; }

/* ============================================================
   Inputs
   ============================================================ */
.big-input {
  width: 100%; padding: 15px; border: 2px solid var(--primary); border-radius: var(--border-radius);
  font-size: 18px; outline: none; background: white; -webkit-appearance: none;
}
.big-input:focus { border-color: var(--primary-dark); box-shadow: 0 0 5px rgba(0,120,212,0.3); }

.big-select {
  width: 100%; padding: 20px; border: 4px solid white; border-radius: var(--border-radius-large);
  font-size: 22px; font-weight: bold; outline: none; background: white; color: var(--primary);
  -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%230078d4'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  box-shadow: var(--shadow);
}
.big-select:focus { border-color: var(--primary); box-shadow: 0 0 5px rgba(0,120,212,0.3); }

.big-textarea {
  width: 100%; padding: 15px; border: 2px solid var(--primary); border-radius: var(--border-radius);
  font-size: 18px; outline: none; background: white; font-family: inherit;
  resize: vertical; min-height: 120px; line-height: 1.5;
}
.big-textarea:focus { border-color: var(--primary-dark); box-shadow: 0 0 5px rgba(0,120,212,0.3); }

/* ============================================================
   Material Autocomplete
   ============================================================ */
.autocomplete-wrap { position: relative; width: 100%; }
.autocomplete-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 100;
  background: white; border: 2px solid var(--primary); border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius); max-height: 280px; overflow-y: auto;
  box-shadow: var(--shadow-large); display: none;
}
.autocomplete-list.visible { display: block; }
.autocomplete-item {
  padding: 14px 18px; cursor: pointer; font-size: 16px;
  border-bottom: 1px solid #f0f0f0; display: flex; flex-direction: column;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.selected { background: #e8f4fd; }
.autocomplete-item .mat-name { font-weight: 500; }
.autocomplete-item .mat-hint { font-size: 0.82rem; color: var(--text-secondary); }
.autocomplete-item .mat-match { color: var(--primary); font-weight: 700; }
.autocomplete-item .mat-detail { font-size: 0.78rem; color: #888; margin-top: 2px; }
.wizard-shortcut-item {
  background: #f8f5ff;
  border-left: 3px solid #6c5ce7;
  border-bottom: 1px solid #ede8fb !important;
}
.wizard-shortcut-item:hover, .wizard-shortcut-item.selected {
  background: #ede8fb;
}
.nacherfassen-btn {
  padding: 12px 15px; cursor: pointer; font-size: 15px; font-weight: 600;
  background: #f5f5f5; color: #666; border-top: 2px solid #e0e0e0;
  text-align: center; width: 100%; display: block;
  border-radius: 0 0 6px 6px;
}
.nacherfassen-btn:active { background: #e8e8e8; color: #333; }

/* ============================================================
   Baustelle Box
   ============================================================ */
.baustelle-box {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  padding: 25px; border-radius: 15px; margin-bottom: 20px;
  box-shadow: 0 8px 16px rgba(0,120,212,0.3);
}
.baustelle-box .label {
  color: white; font-size: 20px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1px;
}

/* ============================================================
   Action Toggle (Bezug / Rueckgabe)
   ============================================================ */
.action-toggle {
  display: flex; gap: 10px; margin-bottom: 20px;
}
.action-toggle button {
  flex: 1; padding: 15px; font-size: 18px; font-weight: bold;
  border: 3px solid; border-radius: 12px; cursor: pointer;
  transition: all 0.2s; min-height: 60px;
}
.action-toggle .bezug-btn { border-color: #107c10; background: white; color: #107c10; }
.action-toggle .bezug-btn.active { background: #107c10; color: white; }
.action-toggle .rueckgabe-btn { border-color: #d13438; background: white; color: #d13438; }
.action-toggle .rueckgabe-btn.active { background: #d13438; color: white; }
.action-toggle button:active { transform: scale(0.97); }

/* ============================================================
   Buttons
   ============================================================ */
.btn-huge {
  width: 100%; padding: 15px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 22px; font-weight: bold; transition: all 0.2s; text-align: center;
  min-height: 70px;
}
.btn-primary { background: #0078d4; color: white; }
.btn-primary:hover { background: #005a9e; }
.btn-primary:active { background: #005a9e; transform: scale(0.98); }
.btn-success { background: #107c10; color: white; }
.btn-success:hover { background: #0d5f0d; }
.btn-success:active { background: #0d5f0d; transform: scale(0.98); }
.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  border: none; color: white;
  padding: 12px 20px; border-radius: 8px; font-size: 0.9rem;
  cursor: pointer; font-weight: 600;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  transition: all 0.3s ease;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}
.btn-danger:active {
  background: linear-gradient(135deg, #bd2130, #a71d2a);
  transform: translateY(0); box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}
.btn-export {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none; color: white;
  padding: 12px 20px; border-radius: 8px; font-size: 0.9rem;
  cursor: pointer; font-weight: 600; margin: 4px;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  transition: all 0.3s ease; min-width: 140px;
}
.btn-export:hover {
  background: linear-gradient(135deg, #218838, #1ea085);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}
.btn-export:active {
  background: linear-gradient(135deg, #1e7e34, #1c7a6e);
  transform: translateY(0); box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}
.export-buttons {
  display: flex; justify-content: center; gap: 8px; margin: 20px 0;
  flex-wrap: wrap;
}
.btn-outline {
  background: white; color: #0078d4; border: 3px solid #0078d4; font-weight: bold;
}
.btn-outline:active { background: #f0f8ff; transform: scale(0.98); }
.btn-huge:disabled { background: #ccc; cursor: not-allowed; opacity: 1; border: none; }

/* ============================================================
   Modal / Dialog
   ============================================================ */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5); z-index: 1000;
  display: flex; justify-content: center; align-items: flex-start;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 16px 0;
  box-sizing: border-box;
}
.modal-dialog {
  background: white; border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  max-width: 380px; width: 90%; overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
  margin: auto;
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
}
/* Scrollbarer Inhaltsbereich in Modals (Header + Footer bleiben fix) */
.modal-body {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  background: linear-gradient(135deg, #0078d4, #005a9e); color: white;
  padding: 20px; display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 1.2rem; }
.modal-close {
  background: none; border: none; color: white; font-size: 1.5rem;
  cursor: pointer; padding: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.2s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.2); }
.modal-body { padding: 20px; }
.modal-body p {
  margin: 0 0 15px 0; font-size: 0.95rem; color: #333; text-align: center;
}

/* ============================================================
   Regie-Wizard: Vollbild auf Mobile (Tastatur-sicher via dvh)
   ============================================================ */
@media (max-width: 900px) {
  #regieWizardOverlay.modal-overlay {
    align-items: stretch;
    padding: 0;
    overflow: hidden;
  }
  #regieWizardOverlay .modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    animation: none;
  }
  #regieWizardOverlay .modal-body {
    max-height: none; /* hebt 70vh-Limit auf */
    flex: 1;
    overflow-y: auto;
  }
}
.modal-options { display: flex; gap: 10px; }
.modal-option {
  flex: 1; border: 2px solid #e0e0e0; border-radius: 6px; padding: 15px 10px;
  transition: all 0.2s; cursor: pointer; text-align: center;
}
.modal-option:hover {
  border-color: #0078d4; box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
  transform: translateY(-1px);
}
.option-icon { font-size: 1.5rem; margin-bottom: 5px; display: block; }
.option-title { font-weight: 600; color: #333; font-size: 0.9rem; margin-bottom: 3px; }
.option-desc { margin: 0; font-size: 0.75rem; color: #666; line-height: 1.2; }

.form-group { margin-bottom: 20px; width: 100%; }

/* ============================================================
   Login Box
   ============================================================ */
.setup-box {
  background: #fff3cd; border: 3px solid #ffc107; border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.setup-box .label { color: #856404; }
.setup-box .big-input { border-color: #ffc107; }
.setup-box .big-input:focus { border-color: #e0a800; box-shadow: 0 0 5px rgba(255,193,7,0.3); }

/* ============================================================
   Capture Action Row (Sprache + Erfassen nebeneinander)
   ============================================================ */
.capture-action-row {
  display: flex; gap: 10px; align-items: stretch; margin-top: 12px;
}
.capture-action-row .btn-save-inline {
  flex: 1;
}

/* ============================================================
   Mic Button – einheitlicher Regie-Stil (rund, Icon-only)
   ============================================================ */
.mic-area { text-align: center; margin: 20px 0; }
.mic-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid #0078d4; background: white;
  color: #0078d4; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; flex-shrink: 0; user-select: none;
}
.mic-btn:hover { background: #e8f3fc; }
.mic-btn:active { background: #d0e9fa; }
.mic-btn.recording {
  background: #d13438; border-color: #d13438; color: white;
  animation: pulse 1.5s infinite;
}

/* Inline Save Button (neben Mic) */
.btn-save-inline {
  height: 56px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 700; transition: all 0.2s; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; width: 100%;
}
.btn-save-inline:disabled { background: #ccc; cursor: not-allowed; opacity: 1; border: none; }
.btn-vormerken { background: #e17055 !important; color: #fff !important; }
.btn-vormerken:hover:not(:disabled) { background: #d35400 !important; }
.btn-vormerken:disabled { background: #ccc !important; color: #fff !important; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.mic-hint { margin-top: 10px; font-size: 16px; color: #666; }
.mic-status { margin-top: 8px; font-size: 18px; font-weight: 600; min-height: 1.4em; text-align: center; }
.mic-status.listening { color: #e81123; }
.mic-status.done { color: #107c10; }

/* ============================================================
   Entry List
   ============================================================ */
.entries-section { width: 100%; margin-top: 20px; }
.entries-title {
  font-size: 1rem; font-weight: 600; color: #333; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.entry-count { background: #0078d4; color: white; padding: 2px 10px; border-radius: 99px; font-size: 0.85rem; font-weight: bold; }

.entry-card {
  background: #f8f9fa; border-radius: 8px; padding: 15px; margin-bottom: 8px;
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 10px; border-left: 4px solid #107c10;
}
.entry-card.rueckgabe { border-left-color: #d13438; background: #fef2f2; }

.entry-type {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 0.75rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px;
}
.entry-type.bezug { background: #e6f7e6; color: #107c10; }
.entry-type.rueckgabe { background: #fee2e2; color: #d13438; }
.entry-type.geruest { background: #fff3e0; color: #b45309; }
.entry-card.geruest { border-left-color: #b45309; background: #fffdf6; }

.entry-text { flex: 1; font-size: 16px; line-height: 1.4; word-break: break-word; color: #333; }
.entry-card.rueckgabe .entry-text { color: #d13438; }
.entry-meta { font-size: 0.8rem; color: #999; margin-top: 4px; }
.entry-secondary { font-size: 0.8rem; color: #666; font-style: italic; margin-top: 2px; }
.entry-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.entry-delete {
  background: none; border: none; color: #d13438; font-size: 1rem; cursor: pointer;
  padding: 2px 6px; line-height: 1; border-radius: 4px; opacity: 0.5; flex-shrink: 0;
}
.entry-delete:hover { opacity: 1; background: #fff0f0; }

/* Vorgemerkt-Einträge */
.vorgemerkt-card { border-left: 4px solid #e17055; }
.vorgemerkt-entry {
  background: #fef6f0; border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
  border-left: 3px solid #e17055; display: flex; align-items: flex-start; gap: 10px;
}
.vorgemerkt-entry .entry-text { flex: 1; font-size: 0.92rem; line-height: 1.4; }
.vorgemerkt-entry .vorgemerkt-user { font-size: 0.75rem; color: #999; margin-top: 3px; }
.vorgemerkt-entry .vorgemerkt-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.vorgemerkt-entry .vorgemerkt-actions button {
  border: none; border-radius: 6px; padding: 5px 10px; font-size: 0.78rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-vorgemerkt-erfassen { background: #107c10; color: #fff; }
.btn-vorgemerkt-erfassen:hover { background: #0d5f0d; }
.btn-vorgemerkt-delete { background: none; color: #ccc; font-size: 1.2rem !important; padding: 2px 6px !important; }
.btn-vorgemerkt-delete:hover { color: #d13438; }

.entry-edit {
  background: none; border: none; color: #6c5ce7; font-size: 1rem; cursor: pointer;
  padding: 2px 6px; line-height: 1; border-radius: 4px; opacity: 0.7; flex-shrink: 0;
}
.entry-edit:hover { opacity: 1; background: #f0eeff; }
.entry-move {
  background: none; border: none; color: #0078d4; font-size: 0.85rem; cursor: pointer;
  padding: 2px 6px; line-height: 1; border-radius: 4px; opacity: 0.7; flex-shrink: 0;
}
.entry-move:hover { opacity: 1; background: #e8f2ff; }
.empty-hint { text-align: center; color: #999; padding: 30px 0; font-size: 16px; }

/* ============================================================
   Edit Entry Modal
   ============================================================ */
.edit-field-group { margin-bottom: 16px; }
.edit-input {
  width: 100%; padding: 10px 12px; border: 2px solid #e0e0e0; border-radius: 8px;
  font-size: 0.95rem; outline: none; background: white; color: #333;
  transition: border-color 0.15s;
}
.edit-input:focus { border-color: #0078d4; }
.edit-type-btn {
  padding: 8px 16px; border: 2px solid #e0e0e0; border-radius: 8px;
  background: white; color: #666; font-weight: 600; cursor: pointer;
  font-size: 0.9rem; transition: all 0.15s;
}
.edit-type-btn.active[data-type="bezug"] {
  background: #107c10; color: white; border-color: #107c10;
}
.edit-type-btn.active[data-type="rueckgabe"] {
  background: #d13438; color: white; border-color: #d13438;
}

/* Edit-Zeitfenster-Buttons (Kontrolle) */
.edit-window-btn {
  padding: 6px 14px; border: 2px solid #e0e0e0; border-radius: 6px;
  background: white; color: #666; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.edit-window-btn.active {
  background: #0078d4; color: white; border-color: #0078d4;
}
.edit-window-btn:hover:not(.active) { border-color: #0078d4; color: #0078d4; }

/* Bottom actions */
.bottom-actions { width: 100%; padding: 15px 0 30px; display: flex; gap: 10px; }
.bottom-actions .btn-huge { flex: 1; font-size: 18px; min-height: 60px; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(100px);
  background: #107c10; color: white; padding: 15px 25px; border-radius: 12px;
  font-size: 18px; font-weight: 600; z-index: 9999; opacity: 0; transition: all 0.3s; white-space: nowrap;
  box-shadow: 0 4px 15px rgba(16,124,16,0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-undo-btn {
  background: rgba(255,255,255,0.25); color: white; border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 6px; padding: 4px 12px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.4); }

/* ---- Sync-Status-Indikator (nur Mobile) ---- */
.sync-ind {
  position: fixed;
  top: calc(13px + env(safe-area-inset-top));
  right: 13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 9999;
  display: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
@media (pointer: coarse) {
  .sync-ind { display: block; }
}
.sync-ok    { background: #00b894; }
.sync-error { background: #e17055; animation: syncPulse 1.4s ease-in-out infinite; }
@keyframes syncPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ============================================================
   Filter Box (Report)
   ============================================================ */
.filter-box {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  padding: 20px; border-radius: 15px; margin-bottom: 15px;
  box-shadow: 0 8px 16px rgba(0,120,212,0.3);
}
.filter-box .label {
  color: white; font-size: 16px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1px;
}
.filter-box select {
  width: 100%; padding: 14px; border: 4px solid white; border-radius: 12px;
  font-size: 18px; font-weight: bold; outline: none; background: white; color: #0078d4;
  -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%230078d4'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Date Filter Chips */
.date-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.date-filter button {
  flex: 1; min-width: 70px; padding: 10px 8px; border: 2px solid #ddd;
  border-radius: 10px; background: #f4f4f6; color: #444;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.date-filter button.active { background: #0078d4; color: white; border-color: #0078d4; }
.date-filter button:hover:not(.active) { background: #e8e8ec; border-color: #bbb; }
.date-filter button:active { transform: scale(0.95); }

/* Date Range Inputs */
.date-range { display: none; gap: 10px; margin-top: 12px; }
.date-range.visible { display: flex; }
.date-range label { color: #555; font-size: 13px; font-weight: 600; flex: 1; }
.date-range input[type="date"] {
  width: 100%; padding: 10px; border: 2px solid #ddd; border-radius: 8px;
  font-size: 15px; background: white; color: #333; margin-top: 4px;
}

/* Report Summary */
.report-summary {
  background: white; border-radius: 12px; padding: 15px 20px; margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); display: flex; justify-content: space-around;
  text-align: center;
}
.report-summary .summary-item { flex: 1; }
.report-summary .summary-value { font-size: 24px; font-weight: 700; color: #0078d4; }
.report-summary .summary-value.green { color: #107c10; }
.report-summary .summary-value.red { color: #d13438; }
.report-summary .summary-label {
  font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
}

/* Report Entry Card */
.report-entry-card {
  background: white; border-radius: 8px; padding: 12px 15px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-left: 4px solid #107c10;
}
.report-entry-card.rueckgabe { border-left-color: #d13438; background: #fef2f2; }
.report-entry-card .report-entry-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.report-entry-card .report-entry-text { font-size: 15px; line-height: 1.4; color: #333; word-break: break-word; }
.report-entry-card.rueckgabe .report-entry-text { color: #d13438; }
.report-entry-card .report-entry-meta { font-size: 0.78rem; color: #999; margin-top: 4px; }

/* Archive restore button */
.archive-restore {
  display: inline-block; margin-top: 6px; padding: 4px 12px; border: 2px solid #0078d4;
  border-radius: 6px; background: white; color: #0078d4; font-size: 0.78rem;
  font-weight: 600; cursor: pointer;
}
.archive-restore:active { background: #f0f8ff; }

/* Topbar button group */
.topbar-btns { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   Mengen-Leiste (Desktop)
   ============================================================ */
.mengen-leiste {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
  border: 2px solid #0078d4; border-radius: 12px; padding: 12px;
  margin-bottom: 15px; display: none;
}
.mengen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mengen-label { font-size: 1rem; font-weight: 600; color: #0078d4; }
.mengen-close {
  background: none; border: none; font-size: 1.6rem; color: #999; cursor: pointer; padding: 6px 10px;
}
.mengen-close:active { color: #d13438; }
.mengen-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mengen-btn {
  flex: 1; min-width: 60px; min-height: 52px; padding: 12px 8px; border: 2px solid #0078d4;
  border-radius: 10px; background: white; color: #0078d4;
  font-size: 16px; font-weight: 700; cursor: pointer; text-align: center;
  transition: all 0.15s; display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}
.mengen-btn:active, .mengen-btn.selected { background: #0078d4; color: white; transform: scale(0.95); }
.mengen-btn:disabled {
  background: #f5f5f5; color: #999; border-color: #ddd;
  cursor: not-allowed; opacity: 0.6;
}
.mengen-custom { display: flex; gap: 8px; align-items: center; }
.mengen-custom input {
  flex: 1; padding: 10px; border: 2px solid #ccc; border-radius: 8px;
  font-size: 16px; outline: none; background: white;
}
.mengen-custom input:focus { border-color: #0078d4; }
.mengen-apply-btn {
  padding: 10px 18px; border: none; border-radius: 8px;
  background: #0078d4; color: white; font-size: 16px; font-weight: 700; cursor: pointer;
}
.mengen-apply-btn:active { background: #005a9e; }
.mengen-unit-select {
  padding: 4px 8px; border: 1px solid var(--primary); border-radius: 6px;
  background: white; color: var(--primary); font-size: 14px; font-weight: 600;
  cursor: pointer; margin-left: 10px;
}
.mengen-preview {
  font-size: 0.85rem; color: #666; margin: 8px 0; text-align: center;
  font-style: italic; min-height: 1.2em;
}
.mengen-warning {
  font-size: 0.88rem; color: #d13438; margin: 8px 0; text-align: center;
  font-weight: 600; padding: 6px 10px; background: #fee2e2;
  border-radius: 6px; border: 1px solid #fecaca;
}

/* ============================================================
   Bauholz-Rückgabe-Panel (Edit-Dialog-Layout in MengenLeiste)
   ============================================================ */
.rueckgabe-field-group {
  margin-bottom: 10px;
}
.rueckgabe-label {
  display: block; font-size: 0.82rem; font-weight: 600; color: #555; margin-bottom: 4px;
}
.rueckgabe-input {
  padding: 8px 10px; border: 2px solid #0078d4; border-radius: 8px;
  font-size: 1rem; font-weight: 600; color: #0078d4; outline: none; background: white;
}
.rueckgabe-input:focus { border-color: #005a9e; }
.rueckgabe-unit-label {
  font-size: 0.85rem; color: #555; font-weight: 500;
}
.rueckgabe-dims-text {
  font-size: 0.95rem; font-weight: 700; color: #999; background: #f0f0f0;
  border: 1.5px solid #ddd; border-radius: 6px; padding: 4px 10px;
  cursor: default;
}
.rueckgabe-preview {
  font-size: 0.82rem; color: #6c5ce7; background: #f5f3ff;
  border-radius: 6px; padding: 8px 10px; margin-top: 4px;
}

/* ============================================================
   Plausibility Dialog
   ============================================================ */
#plausibilityDialog { display: none; }
#plausibilityDialog.visible { display: flex; }
.plausibility-dialog {
  background: white; border-radius: 12px; padding: 24px;
  max-width: 400px; width: 90%; text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.plausibility-dialog h3 { color: #d13438; margin-bottom: 12px; }
.plausibility-dialog p { color: #555; margin-bottom: 20px; line-height: 1.5; }
.plausibility-btns { display: flex; gap: 10px; justify-content: center; }
.plausibility-btns button {
  flex: 1; padding: 12px; border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
#btnPlausibilityConfirm { background: #d13438; color: white; }
#btnPlausibilityCancel { background: #f0f0f0; color: #333; }

/* ============================================================
   Hamburger-Menü (Sidebar-Toggle für schmale Desktop-Fenster)
   ============================================================ */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px; z-index: 500;
  width: 44px; height: 44px;
  background: var(--sidebar-active); border: none; border-radius: 8px;
  color: white; font-size: 1.4rem; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow); touch-action: manipulation;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 490;
  background: rgba(0,0,0,0.45);
}
@keyframes sidebarSlideIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* ============================================================
   Responsive (Base)
   ============================================================ */
@media (max-width: 600px), (max-width: 900px) and (pointer: coarse) {
  .sidebar { display: none !important; }
  .main-content { margin-left: 0; }
  .main-inner { padding: 15px; padding-top: 68px; }
  .screen { padding: 10px; overflow-x: hidden; }
  .topbar { padding: 8px 12px; }
  .topbar h1 { font-size: 1rem; }
  .title { font-size: 24px; }
  .mic-btn { width: 48px; height: 48px; font-size: 1.2rem; }
  .baustelle-box select { font-size: 18px; padding: 15px; }
  .date-filter button { font-size: 13px; padding: 8px 6px; }
  .report-summary .summary-value { font-size: 20px; }
  .topbar-btns { gap: 5px; }
  .topbar-btn { padding: 6px 10px; font-size: 0.8rem; }
  .mengen-btn { min-width: 55px; padding: 10px 6px; font-size: 15px; }

  /* Hamburger sichtbar + Sidebar als Overlay */
  .sidebar-toggle-btn { display: flex; }
  .app-layout.sidebar-open .sidebar {
    display: flex !important;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 495;
    width: var(--sidebar-width);
    padding-top: env(safe-area-inset-top, 0px);
    animation: sidebarSlideIn 0.22s ease;
  }
  .app-layout.sidebar-open .sidebar-overlay { display: block; }
}

/* ============================================================
   Help Screen
   ============================================================ */
.help-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: white; border: none; font-size: 18px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,120,212,0.3);
}
.help-btn:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0,120,212,0.4); }
.help-btn:active { transform: scale(0.95); }

.help-content {
  width: 100%; height: 100%; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
.help-container { max-width: 100%; margin: 0; padding: 20px; }

.help-card {
  background: white; border-radius: 12px; padding: 20px; margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08); transition: all 0.3s;
}
.help-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }

/* Einklappbare Abschnitte */
.help-acc {
  border: 1px solid #e0ddf7; border-radius: 12px; margin-bottom: 10px;
  overflow: hidden; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.help-acc-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: #f8f7ff; cursor: pointer;
  font-weight: 700; font-size: 1rem; color: #1a1a2e;
  list-style: none; user-select: none; transition: background 0.15s;
}
.help-acc-header::-webkit-details-marker { display: none; }
.help-acc-header::marker { display: none; }
/* Regie-Materialien Klapp-Block im Rapport */
.regie-linked-details > summary::-webkit-details-marker { display: none; }
.regie-linked-details > summary::marker { display: none; }
.regie-linked-details > summary:hover { filter: brightness(1.1); }
.regie-linked-details[open] > summary { border-radius: 8px 8px 0 0; }
.regie-linked-details[open] > summary .rld-arrow { transform: rotate(180deg); }
.help-acc-header:hover { background: #f0eeff; }
details[open] > .help-acc-header { background: #6c5ce7; color: white; }
.help-acc-arrow {
  margin-left: auto; font-size: 0.85rem; color: #6c5ce7; transition: transform 0.2s;
}
details[open] > .help-acc-header .help-acc-arrow { transform: rotate(180deg); color: white; }
.help-acc-header > span:nth-child(2) { flex: 1; min-width: 0; }
.help-acc-count {
  font-size: 0.7rem; background: #e0ddf7; color: #6c5ce7;
  border-radius: 10px; padding: 1px 8px; font-weight: 600;
  flex-shrink: 0; white-space: nowrap;
}
details[open] > .help-acc-header .help-acc-count { background: rgba(255,255,255,0.25); color: white; }
.help-acc-body { padding: 14px 14px 4px; animation: helpAccOpen 0.15s ease-out; }
.help-acc-body .help-card { margin-bottom: 10px; }
@keyframes helpAccOpen { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .help-acc { margin-bottom: 8px; border-radius: 10px; }
  .help-acc-header { padding: 11px 11px; font-size: 0.85rem; gap: 6px; }
  .help-acc-header > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .help-acc-count { font-size: 0.68rem; padding: 1px 7px; }
  .help-acc-body { padding: 10px 10px 2px; }
  .help-acc-body .help-card { padding: 14px 14px; text-align: left; }
  .help-acc-body .help-card h3 { text-align: left; }
  .help-acc-body .help-card p,
  .help-acc-body .help-card ol,
  .help-acc-body .help-card ul { text-align: left; }
  .welcome-card { padding: 20px 16px; border-radius: 10px; }
  .welcome-card h2 { font-size: 1.2rem; margin: 10px 0 6px; }
  .welcome-card p { font-size: 0.9rem; }
  .help-icon { font-size: 2rem; margin-bottom: 6px; }
}

.welcome-card {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: white; text-align: center; padding: 30px 20px;
}
.welcome-card h2 { margin: 15px 0 10px 0; font-size: 1.5rem; }
.welcome-card p { margin: 0; font-size: 1rem; color: #ffffff; }

.help-icon { font-size: 2.5rem; margin-bottom: 10px; display: inline-block; }
.help-section { margin-bottom: 30px; }
.help-section-title {
  font-size: 1.3rem; font-weight: 700; color: #0078d4; margin-bottom: 15px;
  padding-left: 15px; border-left: 4px solid #0078d4;
}
.feature-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.feature-header .help-icon { font-size: 2rem; margin-bottom: 0; }
.feature-header h4 { margin: 0; font-size: 1.2rem; color: #333; }
.help-card:not(.welcome-card) p { margin: 10px 0; line-height: 1.6; color: #555; }
.help-steps { margin: 15px 0; padding-left: 25px; line-height: 1.8; color: #333; }
.help-steps li { margin-bottom: 8px; }
.help-list { margin: 15px 0; padding-left: 25px; line-height: 1.8; color: #333; }
.help-list li { margin-bottom: 8px; }
.help-tip {
  background: #e7f3ff; border-left: 4px solid #0078d4;
  padding: 12px 15px; margin-top: 15px; border-radius: 4px;
  font-size: 0.95rem; color: #004085;
}
.help-warning {
  background: #fff3cd; border-left: 4px solid #ffc107;
  padding: 12px 15px; margin-top: 15px; border-radius: 4px;
  font-size: 0.95rem; color: #856404;
}
.tips-card { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border: 2px solid #dee2e6; }
.tips-list { list-style: none; padding: 0; margin: 0; }
.tips-list li { padding: 12px 0; border-bottom: 1px solid #dee2e6; line-height: 1.6; }
.tips-list li:last-child { border-bottom: none; }
.shortcuts-table { width: 100%; border-collapse: collapse; }
.shortcuts-table td { padding: 12px 8px; border-bottom: 1px solid #e0e0e0; }
.shortcuts-table tr:last-child td { border-bottom: none; }
.shortcuts-table kbd {
  background: #f4f4f4; border: 1px solid #ccc; border-radius: 4px;
  padding: 4px 8px; font-family: monospace; font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); display: inline-block;
  min-width: 40px; text-align: center;
}
.support-card { background: linear-gradient(135deg, #107c10 0%, #0d5c0d 100%); color: white; text-align: center; }
.support-card p { color: white; margin: 10px 0; }
.help-version { margin-top: 20px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.3); }
.help-version small { color: rgba(255,255,255,0.8); }
.help-footer { margin-top: 30px; margin-bottom: 20px; text-align: center; }
.btn-back-help {
  min-width: 200px; min-height: 50px;
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: white; border: none; border-radius: 10px;
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 4px 15px rgba(0,120,212,0.3);
}
.btn-back-help:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,120,212,0.4); }
.btn-back-help:active { transform: scale(0.98); }

@media (max-width: 600px), (max-width: 900px) and (pointer: coarse) {
  .help-container { padding: 15px; }
  .help-card { padding: 15px; margin-bottom: 15px; }
  .welcome-card { padding: 25px 15px; }
  .welcome-card h2 { font-size: 1.3rem; }
  .help-section-title { font-size: 1.1rem; }
  .feature-header h4 { font-size: 1.1rem; }
  .help-icon { font-size: 2rem; }
  .feature-header .help-icon { font-size: 1.8rem; }
  .btn-back-help { min-width: 100%; }
}

/* ============================================================
   Mobile Capture Screen – Redesign
   ============================================================ */
#screenCaptureMobile {
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  align-items: stretch; /* Children bekommen volle Breite */
  padding: 0 !important; /* überschreibt @media .screen { padding: 10px } */
  overflow-x: visible !important; /* kein clip auf fixed children */
}

/* Header */
.mob-header {
  background: #1a1a2e; color: #fff;
  height: calc(48px + env(safe-area-inset-top));
  display: flex; align-items: center;
  padding: env(safe-area-inset-top) 16px 0;
  flex-shrink: 0; position: sticky; top: 0; z-index: 10;
  width: 100%; box-sizing: border-box;
}
.mob-header-title { font-size: 1rem; font-weight: 700; letter-spacing: 0.03em; }

/* Erste-Hilfe-Kasten Icon (CSS-gerendert: roter Kasten mit weissem Kreuz) */
.icon-erste-hilfe {
  display: inline-block;
  position: relative;
  width: 1.05em;
  height: 1.05em;
  background: #d13438;
  border-radius: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-erste-hilfe::before,
.icon-erste-hilfe::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 1px;
}
.icon-erste-hilfe::before { width: 60%; height: 22%; top: 39%; left: 20%; }
.icon-erste-hilfe::after  { width: 22%; height: 60%; top: 20%; left: 39%; }

/* Scroll-Container */
.mob-capture-content {
  flex: 1; overflow-y: auto; padding-bottom: 140px;
  background: #f0f0f3; width: 100%; box-sizing: border-box;
  padding-top: 10px;
}

/* Section-Cards (Baustelle, Material) */
.mob-section-card {
  background: #fff; border-radius: 14px; margin: 0 12px 14px;
  padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  box-sizing: border-box;
}
.mob-section-label {
  font-size: 0.85rem; font-weight: 700; color: #888;
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 8px;
}

/* Baustelle */
.mob-baustelle-wrap { position: relative; }
/* Favoriten-Stern: Flex-Wrapper mit Select links + Stern rechts daneben */
.mob-baustelle-wrap > div {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
.mob-baustelle-wrap .fav-star-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  flex-shrink: 0;
  font-size: 1.3rem;
  padding: 4px 6px !important;
}
/* "Favoriten"-Label auf Mobile ausblenden */
.mob-baustelle-wrap .fav-star-btn span:first-child {
  display: none !important;
}
.mob-baustelle-select {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: calc(100% - 48px);
  height: 48px; border: 2px solid #e8e8e8; border-radius: 10px;
  font-size: 0.95rem; padding: 0 36px 0 12px; background: #f8f8f8; color: #222;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color 0.2s; box-sizing: border-box;
}
.mob-baustelle-select:focus { border-color: #0078d4; outline: none; box-shadow: 0 0 0 3px rgba(0,120,212,0.12); }

/* Mobile: Native Select ausblenden, Search-Button anzeigen */
.mob-hidden-select { display: none !important; }
.mob-baustelle-search-btn {
  flex: 1; width: 100%; min-width: 0;
  height: 48px; border: 2px solid #e8e8e8; border-radius: 10px;
  font-size: 0.95rem; padding: 0 12px; background: #f8f8f8; color: #222;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; box-sizing: border-box; text-align: left;
  transition: border-color 0.2s;
}
.mob-baustelle-search-btn:active { border-color: #0078d4; background: #f0f7ff; }
#mobBaustelleLabel {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.mob-bs-search-icon { font-size: 1.1rem; flex-shrink: 0; opacity: 0.5; }

/* Fullscreen Baustellen-Such-Overlay */
.mob-bs-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #f5f5f5; z-index: 10000;
  display: flex; flex-direction: column;
}
.mob-bs-overlay-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: #fff;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.mob-bs-overlay-header input {
  flex: 1; height: 42px; border: 2px solid #e0e0e0; border-radius: 10px;
  padding: 0 14px; font-size: 1rem; background: #f8f8f8;
  outline: none; box-sizing: border-box;
}
.mob-bs-overlay-header input:focus { border-color: #0078d4; background: #fff; }
.mob-bs-cancel-btn {
  background: none; border: none; color: #0078d4; font-size: 0.9rem;
  font-weight: 600; padding: 8px 4px; white-space: nowrap; cursor: pointer;
}
.mob-bs-results {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mob-bs-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: #fff;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer; font-size: 0.95rem; color: #222;
  transition: background 0.1s;
}
.mob-bs-result-item:active { background: #e8f2ff; }
.mob-bs-result-item.fav { background: #fffdf0; }
.mob-bs-result-item.fav:active { background: #fff3cc; }
.mob-bs-result-nr {
  font-weight: 700; color: #0078d4; min-width: 52px; font-size: 0.9rem;
}
.mob-bs-result-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mob-bs-result-fav { flex-shrink: 0; font-size: 0.85rem; }
.mob-bs-result-status { flex-shrink: 0; font-size: 0.8rem; opacity: 0.6; }
.mob-bs-empty {
  text-align: center; padding: 40px 20px; color: #999; font-size: 0.9rem;
}
.mob-bs-section-label {
  padding: 10px 16px 4px; font-size: 0.75rem; font-weight: 600;
  color: #888; text-transform: uppercase; letter-spacing: 0.04em;
  background: #f5f5f5;
}

/* Action Toggle */
.mob-action-row { display: flex; gap: 8px; padding: 0 12px 0; margin-bottom: 14px; }
.mob-action-btn {
  flex: 1; height: 68px; border: 2px solid #e0e0e0; border-radius: 12px;
  background: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; transition: all 0.18s; font-weight: 700; color: #888;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mob-action-btn .mob-action-icon { font-size: 1.4rem; line-height: 1; }
.mob-action-btn .mob-action-label {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.mob-action-btn:not(.active):active { background: #f5f5f5; border-color: #ccc; }
.mob-bezug.active  { background: #107c10; border-color: #107c10; color: #fff; }
.mob-rueckgabe.active { background: #d13438; border-color: #d13438; color: #fff; }

/* Material-Suchleiste */
.mob-search-bar { position: relative; }
.mob-textarea {
  width: 100%; height: 56px; min-height: unset;
  border: 2px solid #e8e8e8; border-radius: 12px;
  padding: 0 148px 0 16px;
  font-size: 1.05rem; resize: none; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; color: #222;
  background: #f8f8f8; line-height: 56px; overflow: hidden;
  -webkit-appearance: none;
}
.mob-textarea:focus {
  border-color: #0078d4; outline: none;
  box-shadow: 0 0 0 3px rgba(0,120,212,0.12); background: #fff;
}
/* Icon-Buttons rechts im Suchfeld */
.mob-search-actions {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 4px; align-items: center;
}
.mob-search-icon-btn {
  width: 48px; height: 48px; border-radius: 10px; border: none;
  font-size: 1.2rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s;
}
.mob-mic-btn {
  background: white; color: #0078d4;
  border: 2px solid #0078d4 !important; border-radius: 50% !important;
}
.mob-mic-btn:active { background: #d0e9fa; }
.mob-mic-btn.recording {
  background: #d13438; color: white;
  border-color: #d13438 !important;
  animation: mobMicPulse 1s infinite;
}
@keyframes mobMicPulse { 0%,100%{opacity:1} 50%{opacity:0.55} }
.mob-qr-btn { background: #f0eeff; color: #6c5ce7; }
.mob-qr-btn:active { background: #6c5ce7; color: #fff; }
/* Clear-Button im Suchfeld – kleiner als mic/QR */
.mob-clear-btn {
  width: 40px; height: 40px; border-radius: 8px;
  background: #ebebed; border: none; color: #555;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; transition: background 0.12s;
}
.mob-clear-btn:active { background: #d0d0d5; }
/* Browse-Button unter Suchfeld */
.mob-browse-btn {
  background: none; border: none; color: #0078d4; font-size: 0.85rem;
  cursor: pointer; padding: 8px 12px; text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}
/* Material-Browser Wizard Typ-Buttons */
.bw-type-btn {
  padding: 16px 10px; border: 1.5px solid #e0e0e0; border-radius: 10px;
  background: #fafafa; cursor: pointer; text-align: center;
  transition: background 0.12s, border-color 0.12s; -webkit-tap-highlight-color: transparent;
}
.bw-type-btn:active, .bw-type-btn:hover { background: #f0eeff; border-color: #6c5ce7; }
.bw-type-label { font-size: 0.9rem; font-weight: 700; color: #1a1a2e; }
.bw-type-sub   { font-size: 0.7rem; color: #888; margin-top: 2px; }
/* Statischer Hint unter dem Suchfeld */
.mob-input-hint {
  font-size: 0.8rem; color: #999; text-align: center;
  margin-top: 7px; letter-spacing: 0.01em;
}
/* Dynamischer Mic-Status */
.mob-mic-hint {
  font-size: 0.8rem; color: #888; text-align: center; margin-top: 4px; min-height: 1.1em;
}
/* Aktions-Buttons in der Heute-Liste (Mobile) */
.mob-today-actions { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
.mob-today-action-btn {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  padding: 8px 10px; border-radius: 6px; opacity: 0.55;
  -webkit-tap-highlight-color: transparent;
}
.mob-today-action-btn:active { opacity: 1; background: #f5f5f5; }

/* Alte Klassen – für Kompatibilität behalten aber nicht mehr sichtbar */
.mob-input-section { display: none; }
.mob-tools-row { display: none; }
.mob-tool-btn { display: none; }
.mob-counter { display: none; }

/* ============================================================
   Mobile Best Practices
   ============================================================ */

/* 1. Input-Zoom Prevention: alle Inputs/Selects/Textareas auf Mobile ≥16px */
@media (max-width: 900px) and (pointer: coarse), (max-width: 600px) {
  input, select, textarea {
    font-size: 16px !important;
  }
  /* Ausnahmen: kleine Badge-Labels nicht überschreiben */
  input[type="checkbox"], input[type="radio"] {
    font-size: inherit !important;
  }
}

/* 2. touch-action: manipulation – kein 300ms Delay auf allen interaktiven Elementen */
@media (pointer: coarse) {
  button, a, [role="button"], label[for], select {
    touch-action: manipulation;
  }
}

/* 3. Autocomplete-Items auf Mobile: grösseres Touch-Ziel (min 56px) */
@media (max-width: 900px) and (pointer: coarse), (max-width: 600px) {
  #autocompleteListMobile .autocomplete-item {
    min-height: 56px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  #autocompleteListMobile .autocomplete-item .mat-name {
    font-size: 1rem;
  }
  #autocompleteListMobile .autocomplete-item .mat-detail,
  #autocompleteListMobile .autocomplete-item .mat-hint {
    font-size: 0.8rem;
  }
}

/* 4. Today-Rows auf Mobile: besser tappbar */
.mob-today-row {
  min-height: 56px;
}
.mob-today-action-btn {
  min-width: 44px; min-height: 44px;
}

/* 5. Skeleton-Loader für Materialsuche */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-item {
  height: 56px; border-radius: 8px; margin: 4px 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.2s infinite linear;
}

/* 6. Haptic-Feedback Klasse: kurzes visuelles "Flash" nach Erfassen */
@keyframes mob-success-flash {
  0%   { background: #107c10; }
  40%  { background: #1a9e1a; }
  100% { background: #107c10; }
}
.mob-save-btn.success-flash,
.mobile-mengen-save-btn.success-flash {
  animation: mob-success-flash 0.4s ease-out;
}

/* 7. Mengen-Sheet: Vollbild auf allen Geräten */

/* 8. Mob-Section-Card: etwas mehr Atemraum */
.mob-section-card {
  padding: 14px 16px;
}

/* Save Button */
.mob-save-btn {
  display: block; margin: 14px 14px 6px; width: calc(100% - 28px);
  height: 56px; background: #6c5ce7; color: #fff; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.08em; cursor: pointer;
  transition: background 0.18s, opacity 0.18s; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  box-sizing: border-box;
}
.mob-save-btn:not([disabled]):active { background: #5a4dd6; }
.mob-save-btn[disabled] { opacity: 0.32; cursor: not-allowed; }

/* Mengen Bottom Sheet – Vollbild auf Mobile */
.mobile-mengen-sheet {
  position: fixed; top: 0; bottom: 0; left: 0; right: 0;
  background: white; border-radius: 0;
  box-shadow: none; z-index: 400;
  display: none; flex-direction: column;
  overflow: hidden;
}
/* ID-Regel: überschreibt alles, z-index über Bottom-Nav (300) */
#mengenSheetMobile {
  position: fixed !important; top: 0 !important; bottom: 0 !important;
  left: 0 !important; right: 0 !important;
  height: 100vh !important; height: 100dvh !important;
  z-index: 400 !important;
  background: white; border-radius: 0 !important;
  box-shadow: none;
  flex-direction: column;
  overflow: hidden;
}
#mengenSheetMobile.open,
#mengenSheetMobile[style*="display: block"],
#mengenSheetMobile[style*="display:block"],
#mengenSheetMobile[style*="display: flex"] { display: flex !important; }
.mobile-mengen-sheet[style*="display: block"] { display: flex; }
.mobile-mengen-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 20px 16px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  border-bottom: 2px solid #e0e0e0;
  background: #f8f8fa; flex-shrink: 0;
}
.mobile-mengen-label { font-size: 1.15rem; font-weight: 700; color: #1a1a2e; line-height: 1.3; flex: 1; padding-right: 12px; }
.mobile-mengen-close {
  background: #f0f0f0; border: none; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mobile-mengen-buttons {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: start;
}
.mobile-mengen-btn {
  background: white; border: 2px solid #0078d4; border-radius: 12px;
  padding: 20px 8px; font-size: 1.2rem; font-weight: 700; color: #0078d4;
  cursor: pointer; transition: all 0.2s; min-height: 68px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-mengen-btn:active { background: #e8f4fd; transform: scale(0.95); }
.mobile-mengen-custom {
  padding: 12px 16px; border-top: 2px solid #e0e0e0; display: flex; gap: 8px;
  box-sizing: border-box;
}
.mobile-mengen-custom input {
  flex: 1; min-width: 0; padding: 12px 6px; border: 2px solid #0078d4; border-radius: 8px;
  font-size: 1.2rem; font-weight: 700; text-align: center; box-sizing: border-box;
}
/* Stepper +/- Buttons */
.mob-stepper-btn {
  width: 48px; height: 48px; border: 2px solid #0078d4; border-radius: 10px;
  background: white; color: #0078d4; font-size: 1.5rem; font-weight: 700;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; box-sizing: border-box;
}
.mob-stepper-btn:active { background: #0078d4; color: white; }
.mobile-mengen-apply-btn {
  padding: 12px 16px; background: #0078d4; color: white;
  border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
  flex-shrink: 0; box-sizing: border-box;
}
/* Aktions-Bar: sticky am unteren Rand des Mengen-Sheets */
.mobile-mengen-action-bar {
  position: sticky; bottom: 0; left: 0; right: 0;
  display: flex; gap: 8px; padding: 10px 12px;
  background: white; border-top: 1px solid #e0e0e0;
  margin-top: auto; z-index: 2;
  box-sizing: border-box;
}
.mobile-mengen-save-btn {
  flex: 1.6; height: 56px; background: #6c5ce7; color: #fff; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.08em; cursor: pointer;
  text-transform: uppercase; -webkit-tap-highlight-color: transparent;
  box-sizing: border-box; transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}
.mobile-mengen-vormerken-btn {
  flex: 1 !important; background: #e17055; font-size: 0.9rem;
}
.mobile-mengen-save-btn:not([disabled]):active { background: #5a4dd6; transform: scale(0.97); }
.mobile-mengen-save-btn[disabled] { opacity: 0.3; cursor: not-allowed; }
/* Pulsieren wenn Menge gewählt wurde */
.mobile-mengen-save-btn.ready {
  opacity: 1 !important; cursor: pointer !important;
  animation: mengen-ready-pulse 0.8s ease-in-out 2;
}
@keyframes mengen-ready-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(108, 92, 231, 0); }
}
/* Gewählter Mengen-Button */
.mengen-btn.selected {
  background: #0078d4 !important; color: white !important;
  border-color: #0078d4 !important; transform: scale(0.95);
}
/* Unit-Select auf Mobile grösser */
#mengenUnitSelectMobile {
  font-size: 1rem !important; padding: 8px 12px !important;
  border: 2px solid #0078d4 !important; border-radius: 8px !important;
  height: 42px; font-weight: 600; background: white; color: #0078d4;
}

/* Compat-Alias: mobile-autocomplete-wrap = mob-autocomplete-wrap */
.mobile-autocomplete-wrap { position: relative; }

/* Autocomplete auf Mobile: fixed positioning damit overflow-y:auto des Containers
   das Dropdown nicht clippt */
#autocompleteListMobile {
  position: fixed;
  left: 12px; right: 12px;
  top: auto; /* wird per JS gesetzt */
  bottom: auto; /* explizit, damit JS-Toggle funktioniert */
  z-index: 350;
  max-height: 45vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#autocompleteListMobile.flip-up {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Safe Area für iPhone Home-Indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mob-capture-content {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }
  .mob-today-entries {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}
@supports (-webkit-touch-callout: none) {
  .mob-capture-content { padding-bottom: 160px; }
}

/* ============================================================
   Heutige Einträge unter Mobile-Erfassen
   ============================================================ */
.mob-today-entries {
  width: 100%; box-sizing: border-box;
  padding: 0 14px 100px; /* Abstand zur Bottom-Nav */
  background: #f5f5f7;
}
.mob-today-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 8px;
  font-size: 0.78rem; font-weight: 700; color: #888;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-top: 1px solid #e0e0e0;
}
.mob-today-count {
  background: #107c10; color: #fff; border-radius: 10px;
  padding: 1px 8px; font-size: 0.72rem; font-weight: 700;
}
.mob-today-list { display: flex; flex-direction: column; gap: 6px; }
.mob-today-row {
  background: #fff; border-radius: 8px; padding: 9px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.mob-today-main {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px;
}
.mob-today-name {
  font-size: 0.88rem; font-weight: 600; color: #111;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mob-today-meta {
  display: flex; justify-content: space-between; align-items: center;
}
.mob-today-menge {
  font-size: 0.76rem; color: #777; font-style: italic;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mob-today-time {
  font-size: 0.72rem; color: #bbb; flex-shrink: 0; margin-left: 8px;
}
.mob-today-badge {
  font-size: 0.72rem; font-weight: 700; border-radius: 4px;
  padding: 1px 5px; flex-shrink: 0;
}
.mob-today-badge-rueck { background: #fff0f0; color: #d13438; }
.mob-today-badge-komm  { background: #fff3e0; color: #e67e22; }

/* ============================================================
   Kontrolle Dashboard
   ============================================================ */
.control-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px; margin-bottom: 0;
}
.stat-card { background: #f8f9fa; border-radius: 8px; padding: 20px; border-left: 4px solid #107c10; }
.stat-card.warning { border-left-color: #ff8c00; }
.stat-card.error { border-left-color: #d13438; }
.stat-card h3 { margin: 0 0 8px 0; font-size: 0.9rem; color: #666; text-transform: uppercase; font-weight: 600; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: #333; }
.stat-card .stat-label { font-size: 0.85rem; color: #888; margin-top: 5px; }

.control-section { background: none; border-radius: 0; padding: 0; box-shadow: none; margin-bottom: 0; }
.control-section h3 { margin: 0 0 15px 0; font-size: 1.2rem; color: #333; display: flex; align-items: center; gap: 8px; }
.control-filters { display: flex; gap: 10px; margin-bottom: 0; flex-wrap: wrap; }
.control-filters select, .control-filters button {
  padding: 8px 15px; border-radius: 6px; border: 1px solid #ccc; font-size: 0.9rem;
}
.control-filters button { background: #0078d4; color: white; border: none; cursor: pointer; font-weight: 600; }
.control-filters button:hover { background: #005a9e; }

/* Aktive Baustellen Chips */
.aktive-bs-label { font-size: 0.82rem; font-weight: 600; color: #555; margin-bottom: 8px; }
.aktive-bs-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.aktive-bs-chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 5px; border-radius: 8px; border: 1px solid #ddd;
  background: #fff; cursor: pointer; font-size: 0.62rem; color: #333;
  transition: all 0.15s ease; user-select: none; white-space: nowrap; line-height: 1.3;
}
.aktive-bs-chip:hover { border-color: #0078d4; background: #f0f7ff; }
.aktive-bs-chip.selected { border-color: #0078d4; background: #e8f2ff; color: #0078d4; font-weight: 600; }
.aktive-bs-chip .chip-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 13px; height: 13px; padding: 0 2px;
  border-radius: 7px; font-size: 0.55rem; font-weight: 700; color: #fff;
}
.aktive-bs-chip .chip-badge.rot { background: #d13438; }
.aktive-bs-chip .chip-badge.orange { background: #e67e22; }
.aktive-bs-chip .chip-badge.grau { background: #999; }
.aktive-bs-chip .chip-badge.gruen { background: #16a34a; }
/* Age + Check nur bei Hover sichtbar (spart Platz) */
.aktive-bs-chip .chip-age { font-size: 0.6rem; color: #999; display: none; }
.aktive-bs-chip:hover .chip-age { display: inline; }
.aktive-bs-chip.kontrolliert { opacity: 0.5; border-style: dashed; border-color: #16a34a; }
.aktive-bs-chip.kontrolliert:hover { opacity: 0.8; }
.chip-check-btn {
  background: none; border: none; cursor: pointer; font-size: 0.65rem;
  padding: 0 1px; line-height: 1; opacity: 0; transition: opacity 0.15s;
}
.aktive-bs-chip:hover .chip-check-btn { opacity: 0.5; }
.chip-check-btn:hover { opacity: 1 !important; }
.aktive-bs-empty { font-size: 0.8rem; color: #999; font-style: italic; padding: 4px 0; }
/* Kontrolliert-Button unter den Chips */
.aktive-bs-kontrolliert-inline {
  width: 100%; margin-top: 10px; padding: 8px 14px;
  border: 1.5px solid #16a34a; border-radius: 8px;
  background: #f0fdf4; color: #16a34a; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
}
.aktive-bs-kontrolliert-inline:hover { background: #dcfce7; border-color: #15803d; }

.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-item {
  display: flex; align-items: center; gap: 15px; padding: 15px;
  background: #f9f9f9; border-radius: 8px; border-left: 4px solid #ff8c00;
}
.issue-item.error { border-left-color: #d13438; background: #fff5f5; }
.issue-item.warning { border-left-color: #ff8c00; background: #fffbf0; }
.issue-item.info { border-left-color: #0078d4; background: #f0f7ff; }
.issue-icon { font-size: 1.5rem; flex-shrink: 0; }
.issue-content { flex: 1; }
.issue-title { font-weight: 600; color: #333; margin-bottom: 4px; }
.issue-details { font-size: 0.9rem; color: #666; }
.issue-meta { font-size: 0.85rem; color: #888; margin-top: 5px; }
.issue-action { flex-shrink: 0; }
.issue-action button {
  padding: 6px 12px; background: #0078d4; color: white;
  border: none; border-radius: 4px; font-size: 0.85rem; cursor: pointer;
}
.issue-action button:hover { background: #005a9e; }

.empty-state { text-align: center; padding: 40px 20px; color: #666; }
.empty-state-icon { font-size: 3rem; margin-bottom: 15px; }

.balance-table { width: 100%; border-collapse: collapse; }
.balance-table th, .balance-table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; }
.balance-table th { background: #f5f5f5; font-weight: 600; font-size: 0.9rem; color: #333; }
.balance-table td { font-size: 0.9rem; color: #666; }
.balance-table-compact th, .balance-table-compact td { padding: 8px 10px; font-size: 0.85rem; }
.balance-positive { color: #107c10; font-weight: 600; }
.balance-negative { color: #d13438; font-weight: 600; }
.balance-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.badge-success { background: #e6f4ea; color: #107c10; }
.badge-warning { background: #fff4e5; color: #ff8c00; }
.badge-error { background: #fce8e6; color: #d13438; }

/* ============================================================
   Erfassungen-Screen
   ============================================================ */
.eintrage-day-group { margin-bottom: 20px; }
.eintrage-day-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #666;
  text-transform: uppercase;
  padding: 6px 0 4px;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}
.eintrage-day-entries { display: flex; flex-direction: column; gap: 6px; }
.eintrage-row {
  transition: box-shadow 0.1s;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 0;
}
.eintrage-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.eintrage-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 5px;
  white-space: nowrap;
}
.eintrage-badge-rueck  { background: #fce8e6; color: #d13438; }
.eintrage-badge-komm   { background: #fff4e5; color: #e67e22; }
.eintrage-badge-re     { background: #f3e8ff; color: #7b2d8b; }
.eintrage-badge-spesen { background: #e0f7fa; color: #0d9488; }

/* Kommissions-Karte im Erfassen-Screen */
.komm-card-entry {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 0; border-bottom: 1px solid #fde3c0;
}
.komm-card-entry:last-child { border-bottom: none; }
.komm-card-entry-info { flex: 1; min-width: 0; }
.komm-card-entry-name { font-size: 0.88rem; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.komm-card-entry-meta { font-size: 0.75rem; color: #999; margin-top: 1px; }
.btn-komm-erfassen {
  flex-shrink: 0; padding: 4px 10px;
  background: #e67e22; color: #fff;
  border: none; border-radius: 6px;
  font-size: 0.78rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.btn-komm-erfassen:hover { background: #d35400; }

.eintrage-badge-regie {
  font-size: 0.7rem; font-weight: 700; background: #0078d4; color: white;
  padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}

/* Regie-Section (alle Screens) */
.regie-section {
  margin-bottom: 16px;
  border-bottom: 2px solid #0078d4;
  padding-bottom: 12px;
}
.regie-section-hdr {
  font-size: 0.82rem; font-weight: 700; color: #0078d4;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.regie-card {
  background: #f0f6ff; border: 1.5px solid #d0e4f7;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 6px;
}
.regie-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.regie-card-meta { font-size: 0.75rem; color: #aaa; }
.regie-pos {
  font-size: 0.78rem; color: #555; margin-top: 4px; line-height: 1.8;
  display: flex; flex-direction: column; gap: 0;
}
.regie-notiz {
  margin-top: 4px; font-size: 0.78rem; color: #666; font-style: italic;
}
.regie-zuordnen-btn {
  margin-top: 6px; width: 100%; padding: 5px;
  border: 1.5px dashed #0078d4; border-radius: 7px;
  background: transparent; color: #0078d4;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  display: block; box-sizing: border-box;
}
.regie-zuordnen-btn:hover { background: #e8f3fc; }

/* ── PL-Screens (Rapport, Kontrolle, Faktoren, Regie-Ansätze) ── */
.content-card {
  background: white; border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.09);
  margin-bottom: 16px; padding: 20px 24px;
}
.pl-section-hdr {
  margin: 0 0 14px; font-size: 0.95rem;
  font-weight: 700; color: #0078d4;
  display: flex; align-items: center; gap: 6px;
}
.pl-info-banner {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 12px 16px;
  border-radius: 8px; font-size: 0.85rem;
}
.pl-info-banner--blue  { background: #e8f4fd; border: 1px solid #b3d7f5; color: #1a5276; }
.pl-info-banner--yellow { background: #fef9e7; border: 1px solid #f9e09a; color: #7d6608; }

/* Faktoren-Inputs */
.faktor-input {
  width: 80px; padding: 6px 4px; border: 1px solid #ddd;
  border-radius: 6px; text-align: center;
  font-size: 0.9rem; font-weight: 600;
}
.faktor-input--neutral  { background: #f5f5f5; }
.faktor-input--positive { background: #e8f4e8; }
.faktor-input--negative { background: #fce8e8; }

/* PL-Grid (2-spaltig: Label | Wert) */
.pl-grid-2col { display: grid; grid-template-columns: 1fr 120px; gap: 6px 16px; align-items: center; }
.pl-grid-label { font-size: 0.78rem; font-weight: 700; color: #888; }
.pl-grid-label--right { text-align: right; }
.pl-grid-row { font-size: 0.92rem; color: #333; padding: 3px 0; }
.pl-grid-value { font-weight: 700; font-size: 0.95rem; color: #111; text-align: right; padding: 3px 0; }

/* Rapport Entry Body */
.report-entry-body {
  display: flex; align-items: flex-start; gap: 8px;
  flex-wrap: wrap; margin-top: 4px;
}
.report-entry-einheitspreis { font-size: 0.78rem; color: #aaa; white-space: nowrap; }
.report-entry-time { font-size: 0.78rem; color: #999; }
.report-delete-btn {
  margin-left: auto; padding: 2px 8px;
  border: 1px solid #d13438; border-radius: 5px;
  background: transparent; color: #d13438;
  cursor: pointer; font-size: 0.8rem;
}
.report-delete-btn:hover { background: #fff0f0; }
.report-locked { margin-left: auto; font-size: 0.72rem; color: #aaa; padding: 2px 8px; }

.eintrage-exported-flag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.7rem; font-weight: 600; color: #2d7d46;
  background: #eafaf1; border: 1px solid #a9dfc0;
  border-radius: 4px; padding: 1px 6px;
}

/* Eintrage-Row Struktur-Klassen */
.eintrage-row-header { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.eintrage-row-left { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eintrage-row-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.eintrage-row-name { font-weight: 700; font-size: 0.97rem; color: #111; }
.eintrage-row-menge { font-weight: 700; font-size: 0.95rem; color: #333; white-space: nowrap; }
.eintrage-row-user { font-size: 0.82rem; white-space: nowrap; }
.eintrage-row-time { font-size: 0.8rem; color: #bbb; }
.eintrage-row-actions { display: flex; gap: 4px; flex-shrink: 0; align-items: center; }
.eintrage-rw-detail {
  font-size: 0.78rem; color: #888; margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed #e4e4e4; line-height: 1.7;
}
.eintrage-bezug-ref {
  font-size: 0.78rem; color: #bbb; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #eee; line-height: 1.6;
}
.eintrage-bezug-ref strong { color: #999; }

/* Footer */
.eintrage-footer {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #eee;
  font-size: 0.9rem; color: #666; display: flex; gap: 16px;
  flex-wrap: wrap; align-items: center;
}

@media (max-width: 600px), (max-width: 900px) and (pointer: coarse) {
  .control-stats { grid-template-columns: 1fr; }
  .issue-item { flex-direction: column; align-items: flex-start; }
  .issue-action { width: 100%; }
  .issue-action button { width: 100%; }
  .balance-table { font-size: 0.85rem; }
  .balance-table th, .balance-table td { padding: 8px; }
}

/* ============================================================
   Mobile Bottom Navigation
   ============================================================ */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 600px), (max-width: 900px) and (pointer: coarse) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1a1a2e;
    z-index: 300;
    border-top: 1px solid rgba(255,255,255,0.08);
    /* Safe area: Home-Indicator auf iPhone X+ */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(62px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 2px;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.2px;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* kein 300ms Delay auf iOS */
    min-width: 0;
    min-height: 62px; /* Touch-Ziel */
  }
  .mobile-nav-btn .mobile-nav-icon {
    font-size: 1.35rem;
    line-height: 1;
  }
  .mobile-nav-btn.active {
    color: #fff;
    background: rgba(108, 92, 231, 0.38);
  }
  .mobile-nav-btn:active {
    background: rgba(108, 92, 231, 0.22);
    color: rgba(255,255,255,0.9);
  }

  /* Topbar für Desktop-Screens auf Mobile – gleich wie .mob-header */
  .mobile-screen-topbar {
    display: flex;
    align-items: center;
    background: #1a1a2e;
    color: #fff;
    padding: env(safe-area-inset-top) 16px 0;
    height: calc(48px + env(safe-area-inset-top));
    flex-shrink: 0;
    position: sticky;
    top: calc(-15px - env(safe-area-inset-top)); /* Kompensiert .main-inner padding-top: 15px */
    z-index: 10;
    width: calc(100% + 30px); /* Kompensiert .main-inner padding links+rechts: 15px */
    margin: -15px -15px 0;    /* Raus aus dem .main-inner padding */
    box-sizing: border-box;
    gap: 12px;
  }
  .mobile-screen-topbar-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: left;
  }
  .mobile-back-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Doppelter Seiten-Titel unter Mobile-Topbar ausblenden */
  .main-inner .page-title { display: none; }

  /* Desktop-Screens auf Mobile: padding-bottom für Bottom-Nav */
  .main-inner {
    padding: 15px;
    padding-bottom: 74px;
  }
  /* appLayout auf Mobile: kein flex mehr nötig, Block-Layout */
  .app-layout {
    display: block;
  }
  .main-content {
    min-height: 100vh;
    padding-bottom: 62px;
  }

  /* Materialien-Screen auf Mobile: Tabelle scrollbar + Filter stapeln */
  .mat-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .mat-table-wrap table {
    min-width: 480px;
  }
  .mat-filter-bar {
    flex-direction: column;
  }
  .mat-filter-bar input,
  .mat-filter-bar select,
  .mat-filter-bar button {
    width: 100% !important;
    box-sizing: border-box;
    min-width: 0 !important;
    flex: none !important;
  }
}

/* ============================================================
   Kontrolle – Sections Layout (Page Cards)
   ============================================================ */
.control-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.control-page-card {
  background: white;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow);
  padding: 24px 28px;
}
.control-page-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0078d4;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   BAUHOLZ WIZARD
   ============================================================ */
.bauholz-wizard-dialog {
  max-width: 500px;
  width: 94%;
}
.bauholz-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  border-top: 1px solid #eee;
  min-height: 48px;
  flex-shrink: 0;
}
.wizard-step-indicator {
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
}
.wizard-back-btn {
  padding: 7px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f5f5f5;
  color: #555;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}
.wizard-back-btn:hover { background: #eee; }

/* Typ-Buttons (Step 1) */
.wizard-type-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  font-size: 0.95rem;
  width: 100%;
  text-align: left;
}
.wizard-type-btn:hover {
  border-color: #6c5ce7;
  background: #f5f3ff;
}
.wizard-type-btn.selected {
  border-color: #6c5ce7;
  background: #f0eeff;
  box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

/* Subtyp-Buttons (Step 2) */
.wizard-subtype-row {
  display: flex;
  gap: 14px;
  margin: 4px 0;
}
.wizard-subtype-btn {
  flex: 1;
  padding: 16px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
}
.wizard-subtype-btn:hover {
  border-color: #6c5ce7;
  background: #f5f3ff;
}
.wizard-subtype-btn.selected {
  border-color: #6c5ce7;
  background: #f0eeff;
  box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

/* Dimensionenraster (Step 3) */
.wizard-dim-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wizard-dim-btn {
  padding: 8px 10px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  transition: all 0.15s;
  white-space: nowrap;
}
.wizard-dim-btn:hover {
  border-color: #6c5ce7;
  background: #f5f3ff;
  color: #6c5ce7;
}
.wizard-dim-btn.selected {
  border-color: #6c5ce7;
  background: #6c5ce7;
  color: #fff;
}

/* Freie Dimensionseingabe */
.wizard-custom-dims {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 600px), (max-width: 900px) and (pointer: coarse) {
  .bauholz-wizard-dialog { max-width: 97vw; }
  .wizard-type-btn {
    padding: 18px 16px;
    font-size: 1rem;
    min-height: 56px;
  }
  .wizard-subtype-btn {
    padding: 20px 12px;
    font-size: 1rem;
    min-height: 56px;
  }
  .wizard-dim-grid {
    gap: 8px;
  }
  .wizard-dim-btn {
    font-size: 0.85rem;
    padding: 12px 10px;
    min-height: 44px;
    min-width: 44px;
  }
  .wizard-back-btn {
    padding: 12px 18px;
    font-size: 0.95rem;
    min-height: 48px;
  }
  .wizard-step-indicator {
    font-size: 0.85rem;
  }
  .modal-close {
    width: 44px;
    height: 44px;
  }
}

/* ── Baustellen-Favoriten Stern-Button ── */
.fav-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 3px 5px 1px;
  line-height: 1;
  color: #ccc;
  transition: color 0.15s, transform 0.1s;
  flex-shrink: 0;
  border-radius: 6px;
}
.fav-star-btn:hover { color: #f0a500; transform: scale(1.15); }
.fav-star-btn.active { color: #f0a500; }

/* ============================================================
   PREISCHECK-SYSTEM (holzpreise.js / preischeck.js)
   ============================================================ */

/* Modal Footer (genutzt von preischeckDialog) */
.modal-footer {
  background: #f8f8f8;
  border-top: 1px solid #e8e8e8;
}

/* Preischeck-Banner im Kontrolle-Screen */
.preischeck-banner-inner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border: 1px solid #ffb74d; border-radius: 8px;
  padding: 12px 18px;
}
.preischeck-banner-icon { font-size: 1.3rem; flex-shrink: 0; }
.preischeck-banner-text { flex: 1; font-size: 0.9rem; color: #333; }
.btn-preischeck-banner {
  background: #e67e22; color: white; border: none;
  padding: 7px 16px; border-radius: 6px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.2s;
}
.btn-preischeck-banner:hover { background: #d35400; }

/* Login-Banner (dringender Hinweis nach 180 Tagen) */
.preischeck-login-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff8e1, #ffe082);
  border: 1px solid #ffc107; border-radius: 8px;
  padding: 10px 16px; margin: 12px 0;
  font-size: 0.9rem; color: #333;
}
.preischeck-login-banner button {
  background: #f39c12; color: white; border: none;
  padding: 5px 12px; border-radius: 5px; cursor: pointer; font-size: 0.82rem;
  font-weight: 600;
}
.preischeck-login-banner button:hover { background: #e67e22; }

/* Preischeck-Dialog: Material-Liste */
.preischeck-gruppe { margin-bottom: 20px; }
.preischeck-gruppe-titel {
  font-size: 0.85rem; font-weight: 700; color: #6c5ce7;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 10px 0; padding-bottom: 6px;
  border-bottom: 2px solid #ede9ff;
}
.preischeck-zeile {
  background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px;
  transition: box-shadow 0.2s;
}
.preischeck-zeile:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.preischeck-zeile-info {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.preischeck-ampel { font-size: 1.3rem; flex-shrink: 0; }
.preischeck-zeile-text { flex: 1; min-width: 0; }
.preischeck-zeile-text strong { display: block; font-size: 0.9rem; color: #222; }
.preischeck-artikelnr { font-size: 0.75rem; color: #888; font-family: monospace; }
.preischeck-zeile-preise {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.preischeck-aktuell, .preischeck-richtwert { display: flex; flex-direction: column; }
.preischeck-label { font-size: 0.72rem; color: #888; margin-bottom: 1px; }
.preischeck-preis-wert { font-size: 0.95rem; font-weight: 700; color: #333; }
.btn-preischeck-aendern {
  margin-left: auto; background: #6c5ce7; color: white; border: none;
  padding: 5px 12px; border-radius: 5px; font-size: 0.8rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.2s;
}
.btn-preischeck-aendern:hover { background: #5a4dd6; }

/* Preischeck-Dialog: Inline-Eingabe */
.preischeck-input-row {
  background: #f0edff; border: 1px solid #6c5ce7; border-radius: 8px;
  padding: 12px 14px; margin-top: 8px;
}
.preischeck-input-inner { display: flex; flex-direction: column; gap: 8px; }
.preischeck-input-inner label { font-size: 0.85rem; font-weight: 600; color: #555; }
.preischeck-input {
  border: 2px solid #6c5ce7; border-radius: 6px; padding: 7px 10px;
  font-size: 1rem; max-width: 160px; outline: none;
  transition: border-color 0.2s;
}
.preischeck-input:focus { border-color: #4834d4; }
.preischeck-input-hint { font-size: 0.78rem; color: #6c5ce7; }
.preischeck-input-buttons { display: flex; gap: 8px; margin-top: 4px; }
.btn-sm { padding: 5px 12px; border-radius: 5px; font-size: 0.82rem; font-weight: 600; cursor: pointer; border: none; }
.btn-primary.btn-sm { background: #6c5ce7; color: white; }
.btn-primary.btn-sm:hover { background: #5a4dd6; }
.btn-secondary.btn-sm { background: #e0e0e0; color: #333; }
.btn-secondary.btn-sm:hover { background: #c8c8c8; }

/* ============================================================
   RÜSTLISTE – Planer-Screen
   ============================================================ */

/* Editor-Item (vorgemerktes Material oder Freitext) */
.rl-editor-empty {
  color: #888;
  font-size: 0.88rem;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px dashed #ccc;
}
.rl-editor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8f7ff;
  border: 1px solid #e0dcff;
  border-radius: 8px;
  margin-bottom: 6px;
}
.rl-editor-item-info { flex: 1; min-width: 0; }
.rl-editor-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rl-editor-item-meta { font-size: 0.82rem; color: #666; margin-top: 2px; }
.rl-editor-item-remove {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.rl-editor-item-remove:hover { color: #d13438; background: #fff0f0; }
.rl-badge-freitext {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Rüstlisten-Liste (bestehende Listen) */
.rl-liste-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: box-shadow 0.15s;
}
.rl-liste-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.rl-liste-item-info { flex: 1; min-width: 0; }
.rl-liste-item-title { font-weight: 700; font-size: 0.95rem; color: #222; }
.rl-liste-item-meta { font-size: 0.82rem; color: #888; margin-top: 2px; }
.rl-liste-item-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.rl-action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.rl-btn-qr    { background: #f0eeff; color: #6c5ce7; }
.rl-btn-open  { background: #6c5ce7; color: #fff; }
.rl-btn-open:hover { background: #5a4dd6; }
.rl-btn-delete { background: #fff0f0; color: #c0392b; }
.rl-btn-delete:hover { background: #ffd7d7; }

/* Status-Badges */
.rl-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}
.rl-status-offen    { background: #f0f0f3; color: #555; }
.rl-status-progress { background: #fff3cd; color: #856404; }
.rl-status-done     { background: #d4edda; color: #155724; }

/* ============================================================
   RÜSTLISTE – Runner (Rüster-Ansicht, mobile-first)
   ============================================================ */

#screenRuestlisteRunner {
  background: #f0f0f3;
  min-height: 100vh;
}
.rl-runner {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
}
.rl-runner-header {
  background: #1a1a2e;
  color: #fff;
  padding: 14px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.rl-runner-back-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.rl-runner-back-btn:hover { background: rgba(255,255,255,0.25); }
.rl-runner-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.rl-runner-baustelle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  margin-top: 1px;
}
.rl-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}
.rl-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}
.rl-progress-fill {
  height: 100%;
  background: #6c5ce7;
  border-radius: 4px;
  transition: width 0.35s ease;
}
.rl-progress-text {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}

/* Item-Liste */
.rl-runner-list {
  flex: 1;
  padding: 10px 10px 0;
  overflow-y: auto;
}

/* Runner-Item */
.rl-runner-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
}
.rl-runner-item.rl-item-done {
  opacity: 0.6;
  border-color: #27ae60;
  background: #f6fff9;
}
.rl-runner-item.rl-item-na {
  opacity: 0.45;
  border-color: #e0e0e0;
  background: #f8f8f8;
}
.rl-runner-item-check {
  font-size: 1.4rem;
  line-height: 1;
  padding-top: 2px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.rl-runner-item-body { flex: 1; min-width: 0; }
.rl-runner-item-name {
  font-weight: 700;
  font-size: 1rem;
  color: #222;
  line-height: 1.3;
}
.rl-runner-item-detail {
  font-size: 0.85rem;
  color: #777;
  margin-top: 2px;
}
.rl-runner-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Erkanntes Material nach QR-Scan */
.rl-erkanntes-mat {
  margin-top: 6px;
  padding: 6px 10px;
  background: #eef9f1;
  border-radius: 7px;
  font-size: 0.88rem;
  color: #1a6b3a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Runner-Buttons */
.rl-runner-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.rl-runner-btn-ok {
  background: #6c5ce7;
  color: #fff;
  min-width: 110px;
}
.rl-runner-btn-ok:hover { background: #5a4dd6; }
.rl-runner-btn-scan {
  background: #f39c12;
  color: #fff;
}
.rl-runner-btn-scan:hover { background: #e67e22; }
.rl-runner-btn-na {
  background: #f0f0f0;
  color: #777;
}
.rl-runner-btn-na:hover { background: #e0e0e0; }
.rl-btn-inline {
  padding: 4px 10px;
  font-size: 0.82rem;
  min-width: auto;
  margin-left: auto;
}

/* Footer */
.rl-runner-footer {
  padding: 12px 10px;
  background: #fff;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  position: sticky;
  bottom: 0;
}
.rl-btn-abschliessen {
  width: 100%;
  padding: 14px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.rl-btn-abschliessen:hover:not(:disabled) { background: #219a52; }
.rl-btn-abschliessen:disabled {
  background: #b0c4b8;
  cursor: not-allowed;
}

/* ============================================================
   Rüstliste Mobile Screen V2
   ============================================================ */
#screenRuestlisteMobile {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
  background: #f0f0f3;
  max-width: 100vw;
  box-sizing: border-box;
  padding: 0; /* ID-Selektor schlägt .screen ohne !important → Desktop-Regel (30px 40px) greift wieder */
  align-items: stretch;  /* Children bekommen volle Breite */
}
#screenRuestlisteMobile.active {
  display: flex;
}
.rl-mob-content {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Baustelle Label (read-only, wird im Erfassen-Screen gesetzt) */
.rl-mob-baustelle-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.rl-mob-baustelle-icon { font-size: 1rem; flex-shrink: 0; }
.rl-mob-baustelle-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a2e;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Add-Formular */
.rl-mob-add-form {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rl-mob-add-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.rl-mob-add-input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
}
.rl-mob-qr-btn {
  background: #f0eeff;
  border: 1.5px solid #c8bcff;
  border-radius: 10px;
  font-size: 1.2rem;
  padding: 0 13px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.rl-mob-qr-btn:active { background: #e0d8ff; }
.rl-mob-add-row2 {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rl-mob-menge-input {
  flex: 0 0 76px;
  min-width: 0;
  border-radius: 10px;
}
.rl-mob-einheit-input {
  flex: 0 0 56px;
  min-width: 0;
  border-radius: 10px;
}
.rl-mob-add-btn {
  flex: 1;
  background: #6c5ce7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  min-height: 42px;
}
.rl-mob-add-btn:active { background: #5a4dd6; }

/* Autocomplete Dropdown */
.rl-ac-list {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 3px;
}
.rl-ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  gap: 8px;
}
.rl-ac-item:last-child { border-bottom: none; }
.rl-ac-item:active, .rl-ac-item:hover { background: #f0eeff; }
.rl-ac-name { font-size: 0.9rem; font-weight: 600; color: #222; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-ac-meta { font-size: 0.78rem; color: #888; white-space: nowrap; }

/* Import Bar */
.rl-mob-import-bar {
  /* wrapper */
}
.rl-mob-import-btn {
  width: 100%;
  background: #fff;
  border: 1.5px dashed #6c5ce7;
  border-radius: 10px;
  color: #6c5ce7;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  min-height: 42px;
}
.rl-mob-import-btn:active { background: #f0eeff; }
.rl-import-count {
  background: #6c5ce7;
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
  display: inline-block;
}

/* Liste Container */
.rl-mob-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rl-mob-empty {
  text-align: center;
  color: #888;
  font-size: 1rem;
  padding: 30px 20px;
  background: #fff;
  border-radius: 12px;
  line-height: 1.6;
}
.rl-tipp-box {
  padding: 15px;
  background: #f0f7ff;
  border-left: 4px solid #0984e3;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
}

/* Abschnitt-Header (Offen / Erledigt) */
.rl-section-hdr {
  font-size: 0.82rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.rl-section-done { color: #4CAF50; }
.rl-clear-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #888;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.rl-clear-btn:active { background: #f5f5f5; color: #d13438; border-color: #d13438; }

/* Einzelne Items */
.rl-mob-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px 10px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.rl-mob-item-done {
  opacity: 0.6;
}
.rl-mob-item-done .rl-mob-item-name {
  text-decoration: line-through;
  color: #999;
}
.rl-mob-check {
  background: none;
  border: 2px solid #ccc;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  -webkit-tap-highlight-color: transparent;
  color: #aaa;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
}
.rl-mob-item-done .rl-mob-check {
  border-color: #4CAF50;
  background: #e8f5e9;
  color: #4CAF50;
}
.rl-mob-check:active { background: #f0eeff; border-color: #6c5ce7; color: #6c5ce7; }
.rl-mob-item-info {
  flex: 1;
  min-width: 0;
}
.rl-mob-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #222;
  overflow-wrap: break-word;
  word-break: break-word;
}
.rl-mob-item-meta {
  font-size: 0.78rem;
  color: #888;
  margin-top: 2px;
  overflow-wrap: break-word;
}
.rl-mob-del {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1rem;
  padding: 6px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
}
.rl-mob-del:active { color: #d13438; background: #fff0f0; }
.rl-mob-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 8px;
  opacity: 0.45;
  flex-shrink: 0;
  border-radius: 6px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.rl-mob-edit:hover, .rl-mob-edit:active { opacity: 1; background: #f0f0f5; }
.rl-mob-del { color: #bbb; }
.rl-mob-del:hover { color: #d13438; background: #fff0f0; }
.rl-badge-ft {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  background: #f0eeff;
  color: #6c5ce7;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
}

/* ---- Rüstliste: "Ersetzt"-Item ---- */
.rl-mob-item-ersetzt {
  opacity: 0.7;
  background: #fff5f5;
}
.rl-mob-ersetzt-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d13438;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.rl-ersetzt-hint {
  color: #d13438 !important;
  font-size: 0.75rem;
}

/* ---- FT-Preis-Eingabe (Rapport + Kontrolle) ---- */
.ft-preis-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.ft-preis-input {
  width: 110px;
  padding: 4px 8px;
  font-size: 0.85rem;
  border: 1px solid #e0b000;
  border-radius: 6px;
  background: #fffbe6;
  color: #333;
  outline: none;
}
.ft-preis-input:focus {
  border-color: #c89600;
  background: #fff9d6;
}
.ft-preis-label {
  font-size: 0.78rem;
  color: #a07800;
  font-weight: 600;
}

/* ---- Kontrolle: FT-Einträge ohne Preis ---- */
.ft-control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid #f5d76e;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.ft-control-info {
  flex: 1;
  min-width: 0;
}
.ft-control-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ft-control-meta {
  font-size: 0.78rem;
  color: #888;
  margin-top: 2px;
}

/* ============================================================
   Rüstliste Mikrofon-Button (ersetzt QR-Button)
   ============================================================ */
.rl-mob-mic-btn {
  background: white;
  color: #0078d4;
  border: 2px solid #0078d4;
  border-radius: 50%;
  padding: 0 14px;
  height: 44px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.rl-mob-mic-btn:active { background: #d0e9fa; }
.rl-mob-mic-btn.recording {
  background: #d13438; color: white; border-color: #d13438;
}

/* ============================================================
   Rüstliste Desktop-Modus (Overlay neben Sidebar)
   ============================================================ */
.rl-desktop-title { display: none; }
.rl-mob-header-only { /* auf Desktop ausblenden */ }

@media (min-width: 901px) {
  /* Rüstliste Mobile-Screen wird neben der Sidebar positioniert */
  #screenRuestlisteMobile.active {
    position: fixed;
    left: var(--sidebar-width, 240px);
    top: 0;
    right: 0;
    bottom: 0;
    display: block !important;   /* überschreibt flex vom .screen.active */
    overflow-y: auto;
    background: var(--bg-body, #f0f0f3);
    padding: 30px 40px;
    z-index: 10;
    min-height: unset;
    align-items: unset;
  }
  /* Mobile Header auf Desktop verstecken */
  #screenRuestlisteMobile .rl-mob-header-only { display: none !important; }
  /* Desktop-Titel einblenden */
  #screenRuestlisteMobile .rl-desktop-title {
    display: block;
    margin-bottom: 24px;
  }
  /* Content-Bereich als desktop-styled Card */
  #screenRuestlisteMobile .rl-mob-content {
    max-width: 780px;
    padding: 0;
  }
  #screenRuestlisteMobile .rl-mob-baustelle-bar {
    background: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 16px;
  }
  #screenRuestlisteMobile .rl-mob-add-form {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
  }
  #screenRuestlisteMobile .rl-mob-list {
    /* Desktop: Items sehen schon gut aus dank .rl-mob-item Styles */
  }
  #screenRuestlisteMobile .rl-mob-item-name {
    font-size: 1rem;
  }
  #screenRuestlisteMobile .rl-mob-item-meta {
    font-size: 0.85rem;
  }
  #screenRuestlisteMobile .rl-mob-edit {
    opacity: 0.6;
  }
  #screenRuestlisteMobile .rl-mob-del {
    color: #aaa;
  }
}

/* ── Faktor-Badges (nur am Bildschirm, nicht im PDF) ─────────────── */
.rapport-faktor-badge {
  cursor: default;
  vertical-align: middle;
}
/* controlFaktorenCard: nur PL – wird per JS ein-/ausgeblendet */
#controlFaktorenCard { display: none; }  /* Standard ausgeblendet; JS zeigt für PL */

/* Alles mit .screen-only beim Drucken ausblenden */
@media print {
  .screen-only         { display: none !important; }
  #controlFaktorenCard { display: none !important; }
  /* Regie-Materialien-Klappblock immer aufgeklappt drucken */
  .regie-linked-details { display: block !important; }
  .regie-linked-details > summary { display: none !important; }
  .regie-linked-details > div { display: block !important; }
}

/* ============================================================
   Mobile Best Practices
   ============================================================ */

/* 1. Input Zoom Prevention: verhindert Auto-Zoom auf iOS Safari */
@media (pointer: coarse) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* 2. Touch-Action: entfernt 300ms Tap-Delay auf iOS Safari */
@media (pointer: coarse) {
  button, a, [role="button"], label, select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-action-btn, .mob-search-icon-btn, .mob-save-btn {
    touch-action: manipulation;
  }
}

/* 3. Autocomplete-Items: Mindestgrösse für bequemes Tippen */
#autocompleteListMobile .autocomplete-item {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.95rem;
}
#autocompleteListMobile .autocomplete-item .mat-name {
  font-size: 0.95rem;
}

/* 4. Today-Rows: Mindestgrösse */
.mob-today-row {
  min-height: 56px;
}

/* 5. Safe Area (iPhone Home Indicator) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mob-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    min-height: calc(62px + env(safe-area-inset-bottom));
  }
  #screenCaptureMobile {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  #mengenSheetMobile {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   ITEM 2: Touch-Targets – min. 44px auf allen interaktiven Elementen
   ============================================================ */

/* Alle Buttons und Links müssen auf Touch mindestens 44px gross sein */
button, [role="button"], a.btn, input[type="submit"], input[type="button"] {
  min-height: var(--touch-target);
  touch-action: manipulation; /* Verhindert 300ms Tap-Delay */
}

/* Ausnahmen: Icon-only Buttons die explizit kleiner sind (z.B. ✕ Schliessen) */
.modal-close,
.btn-icon-sm {
  min-height: 36px;
}

/* Sidebar-Menüpunkte */
.sidebar-item {
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}

/* Autocomplete-Einträge auf Mobile */
@media (max-width: 768px) {
  .autocomplete-item {
    min-height: var(--touch-target);
    padding: 10px 14px;
  }
  /* Mengen-Buttons */
  .mengen-btn {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
  }
  /* Entry-Karten Actions */
  .entry-actions button {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
  }
  /* Wizard-Auswahl-Chips sollen gut tappbar sein */
  .bauholz-option,
  .rl-item-row {
    min-height: var(--touch-target);
  }
  /* Filter-Inputs */
  select, input[type="text"], input[type="number"], textarea {
    min-height: var(--touch-target);
    font-size: 16px; /* verhindert Zoom bei Focus auf iOS */
  }
}

/* ============================================================
   ITEM 1: CSS-Variablen – Utility-Klassen für Wizard-Inline-Styles
   Verwendung in JS: class="rw-btn-primary" statt style="background:#0078d4..."
   ============================================================ */

/* Buttons */
.rw-btn {
  border: none; border-radius: var(--border-radius); cursor: pointer;
  font-family: inherit; font-weight: 600; padding: 8px 16px;
  min-height: var(--touch-target); transition: opacity .15s;
}
.rw-btn:active { opacity: .85; }
.rw-btn-primary  { background: var(--primary);  color: #fff; }
.rw-btn-success  { background: var(--success);  color: #fff; }
.rw-btn-danger   { background: var(--danger);   color: #fff; }
.rw-btn-outline  { background: var(--bg-white); color: var(--primary);
                   border: 1.5px solid var(--primary); }
.rw-btn-ghost    { background: var(--bg-white); color: var(--text-muted);
                   border: 1px solid var(--border); }
.rw-btn-sm       { padding: 5px 12px; min-height: 36px; font-size: .83rem; }
.rw-btn-lg       { padding: 10px 22px; font-size: .95rem; font-weight: 700; }

/* Cards + Sektionen */
.rw-card {
  background: var(--bg-card); border-radius: var(--border-radius-large);
  box-shadow: var(--shadow); padding: 16px;
}
.rw-card-info    { background: #e8f5e9; border: 1.5px solid #a5d6a7; }
.rw-card-warn    { background: #fff8e1; border: 1.5px solid #ffe082; }
.rw-card-danger  { background: #fdecea; border: 1.5px solid #f5c6cb; }
.rw-card-muted   { background: var(--bg-body); border: 1px solid var(--border); }

/* Labels + Text */
.rw-label        { font-size: .75rem; font-weight: 700; color: var(--text-muted);
                   text-transform: uppercase; letter-spacing: .05em; }
.rw-value        { font-weight: 700; color: var(--text-primary); }
.rw-muted        { color: var(--text-muted); font-size: .82rem; }
.rw-hint         { color: var(--text-secondary); font-size: .8rem; margin-top: 4px; }

/* Chips/Badges */
.rw-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; font-size: .82rem; font-weight: 600;
}
.rw-chip-blue    { background: #e3f2fd; border: 1.5px solid #90caf9; color: #1565c0; }
.rw-chip-green   { background: #e8f5e9; border: 1.5px solid #a5d6a7; color: #2d7d46; }
.rw-chip-orange  { background: #fff8e1; border: 1.5px solid #ffe082; color: #7d6608; }

/* Inputs */
.rw-input {
  padding: 8px 10px; border: 2px solid var(--border); border-radius: var(--border-radius);
  font-size: .9rem; font-family: inherit; outline: none; width: 100%; box-sizing: border-box;
  min-height: var(--touch-target);
}
.rw-input:focus { border-color: var(--border-focus); }

/* Hilfsklasse: content-card und pl-section-hdr (für Regie-Einstellungen) */
.content-card {
  background: var(--bg-card); border-radius: var(--border-radius-large);
  box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 16px;
}
.pl-section-hdr {
  font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0 0 12px;
}
.pl-grid-label        { font-size: .75rem; font-weight: 700; color: var(--text-muted);
                        text-transform: uppercase; letter-spacing: .04em; }
.pl-grid-label--right { text-align: right; }
.pl-grid-row          { padding: 6px 0; color: var(--text-primary); font-size: .88rem; }
.pl-grid-value        { padding: 6px 0; text-align: right; font-size: .88rem; }
.pl-grid-2col         { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; }

/* ============================================================
   KOMMISSIONEN – RE-Prüfungs-Buttons
   ============================================================ */
.komm-btn {
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 32px;
}
.komm-btn-primary { background: #6c5ce7; color: white; }
.komm-btn-primary:hover { background: #5a4dd6; }
.komm-btn-ok {
  background: #22c55e; color: white;
  padding: 4px 10px; font-size: 1rem;
}
.komm-btn-ok:hover { background: #16a34a; }
.komm-btn-nok {
  background: #ef4444; color: white;
  padding: 4px 10px; font-size: 1rem;
}
.komm-btn-nok:hover { background: #dc2626; }

/* ── Rüstliste ausgeblendet (Migration auf Plattform-App geplant) ── */
#nav-ruestliste,
#mob-nav-ruestliste,
#screenRuestliste,
#screenRuestlisteMobile,
#btnVormerken,
#btnVormerkenMobile,
.btn-vormerken,
.mobile-mengen-vormerken-btn,
#vormerkenFtDialog,
[data-wizard-action^="vormerken"],
[data-fw-action^="vormerken"],
[data-scr-action="vormerken"] { display: none !important; }

