/* ── Globale Farbvariablen ────────────────────────────────── */
:root {
  --color-ek: #e67e22;  /* EK netto / Einkaufspreis — orange  */
  --color-vk: #27ae60;  /* VK netto / Verkaufspreis — grün    */
  --color-cu: #b45309;  /* CU-Zuschlag — Kupferbraun           */
  --color-al: #6b7280;  /* AL-Zuschlag — Aluminiumgrau         */
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f4f6f9;
  color: #222;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  background: #1a2535;
  color: #fff;
  padding: 12px 20px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Titel + Auge-Icon nebeneinander auf index.html */
.index-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.index-title-group h1 {
  flex: 0 0 auto; /* überschreibt globales flex:1 — Titel nur so breit wie nötig */
}

/* ── Gear Button ──────────────────────────────────────────── */
.gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  color: #ccd;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  touch-action: manipulation;
}

.gear-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.sliders-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  color: #ccd;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.sliders-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}


/* ── Eye Button (globaler Preis-Toggle) ───────────────────── */
.eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  color: #ccd;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}

.eye-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* ── Info Button ──────────────────────────────────────────── */
.info-btn {
  background: none;
  border: 1px solid #4b5563;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.info-btn:hover { border-color: #6366f1; color: #6366f1; }

/* ── Settings Modal ───────────────────────────────────────── */
.settings-box {
  width: min(92vw, 380px);
}

.settings-body {
  padding: 8px 0 4px;
  max-height: 72vh;
  overflow-y: auto;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.settings-row:last-child { border-bottom: none; }

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-title {
  font-size: 14px;
  font-weight: 600;
  color: #e8eaf0;
}

.settings-desc {
  font-size: 12px;
  color: #778;
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: #3a4555;
  transition: background .2s;
  position: relative;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  transition: transform .2s;
}

.toggle-switch input:checked + .toggle-track {
  background: #3b82f6;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

/* VK factor input */
.settings-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.settings-input-group input {
  width: 70px;
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 600;
  background: #111b28;
  border: 2px solid #3a4a60;
  border-radius: 6px;
  color: #e8eaf0;
  text-align: right;
  outline: none;
  transition: border-color .15s;
}

.settings-input-group input:focus {
  border-color: #3b82f6;
}

.settings-input-unit {
  font-size: 14px;
  font-weight: 600;
  color: #778;
}

/* ── Main ─────────────────────────────────────────────────── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── Search Box ───────────────────────────────────────────── */
.search-box {
  display: flex;
  gap: 8px;
  position: sticky;
  top: 62px;       /* Desktop: direkt unter Header-Unterkante; 4px-Gap kommt aus padding-top */
  z-index: 90;
  background: #f4f6f9;  /* gleiche Farbe wie body/main — verhindert Durchscheinen beim Scrollen */
  padding-top: 6px;
  padding-bottom: 6px;
  margin-bottom: 0;
}

.db-selector-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 10px;
}

.db-selector-label {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  font-size: 15px;
  background: #fff;
  border: 2px solid #c8d0da;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}

.search-box input:focus {
  border-color: #3b82f6;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: #c8d0da;
  color: #4a5568;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: #a0aec0;
}

.search-go-btn {
  padding: 10px 13px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-go-btn:hover {
  background: #2563eb;
}

.scan-btn {
  padding: 10px 11px !important;
  background: #3b82f6 !important;
  border: none !important;
  border-radius: 8px;
  color: #000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-btn:hover {
  background: #2563eb !important;
}

/* ── Modal (gemeinsam) ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  z-index: 1000;
}

.modal-box {
  background: #1a2535;
  border-radius: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  width: min(92vw, 420px);
  max-height: calc(var(--vvh, 100dvh) - 24px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #2d3e55 transparent;
}
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-thumb { background: #2d3e55; border-radius: 4px; }
.modal-content {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #2d3e55 transparent;
}
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: #2d3e55; border-radius: 4px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #111b28;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-close:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Scanner Panel (nicht-blockierend, unterer Bildschirmrand) */
.scanner-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50vh;
  z-index: 500;
  pointer-events: none;   /* Klicks gehen durch zum Inhalt oben */
}

.scanner-box {
  pointer-events: auto;   /* Scanner selbst bleibt bedienbar */
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  background: #1a2535;
  box-shadow: 0 -4px 24px rgba(0,0,0,.6);
}

#scanner-viewport {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #000;
  position: relative;
  overflow: hidden;
}

#scanner-viewport video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scanner-viewport canvas {
  display: none;
}

.scanner-hint {
  padding: 8px 16px 6px;
  font-size: 13px;
  color: #aab;
  text-align: center;
  flex-shrink: 0;
}

.scanner-btn-row {
  display: flex;
  justify-content: center;
  padding: 10px 16px 14px;
  flex-shrink: 0;
}

.scan-action-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 52px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.06em;
}

.scan-action-btn:hover { background: #1d4ed8; }
.scan-action-btn:active { background: #1e40af; }

.hint {
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
}

/* ── Status ───────────────────────────────────────────────── */
#status {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
  min-height: 18px;
}

/* ── Results Table ────────────────────────────────────────── */
.result-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.result-table thead tr {
  background: #1a2535;
  color: #fff;
}

.result-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-table tbody tr {
  border-bottom: 1px solid #eef0f3;
  transition: background .1s;
}

.result-table tbody tr:last-child { border-bottom: none; }

.result-table tbody tr:hover { background: #f0f4ff; }

.result-table td {
  padding: 9px 12px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-table td.desc {
  white-space: normal;
}

/* ── Column-specific styles ───────────────────────────────── */
.artnr {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: #1a2535;
}

.desc { }

.desc1 {
  display: block;
  font-weight: 500;
}

.desc2 {
  display: block;
  font-size: 12px;
  color: #666;
}

.unit {
  font-size: 13px;
  color: #444;
  white-space: nowrap;
}

.gtin {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  color: #666;
}

/* ── UVP ──────────────────────────────────────────────────── */
.uvp-col { white-space: nowrap; }

.uvp {
  font-size: 12px;
  color: #999;
}

/* ── EK Price ─────────────────────────────────────────────── */
.ek-cell { white-space: nowrap; }

.ek-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-ek);
}

.ek-hidden {
  display: none !important;
}

.vk-cell { white-space: nowrap; }

.vk-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-vk);
}

.cu-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-cu);
}

.al-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-al);
}

.vk-hidden {
  display: none !important;
}

/* Calc-Button (Mengenberechnung) */
.calc-btn {
  background: #f0f4ff;
  color: #6366f1;
  border-color: #c7d2fe;
  font-size: 14px;
}
.calc-btn:hover { background: #e0e7ff; border-color: #818cf8; }

/* Notizfeld im Auftragskorb */
.cart-note-textarea {
  width: 100%;
  min-height: 228px;
  padding: 8px 10px;
  font-size: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  color: #374151;
  background: #fff;
  line-height: 1.5;
}
.cart-note-textarea:focus { border-color: #6366f1; outline: none; }

/* Unit-/Längen-Selector im Mengenberechnung-Modal */
.calc-unit-btn {
  padding: 5px 10px;
  border: 1px solid #374151;
  border-radius: 6px;
  background: #1a2535;
  cursor: pointer;
  font-size: 13px;
  color: #d1d5db;
  white-space: nowrap;
}
.calc-unit-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

mark.hl {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-style: inherit;
}

/* ── Auftrags-Zusammenfassung (Auftragskorb) ──────────────── */
.cart-summary-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px 4px;
  border-top: 1px solid #e5e7eb;
  margin-top: 8px;
}

.cart-summary-label {
  font-size: 13px;
  color: #555;
}

.cart-summary-value {
  font-size: 16px;
  font-weight: 700;
}

/* ── Arbeitszeit-Sektion (Auftragskorb) ───────────────────── */
.labor-section {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.labor-title {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.copy-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.copy-note-btn:hover { border-color: #6366f1; color: #6366f1; }
.labor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.labor-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s, border-color 0.15s;
}
.labor-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* ── Source Badges ────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: .03em;
}

.badge-change {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-discount {
  background: #dcfce7;
  color: #15803d;
}

/* ── Header Right Group ───────────────────────────────────── */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  min-width: 180px;
}

/* cart.html hat nur info-btn + back-btn — kein min-width nötig */
.cart-header .header-right { min-width: 0; }

/* ── DB Selector (Lieferant) ──────────────────────────────── */
.db-selector {
  flex-shrink: 0;
}

.db-select {
  background: #fff;
  border: 2px solid #c8d0da;
  border-radius: 6px;
  color: #374151;
  font-size: 13px;
  padding: 5px 8px;
  cursor: pointer;
  max-width: 140px;
}

.db-select option {
  background: #fff;
  color: #374151;
}

/* ── Customer Selector ────────────────────────────────────── */
.customer-selector {
  position: relative;
}

.customer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  color: #e8eaf0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.customer-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.35);
}

.customer-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a2535;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  min-width: 160px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 200;
}

.customer-dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  color: #ccd;
  cursor: pointer;
  transition: background .1s;
}

.customer-dropdown-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.customer-dropdown-item.active {
  color: #3b82f6;
  font-weight: 600;
}

/* ── Cart Button ──────────────────────────────────────────── */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  color: #ccd;
  text-decoration: none;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.cart-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #1a2535;
}

/* ── Back Button (Cart Page) ──────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  color: #ccd;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.back-btn:hover {}

/* ── Add-to-Cart Column ───────────────────────────────────── */
.qty-col { white-space: nowrap; }

.qty-cell { white-space: nowrap; }

.qty-add-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-input {
  width: 65px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid #c8d0da;
  border-radius: 6px;
  outline: none;
  text-align: right;
  transition: border-color .15s;
}

.cart-qty-input {
  width: 65px;
  text-align: center;
}

.qty-input:focus { border-color: #3b82f6; }

.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}

.add-to-cart-btn:hover { background: #2563eb; }

/* Green flash when added to cart */
@keyframes rowAddedFlash {
  0%   { background: #dcfce7; }
  80%  { background: #dcfce7; }
  100% { background: transparent; }
}

.row-added { animation: rowAddedFlash .7s ease forwards; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Cart Page – Qty Controls ─────────────────────────────── */
.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid #c8d0da;
  background: #fff;
  color: #333;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  line-height: 1;
}

.qty-control-btn:hover {
  background: #f0f4ff;
  border-color: #3b82f6;
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #1a2535;
}

/* ── Delete Button ────────────────────────────────────────── */
.delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: background .1s, color .1s;
}

.delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* ── Cart Settings ────────────────────────────────────────── */
.settings-name-input {
  width: 160px;
  padding: 7px 10px;
  font-size: 14px;
  background: #111b28;
  border: 2px solid #3a4a60;
  border-radius: 6px;
  color: #e8eaf0;
  outline: none;
  transition: border-color .15s;
}

.settings-name-input:focus { border-color: #3b82f6; }

.settings-save-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}

.settings-save-btn:hover { background: #2563eb; }

.clear-cart-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.clear-cart-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* ── Export Button ────────────────────────────────────────── */
.export-format-group { display: flex; gap: 8px; }

.export-btn {
  padding: 6px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.export-btn:hover { background: #1d4ed8; }

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f6f9;
}

.login-box {
  background: #1a2535;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  width: min(92vw, 360px);
  overflow: hidden;
}

.login-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.login-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e8eaf0;
  letter-spacing: .02em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px 24px;
}

.login-label {
  font-size: 12px;
  font-weight: 600;
  color: #778;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: -4px;
}

.login-input {
  padding: 10px 14px;
  font-size: 15px;
  background: #111b28;
  border: 2px solid #3a4a60;
  border-radius: 8px;
  color: #e8eaf0;
  outline: none;
  transition: border-color .15s;
}

.login-input:focus {
  border-color: #3b82f6;
}

.login-btn {
  margin-top: 6px;
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.login-btn:hover {
  background: #2563eb;
}

.login-error {
  padding: 10px 14px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 500;
}

/* ── Darstellung-Panel ────────────────────────────────────── */
.settings-nav-row {
  cursor: pointer;
  transition: background .1s;
}

.settings-nav-row:hover {
  background: rgba(255,255,255,.05);
}

.settings-chevron {
  font-size: 22px;
  color: #778;
  flex-shrink: 0;
  line-height: 1;
}

.darst-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.darst-back-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .1s;
}

.darst-back-btn:hover {
  background: rgba(59,130,246,.15);
}

.darst-title {
  font-size: 14px;
  font-weight: 600;
  color: #e8eaf0;
}

.settings-select {
  padding: 6px 10px;
  border: 1px solid #3a4558;
  border-radius: 6px;
  background: #1a2535;
  color: #f1f5f9;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.darst-list {
  padding: 4px 0;
}

.darst-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .1s;
}

.darst-row:last-child { border-bottom: none; }

.darst-label {
  flex: 1;
  font-size: 13px;
  color: #ccd;
  font-weight: 500;
}

.darst-extra {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.darst-extra-label {
  font-size: 11px;
  color: #778;
  white-space: nowrap;
}

/* ── Warenkorb-Konflikt-Modal ─────────────────────────────── */
.conflict-box {
  width: min(92vw, 380px);
}

.conflict-body {
  padding: 16px 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conflict-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.conflict-label {
  font-size: 13px;
  color: #aab;
}

.conflict-value {
  font-size: 13px;
  color: #e8eaf0;
  font-weight: 500;
  white-space: nowrap;
}

.conflict-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 2px 0;
}

.conflict-total-row .conflict-label {
  color: #ccd;
  font-weight: 600;
}

.conflict-total-val {
  font-size: 15px;
  color: #60a5fa;
  font-weight: 700;
}

.conflict-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 16px;
}

.conflict-newpos-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conflict-newpos-btn {
  background: none;
  border: 1px solid #3a4558;
  color: #aab;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.conflict-newpos-btn:hover { background: rgba(255,255,255,.06); color: #ccd; }

.conflict-confirm-btn {
  background: #2563eb;
  border: none;
  color: #fff;
  border-radius: 7px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.conflict-confirm-btn:hover { background: #1d4ed8; }

.darst-move-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.darst-move-btn {
  background: none;
  border: 1px solid #3a4558;
  border-radius: 4px;
  color: #778;
  width: 26px;
  height: 20px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.darst-move-btn:hover:not(:disabled) { background: rgba(255,255,255,.1); color: #ccd; }
.darst-move-btn:disabled { opacity: 0.25; cursor: default; }

/* ── Kartenansicht (Suche + Korb, alle Bildschirmgrößen) ───── */
.result-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.card-artnr {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  min-width: 0;
}

.card-prices {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 100%;
}

.card-prices .cu-price,
.card-prices .al-price {
  flex-shrink: 0;
  font-size: 13px;
}

.card-prices .ek-price,
.card-prices .vk-price {
  font-size: 13px;
}

.card-ek {
  text-align: right;
  font-size: 13px;
  flex-shrink: 0;
}

.card-ek .ek-price { font-size: inherit; font-weight: 600; color: var(--color-ek); }
.card-ek .badge { vertical-align: middle; }

.card-vk {
  text-align: right;
  font-size: 13px;
  color: var(--color-vk);
  flex-shrink: 0;
}
.card-vk .vk-price { font-size: inherit; }

.card-desc {
  font-size: 13px;
  color: #222;
  line-height: 1.35;
}

.card-desc .desc1 { display: inline; font-weight: 500; }
.card-desc .desc2 { display: inline; color: #444; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  font-size: 12px;
  color: #444;
  margin-top: 2px;
}

.card-meta-label {
  color: #888;
  font-size: 11px;
}

.card-qty-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.card-qty-row .qty-add-group { gap: 6px; }
.card-qty-row .qty-control-btn { width: 34px; height: 34px; font-size: 18px; }
.card-qty-row .qty-input { width: 65px; height: 34px; font-size: 15px; }
.card-qty-row .add-to-cart-btn { width: 34px; height: 34px; }

.img-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #1a2535;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #9ca3af;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: auto;
}
.img-search-btn:hover { background: #2d3e55; color: #e2e8f0; }

.label-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #1a2535;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #9ca3af;
  cursor: pointer;
  flex-shrink: 0;
}
.label-search-btn:hover { background: #2d3e55; color: #e2e8f0; }

.result-card.row-added {
  animation: rowAddedFlash .7s ease forwards;
}

/* ── Cart-Karten (Auftragskorb) ────────────────────────────── */
.cart-cards { display: flex; flex-direction: column; gap: 10px; }

.cart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.cart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-card-artnr {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  min-width: 0;
}

.cart-card-ek {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.cart-card-ek .ek-price,
.cart-card-ek .vk-price,
.cart-card-ek .cu-price,
.cart-card-ek .al-price { font-size: inherit; font-weight: inherit; }

.cart-card-desc { font-size: 13px; color: #222; line-height: 1.35; }
.cart-card-desc .desc1 { display: inline; font-weight: 500; }
.cart-card-desc .desc2 { display: inline; color: #444; }

.cart-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  font-size: 12px;
  color: #444;
  margin-top: 2px;
}

.cart-card-meta-label { color: #888; font-size: 11px; }

.cart-card-qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.cart-card-qty-row .qty-controls { gap: 6px; }
.cart-card-qty-row .qty-control-btn { width: 34px; height: 34px; font-size: 18px; }
.cart-card-qty-row .cart-qty-input { width: 65px; height: 34px; font-size: 15px; }
.cart-card-qty-row .delete-btn { width: 34px; height: 34px; }

/* ── Mobile-Only Overrides (< 640px) ──────────────────────── */
@media (max-width: 639px) {
  /* Inputs/Textareas/Selects auf 16px — verhindert Auto-Zoom auf iOS/Android */
  input, textarea, select { font-size: 16px !important; }

  /* Kompakterer Header auf Mobile */
  header { padding: 8px 12px; gap: 8px 10px; min-height: 54px; }
  header h1 { font-size: 1.0rem; }

  /* Kunde + Korb in zweite Zeile, volle Breite (gilt für alle Seiten außer index-header) */
  .header-right { flex: 0 0 100%; margin-left: 0; }

  /* Kundenname-Selector dehnt sich, Korb bleibt rechts */
  .customer-selector { flex: 1; min-width: 0; }
  .customer-btn { width: 100%; min-width: 0; overflow: hidden; }
  #basket-label, #customer-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; text-align: left; }

  /* index.html Mobile: Titel ausblenden, header-right füllt den Platz */
  .index-header h1 { display: none; }
  .index-header { gap: 0; } /* title-group kollabiert auf 0px → kein Gap-Versatz */
  .index-title-group { flex: 0 0 0px; overflow: hidden; }
  .index-header .header-right { flex: 1; margin-left: 0; min-width: 0; }

  /* Kleineres main-Padding — 86px statt 80px wegen zusätzlichem Button-Bottom-Padding */
  main { padding: 0 12px calc(86px + env(safe-area-inset-bottom, 0px)); }

  /* Bottom Tab Bar: Button-Bottom-Padding erhöht für mehr Abstand zum Home-Indicator */
  .bottom-tab-btn { padding-bottom: 20px; }
  /* FAB und Drawer-Padding entsprechend anpassen (+6px) */
  .todo-fab { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .drawer { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

  /* Lupe-Button und Scanner-Button enger auf Mobile */
  .search-go-btn { padding: 10px 11px; }
  .scan-btn { padding: 10px 10px !important; }

  /* Sticky Search-Box: auf Mobile ist der Header einzeilig (54px) */
  .search-box { top: 54px; }

  /* Lieferant-Zeile: Select nimmt volle verfügbare Breite */
  .db-selector-bar { gap: 8px; }
  .db-selector-bar .db-select { max-width: none; flex: 1; }
  .db-selector-bar .db-selector { flex: 1; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  header h1 { font-size: 1.1rem; }
}

/* ── Cart-Header Mobile (eine Zeile: Titel links, Buttons rechts) ── */
@media (max-width: 639px) {
  .cart-header h1 { flex: 1; min-width: 0; font-size: 1.0rem; order: 0; }
  .cart-header .header-right { flex: 0 0 auto; margin-left: 0; }
}

/* ── Hamburger Button ──────────────────────────────────────── */
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  color: #ccd;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.hamburger-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* ── Drawer ───────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #fff;
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 2px 0 20px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}
.drawer.drawer-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  font-size: 16px;
  color: #111827;
  background: #f9fafb;
  flex-shrink: 0;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.drawer-close:hover { background: #e5e7eb; }

.drawer > a:first-of-type { margin-top: auto; }

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  text-decoration: none;
  color: #1f2937;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
}
.drawer-item:hover { background: #f0f4ff; }
.drawer-item.drawer-item-active { background: #eef2ff; color: #6366f1; font-weight: 600; }
.drawer-item svg { color: #6366f1; flex-shrink: 0; }

/* ── Kunden-Seite ─────────────────────────────────────────── */

.customers-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.customers-name {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customers-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customers-type-badge {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 99px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.customers-contact-link {
  font-size: 12px;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 99px;
  white-space: nowrap;
  transition: background .1s, color .1s;
}
.customers-contact-link:hover { background: #eef2ff; }

.customers-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.customers-type-toggle {
  display: flex;
  border: 1px solid #374151;
  border-radius: 8px;
  overflow: hidden;
}
.customers-type-btn {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.customers-type-btn + .customers-type-btn { border-left: 1px solid #374151; }
.customers-type-btn-active {
  background: #6366f1;
  color: #fff;
  font-weight: 600;
}
.customers-edit-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .1s, color .1s;
}
.customers-edit-btn:hover { background: #f3f4f6; color: #374151; }

.customers-rename-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 2px solid #2d3e55;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  background: #0f1923;
  color: #f1f5f9;
  font-family: inherit;
}
.customers-rename-input::placeholder { color: #4a5568; }
.customers-rename-input:focus { border-color: #6366f1; }

/* ── ToDo-Seite ───────────────────────────────────────────── */
.todo-tabs-wrap {
  background: #fff;
  border-bottom: 2px solid #e5e7eb;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.todo-tabs-wrap::-webkit-scrollbar { display: none; }
.todo-tabs {
  display: flex;
  gap: 0;
  min-width: max-content;
  padding: 0 20px;
}
.todo-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}
.todo-tab.active { color: #6366f1; border-bottom-color: #6366f1; }
.todo-tab:hover:not(.active) { color: #374151; }

.todo-main { padding: 16px 20px 100px; }

.todo-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: opacity .2s;
}
.todo-row.todo-done { opacity: 0.55; }
.todo-row.todo-checking { opacity: 0.35; }

.todo-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background .15s, border-color .15s;
}
.todo-check.checked {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.todo-check:not(.checked):hover { border-color: #6366f1; }

.todo-row-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.todo-row-title {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}
.todo-done .todo-row-title { text-decoration: line-through; color: #9ca3af; }
.todo-row-notes {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.todo-cat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.todo-due-badge {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 3px;
}
.todo-due-badge.todo-overdue {
  color: #ef4444;
  font-weight: 600;
}

.todo-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-top: 1px;
}
.todo-delete-btn:hover { color: #ef4444; background: #fef2f2; }

.todo-done-sep {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 8px;
  font-size: 13px;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.todo-done-toggle {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
}
.todo-done-toggle:hover { background: #f3f4f6; }

.todo-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 15px;
  margin-top: 48px;
}
.todo-empty-open {
  color: #22c55e;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 0;
}

/* FAB */
.todo-fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99,102,241,.45);
  z-index: 100;
  transition: background .15s, transform .15s;
}
.todo-fab:hover { background: #4f46e5; transform: scale(1.07); }
.todo-fab:active { transform: scale(0.95); }

/* modal-btn / modal-footer (gemeinsam für alle Modals) */
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 8px 20px 20px;
  flex-shrink: 0;
}
.modal-btn-primary {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}
.modal-btn-primary:hover { background: #4f46e5; }
.modal-btn-secondary {
  flex: 1;
  padding: 10px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #1a2535;
  color: #d1d5db;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.modal-btn-secondary:hover { background: #243247; }

/* ToDo-Modal */
.todo-modal-box { max-width: 480px; }
.todo-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.todo-field { display: flex; flex-direction: column; gap: 5px; }
.todo-label { font-size: 12px; font-weight: 600; color: #ccc; }
.todo-textarea {
  padding: 10px 12px;
  font-size: 15px;
  border: 2px solid #2d3e55;
  border-radius: 8px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
  background: #0f1923;
  color: #f1f5f9;
}
.todo-textarea::placeholder { color: #4a5568; }
.todo-textarea:focus { border-color: #6366f1; }
.todo-input {
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid #2d3e55;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  background: #0f1923;
  color: #f1f5f9;
}
.todo-input::placeholder { color: #6b7280; }
.todo-input:focus { border-color: #6366f1; }
.todo-select {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid #2d3e55;
  border-radius: 8px;
  outline: none;
  background: #0f1923;
  color: #f1f5f9;
  font-family: inherit;
}
.todo-select:focus { border-color: #6366f1; }
.todo-newcat-btn {
  background: #1a2535;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #d1d5db;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.todo-newcat-btn:hover { background: #243247; }

.todo-quick-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.todo-quick-btn {
  background: #1a2535;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  color: #d1d5db;
  cursor: pointer;
  font-family: inherit;
  transition: background .1s;
}
.todo-quick-btn:hover { background: #6366f1; border-color: #6366f1; color: #fff; }

/* Farb-Pills */
.todo-color-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.todo-color-pill {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.todo-color-pill.selected {
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}

/* Kategorie-Verwaltung */
.cat-mgmt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.cat-mgmt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-mgmt-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #f1f5f9;
}

/* ── Einstellungen-Seite ──────────────────────────────────── */
.settings-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
}
.settings-upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  background: #6366f1;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s;
}
.settings-upload-btn:hover { background: #4f46e5; }
.settings-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  color: #f1f5f9;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}
.settings-nav-row:hover { background: rgba(255,255,255,.04); }
.settings-text-input {
  background: #0f1923;
  border: 2px solid #2d3e55;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 15px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.settings-text-input:focus { border-color: #6366f1; }

/* ── Basket-Seite ───────────────────────────────────────────── */
.basket-customer-bar {
  background: #1e2d3d;
  border-bottom: 1px solid #2d3e55;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.basket-customer-label {
  font-size: 14px;
  color: #f1f5f9;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.basket-customer-label-empty { color: #9ca3af !important; }
.basket-customer-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: #2d3e55;
  border: 1px solid #4b5e72;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
}
.basket-customer-btn:hover { background: #374558; }
.basket-action-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.basket-export-btn {
  flex: 1;
  padding: 12px 16px;
  background: #1a2535;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.basket-export-btn:hover { background: #22334a; }
.basket-close-btn {
  flex: 1;
  padding: 12px 16px;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.basket-close-btn:hover { background: #4f46e5; }
.basket-close-btn:disabled { opacity: 0.6; cursor: default; }
.basket-deleted-btn {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 2px solid #6b7280;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.basket-deleted-btn:hover { border-color: #9ca3af; color: #f1f5f9; }
.basket-clear-btn {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 2px solid #ef4444;
  border-radius: 8px;
  color: #ef4444;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.basket-clear-btn:hover { background: rgba(239,68,68,.08); }
.customer-search-row {
  padding: 12px 16px;
  font-size: 14px;
  color: #f1f5f9;
  cursor: pointer;
  border-bottom: 1px solid #1e2e40;
}
.customer-search-row:hover { background: #1e2e40; }
.customer-search-none { color: #9ca3af; font-style: italic; }

/* ── Kunden-Detail-Seite ────────────────────────────────────── */
.customer-detail-card {
  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.customer-detail-section { color: #111827; font-size: 14px; line-height: 1.6; }
.customer-detail-contacts { display: flex; gap: 16px; flex-wrap: wrap; }
.customer-detail-uid { font-size: 13px; color: #6b7280; }
.cdc-row { display: flex; gap: 10px; font-size: 14px; color: #111827; line-height: 1.5; }
.cdc-label { color: #6b7280; white-space: nowrap; min-width: 70px; flex-shrink: 0; }
.cdc-value { word-break: break-word; }
.customer-detail-orders-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 10px;
}
.customer-detail-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: background .15s, box-shadow .15s;
}
.customer-detail-order-row:hover { background: #2563eb; box-shadow: 0 2px 8px rgba(59,130,246,.4); }
.customer-detail-order-number { font-size: 15px; font-weight: 600; color: #ffffff; }
.customer-detail-order-meta { font-size: 12px; color: #e0e7ff; margin-top: 2px; }

/* ── Auftrags-Seite ─────────────────────────────────────────── */
.order-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #2d3e1a;
  border: 1px solid #4a6128;
  border-radius: 8px;
  font-size: 14px;
  color: #d4edda;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.order-edit-toggle-btn {
  padding: 5px 12px;
  background: #4a6128;
  border: none;
  border-radius: 6px;
  color: #d4edda;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.order-edit-toggle-btn:hover { background: #5a7533; }

/* ── Mail-Seite ─────────────────────────────────────────────── */
.mail-layout { display:flex; gap:0; align-items:flex-start; }
.mail-folders { width:200px; flex-shrink:0; border-right:1px solid #e5e7eb; padding:8px 0; background:#f9fafb; position:sticky; top:62px; max-height:calc(100vh - 62px); overflow-y:auto; }
.mail-folder-item { display:block; padding:10px 16px; color:#374151; font-size:14px; cursor:pointer; border-radius:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mail-folder-item:hover { background:#f3f4f6; }
.mail-folder-item.active { background:#3b82f6; color:#fff; font-weight:600; }
.mail-messages { flex:1; background:#fff; }
.mail-message-row { display:flex; flex-direction:column; gap:2px; padding:12px 16px; border-bottom:1px solid #f3f4f6; cursor:pointer; }
.mail-message-row:hover { background:#f9fafb; }
.mail-message-row.active { background:#eff6ff; }
.mail-message-row.unread .mail-msg-subject { font-weight:700; color:#111827; }
.mail-message-row.unread .mail-unread-dot { display:inline-block; }
.mail-unread-dot { display:none; width:8px; height:8px; background:#6366f1; border-radius:50%; flex-shrink:0; margin-top:4px; }
.mail-msg-subject { font-size:14px; color:#374151; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mail-msg-from { font-size:12px; color:#6b7280; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mail-msg-date { font-size:11px; color:#9ca3af; }
.mail-detail { flex:1; overflow-y:auto; padding:20px; display:none; background:#fff; }
.mail-detail.visible { display:block; }
.mail-detail-header { margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid #e5e7eb; }
.mail-detail-subject { font-size:18px; font-weight:700; color:#111827; margin-bottom:8px; }
.mail-detail-meta { font-size:13px; color:#6b7280; line-height:1.6; }
.mail-detail-body { font-size:14px; color:#374151; line-height:1.6; white-space:pre-wrap; word-break:break-word; }
.mail-pagination { display:flex; gap:8px; padding:12px 16px; border-top:1px solid #e5e7eb; background:#fff; }
.mail-compose-btn { background:#6366f1; color:#fff; border:none; border-radius:8px; padding:0 14px; height:38px; font-size:14px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:4px; }
.mail-compose-btn:hover { background:#4f46e5; }
.settings-text-input { width:100%; padding:9px 12px; background:#0f1923; border:2px solid #2d3e55; border-radius:8px; color:#f1f5f9; font-size:14px; box-sizing:border-box; }
.settings-text-input:focus { outline:none; border-color:#6366f1; }
#mobile-folder-bar { display:none; }
@media (max-width:639px) {
  .mail-layout { display:block; }
  .mail-folders { display:none; }
  .mail-messages { border-right:none; }
  #mobile-folder-bar { display:flex; }
  .mail-folder-sheet-item { display:block; padding:14px 20px; font-size:15px; color:#111827; cursor:pointer; border-bottom:1px solid #f3f4f6; }
  .mail-folder-sheet-item:active { background:#f3f4f6; }
  .mail-folder-sheet-item.active { color:#6366f1; font-weight:600; background:#f5f3ff; }
}

/* ── Korb-Bottom-Sheet (index.html Mobile) ───────────────────── */
.basket-sheet-item {
  padding: 14px 20px;
  border-bottom: 1px solid #2d3e55;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.basket-sheet-item:last-child { border-bottom: none; }
.basket-sheet-item:active { background: #1e2d3d; }
.basket-sheet-item.active .basket-sheet-item-name { color: #6366f1; font-weight: 700; }
.basket-sheet-item-name { font-size: 15px; color: #f1f5f9; font-weight: 500; }
.basket-sheet-item-sub  { font-size: 12px; color: #9ca3af; margin-top: 3px; }

/* ── Notizen-Seite ──────────────────────────────────────────── */

#view-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 80px;
}
@media (max-width: 639px) {
  #view-list { padding: 0 12px calc(86px + env(safe-area-inset-bottom, 0px)); }
}

.notiz-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-bottom: 20px;
}
@media (max-width: 600px) {
  .notiz-cards { grid-template-columns: 1fr; }
}

.notiz-card {
  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100px;
  transition: border-color .15s, box-shadow .15s;
}
.notiz-card:hover { box-shadow: 0 0 0 3px rgba(99,102,241,.25); }

.notiz-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notiz-card-preview {
  font-size: 13px;
  color: #4b5563;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.notiz-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.notiz-card-date { font-size: 11px; color: #6b7280; }
.notiz-shared-badge {
  font-size: 10px;
  font-weight: 700;
  background: #312e81;
  color: #a5b4fc;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.notiz-title-input {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  outline: none;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  padding: 0;
  font-family: inherit;
  resize: none;
  line-height: 1.3;
  overflow: hidden;
}
.notiz-title-input::placeholder { color: #9ca3af; }

.notiz-content-area {
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: #111827;
  line-height: 1.7;
  resize: none;
  font-family: inherit;
  padding: 0;
  min-height: 200px;
}
.notiz-content-area::placeholder { color: #9ca3af; }

/* Scrollbar für den Notiz-Detail-Panel */
#view-detail {
  scrollbar-width: thin;
  scrollbar-color: #c8d0da transparent;
}
#view-detail::-webkit-scrollbar { width: 5px; }
#view-detail::-webkit-scrollbar-track { background: transparent; }
#view-detail::-webkit-scrollbar-thumb { background: #c8d0da; border-radius: 99px; }

.notiz-photo-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 8px 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.notiz-photo-strip::-webkit-scrollbar { display: none; }
.notiz-photo-thumb {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #d1d5db;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.notiz-photo-thumb:hover { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }

/* Lightbox */
.notiz-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.93);
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.notiz-lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  width: 100%;
  touch-action: pinch-zoom;
}
.notiz-lightbox-img-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 8px;
  touch-action: pinch-zoom;
  user-select: none;
}
.notiz-lightbox-bar {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-shrink: 0;
}
.notiz-lightbox-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.notiz-lightbox-close { background: #374151; color: #f1f5f9; }
.notiz-lightbox-delete { background: #dc2626; color: #fff; }

.notiz-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 6px;
  border-top: 1px solid #e5e7eb;
  margin-top: 12px;
  flex-wrap: wrap;
}
.notiz-share-toggle {
  display: flex;
  height: 38px;
  border: 1px solid #374151;
  border-radius: 20px;
  overflow: hidden;
  font-size: 13px;
}
.notiz-share-btn {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  transition: background .12s, color .12s;
}
.notiz-share-btn.active { background: #6366f1; color: #fff; font-weight: 600; }

.notiz-save-indicator {
  display: flex;
  align-items: center;
}
.notiz-save-indicator.saved   { color: #22c55e; }
.notiz-save-indicator.unsaved { color: #ef4444; }

/* ── Bottom Tab Bar ─────────────────────────────────────── */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f1923;
  border-top: 1px solid #2d3e55;
  display: flex;
  align-items: stretch;
  z-index: 210;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 14px 0;
  text-decoration: none;
  font-size: 10px;
  line-height: 1;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-tab-btn:hover, .bottom-tab-btn:active {
  color: #f1f5f9;
  background: rgba(255,255,255,0.05);
}
.bottom-tab-btn.bottom-tab-home {
  color: #6366f1;
}
.bottom-tab-btn.bottom-btn-disabled {
  color: #374151;
  cursor: default;
  pointer-events: none;
}

/* ── Verleih ──────────────────────────────────────────────── */
#view-list .todo-tabs-wrap {
  background: transparent;
  border-bottom: none;
  margin-bottom: 0;
}
#view-list .todo-tabs {
  padding: 0;
}
#view-list .todo-tab {
  margin-bottom: 0;
}
#vl-scanner-panel {
  display: flex;
  flex-direction: column;
}
#view-basket-detail {
  scrollbar-width: thin;
  scrollbar-color: #2d3e55 transparent;
}
#view-basket-detail::-webkit-scrollbar { width: 5px; }
#view-basket-detail::-webkit-scrollbar-thumb { background: #2d3e55; border-radius: 4px; }
