/* Druckansicht: nur #print-area anzeigen, alles andere ausblenden.
   Wichtig: mit display:none (nicht nur visibility:hidden) auf den Geschwistern,
   damit sie keine Layout-Höhe mehr belegen — sonst zählt der Browser die
   (unsichtbare) Höhe der ganzen SPA mit und erzeugt viele leere Druckseiten. */
@media print {
  @page { size: landscape; margin: 10mm; }
  body > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block !important;
  }
}

/* style.css - SAP Fiori Horizon Light Theme Official System */

:root {
  /* SAP Fiori Horizon Design System Tokens - Clean Light Canvas */
  --bg-base: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f7fa;
  --bg-app: #ffffff;
  
  --border-color: #d9d9d9;
  --border-hover: #b0b0b0;
  
  --text-primary: #1d2d3e;
  --text-secondary: #556b82;
  --text-muted: #6a7d92;
  
  --primary: #0a6ed1; /* SAP Fiori Horizon Emphasized Blue */
  --primary-hover: #085caf;
  --primary-glow: rgba(10, 110, 209, 0.15);
  
  --secondary: #556b82;
  
  --success: #107e3e; /* SAP Fiori Semantic Green */
  --success-glow: rgba(16, 126, 62, 0.15);
  --warning: #e9730c; /* SAP Fiori Semantic Orange */
  --danger: #bb0000;  /* SAP Fiori Semantic Red */
  --danger-glow: rgba(187, 0, 0, 0.15);
  
  --info: #0a6ed1;
  
  /* Stage Colors for Pipeline */
  --color-stage-1: #0a6ed1; /* Stanzado - SAP Blue */
  --color-stage-2: #e9730c; /* Doblado 1 - SAP Amber */
  --color-stage-3: #d0431b; /* Doblado 2 - Rust */
  --color-stage-4: #6b46c1; /* Montaje - Purple */
  
  --font-sans: '72', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: '72', 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition-smooth: all 0.2s ease-in-out;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

body {
  background: #ffffff;
  background-color: #ffffff;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Optimización de Rendimiento GPU & Renderizado Femenino */
table, tr, td, th, .tab-content {
  contain: layout style;
}

.modal-card, .inv-table-card {
  transform: translateZ(0);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Bar Superior */
.top-shellbar {
  background: #060c17;
  color: #ffffff;
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0a6ed1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.top-shellbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  background: #0a6ed1;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 1px;
  font-family: var(--font-sans);
}

.top-shellbar-title {
  display: flex;
  flex-direction: column;
}

.sys-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.sys-sub {
  font-size: 0.72rem;
  color: #a2b9d3;
}

.top-shellbar-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.sys-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: #d1e2f7;
}

.sys-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.brand-logo-img {
  height: 34px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Header de Navegación Principal */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.4rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #556b82;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  color: #0a6ed1;
  background-color: #f5f7fa;
}

.tab-btn.active {
  color: #0a6ed1;
  background-color: #f0f7ff;
  border-bottom: 3px solid #0a6ed1;
  font-weight: 800;
}

/* Main content wrapper */
main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography & General Classes */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: #1d2d3e;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.tab-content > p, main > p, .tab-header-desc, .tab-content h2 + p {
  color: #556b82 !important;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Dashboard CSS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stat-icon.blue { background-color: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon.purple { background-color: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon.amber { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-top: 0.2rem;
}

/* Dashboard Panels Layout */
.dashboard-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-panels {
    grid-template-columns: 1fr;
  }
}

.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
}

/* Alert Items */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background-color: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.alert-item.info {
  background-color: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.alert-item-content {
  flex: 1;
}

.alert-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.alert-item-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.alert-btn {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.alert-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Production Manager Styling */
.prod-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background-color: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Production Board Pipeline */
.pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.batch-pipeline-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.batch-pipeline-card:hover {
  border-color: var(--border-hover);
}

.batch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.batch-badge {
  background-color: var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-family: var(--font-display);
}

.batch-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 1rem;
  position: relative;
  align-items: center;
}

@media (max-width: 900px) {
  .pipeline-stages {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.pipeline-stage {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: var(--transition-smooth);
}

.pipeline-stage.active-stage {
  border-style: solid;
}

.pipeline-stage[data-stage="1"].active-stage { border-color: var(--color-stage-1); background-color: rgba(59, 130, 246, 0.03); }
.pipeline-stage[data-stage="2"].active-stage { border-color: var(--color-stage-2); background-color: rgba(245, 158, 11, 0.03); }
.pipeline-stage[data-stage="3"].active-stage { border-color: var(--color-stage-3); background-color: rgba(239, 68, 68, 0.03); }
.pipeline-stage[data-stage="4"].active-stage { border-color: var(--color-stage-4); background-color: rgba(167, 139, 250, 0.03); }

.stage-number-badge {
  position: absolute;
  top: -12px;
  left: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--bg-base);
  font-weight: bold;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipeline-stage[data-stage="1"] .stage-number-badge { background-color: var(--color-stage-1); }
.pipeline-stage[data-stage="2"] .stage-number-badge { background-color: var(--color-stage-2); }
.pipeline-stage[data-stage="3"] .stage-number-badge { background-color: var(--color-stage-3); }
.pipeline-stage[data-stage="4"] .stage-number-badge { background-color: var(--color-stage-4); }

.stage-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
}

.stage-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 36px;
  margin-bottom: 1rem;
}

.stage-qty-badge {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.qty-number {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.qty-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-action {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-report {
  background-color: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.input-report:focus {
  border-color: var(--primary);
}

.btn-report {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.btn-report:hover:not(:disabled) {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-report:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Completed Column */
.pipeline-completed {
  background-color: rgba(16, 185, 129, 0.05);
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  text-align: center;
}

.completed-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 15px var(--success-glow);
}

.completed-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.completed-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--success);
  font-family: var(--font-display);
}

/* Pipeline Stage Materials info */
.stage-materials {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.75rem;
}

.stage-materials-title {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease-in-out;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

/* .modal-card / .modal-header: variante usada por los modales de Ventas,
   Stammdaten, Wareneingang, Bestellungen y el visor de PDF. Antes no tenía
   ningún estilo base (sin fondo, sin borde), por lo que el texto se veía
   mezclado con el fondo oscuro difuminado de detrás. */
.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease-in-out;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background-color: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  outline: none;
  font-size: 1rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Inventory Manager Styling */
.inventory-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .inventory-grid {
    grid-template-columns: 1fr;
  }
}

.inv-table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 0.95rem;
}

/* MRP: celdas de meses (antes con el estilo repetido en línea en cada una —
   ~800 KB de HTML por render; con clases la tabla pesa mucho menos). */
.mrp-dem {
  padding: 0.45rem 0.55rem; text-align: right; font-family: var(--font-display); font-weight: 700;
  font-size: 0.84rem; color: var(--text-primary); border-right: 1px solid var(--border-color);
  background: rgba(168,85,247,0.015); white-space: nowrap;
}
.mrp-dem.cur { background: rgba(22,163,74,0.06); }
.mrp-end {
  padding: 0.45rem 0.55rem; text-align: right; border-right: 2px solid var(--border-color);
  background: rgba(168,85,247,0.03); white-space: nowrap;
}
.mrp-end.cur { background: rgba(22,163,74,0.09); }
.mrp-inc {
  padding: 0.45rem 0.55rem; text-align: right; font-family: var(--font-display); font-weight: 700;
  font-size: 0.84rem; color: #3b82f6; border-right: 1px solid var(--border-color);
  background: rgba(59,130,246,0.015); white-space: nowrap;
}
.mrp-inc.cur { background: rgba(59,130,246,0.06); }
.mrp-pill {
  font-family: var(--font-display); font-weight: 800; font-size: 0.84rem; padding: 0.15rem 0.4rem;
  border-radius: 4px; display: inline-block;
  background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.25);
}
.mrp-pill.neg { background: rgba(239,68,68,0.1); color: #ef4444; border-color: rgba(239,68,68,0.25); }
.mrp-unit { font-size: 0.7rem; color: var(--text-muted); }
.mrp-zero { color: var(--text-muted); opacity: 0.6; }

/* Inventur: celdas de meses (antes estilo y handlers en línea en cada una). */
.inv-td { text-align: center; padding: 0.3rem 0.15rem; }
.inv-cell {
  width: 58px; text-align: center; padding: 0.25rem 0.1rem; border: 1px solid var(--border-color);
  background: transparent; color: var(--text-muted); font-weight: 700; border-radius: 6px;
  font-size: 0.8rem; font-family: var(--font-display);
}
.inv-cell.has { border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.08); color: var(--primary); }

.stock-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.badge-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-status.low {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.badge-status.ok {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

/* BOM Structure Visualizer */
.bom-visualizer {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.bom-node {
  margin-left: 1.5rem;
  border-left: 2px solid var(--border-color);
  padding-left: 1rem;
  position: relative;
  margin-top: 1rem;
}

.bom-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 10px;
  height: 2px;
  background-color: var(--border-color);
}

.bom-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.bom-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Sales Manager Styling */
.sales-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .sales-layout {
    grid-template-columns: 1fr;
  }
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.order-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.order-card:hover {
  border-color: var(--border-hover);
}

.order-main-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.order-customer {
  font-weight: 600;
}

.order-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.order-financial {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.order-amount {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-display);
}

.badge-order-status {
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-order-status.pending {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-order-status.shipped {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1100;
}

.toast {
  background-color: var(--bg-surface);
  border-left: 4px solid var(--primary);
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  transform: translateX(120%);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  max-width: 350px;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

@keyframes slideIn {
  to { transform: translateX(0); }
}

.toast.hide {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ==========================================================================
   Horizontal Scroll System for Inventory Tables (Sticky & Synchronized)
   ========================================================================== */

/* Top Synchronized Scrollbar */
.top-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-bottom: 6px;
  background: rgba(10, 110, 209, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.top-scroll-container::-webkit-scrollbar,
.floating-scroll-bar::-webkit-scrollbar,
#inv-table-scroll-container::-webkit-scrollbar,
#coils-table-scroll-container::-webkit-scrollbar,
#tafeln-table-scroll-container::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.top-scroll-container::-webkit-scrollbar-track,
.floating-scroll-bar::-webkit-scrollbar-track,
#inv-table-scroll-container::-webkit-scrollbar-track,
#coils-table-scroll-container::-webkit-scrollbar-track,
#tafeln-table-scroll-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
}

.top-scroll-container::-webkit-scrollbar-thumb,
.floating-scroll-bar::-webkit-scrollbar-thumb,
#inv-table-scroll-container::-webkit-scrollbar-thumb,
#coils-table-scroll-container::-webkit-scrollbar-thumb,
#tafeln-table-scroll-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 6px;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 4px rgba(10, 110, 209, 0.3);
}

.top-scroll-container::-webkit-scrollbar-thumb:hover,
.floating-scroll-bar::-webkit-scrollbar-thumb:hover,
#inv-table-scroll-container::-webkit-scrollbar-thumb:hover,
#coils-table-scroll-container::-webkit-scrollbar-thumb:hover,
#tafeln-table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Floating Bottom Scroll Dock (Always Accessible) */
.inventory-scroll-dock {
  position: sticky;
  bottom: 0.65rem;
  z-index: 90;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  background: #0f2537;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.scroll-dock-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.scroll-dock-bar-wrapper {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.scroll-dock-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.floating-scroll-bar {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-scroll-nav {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition-smooth);
}

.btn-scroll-nav:hover {
  background: rgba(10, 110, 209, 0.6);
  border-color: #0a6ed1;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-scroll-nav.btn-scroll-primary {
  background: #0a6ed1;
  border-color: #0a6ed1;
  color: #ffffff;
}

.btn-scroll-nav.btn-scroll-primary:hover {
  background: #085caf;
}

/* Master-Detail Layout für Produktion (Bauteilauswahl links, Arbeitsgänge rechts) */
.production-workspace {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

/* En Werkstatt-Modus, la selección de pieza va a pantalla completa arriba y
   el resto (trabajador / AG) debajo, en vez de columnas lado a lado */
.production-workspace.operator-mode {
  flex-direction: column;
}

.production-sidebar {
  width: 380px;
  min-width: 340px;
  max-width: 420px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
  max-height: calc(100vh - 110px);
}

/* Selector de piezas en Werkstatt-Modus: cuadrícula de botones grandes */
.production-sidebar.operator-mode {
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow-y: visible;
  margin-bottom: 0.5rem;
}

.prod-sidebar-title {
  padding: 0.55rem 1.15rem 0.3rem;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.prod-piece-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.85rem;
  padding: 0.3rem 1.15rem 0.6rem;
}

.prod-piece-btn {
  min-height: 74px;
  min-width: 170px;
  flex: 1 1 170px;
  padding: 0.5rem;
  border-radius: 10px;
  border: 2px solid #94a3b8;
  background: #ffffff;
  color: #1e293b;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
}

.prod-piece-btn:hover {
  background: #fef9c3;
  border-color: #ca8a04;
  transform: translateY(-2px);
}

.prod-piece-btn.active {
  background: #ffff00 !important;
  border-color: #000000 !important;
  border-width: 3px !important;
  color: #000000 !important;
  box-shadow: inset 0 0 0 2px #000, 0 4px 10px rgba(0,0,0,0.2) !important;
  transform: translateY(-2px);
}

.production-detail-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* En Werkstatt-Modus (apilado verticalmente), centrar el bloque de trabajador/AG
   en vez de estirarlo a todo el ancho de pantallas grandes */
.production-workspace.operator-mode .production-detail-panel {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Panel lateral derecho (solo admin, vista Fertigungslinie): últimos
   movimientos/reportes de los trabajadores, para saber qué falta verbuchen a mano */
.production-activity-panel {
  width: 320px;
  min-width: 280px;
  max-width: 340px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: 780px;
}

.production-activity-list {
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.production-sidebar-header {
  padding: 0.95rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.production-sidebar-list {
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.production-piece-card {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  transition: all 0.15s ease-in-out;
  position: relative;
}

.production-piece-card:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(10, 110, 209, 0.08);
}

.production-piece-card.active {
  border-width: 2px;
  border-color: #0a6ed1;
  background: #f0f7ff;
  box-shadow: 0 4px 14px rgba(10, 110, 209, 0.12);
}

/* Selector de operario en taller (EDY / ELIAS / SAMUEL / MATO) */
.operator-worker-banner {
  background: #fffbeb;
  border: 2px solid #eab308;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.15);
}

.operator-worker-btn {
  padding: 0.8rem 0.5rem;
  border-radius: 8px;
  font-weight: 900;
  font-size: 1.15rem;
  cursor: pointer;
  text-align: center;
  border: 2px solid #ca8a04;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 0.15s ease;
}

.operator-worker-btn:hover {
  background: #fef9c3;
  transform: translateY(-2px);
}

.operator-worker-btn.active {
  background: #ffff00 !important;
  border-color: #000000 !important;
  border-width: 2.5px !important;
  color: #000000 !important;
  box-shadow: inset 0 0 0 2px #000, 0 4px 10px rgba(0,0,0,0.2) !important;
  transform: translateY(-2px);
}

@media (max-width: 1024px) {
  .production-workspace {
    flex-direction: column;
  }
  .production-sidebar {
    width: 100%;
    max-width: 100%;
  }
  .production-activity-panel {
    width: 100%;
    max-width: 100%;
    max-height: 420px;
  }
  .production-sidebar-list {
    max-height: 350px;
  }
}

/* Aviso grande centrado en pantalla al confirmar una cantidad en Werkstatt-Modus */
.op-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
  animation: opConfirmFade 3s ease forwards;
}

.op-confirm-badge {
  background: #16a34a;
  color: #ffffff;
  border-radius: 28px;
  min-width: 190px;
  min-height: 190px;
  padding: 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 45px rgba(0,0,0,0.4), 0 0 0 10px rgba(22,163,74,0.2);
  animation: opConfirmPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.op-confirm-check {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
}

.op-confirm-qty {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: var(--font-display);
  margin-top: 0.35rem;
  line-height: 1;
}

.op-confirm-today {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.5rem;
  opacity: 0.92;
}

@keyframes opConfirmPop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes opConfirmFade {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}






/* ─── Produktion › FEPA-Barcodes ─── */
.fepa-view { max-width: 1100px; margin: 0 auto; }
.fepa-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 0.9rem 1.2rem; box-shadow: var(--shadow-sm); }
.fepa-week { display: flex; align-items: center; gap: 0.75rem; }
.fepa-week button { border: 1.5px solid var(--border-color); background: var(--bg-base); color: var(--text-primary); border-radius: 8px; padding: 0.4rem 0.75rem; font-weight: 800; cursor: pointer; }
.fepa-week button:disabled { opacity: 0.35; cursor: default; }
.fepa-week .fepa-today { font-size: 0.8rem; }
.fepa-kw { font-size: 1.35rem; font-weight: 900; font-family: var(--font-display); color: var(--text-primary); line-height: 1.1; }
.fepa-range { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; }
.fepa-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; }
.fepa-summary span { padding: 0.25rem 0.65rem; border-radius: 999px; background: var(--bg-base); color: var(--text-secondary); font-weight: 700; }
.fepa-summary .ok { background: #dcfce7; color: #166534; }
.fepa-summary .todo { background: #dbeafe; color: #1e40af; }
.fepa-summary .warn { background: #fef3c7; color: #92400e; }
.fepa-print { border: 0; background: var(--primary); color: #fff; font-weight: 800; border-radius: 8px; padding: 0.55rem 1.1rem; cursor: pointer; }
.fepa-print:disabled { opacity: 0.4; cursor: default; }
.fepa-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0.6rem 0.2rem 0.9rem; }
.fepa-pending { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: var(--radius-md); padding: 0.6rem 0.9rem; font-size: 0.82rem; font-weight: 700; margin-bottom: 0.9rem; }
.fepa-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); background: var(--bg-card); border: 1px dashed var(--border-color); border-radius: var(--radius-lg); }
.fepa-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 1rem; overflow: hidden; }
.fepa-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.85rem 1.2rem; border-bottom: 1px solid var(--border-color); background: var(--bg-base); }
.fepa-name { font-size: 1.02rem; font-weight: 900; color: var(--text-primary); }
.fepa-ka { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; font-family: Consolas, monospace; }
.fepa-fa { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.7rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fepa-fa input { width: 150px; font-size: 1.15rem; font-weight: 900; font-family: Consolas, monospace; letter-spacing: 0.08em; padding: 0.4rem 0.6rem; border: 1.5px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-primary); }
.fepa-fa.missing input { border-color: #f59e0b; background: #fffbeb; }
.fepa-table { width: 100%; border-collapse: collapse; }
.fepa-table td { padding: 0.75rem 1.2rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.fepa-table tr:last-child td { border-bottom: 0; }
.fepa-ag { width: 80px; }
.fepa-ag, .fepa-table td.fepa-ag { font-size: 1.1rem; font-weight: 900; color: var(--text-primary); white-space: nowrap; }
.fepa-qty { width: 150px; font-size: 1.35rem; font-weight: 900; color: var(--text-primary); white-space: nowrap; }
.fepa-qty span { font-size: 0.8rem; color: var(--text-muted); }
.fepa-days { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.fepa-code svg { max-width: 100%; }
.fepa-digits { font-family: Consolas, monospace; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 0.15rem; width: 300px; max-width: 100%; text-align: center; }
.fepa-digits b { color: var(--text-primary); }
.fepa-digits b.ag { background: var(--text-primary); color: var(--bg-card); border-radius: 3px; padding: 0 0.2rem; }
.fepa-nofa { color: #b45309; font-weight: 800; font-size: 0.85rem; }
.fepa-act { width: 190px; text-align: right; }
.fepa-done-btn { border: 1.5px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); border-radius: 8px; padding: 0.45rem 0.8rem; font-weight: 800; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.fepa-done-btn.on { border-color: #16a34a; background: #dcfce7; color: #166534; }
.fepa-new { font-size: 0.72rem; font-weight: 800; color: #b45309; margin-top: 0.3rem; }
.fepa-row-done td.fepa-ag, .fepa-row-done td.fepa-qty, .fepa-row-done td.fepa-code { opacity: 0.45; }
@media (max-width: 760px) {
  .fepa-table tr { display: grid; grid-template-columns: auto 1fr; }
  .fepa-table td { border-bottom: 0; padding: 0.5rem 0.9rem; }
  .fepa-table td.fepa-code, .fepa-table td.fepa-act { grid-column: 1 / -1; text-align: left; }
  .fepa-table tr { border-bottom: 1px solid var(--border-color); }
}
.fepa-other { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.9rem; }
.fepa-other button { border: 1px solid #93c5fd; background: #eff6ff; color: #1e40af; border-radius: 999px; padding: 0.2rem 0.7rem; font-weight: 800; font-size: 0.78rem; cursor: pointer; }
.prod-fa-field { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 800; color: var(--text-secondary); }
.prod-fa-field input { width: 120px; font-size: 1rem; font-weight: 900; font-family: Consolas, monospace; letter-spacing: 0.08em; padding: 0.3rem 0.55rem; border: 1.5px solid var(--border-color); border-radius: 6px; background: #fff; color: var(--text-primary); }
.prod-fa-field.missing span { color: #b45309; }
.prod-fa-field.missing input { border-color: #f59e0b; background: #fffbeb; }
.fepa-fa { align-items: flex-end; }
.fepa-fa-val { display: flex; align-items: center; gap: 0.6rem; text-transform: none; letter-spacing: 0; }
.fepa-fa-val b { font-size: 1.2rem; font-weight: 900; font-family: Consolas, monospace; letter-spacing: 0.08em; color: var(--text-primary); }
.fepa-fa-val em { font-style: normal; font-size: 0.9rem; font-weight: 800; color: #b45309; }
.fepa-fa-val button { border: 1px solid var(--border-color); background: var(--bg-card); color: var(--primary); border-radius: 6px; padding: 0.25rem 0.6rem; font-weight: 800; font-size: 0.75rem; cursor: pointer; }
.fepa-fa.missing .fepa-fa-val button { border-color: #f59e0b; background: #fffbeb; color: #92400e; }

/* Big screen (Produktion-Benutzer): Druck-Buttons */
.bigscreen-print-btn { padding: 1.6vmin 1vmin; border: none; border-radius: var(--radius-lg); background: var(--primary); color: #fff; font-weight: 900; font-family: var(--font-display); font-size: clamp(1.05rem, 2.3vmin, 2rem); cursor: pointer; box-shadow: 0 4px 14px rgba(59,130,246,0.35); touch-action: manipulation; line-height: 1.15; }

/* Inventur: Lagerort */
.inv-lager { width: 100%; min-width: 150px; padding: 0.3rem 0.4rem; font-size: 0.78rem; font-weight: 700; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-card); color: var(--text-muted); cursor: pointer; }
.inv-lager.has { color: var(--text-primary); border-color: rgba(59,130,246,0.45); background: rgba(59,130,246,0.06); }

/* Coils: Bearbeiten-Fenster */
.coil-edit-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.55); z-index: 9999; justify-content: center; align-items: center; padding: 1rem; }
.coil-edit-box { background: #fff; border-radius: var(--radius-lg); width: min(640px, 100%); max-height: 92vh; overflow: auto; padding: 1.1rem 1.25rem; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.coil-edit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.9rem; }
.coil-edit-head h3 { margin: 0.15rem 0 0; font-size: 1.2rem; font-weight: 900; font-family: var(--font-display); }
.coil-edit-kicker { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.coil-edit-x { border: none; background: #f1f5f9; border-radius: 8px; padding: 0.4rem 0.7rem; font-size: 1.1rem; cursor: pointer; }
.coil-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 0.9rem; }
.coil-edit-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); }
.coil-edit-field:first-child { grid-column: 1 / -1; }
.coil-edit-field input { padding: 0.5rem 0.65rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.9rem; font-weight: 700; color: var(--text-primary); background: var(--bg-app); }
.coil-edit-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0.8rem 0 0; }
.coil-edit-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; }
.coil-edit-actions .btn-primary, .coil-edit-actions .btn-secondary { padding: 0.55rem 1rem; font-weight: 800; border-radius: 8px; cursor: pointer; }
.coil-edit-del { border: 1px solid rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); color: var(--danger); font-weight: 800; border-radius: 8px; padding: 0.55rem 0.9rem; cursor: pointer; }
@media (max-width: 600px) { .coil-edit-grid { grid-template-columns: 1fr; } }

/* Inventur › Zusammenfassung */
.zus-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); margin-bottom: 1.25rem; }
.zus-table { border-collapse: collapse; font-size: 0.78rem; min-width: 100%; }
.zus-table th, .zus-table td { padding: 0.35rem 0.55rem; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border-color); }
.zus-table .zus-lbl { position: sticky; left: 0; z-index: 2; background: var(--bg-card); text-align: left; font-weight: 800; min-width: 170px; border-right: 2px solid var(--border-color); }
.zus-table thead th { background: var(--bg-app); font-weight: 800; color: var(--text-primary); }
.zus-table thead th.zus-head { z-index: 3; background: var(--bg-app); font-size: 0.82rem; color: var(--text-muted); }
.zus-table .zus-th div { font-size: 0.85rem; }
.zus-table .zus-th small, .zus-table .zus-head small { font-weight: 600; color: var(--text-muted); font-size: 0.68rem; }
.zus-table th.calc, .zus-table td.calc { background: rgba(59,130,246,0.07); }
.zus-table th.calc div::after { content: ' ✱'; color: #3b82f6; }
.zus-dot { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 2px; margin-right: 0.4rem; vertical-align: -1px; }
.zus-gesamt td { font-weight: 900; border-top: 2px solid var(--text-primary); border-bottom: 2px solid var(--text-primary); color: var(--text-primary); }
.zus-small td { font-size: 0.74rem; color: var(--text-secondary); }
.zus-small .zus-lbl { font-weight: 700; font-style: italic; }
.zus-muted { color: var(--text-muted) !important; font-style: italic; }
.zus-pos { color: #15803d !important; font-weight: 700; }
.zus-neg { color: #b91c1c !important; font-weight: 700; }
.zus-calc-tag { background: rgba(59,130,246,0.12); color: #1d4ed8; font-weight: 800; padding: 0 0.35rem; border-radius: 4px; }
.zus-bottom { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.zus-box { border: 2px solid var(--text-primary); border-radius: var(--radius-md); background: var(--bg-card); padding: 0.9rem 1rem; }
.zus-box-head { display: flex; align-items: center; gap: 0.6rem; font-size: 1.35rem; font-weight: 900; font-family: var(--font-display); }
.zus-box-head select { font-size: 1.05rem; font-weight: 900; border: 1px solid var(--border-color); border-radius: 8px; padding: 0.2rem 0.4rem; background: var(--bg-app); color: var(--text-primary); }
.zus-box-foot { display: flex; justify-content: flex-end; margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px dashed var(--border-color); }
.zus-print-btn { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; font-size: 0.78rem; font-weight: 800; padding: 0.35rem 0.7rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-app); color: var(--text-primary); cursor: pointer; font-family: inherit; }
.zus-print-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.zus-box-sub { font-size: 0.75rem; color: var(--text-muted); margin: 0.2rem 0 0.7rem; }
.zus-box table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.zus-box td { padding: 0.35rem 0.2rem; border-bottom: 1px solid var(--border-color); }
.zus-box td:nth-child(2) { text-align: right; font-weight: 800; }
.zus-box .zus-share { text-align: right; color: var(--text-muted); font-size: 0.75rem; width: 3.2rem; }
.zus-box .zus-total td { font-weight: 900; border-top: 2px solid var(--text-primary); border-bottom: none; font-size: 0.95rem; }
.zus-chart-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); padding: 0.9rem 1rem; min-width: 0; }
.zus-chart-title { text-align: center; font-weight: 800; color: var(--text-secondary); margin-bottom: 0.4rem; }
.zus-details { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); padding: 0.75rem 1rem; }
.zus-details summary { cursor: pointer; font-weight: 800; }
@media (max-width: 900px) { .zus-bottom { grid-template-columns: 1fr; } }

/* Produktion: Letzte Bewegungen + Warnungen nebeneinander (schmale Bildschirme: untereinander) */
.production-side-panels { display: flex; gap: 1rem; align-items: stretch; flex-shrink: 0; }
.production-alerts-panel { width: 300px; min-width: 260px; }
@media (max-width: 1700px) {
  .production-side-panels { flex-direction: column; width: 320px; }
  .production-side-panels .production-activity-panel { width: 100%; max-height: 420px; }
}
@media (max-width: 1024px) {
  .production-side-panels { width: 100%; }
}
.alert-count { display: inline-block; min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.75rem; text-align: center; margin-left: 0.25rem; }
.alert-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.6rem 0.75rem; background: #fff; }
.alert-card.err { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.06); }
.alert-card.warn { border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.08); }
.alert-card.done { opacity: 0.6; margin-top: 0.5rem; }
.alert-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.4rem; }
.alert-card-name { font-weight: 800; font-size: 0.85rem; color: var(--text-primary); }
.alert-badge { font-size: 0.66rem; font-weight: 900; padding: 0.1rem 0.45rem; border-radius: 10px; white-space: nowrap; color: #fff; background: #10b981; }
.alert-card.err .alert-badge { background: #ef4444; }
.alert-card.warn .alert-badge { background: #f59e0b; }
.alert-card-meta { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.alert-card-msg { font-size: 0.76rem; color: var(--text-primary); margin-top: 0.3rem; line-height: 1.35; }
.alert-card-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.alert-card-actions { display: flex; gap: 0.4rem; margin-top: 0.45rem; flex-wrap: wrap; }
.alert-btn { border: 1px solid var(--border-color); background: #fff; color: var(--text-secondary); font-size: 0.74rem; font-weight: 800; padding: 0.3rem 0.6rem; border-radius: 6px; cursor: pointer; }
.alert-btn.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.alert-empty { text-align: center; padding: 1.5rem 0.5rem; color: #15803d; font-size: 0.85rem; font-weight: 800; }
.alert-empty span { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; }
.alert-done summary { cursor: pointer; font-size: 0.78rem; font-weight: 800; color: var(--text-muted); margin-top: 0.4rem; }
.zus-table td.zus-check-td { text-align: center; padding: 0.25rem 0.3rem; }
.zus-check-btn { border: 1.5px solid var(--border-color); background: #fff; border-radius: 6px; font-size: 1rem; line-height: 1; padding: 0.15rem 0.35rem; cursor: pointer; color: var(--text-muted); }
.zus-check-btn.ok { border-color: rgba(16,185,129,0.5); background: rgba(16,185,129,0.1); }
.zus-check-btn.changed { border-color: rgba(239,68,68,0.6); background: rgba(239,68,68,0.12); }
.zus-check-by { font-size: 0.62rem; color: var(--text-muted); margin-top: 0.1rem; }
.zus-check-diff { font-size: 0.66rem; color: #b91c1c; font-weight: 800; margin-top: 0.1rem; }
.zus-check-row .zus-lbl { font-weight: 800; }
.zus-check-help { cursor: help; color: var(--text-muted); font-weight: 600; }
.zus-table td.zus-check-td { text-align: right; white-space: nowrap; }
.zus-check-val { font-style: italic; color: var(--text-secondary); }
.zus-diff { color: #b91c1c; font-weight: 800; }
.zus-diff-zero { color: var(--text-muted); }

/* Analysis: Punkte */
.pts-periods { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.75rem 0.9rem; margin-bottom: 1.25rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pts-period { padding: 0.4rem 0.75rem; font-size: 0.8rem; font-weight: 800; border-radius: var(--radius-sm); border: 1px solid var(--border-color); cursor: pointer; background: transparent; color: var(--text-secondary); }
.pts-period.on { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.pts-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; }
.pts-card > summary { cursor: pointer; margin-bottom: 0.6rem; }
.pts-card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; font-weight: 900; font-size: 1rem; }
.pts-empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); font-size: 0.88rem; }
.pts-table-wrap { overflow-x: auto; }
.pts-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.pts-table th { text-align: left; padding: 0.5rem 0.6rem; background: var(--bg-app); color: var(--text-muted); border-bottom: 2px solid var(--border-color); text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.4px; }
.pts-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.pts-table .r { text-align: right; } .pts-table .c { text-align: center; } .pts-table .b { font-weight: 800; } .pts-table .nw { white-space: nowrap; }
.pts-table tr.ok td { background: rgba(16,185,129,0.05); } .pts-table tr.bad td { background: rgba(239,68,68,0.04); }
.pts-table tr.click { cursor: pointer; } .pts-table tr.click:hover td { background: rgba(59,130,246,0.06); }
.pts-muted { color: var(--text-muted); font-size: 0.74rem; font-weight: 600; }
.pts-link { color: var(--primary); font-weight: 800; }
.pts-yes { color: #15803d; font-weight: 900; } .pts-no { color: #b91c1c; font-weight: 900; } .pts-na { color: var(--text-muted); }
.pts-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 99999; justify-content: center; align-items: center; padding: 1rem; }
.pts-box { background: #fff; border-radius: var(--radius-lg); width: min(1050px, 100%); max-height: 90vh; overflow: auto; padding: 1.1rem 1.3rem; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.pts-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.5rem; }
.pts-head h3 { margin: 0.15rem 0 0; font-size: 1.4rem; font-weight: 900; font-family: var(--font-display); }
.pts-kicker { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
.pts-sum { font-size: 0.95rem; color: var(--text-secondary); margin-top: 0.2rem; } .pts-sum b { font-size: 1.3rem; color: var(--text-primary); }
.pts-x { border: none; background: #f1f5f9; border-radius: 8px; padding: 0.45rem 0.8rem; font-size: 1.2rem; cursor: pointer; }
.pts-rule { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.7rem; }
.pts-box.big { width: min(1400px, 96vw); }
.pts-box.big .pts-head h3 { font-size: 2.4rem; } .pts-box.big .pts-sum { font-size: 1.4rem; } .pts-box.big .pts-sum b { font-size: 2rem; }
.pts-box.big .pts-table { font-size: 1.1rem; } .pts-box.big .pts-table th { font-size: 0.85rem; } .pts-box.big .pts-muted { font-size: 0.9rem; }
.pts-box.big .pts-x { font-size: 2rem; padding: 0.6rem 1.2rem; } .pts-box.big .pts-rule { font-size: 1rem; }

/* =====================================================================
   Responsive: Tablet (≤1024px) und Handy (≤760px)
   Viele Bereiche werden in app.js mit Inline-Styles gebaut – deshalb hier
   gezielt mit Attribut-Selektoren und !important übersteuert.
   ===================================================================== */
img, video { max-width: 100%; }

@media (max-width: 1024px) {
  .top-shellbar { flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0.9rem; }
  .top-shellbar-right { flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; margin-left: auto; }
  .app-header { padding: 0.3rem 0.5rem; }
  .nav-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .tab-btn { flex-shrink: 0; white-space: nowrap; }
  main { padding: 1rem; }
  /* Produktion-Benutzer: Teile-Knöpfe groß genug zum Antippen */
  #bigscreen-grid .prod-piece-btn { height: auto !important; min-height: 2.5rem !important; padding: 0.3rem 0.4rem !important; font-size: 0.85rem !important; }
}

@media (max-width: 760px) {
  .sys-sub, .brand-logo-img { display: none; }
  .sys-name { font-size: 0.9rem; }
  .top-shellbar-left { gap: 0.6rem; }
  #shn-cloud-text { font-size: 0.7rem; }
  .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
  main { padding: 0.75rem 0.6rem; }
  h2 { font-size: 1.35rem; margin-bottom: 1rem; }
  .panel, .inv-table-card { padding: 0.85rem !important; }
  .inv-table-card { overflow-x: auto !important; }

  /* Fenster (Modals) nutzen die volle Breite */
  .modal, .modal-card { width: 96vw !important; max-width: 96vw !important; min-width: 0 !important; padding: 1rem !important; max-height: 92vh; overflow-y: auto; }
  .form-actions { flex-wrap: wrap; }
  .toast-container { left: 0.6rem; right: 0.6rem; bottom: 0.8rem; }
  .toast { max-width: none; padding: 0.75rem 1rem; }

  /* In app.js gebaute Raster: auf dem Handy untereinander */
  main [style*="grid-template-columns"],
  .modal-overlay [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  main [style*="grid-column"], .modal-overlay [style*="grid-column"] { grid-column: auto !important; }
  main [style*="grid-row"], .modal-overlay [style*="grid-row"] { grid-row: auto !important; }
  main [style*="grid-template-rows"] { grid-template-rows: none !important; }

  /* Produktion-Benutzer (Großbildschirm): untereinander, Höhe nach Inhalt */
  #bigscreen-grid { height: auto !important; }
  #bigscreen-grid > div { min-height: 0; }
  /* Reihenfolge: Buchen, Druck-Knöpfe, Punkte, Lieferplan (mit eigener Scroll-Box) */
  #bigscreen-grid > div:nth-child(2) { order: 5; height: 75vh; }
  #bigscreen-grid > div:nth-child(4) { height: 320px; }
  main [style*="grid-template-columns"]:has(> .prod-piece-btn),
  main [style*="grid-template-columns"]:has(> .bigscreen-print-btn) { grid-template-columns: 1fr 1fr !important; gap: 0.4rem !important; }
  #bigscreen-grid [style*="flex-direction:column"]:has(> [style*="grid-template-columns"] > .prod-piece-btn) { gap: 0.4rem !important; }
  .bigscreen-print-btn { padding: 0.7rem 0.4rem; font-size: 1rem; }

  /* Flex-Zeilen dürfen umbrechen, Kinder dürfen schrumpfen */
  main [style*="display:flex"]:not(td *):not(th *), main [style*="display: flex"]:not(td *):not(th *),
  .modal-overlay [style*="display:flex"]:not(td *):not(th *), .modal-overlay [style*="display: flex"]:not(td *):not(th *) { flex-wrap: wrap; }
  main :not(table):not(th):not(td)[style*="min-width"],
  .modal-overlay :not(table):not(th):not(td)[style*="min-width"] { min-width: 0 !important; }
  main :not(table):not(th):not(td)[style*="width:"][style*="px"] { max-width: 100%; }

  /* Produktion: AG-Knöpfe zwei pro Zeile, ohne Pfeile */
  .ag-flow { gap: 0.6rem !important; }
  .ag-flow > .ag-arrow { display: none !important; }
  .ag-flow > .ag-step { flex: 1 1 calc(50% - 0.6rem); }
  .ag-flow > .ag-step > button[id^="ag-btn-"] { width: 100% !important; max-width: 150px; }

  /* Inventur/Coils: Monats-Navigation unten – Leiste oben, 4 gleich breite Knöpfe */
  .inventory-scroll-dock { padding: 0.45rem 0.5rem; }
  .scroll-dock-controls { flex-wrap: wrap; gap: 0.35rem; }
  .scroll-dock-bar-wrapper { order: -1; flex: 1 1 100%; min-width: 0; }
  .scroll-dock-title { display: none; }
  .btn-scroll-nav { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; white-space: normal; line-height: 1.15; padding: 0.4rem 0.3rem; font-size: 0.72rem; }
}

/* Inventur/Coils/Tafeln: nur EINE horizontale Leiste – die in der Navigation unten.
   Die eigene Leiste der Tabelle wird ausgeblendet (Wischen / Shift+Mausrad geht weiter). */
#inv-table-scroll-container,
#coils-table-scroll-container,
#tafeln-table-scroll-container { scrollbar-width: none; }
#inv-table-scroll-container::-webkit-scrollbar,
#coils-table-scroll-container::-webkit-scrollbar,
#tafeln-table-scroll-container::-webkit-scrollbar { display: none; height: 0; }
.floating-scroll-bar { height: 16px; cursor: pointer; }

/* Ohne Anmeldung: nichts von der App zeigen, nur das Anmeldefenster (nicht schließbar) */
html.auth-locked .app-container { display: none !important; }
html.auth-locked #modal-login { display: flex !important; opacity: 1 !important; pointer-events: auto !important; background: #0f2537; backdrop-filter: none; transition: none !important; }
html.auth-locked #modal-login .modal-card { transform: none !important; transition: none !important; }
html.auth-locked #modal-login .modal-close,
html.auth-locked #modal-login .btn-secondary { display: none !important; }
html.auth-locked #modal-login .form-actions { justify-content: flex-end !important; }

/* Kopfbereich (schwarze Leiste + Reiter) bleibt beim Scrollen oben */
.app-topbar { position: sticky; top: 0; z-index: 950; background: #ffffff; }
html { scroll-padding-top: var(--topbar-h, 0px); }

/* Nichts darf rechts aus dem Bildschirm ragen (sonst lässt sich die Seite auf
   Handy/Tablet seitlich schieben und rechts erscheint ein weißer Streifen).
   clip statt hidden: erzeugt keinen eigenen Scrollbereich (sticky bleibt ok). */
html, body { overflow-x: clip; }

@media (max-width: 1024px) {
  /* Meldungen von unten statt von rechts einblenden */
  .toast { transform: translateY(16px); opacity: 0; animation: toastUp 0.25s ease-out forwards; }
  .toast.hide { animation: toastDown 0.25s ease-in forwards; }
  @keyframes toastUp { to { transform: translateY(0); opacity: 1; } }
  @keyframes toastDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(16px); opacity: 0; } }
}

@media (max-width: 760px) {
  /* Handy: Kopfzeile kompakt in einer Zeile – SHN links, Nutzer + Abmelden rechts */
  .top-shellbar { flex-wrap: nowrap; padding: 0.4rem 0.6rem; margin-top: 0; }
  .top-shellbar-title { display: none; }
  .top-shellbar-right { flex-wrap: nowrap; gap: 0.35rem; min-width: 0; }
  #shn-cloud-text { display: none; }
  #shn-cloud-status { padding: 0.3rem 0.4rem !important; }
  .sys-info, #sys-auth-container { min-width: 0; gap: 0.35rem !important; }
  #sys-auth-container > div { min-width: 0; }
  #sys-auth-container > div span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #sys-auth-container button { font-size: 0 !important; gap: 0 !important; padding: 0.3rem 0.5rem !important; }
  #sys-auth-container button span { font-size: 0.9rem; }
  .app-header { padding: 0.2rem 0.4rem; }
}

/* Produktions Zeit: bearbeiten */
.pz-edit-btn { border: 1px solid var(--border-color); background: var(--bg-card); border-radius: 6px; padding: 0.2rem 0.45rem; cursor: pointer; font-size: 0.85rem; }
.pz-edit-btn:hover { border-color: var(--primary); background: rgba(10,110,209,0.08); }
.pz-add-btn { border: 1px solid rgba(10,110,209,0.4); background: rgba(10,110,209,0.08); color: var(--primary); border-radius: 6px; padding: 0.25rem 0.6rem; font-weight: 800; font-size: 0.78rem; cursor: pointer; }
.pz-edited { display: inline-block; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 4px; padding: 0.05rem 0.35rem; vertical-align: middle; }
.coil-edit-field.pz-wide { grid-column: 1 / -1; }
/* Einkauf: Felder aus Stammdaten › Einkaufsteile (gesperrt) */
.form-control.ek-locked { background: #f1f5f9 !important; color: var(--text-secondary); cursor: not-allowed; }
select.form-control.ek-locked { opacity: 1; }
.ek-info { font-size: 0.8rem; line-height: 1.4; padding: 0.55rem 0.8rem; border-radius: var(--radius-md); margin: -0.25rem 0 1rem; background: var(--bg-app); border: 1px solid var(--border-color); color: var(--text-secondary); }
.ek-info:empty { display: none; }
.ek-info.ok { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.35); color: #065f46; }
.ek-info.warn { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.45); color: #92400e; }
.ek-info-btn { margin-left: 0.4rem; border: 1px solid currentColor; background: #fff; color: inherit; border-radius: 6px; padding: 0.15rem 0.55rem; font-weight: 800; font-size: 0.75rem; cursor: pointer; }
.ek-price-link { display: inline-block; margin-top: 0.3rem; border: none; background: none; padding: 0; color: var(--primary); font-size: 0.75rem; font-weight: 800; cursor: pointer; text-decoration: underline; }
.ek-price-link:hover { color: var(--primary-hover); }
/* Datumsfelder TT.MM.JJJJ mit Kalender-Knopf */
.de-date-wrap { position: relative; display: flex; gap: 0.35rem; align-items: stretch; }
.de-date-wrap > .form-control { flex: 1; min-width: 0; }
.de-date-btn { flex-shrink: 0; border: 1px solid var(--border-color); background: var(--bg-card); border-radius: var(--radius-md); padding: 0 0.6rem; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.de-date-btn:hover { border-color: var(--primary); background: rgba(10,110,209,0.06); }
.de-date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }
.form-control.de-date-bad { border-color: #ef4444 !important; background: #fef2f2 !important; }
/* Lieferplan: Aufschlüsselung je Lieferung (Klick auf die Zeile) */
.lp-row:hover td { filter: brightness(0.97); }
.lp-row.lp-open td:first-child::before { content: '▾ '; color: var(--primary); font-weight: 900; }
.lp-row:not(.lp-open) td:first-child::before { content: '▸ '; color: var(--text-muted); font-weight: 900; }
.lp-det { padding: 0.85rem 1.1rem 1rem; background: var(--bg-app); }
.lp-det-title { font-weight: 900; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.lp-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #e5e7eb; margin-bottom: 0.65rem; }
.lp-bar-seg.fin { background: #10b981; } .lp-bar-seg.wip { background: #3b82f6; } .lp-bar-seg.new { background: #f59e0b; } .lp-bar-seg.miss { background: #ef4444; }
.lp-det-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.55rem; }
.lp-chip { font-size: 0.8rem; padding: 0.3rem 0.65rem; border-radius: 8px; border: 1px solid; background: #fff; }
.lp-chip span { color: var(--text-muted); font-size: 0.74rem; }
.lp-chip.fin { border-color: rgba(16,185,129,0.45); color: #065f46; }
.lp-chip.wip { border-color: rgba(59,130,246,0.45); color: #1e40af; }
.lp-chip.new { border-color: rgba(245,158,11,0.5); color: #92400e; }
.lp-chip.miss { border-color: rgba(239,68,68,0.45); color: #991b1b; }
.lp-det-note { font-size: 0.76rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.lp-mat { width: auto; min-width: 360px; border-collapse: collapse; font-size: 0.76rem; margin: 0.2rem 0 0.5rem; background: #fff; border: 1px solid var(--border-color); border-radius: 6px; }
.lp-mat th { text-align: left; padding: 0.3rem 0.6rem; color: var(--text-muted); font-weight: 800; background: var(--bg-app); border-bottom: 1px solid var(--border-color); }
.lp-mat td { padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--border-color); }
.lp-mat tr.short td { color: #b91c1c; font-weight: 800; }
.lp-det-warn { font-size: 0.78rem; font-weight: 800; color: #b91c1c; margin-bottom: 0.4rem; }
.lp-det-foot { font-size: 0.7rem; color: var(--text-muted); }
.lp-det-empty { padding: 0.75rem 1.1rem; font-size: 0.8rem; color: var(--text-muted); background: var(--bg-app); }
/* Lieferplan-Aufschlüsselung: Kästchen je AG */
.lp-det-note span { color: var(--text-muted); font-weight: 600; }
.lp-det-note { font-weight: 800; color: var(--text-primary); margin: 0.2rem 0 0.4rem; }
.lp-ag-row { display: flex; align-items: stretch; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.lp-ag { min-width: 112px; padding: 0.45rem 0.65rem; border-radius: 10px; background: #fff; border: 2px solid var(--border-color); display: flex; flex-direction: column; gap: 0.1rem; }
.lp-ag.empty { opacity: 0.6; }
.lp-ag.used { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.lp-ag.fin.used { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }
.lp-ag-head { font-size: 0.78rem; font-weight: 900; color: var(--primary); letter-spacing: 0.3px; }
.lp-ag.fin .lp-ag-head { color: #047857; }
.lp-ag-sub { font-size: 0.68rem; color: var(--text-muted); line-height: 1.2; }
.lp-ag-num { font-size: 1.35rem; font-weight: 900; font-family: var(--font-display); color: var(--text-primary); line-height: 1.15; margin-top: 0.15rem; }
.lp-ag-num span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.lp-ag-use { font-size: 0.72rem; color: var(--text-muted); }
.lp-ag.used .lp-ag-use { color: #1d4ed8; }
.lp-ag.fin.used .lp-ag-use { color: #047857; }
.lp-ag-use b { font-size: 0.85rem; }
.lp-ag-arrow { align-self: center; color: var(--text-muted); font-weight: 900; }
@media (max-width: 760px) { .lp-ag { min-width: 96px; } .lp-ag-arrow { display: none; } }
/* Lieferplanabruf hochladen: Vorschau */
.lpa-box { width: min(860px, 100%); }
.lpa-title { font-size: 1.2rem; font-weight: 900; font-family: var(--font-display); margin-bottom: 0.2rem; }
.lpa-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.9rem; }
.lpa-loading { padding: 2rem 1rem; text-align: center; font-weight: 800; color: var(--text-secondary); }
.lpa-block { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.65rem 0.8rem; margin-bottom: 0.7rem; background: #fff; }
.lpa-block.bad { border-color: rgba(239,68,68,0.45); background: #fef2f2; }
.lpa-head { font-size: 0.9rem; margin-bottom: 0.25rem; }
.lpa-muted { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; }
.lpa-warn { font-size: 0.78rem; font-weight: 700; color: #b45309; margin: 0.2rem 0; }
.lpa-info { font-size: 0.76rem; color: var(--text-secondary); margin: 0.2rem 0 0.4rem; }
.lpa-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.lpa-table th { text-align: left; padding: 0.3rem 0.5rem; color: var(--text-muted); border-bottom: 1px solid var(--border-color); font-weight: 800; }
.lpa-table td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border-color); }
.lpa-table tr.delete td { color: #991b1b; text-decoration: line-through; }
.lpa-table tr.delete td:last-child { text-decoration: none; }
.lpa-badge { font-size: 0.7rem; font-weight: 900; padding: 0.1rem 0.5rem; border-radius: 999px; color: #fff; }
.lpa-badge.new { background: #10b981; } .lpa-badge.update { background: #3b82f6; } .lpa-badge.delete { background: #ef4444; }
.lpa-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.9rem; }
.lpa-actions .btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }

/* MRP: "Was müssen wir bestellen?" */
.wb-card { background: var(--bg-card); border: 1.5px solid rgba(59,130,246,0.3); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; }
.wb-head { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border-color); background: rgba(59,130,246,0.07); display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.wb-head h3 { margin: 0; font-size: 1rem; font-weight: 900; font-family: var(--font-display); }
.wb-head span { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.wb-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.wb-table th { text-align: left; padding: 0.55rem 0.6rem; background: var(--bg-app); border-bottom: 1px solid var(--border-color); font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); font-weight: 800; white-space: nowrap; }
.wb-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.wb-table td small { display: block; font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.wb-table .r { text-align: right; }
.wb-table .nw { white-space: nowrap; }
.wb-details { margin-top: 0.5rem; }
.wb-details summary { cursor: pointer; font-weight: 800; color: var(--text-secondary); padding: 0.5rem 0; }

/* HR: Anwesenheitskalender (hr_kalender.js) */
.hk-wrap { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.9rem 1rem; }
.hk-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }
.hk-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.hk-nav { display: flex; align-items: center; gap: 0.5rem; }
.hk-nav b { min-width: 8.5rem; text-align: center; }
.hk-nav button { border: 1px solid var(--border-color); background: var(--bg-app); border-radius: 6px; padding: 0.25rem 0.6rem; font-weight: 800; cursor: pointer; }
.hk-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.76rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.6rem; }
.hk-legend i { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; vertical-align: -2px; margin-right: 0.3rem; border: 1px solid rgba(0,0,0,0.08); }
.hk-scroll { overflow-x: auto; }
.hk-table { border-collapse: separate; border-spacing: 2px; font-size: 0.74rem; }
.hk-table th { font-weight: 800; color: var(--text-secondary); text-align: center; min-width: 1.75rem; padding: 0.15rem 0; }
.hk-table thead th span { display: block; font-size: 0.62rem; font-weight: 700; color: var(--text-muted); }
.hk-table thead th.we { color: var(--text-muted); }
.hk-table th.today { color: #0a6ed1; }
.hk-table .hk-name { text-align: left; white-space: nowrap; padding-right: 0.5rem; min-width: 6rem; position: sticky; left: 0; background: var(--bg-card); z-index: 1; }
.hk-table td { height: 1.7rem; text-align: center; font-weight: 900; border-radius: 4px; }
.hk-table td.today { outline: 2px solid #0a6ed1; outline-offset: -1px; }
.hk-p { background: #dcfce7; } .hk-a { background: #bbf7d0; }
.hk-u { background: #bfdbfe; color: #1e3a8a; }
.hk-k { background: #fecaca; color: #991b1b; }
.hk-f { background: #e2e8f0; color: #475569; }
.hk-q { background: #fef3c7; color: #92400e; }
.hk-we { background: #f1f5f9; }
.hk-table td.hk-click { cursor: pointer; }
.hk-table td.hk-click:hover { box-shadow: inset 0 0 0 2px #0a6ed1; }
.hk-pick-box { width: min(440px, 100%); }
.hk-pick-title { font-size: 1.05rem; font-weight: 900; margin-bottom: 0.7rem; }
.hk-pick-list { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.7rem; font-size: 0.82rem; }
.hk-pick-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.hk-pick-row button { margin-left: auto; border: 1px solid var(--border-color); background: #fff; border-radius: 6px; padding: 0.2rem 0.5rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.hk-pick-opts { display: flex; flex-direction: column; gap: 0.4rem; }
.hk-pick { text-align: left; padding: 0.5rem 0.7rem; border-radius: 8px; border: 1px solid var(--border-color); font-weight: 800; font-size: 0.85rem; cursor: pointer; }
.hk-pick.a { background: #bbf7d0; border-color: #86efac; }
.hk-pick.k { background: #fee2e2; } .hk-pick.u { background: #dbeafe; } .hk-pick.f { background: #f1f5f9; }
.hk-sum th { text-align: left; }
.hk-sum td { font-size: 0.66rem; font-weight: 800; color: var(--text-secondary); background: transparent; }
.hk-bottom { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.9rem; margin-top: 0.9rem; }
.hk-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.7rem 0.8rem; background: var(--bg-app); }
.hk-card h4 { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 800; }
.hk-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.8rem; }
.hk-form select, .hk-form input { border: 1px solid var(--border-color); border-radius: 6px; padding: 0.3rem 0.4rem; font-size: 0.8rem; background: #fff; }
.hk-form label { display: flex; align-items: center; gap: 0.25rem; font-weight: 700; color: var(--text-secondary); }
.hk-add { background: #0ea5e9; color: #fff; border: none; border-radius: 6px; padding: 0.35rem 0.8rem; font-weight: 800; cursor: pointer; }
.hk-list { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; }
.hk-item { display: flex; align-items: center; gap: 0.5rem; }
.hk-item button { margin-left: auto; border: none; background: none; cursor: pointer; opacity: 0.6; }
.hk-chip { padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; }
.hk-set { font-size: 0.8rem; border-collapse: collapse; }
.hk-set th { font-size: 0.7rem; color: var(--text-muted); font-weight: 800; padding: 0.2rem 0.3rem; text-align: left; }
.hk-set td { padding: 0.2rem 0.3rem; }
.hk-dow { display: flex; align-items: center; gap: 0.15rem; font-weight: 700; }
@media (max-width: 900px) { .hk-bottom { grid-template-columns: 1fr; } }

/* Werkstatt: Rüsten (ruesten.js) */
.rs-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8vmin; margin-bottom: 0.4vmin; }
.rs-tabs button { padding: 0.9vmin 1vmin; border-radius: 10px; border: 2.5px solid var(--border-color); background: #fff; color: var(--text-secondary); font-weight: 900; font-size: clamp(1rem, 2.1vmin, 1.6rem); font-family: var(--font-display); cursor: pointer; touch-action: manipulation; }
.rs-tabs button.on { background: #0a6ed1; border-color: #0a6ed1; color: #fff; }
.rs-tabs button.on.rs { background: #ea580c; border-color: #ea580c; }
.rs-badge { display: inline-block; min-width: 1.4em; padding: 0 0.35em; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.75em; line-height: 1.4em; }
.rs-tabs button.on .rs-badge { background: #fff; color: #ea580c; }
.rs-ag { min-width: 0; min-height: 13vmin; padding: 0.8vmin 0.4vmin; border-radius: 16px; border: none; background: #ea580c; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3vmin; box-shadow: 0 6px 16px rgba(234,88,12,0.4); touch-action: manipulation; font-family: inherit; }
.rs-ag.small { min-height: 9vmin; }
.rs-ag.open { background: #b91c1c; box-shadow: 0 6px 16px rgba(185,28,28,0.45); }
.rs-ag-n { font-weight: 900; font-size: clamp(1.4rem, 4.2vmin, 3.2rem); line-height: 1; }
.rs-ag.small .rs-ag-n { font-size: clamp(1.1rem, 2.8vmin, 2.1rem); }
.rs-ag-act { font-weight: 900; font-size: clamp(0.9rem, 2vmin, 1.5rem); }
.rs-ag-info { font-size: clamp(0.7rem, 1.4vmin, 1.05rem); font-weight: 700; opacity: 0.9; }
.rs-open { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.8vmin; }
.rs-open-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2vmin; padding: 1vmin 1.4vmin; border-radius: 12px; background: #fff7ed; border: 3px solid #ea580c; }
.rs-open-ico { font-size: clamp(1.4rem, 3vmin, 2.2rem); }
.rs-open-txt b { display: block; font-size: clamp(1rem, 2.2vmin, 1.6rem); color: #9a3412; }
.rs-open-txt small { display: block; font-size: clamp(0.85rem, 1.8vmin, 1.3rem); font-weight: 700; color: #7c2d12; }
.rs-end { padding: 1.2vmin 2vmin; border-radius: 12px; border: none; background: #b91c1c; color: #fff; font-weight: 900; font-size: clamp(1rem, 2.2vmin, 1.6rem); cursor: pointer; white-space: nowrap; touch-action: manipulation; }

/* Werkstatt: Wareneingang (werkstatt_we.js) – ohne Preise */
.we-box { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--bg-card); border: 3px solid #8b5cf6; border-radius: var(--radius-lg); padding: 1.4vmin 1.8vmin; box-shadow: var(--shadow-sm); max-height: 24vh; }
.we-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1vmin; margin-bottom: 0.8vmin; }
.we-title { font-size: clamp(1.2rem, 3vmin, 2.2rem); font-weight: 900; font-family: var(--font-display); color: var(--text-primary); }
.we-count { font-size: clamp(0.9rem, 1.8vmin, 1.3rem); font-weight: 800; color: var(--text-muted); }
.we-list { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 0.6vmin; padding-right: 0.4vmin; }
.we-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 1.2vmin; width: 100%; text-align: left; padding: 0.8vmin 1vmin; border: 2px solid var(--border-color); border-radius: 10px; background: var(--bg-app); cursor: pointer; font-family: inherit; color: var(--text-primary); touch-action: manipulation; }
.we-row:active { background: rgba(139,92,246,0.1); }
.we-row small { display: block; font-size: 0.72em; font-weight: 700; color: var(--text-muted); }
.we-date { font-weight: 900; font-size: clamp(0.95rem, 2vmin, 1.5rem); white-space: nowrap; }
.we-prod { font-size: clamp(0.95rem, 2vmin, 1.45rem); min-width: 0; }
.we-prod b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.we-qty { font-weight: 900; font-size: clamp(1rem, 2.2vmin, 1.6rem); white-space: nowrap; text-align: right; }
.we-go { font-size: clamp(1.2rem, 2.8vmin, 2rem); }
.we-empty { color: var(--text-muted); font-weight: 600; font-size: clamp(0.9rem, 1.8vmin, 1.3rem); }
.we-info { background: #f5f3ff; border: 2px solid #ddd6fe; border-radius: 12px; padding: 1.4vmin 1.8vmin; margin-bottom: 1.6vmin; }
.we-info-prod { font-size: clamp(1.2rem, 3vmin, 2.2rem); font-weight: 900; color: #0f172a; }
.we-info-sub { font-size: clamp(0.9rem, 1.9vmin, 1.35rem); font-weight: 700; color: var(--text-muted); margin-top: 0.3vmin; }
.we-info-qty { font-size: clamp(1rem, 2.2vmin, 1.6rem); margin-top: 0.8vmin; color: #334155; }
.we-menge { text-align: center; font-size: clamp(1.6rem, 4vmin, 3rem) !important; cursor: pointer; }

/* Verwaltung: Urlaubsanträge (verwaltung.js) */
.vw-box { flex: 0 0 auto; background: var(--bg-card); border: 3px solid #0ea5e9; border-radius: var(--radius-lg); padding: 1.6vmin 2vmin; box-shadow: var(--shadow-sm); }
.vw-head { display: flex; align-items: center; justify-content: space-between; gap: 1.2vmin; }
.vw-title { font-size: clamp(1.2rem, 3vmin, 2.2rem); font-weight: 900; font-family: var(--font-display); color: var(--text-primary); }
.vw-big-btn { background: #0ea5e9; color: #fff; border: none; border-radius: 12px; padding: 1.2vmin 2.4vmin; font-size: clamp(1.1rem, 2.6vmin, 2rem); font-weight: 900; cursor: pointer; box-shadow: 0 3px 8px rgba(14,165,233,0.35); touch-action: manipulation; }
.vw-big-btn:active { transform: scale(0.98); }
.vw-list { margin-top: 1vmin; display: flex; flex-direction: column; gap: 0.6vmin; }
.vw-row { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2vmin; align-items: center; font-size: clamp(0.95rem, 2vmin, 1.5rem); font-weight: 700; padding: 0.6vmin 0.8vmin; border-radius: 8px; background: var(--bg-app); }
.vw-name { font-weight: 900; white-space: nowrap; }
.vw-dates { color: var(--text-secondary); }
.vw-more { margin-top: 0.6vmin; text-align: right; font-size: clamp(0.85rem, 1.7vmin, 1.25rem); font-weight: 800; color: var(--text-muted); }
.vw-row .vw-status { font-size: clamp(0.95rem, 2vmin, 1.5rem); padding: 0.3vmin 1.2vmin; }
.vw-empty { margin-top: 0.8vmin; color: var(--text-muted); font-size: clamp(0.9rem, 1.8vmin, 1.3rem); font-weight: 600; }
.vw-status { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-weight: 800; white-space: nowrap; font-size: 0.85em; }
.vw-status.offen { background: rgba(245,158,11,0.16); color: #b45309; }
.vw-status.ok { background: rgba(16,185,129,0.16); color: #047857; }
.vw-status.no { background: rgba(239,68,68,0.14); color: #b91c1c; }
.vw-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 99990; display: flex; align-items: center; justify-content: center; padding: 2vmin; }
.vw-form { background: #fff; border-radius: 18px; width: min(1100px, 100%); max-height: 96vh; overflow: auto; padding: 2.4vmin 3vmin; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.vw-form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.4vmin; }
.vw-form-head h3 { margin: 0; font-size: clamp(1.5rem, 3.6vmin, 2.6rem); font-weight: 900; font-family: var(--font-display); }
.vw-x { background: none; border: none; font-size: clamp(1.4rem, 3.4vmin, 2.4rem); cursor: pointer; color: var(--text-muted); }
.vw-field { margin-bottom: 1.6vmin; }
.vw-field label { display: block; font-weight: 900; font-size: clamp(1rem, 2.2vmin, 1.6rem); margin-bottom: 0.6vmin; color: #0f172a; }
.vw-field label span { font-weight: 600; color: var(--text-muted); font-size: 0.8em; }
.vw-field small { display: block; margin-top: 0.4vmin; color: var(--text-muted); font-weight: 700; font-size: clamp(0.85rem, 1.7vmin, 1.2rem); min-height: 1.2em; }
.vw-input { width: 100%; box-sizing: border-box; font-size: clamp(1.1rem, 2.6vmin, 2rem); font-weight: 800; padding: 1vmin 1.2vmin; border: 2.5px solid #cbd5e1; border-radius: 12px; background: #fff; color: #0f172a; font-family: inherit; }
.vw-input:focus { outline: none; border-color: #0ea5e9; }
.vw-grid3 { display: grid; grid-template-columns: 1fr 1fr 0.7fr; gap: 1.6vmin; }
.vw-grid2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.6vmin; }
.vw-chips { display: flex; flex-wrap: wrap; gap: 1vmin; }
.vw-chip { padding: 1.1vmin 1.8vmin; border-radius: 12px; border: 2.5px solid #000; background: #fef08a; color: #000; font-weight: 900; font-size: clamp(1rem, 2.4vmin, 1.8rem); cursor: pointer; touch-action: manipulation; }
.vw-chip.on { background: #0ea5e9; color: #fff; border-color: #0369a1; }
.vw-tage-box { background: #f1f5f9; color: #0f172a; text-align: center; font-size: clamp(1.3rem, 3vmin, 2.3rem); font-weight: 900; }
.vw-check { display: flex; align-items: center; gap: 1.4vmin; width: 100%; margin: 0 0 1.6vmin; padding: 1.4vmin 1.8vmin; border: 2.5px solid #cbd5e1; border-radius: 14px; background: #fff; color: #0f172a; font-size: clamp(1.05rem, 2.4vmin, 1.8rem); font-weight: 800; text-align: left; cursor: pointer; touch-action: manipulation; font-family: inherit; }
.vw-check.on { border-color: #10b981; background: rgba(16,185,129,0.08); }
.vw-box-check { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 4.4vmin; height: 4.4vmin; min-width: 30px; min-height: 30px; border: 3px solid #64748b; border-radius: 8px; font-size: clamp(1.1rem, 3vmin, 2rem); font-weight: 900; color: #fff; background: #fff; }
.vw-check.on .vw-box-check { background: #10b981; border-color: #10b981; }
.vw-err { min-height: 1.4em; color: #b91c1c; font-weight: 800; font-size: clamp(1rem, 2.2vmin, 1.6rem); margin-bottom: 0.6vmin; }
.vw-actions { display: flex; justify-content: flex-end; gap: 1.6vmin; }
.vw-cancel, .vw-send { padding: 1.4vmin 3vmin; border-radius: 14px; font-size: clamp(1.1rem, 2.6vmin, 2rem); font-weight: 900; cursor: pointer; touch-action: manipulation; }
.vw-cancel { background: #fff; border: 2.5px solid #cbd5e1; color: #334155; }
.vw-send { background: #10b981; border: none; color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,0.35); }
.vw-badge { display: inline-block; margin-left: 0.35rem; min-width: 1.2rem; padding: 0 0.35rem; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 900; line-height: 1.2rem; text-align: center; }
.vw-admin h2 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.vw-admin-head { margin-bottom: 1rem; }
.vw-admin-head p { font-size: 0.83rem; margin: 0.25rem 0 0; }
.vw-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.vw-tabs button { padding: 0.45rem 0.9rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.vw-tabs button.on { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.vw-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); }
.vw-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.vw-table th { text-align: left; padding: 0.55rem 0.6rem; background: var(--bg-app); color: var(--text-muted); font-weight: 800; font-size: 0.72rem; text-transform: uppercase; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.vw-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.vw-num { text-align: right; white-space: nowrap; }
.vw-muted { color: var(--text-muted); font-size: 0.75rem; }
.vw-acts { white-space: nowrap; text-align: right; }
.vw-acts button { margin-left: 0.3rem; padding: 0.3rem 0.6rem; border-radius: 6px; font-weight: 800; font-size: 0.76rem; cursor: pointer; border: 1px solid var(--border-color); background: var(--bg-card); }
.vw-acts .vw-ok { background: #10b981; color: #fff; border-color: #10b981; }
.vw-acts .vw-no { background: #fff; color: #b91c1c; border-color: rgba(239,68,68,0.5); }
.vw-acts .vw-del { color: var(--text-muted); }
.vw-empty-row { text-align: center; color: var(--text-muted); padding: 1.5rem !important; }
.vw-summary { margin-top: 1.2rem; }
.vw-summary h3 { font-size: 1rem; font-weight: 800; margin: 0 0 0.5rem; }
.vw-sum-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.vw-sum-grid div { display: flex; gap: 0.6rem; align-items: center; padding: 0.45rem 0.8rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); font-size: 0.85rem; }
@media (max-width: 760px) { .vw-grid3, .vw-grid2 { grid-template-columns: 1fr; } }

/* Hinweis für die Werkstatt (Pantalla Enorme / Produktion) */
.bigscreen-notice { margin: 0 0 1.4vmin; padding: 1.4vmin 2.4vmin; border-radius: var(--radius-lg); background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; font-size: clamp(1.3rem, 3.2vmin, 2.6rem); font-weight: 700; text-align: center; line-height: 1.25; box-shadow: 0 4px 14px rgba(249,115,22,0.35); }
.bigscreen-notice b { font-weight: 900; }

/* Hinweis "Neue Version verfügbar" (statt automatisch neu zu laden) */
#app-update-notice { position: fixed; right: 16px; bottom: 16px; z-index: 1200; display: flex; align-items: center; gap: 0.6rem; background: #0f2537; color: #fff; padding: 0.55rem 0.6rem 0.55rem 0.9rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); font-size: 0.82rem; font-weight: 700; max-width: calc(100vw - 32px); }
#app-update-notice button { background: #3b82f6; color: #fff; border: none; border-radius: 7px; padding: 0.35rem 0.75rem; font-weight: 800; font-size: 0.8rem; cursor: pointer; white-space: nowrap; font-family: inherit; }
#app-update-notice button:hover { background: #2563eb; }

/* Ja/Nein-Abfrage (z. B. Teillieferung: Bestellung abschließen?) */
.ask-yn-box { width: min(460px, 100%); }
.ask-yn-title { font-size: 1.15rem; font-weight: 900; font-family: var(--font-display); margin-bottom: 0.6rem; }
.ask-yn-text { font-size: 0.88rem; line-height: 1.55; color: var(--text-secondary); margin-bottom: 1rem; }
.ask-yn-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.bes-teil-info { display: block; font-size: 0.68rem; font-weight: 700; color: #d97706; margin-top: 0.1rem; white-space: nowrap; }

/* Kundenauftrag: Bezeichnung/Preis aus Stammdaten */
.ord-stamm-info { font-size: 0.74rem; color: var(--text-muted); margin: -0.5rem 0 1rem; min-height: 0.5rem; }
.ord-stamm-info a { color: #0a6ed1; font-weight: 700; }
.ord-stamm-warn { color: #b91c1c; font-weight: 700; }

/* Auftrag aus PDF (FEPA-AB) */
.ab-pdf-info { font-size: 0.8rem; line-height: 1.45; background: #eff6ff; border: 1px solid rgba(59,130,246,0.35); color: #1e3a8a; border-radius: var(--radius-md); padding: 0.55rem 0.75rem; margin-bottom: 0.9rem; }
.ab-pdf-info.dup { background: #fffbeb; border-color: rgba(245,158,11,0.5); color: #92400e; }
.form-control.ab-missing { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.18); }
.ab-pos-row { display: flex; gap: 0.5rem; align-items: center; font-size: 0.82rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.ab-pos-row:last-child { border-bottom: none; }
/* Analyse: Zeitraum einer Arbeit von Hand korrigieren */
.pts-zr-edit { cursor: pointer; border-bottom: 1px dashed var(--text-muted); }
.pts-zr-edit:hover { color: #2563eb; border-bottom-color: #2563eb; }
#pts-zr-overlay input[type="datetime-local"] { padding: 0.45rem 0.55rem; border: 1px solid var(--border-color); border-radius: 6px; font-family: inherit; font-size: 0.9rem; background: var(--bg-card); color: var(--text-primary); box-sizing: border-box; }
.pts-base { color: var(--text-primary); font-weight: 900; } .pts-we { color: #0369a1; font-weight: 900; }
.pts-del { background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 0.95rem; padding: 0.15rem 0.35rem; opacity: 0.55; }
.pts-del:hover { opacity: 1; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.08); }

/* HR-Kasten Werkstatt: "Urlaub verwalten" */
.vw-summary { margin-top: 1vmin; display: flex; align-items: center; justify-content: space-between; gap: 1vmin; flex-wrap: wrap; font-size: clamp(0.95rem, 2vmin, 1.5rem); font-weight: 700; color: var(--text-secondary); }
.vw-summary b { color: var(--text-primary); font-weight: 900; }
.vw-full { width: 100%; padding: 1.8vmin; margin-bottom: 1vmin; }
.vw-sec { margin: 2vmin 0 0.8vmin; font-size: clamp(1.15rem, 2.8vmin, 2rem); font-weight: 900; font-family: var(--font-display); color: #0f172a; }
.vw-form .vw-row { font-size: clamp(1rem, 2.3vmin, 1.7rem); padding: 1vmin 1.2vmin; }
.vw-row.vw-now { background: rgba(16,185,129,0.1); }
.vw-status.plan { background: rgba(14,165,233,0.14); color: #0369a1; }
.vw-title { white-space: nowrap; }
.vw-box .vw-full { margin-bottom: 0; }

/* Benachrichtigungen (notifications.js) */
.nt-bell { position: relative; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 7px; padding: 0.18rem 0.5rem; font-size: 1rem; cursor: pointer; line-height: 1.3; }
.nt-bell:hover { background: rgba(255,255,255,0.18); }
.nt-badge { position: absolute; top: -7px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 0.68rem; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #0f172a; }
.nt-panel { position: fixed; top: calc(var(--topbar-h, 56px) + 6px); right: 12px; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - var(--topbar-h, 56px) - 24px); display: flex; flex-direction: column; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,0.28); z-index: 2000; overflow: hidden; }
.nt-head { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0.9rem 0.5rem; font-size: 1rem; }
.nt-x { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }
.nt-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 0.9rem 0.6rem; border-bottom: 1px solid var(--border-color); }
.nt-chip { border: 1px solid var(--border-color); background: var(--bg-app); color: var(--text-secondary); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.74rem; font-weight: 800; cursor: pointer; font-family: inherit; }
.nt-chip.on { background: var(--primary, #0a6ed1); border-color: var(--primary, #0a6ed1); color: #fff; }
.nt-chip span { background: #ef4444; color: #fff; border-radius: 8px; padding: 0 0.35rem; margin-left: 0.15rem; font-size: 0.68rem; }
.nt-body { overflow-y: auto; padding: 0.3rem 0 0.6rem; }
.nt-sec { padding: 0.55rem 0.9rem 0.25rem; font-size: 0.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.nt-item { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 0.5rem; align-items: start; width: 100%; text-align: left; background: none; border: none; border-left: 3px solid transparent; padding: 0.5rem 0.9rem 0.5rem 0.75rem; cursor: pointer; font-family: inherit; color: inherit; }
.nt-item:hover { background: var(--bg-app); }
.nt-item.new { background: rgba(59,130,246,0.07); border-left-color: #3b82f6; }
.nt-item.rem { border-left-color: #f59e0b; }
.nt-ico { font-size: 1.05rem; line-height: 1.3; }
.nt-title { display: block; font-size: 0.82rem; line-height: 1.35; }
.nt-sub { display: block; font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 0.1rem; }
.nt-when { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
.nt-tag { display: inline-block; background: rgba(245,158,11,0.18); color: #b45309; border-radius: 5px; padding: 0 0.35rem; font-size: 0.68rem; font-weight: 900; }
.nt-empty { padding: 1.2rem 0.9rem; color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }

/* Lieferplan: fehlendes Material + Ankunft */
.lp-short { margin-top: 0.35rem; display: flex; flex-direction: column; gap: 0.18rem; font-weight: 600; }
.lp-sh-row { font-size: 0.74rem; line-height: 1.35; color: var(--text-secondary); }
.lp-sh-row b { color: var(--text-primary); }
.lp-sh-name { font-weight: 800; color: #b91c1c; }
.lp-sh-ok { color: #047857; font-weight: 700; }
.lp-sh-bad { color: #b91c1c; font-weight: 800; }
.lp-sh-more { color: var(--text-muted); }
.lp-det-warn .lp-short { margin-top: 0.4rem; }

/* Neuer Auftrag: mehrere Positionen */
.op-head { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 0.8rem; margin-bottom: 0.9rem; }
.op-table { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.2rem 0.6rem 0.4rem; background: var(--bg-app); }
.op-row { display: grid; grid-template-columns: 3.6rem 7.6rem minmax(0, 1.4fr) 5.6rem 9.2rem minmax(0, 1fr) 5.6rem 2.4rem 2.6rem 2rem; gap: 0.45rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--border-color); }
.op-row:last-child { border-bottom: none; }
.op-hdr { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); border-bottom: 2px solid var(--border-color) !important; padding-bottom: 0.3rem; }
.op-row .form-control { width: 100%; min-width: 0; box-sizing: border-box; font-size: 0.84rem; padding: 0.38rem 0.5rem; }
.op-row .op-info { grid-column: 1 / -1; margin: 0; }
.op-row.op-bad { background: rgba(239,68,68,0.09); border-radius: 6px; }
.op-del { background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 0.95rem; padding: 0.2rem; opacity: 0.6; }
.op-del:hover { opacity: 1; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.08); }
.op-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.7rem; flex-wrap: wrap; }
.op-summary { font-size: 0.82rem; font-weight: 800; color: var(--text-secondary); }
@media (max-width: 900px) {
  .op-head { grid-template-columns: 1fr 1fr; }
  .op-hdr { display: none; }
  .op-row { grid-template-columns: 1fr 1fr; }
  .op-row .op-item, .op-row .op-ladung { grid-column: 1 / -1; }
}

/* Auftragsübersicht › Nach Auftrag: Fenster mit dem ganzen Auftrag */
.ab-list-row:hover { background: rgba(59,130,246,0.08); }
.ab-detail-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(3px); z-index: 960; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.ab-detail-card { background: var(--bg-card); border-radius: var(--radius-lg); width: min(1350px, 100%); max-height: 96vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,0.4); border: 1px solid var(--border-color); }

/* Umsatz (umsatz.js) */
.um-head { padding: 0.5rem 0 0.9rem; }
.um-head h2 { margin: 0; }
.um-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem 1.2rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.8rem 1rem; margin-bottom: 1rem; }
.um-f { display: flex; flex-direction: column; gap: 0.25rem; }
.um-f > span { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.um-f select { padding: 0.45rem 0.7rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-app); color: var(--text-primary); font-size: 0.84rem; font-weight: 700; min-width: 10rem; }
.um-seg { display: flex; background: var(--bg-app); padding: 0.2rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); gap: 0.2rem; }
.um-seg button { padding: 0.38rem 0.8rem; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-secondary); font-weight: 800; font-size: 0.78rem; cursor: pointer; font-family: inherit; }
.um-seg button.on { background: var(--primary); color: #fff; }
.um-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.um-kpi { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.75rem 1rem; }
.um-kpi.main { border-color: rgba(42,120,214,0.45); }
.um-kpi-l { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.um-kpi-v { font-size: 1.55rem; font-weight: 900; font-family: var(--font-display); color: var(--text-primary); margin-top: 0.15rem; }
.um-kpi-s { font-size: 0.76rem; color: var(--text-secondary); font-weight: 600; margin-top: 0.1rem; }
.um-note { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.4); color: #92400e; border-radius: var(--radius-md); padding: 0.5rem 0.8rem; font-size: 0.8rem; font-weight: 700; margin-bottom: 1rem; }
.um-empty { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 2rem; text-align: center; color: var(--text-muted); font-weight: 700; }
.um-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.9rem 1.1rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.um-card h3 { margin: 0; font-size: 1rem; font-weight: 900; font-family: var(--font-display); }
.um-sub { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; margin: 0.15rem 0 0.5rem; }
.um-chart { position: relative; width: 100%; margin-top: 0.6rem; }
.um-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.um-grid2 .um-card { margin-bottom: 1rem; }
@media (max-width: 900px) { .um-grid2 { grid-template-columns: 1fr; } }
.um-dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-right: 0.45rem; vertical-align: -1px; }
.um-total td { border-top: 2px solid var(--border-color); font-weight: 900; }
.um-intro { margin: 0 0 0.8rem; font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.lp-agc { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 6px; background: rgba(59,130,246,0.12); color: #1d4ed8; font-size: 0.74rem; font-weight: 700; margin: 0.08rem 0.15rem 0.08rem 0; white-space: nowrap; }
.lp-agc.fin { background: rgba(16,185,129,0.15); color: #047857; }
.lp-agc.z { background: rgba(100,116,139,0.1); color: #94a3b8; font-weight: 600; }
.lp-muted { color: var(--text-muted); font-size: 0.74rem; font-weight: 600; }
.an-sub { display: flex; gap: 0.4rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.8rem; }
.an-sub button { padding: 0.55rem 1.2rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); font-weight: 800; font-size: 0.86rem; cursor: pointer; font-family: inherit; }
.an-sub button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.bp-in { font: inherit; font-size: 0.8rem; padding: 0.2rem 0.4rem; border: 1px solid var(--border-color); border-radius: 5px; background: #fff; color: var(--text-primary); }
.bp-fepa { width: 6.4rem; font-weight: 800; font-family: var(--font-mono); } .bp-menge { width: 5.6rem; text-align: right; } .bp-date { width: 6.8rem; } .bp-nr { width: 5rem; font-weight: 800; }
.bp-in:focus { outline: 2px solid #0a6ed1; }

/* Produktion › Fertigungsauftrag */
.fa-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fa-month { display: flex; align-items: center; gap: 0.5rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.35rem 0.6rem; font-size: 0.95rem; }
.fa-month b { min-width: 9.5rem; text-align: center; }
.fa-month button { border: 1px solid var(--border-color); background: var(--bg-app); border-radius: 6px; padding: 0.25rem 0.6rem; cursor: pointer; font-weight: 800; }
.fa-month .fa-now { font-size: 0.75rem; color: var(--primary); }
.fa-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.fa-bar input[type="text"] { padding: 0.5rem 0.8rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); min-width: 260px; font-size: 0.85rem; }
.fa-chk { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 0.35rem; }
.fa-count { font-size: 0.8rem; font-weight: 800; color: #b45309; background: rgba(245,158,11,0.12); border-radius: 999px; padding: 0.25rem 0.7rem; }
.fa-count.ok { color: #047857; background: rgba(16,185,129,0.14); }
.fa-input { width: 8rem; padding: 0.4rem 0.6rem; border: 1.5px solid var(--border-color); border-radius: 7px; font-family: var(--font-mono); font-size: 0.95rem; font-weight: 800; letter-spacing: 0.08em; }
.fa-input:focus { outline: 2px solid var(--primary); }
tr.fa-missing .fa-input { border-color: rgba(245,158,11,0.7); background: rgba(245,158,11,0.07); }
.fa-btn { border: 1px solid var(--border-color); background: var(--bg-app); border-radius: 6px; padding: 0.25rem 0.55rem; cursor: pointer; font-size: 0.78rem; font-weight: 700; font-family: inherit; }
.fa-btn.del:hover { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.08); }
.fa-part-box { background: var(--bg-card, #fff); border-radius: var(--radius-lg, 12px); padding: 1.2rem 1.4rem; width: min(760px, 94vw); max-height: 85vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.fa-part-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.8rem; font-size: 1.1rem; }
/* Kundenauftrag bearbeiten: kompakt, damit alles ohne Scrollen sichtbar ist */
.edit-order-card { padding: 0.9rem 1.2rem !important; max-height: 96vh; }
.edit-order-card .modal-header { margin-bottom: 0.5rem !important; padding-bottom: 0.4rem !important; }
.edit-order-card .modal-header h3 { font-size: 1.05rem; }
.edit-order-card .form-group { margin-bottom: 0.2rem; }
.edit-order-card .form-group label { font-size: 0.75rem; margin-bottom: 0.2rem; }
.edit-order-card .form-control { padding: 0.4rem 0.6rem; font-size: 0.88rem; }
.edit-order-card #form-edit-order > div[style*="grid"] { margin-bottom: 0.5rem !important; gap: 0.6rem !important; }
.edit-order-card .ord-stamm-info { margin: 0 0 0.4rem; font-size: 0.78rem; }
/* Auftragsfenster: dichtere Zeilen, damit mehr Positionen ohne Scrollen sichtbar sind */
.ab-detail-card td { padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; }
.ab-detail-card th { padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; }
.ab-detail-card .btn-secondary { padding: 0.2rem 0.45rem !important; }
/* Auftragsfenster: Spalten schmaler, Aktionsspalte (✔ ➕ ✏️ 🗑️) bleibt rechts immer sichtbar */
.ab-detail-card th { min-width: 0 !important; }
.ab-detail-card td, .ab-detail-card th { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.ab-detail-card table { font-size: 0.78rem !important; }
.ab-detail-card td:last-child, .ab-detail-card th:last-child { position: sticky; right: 0; background: var(--bg-card, #fff); box-shadow: -6px 0 8px -6px rgba(0,0,0,0.18); z-index: 1; }
/* Neue Position: Teilename (aus Stammdaten, gesperrt) wieder sichtbar – Javier 12.10.2026 */
/* Wareneingang/Bestellung bearbeiten: Hinweis auf neuen Preis in Stammdaten */
.ek-newprice { margin-top: 0.45rem; padding: 0.45rem 0.6rem; border-radius: 6px; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.4); color: var(--text-primary); line-height: 1.5; }
.fp-link { cursor:pointer; text-decoration:underline dotted; } .fp-link:hover { color:var(--primary); }

/* Performance (14.10.2026): lange Karten/Tabellen erst layouten, wenn sie in den sichtbaren Bereich kommen */
#bom-tab > div > div, #database-content-area .bom-card { content-visibility: auto; contain-intrinsic-size: auto 600px; }
/* Auftrag anlegen: Registerkarten */
.op-tabs { display:flex; gap:2px; border-bottom:2px solid var(--primary, #3b82f6); margin:0.25rem 0 0.9rem; flex-wrap:wrap; }
.op-tab { background:var(--bg-card); color:var(--text-primary); border:1px solid var(--border-color); border-bottom:none; padding:0.45rem 0.9rem; font-size:0.85rem; font-weight:600; cursor:pointer; border-radius:6px 6px 0 0; }
.op-tab.active { background:var(--primary, #3b82f6); color:#fff; border-color:var(--primary, #3b82f6); }
.op-pane[hidden] { display:none; }
