/* ==============================================================================
   AGROCONECTA - SISTEMA DE CONTROL DE EMPAQUE Y CÓDIGO DE BARRAS
   Estilos CSS Industriales de Alto Contraste y Respuesta Visual Inmediata
   ============================================================================== */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0b1329;
  
  --border-color: #334155;
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-garlic: #fef08a;
  --accent-garlic-dark: #ca8a04;
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.15);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.15);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-glow-success: 0 0 25px rgba(16, 185, 129, 0.45);
  --shadow-glow-danger: 0 0 25px rgba(239, 68, 68, 0.45);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

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

html, body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.app-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.45rem 1.25rem;
  flex-shrink: 0;
  z-index: 50;
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.3);
}

.brand-info h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.1;
}

.brand-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  background-color: #3b82f6;
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.25rem;
  background-color: var(--bg-primary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Header Utilities */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: blink-live-dot 0.9s infinite alternate ease-in-out;
  flex-shrink: 0;
}

.status-dot.syncing {
  background-color: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: blink-live-dot 0.5s infinite alternate ease-in-out;
}

.status-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: none;
}

@keyframes blink-live-dot {
  0% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 12px #10b981, 0 0 4px #10b981;
  }
  100% {
    opacity: 0.15;
    transform: scale(0.65);
    box-shadow: 0 0 1px #10b981;
  }
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-primary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.btn-test-sound {
  background: transparent;
  border: none;
  color: var(--accent-garlic);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.btn-test-sound:hover {
  background-color: rgba(254, 240, 138, 0.15);
}

.volume-slider {
  width: 60px;
  height: 3px;
  accent-color: var(--accent-garlic);
  cursor: pointer;
}

/* Main Layout */
.main-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 0.65rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-content {
  display: none !important;
  flex: 1;
  min-height: 0;
}

.tab-content.active {
  display: flex !important;
  flex-direction: column;
  animation: fadeIn 0.15s ease-in-out;
}

/* Permitir scroll en pestañas administrativas secundarias */
.tab-content:not(#tab-scanner).active {
  overflow-y: auto;
  padding-right: 0.4rem;
  display: block !important;
}

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

/* ==============================================================================
   KPI COMPACT STRIP (Diseñado para no ocupar espacio vertical)
   ============================================================================== */
.kpi-compact-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.kpi-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.15s;
  min-height: 42px;
}

.kpi-chip:hover {
  border-color: var(--border-focus);
}

.kpi-chip-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.kpi-chip-icon.blue { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.kpi-chip-icon.green { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.kpi-chip-icon.yellow { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.kpi-chip-icon.purple { background-color: rgba(168, 85, 247, 0.15); color: #c084fc; }
.kpi-chip-icon.amber { background-color: rgba(217, 119, 6, 0.15); color: #f59e0b; }
.kpi-chip-icon.cyan { background-color: rgba(56, 189, 248, 0.15); color: #38bdf8; }

.kpi-chip-envase {
  border-color: rgba(56, 189, 248, 0.3);
}

.kpi-chip-envase:hover {
  border-color: #38bdf8 !important;
  background-color: rgba(56, 189, 248, 0.08) !important;
}

.kpi-chip-data {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.kpi-chip-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.kpi-chip-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.1;
}

/* ==============================================================================
   TAB 1: SCANNER OPERATOR VIEW (100% VISIBLE EN PANTALLA)
   ============================================================================== */

#tab-scanner {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

#tab-scanner.active {
  display: flex !important;
}

/* Barra de Entrada Compacta */
.scanner-compact-bar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #38bdf8;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.scanner-badge-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.05em;
  background: rgba(56, 189, 248, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.scanner-pulse-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38bdf8;
  animation: radar-pulse 1.5s infinite;
}

@keyframes radar-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #38bdf8; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.barcode-compact-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1.5px solid #475569;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 1.15rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.08em;
  outline: none;
  transition: all 0.15s;
}

.barcode-compact-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.barcode-compact-input::placeholder {
  color: #64748b;
  font-size: 0.92rem;
  letter-spacing: normal;
}

.btn-manual-scan-compact {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-manual-scan-compact:hover {
  background-color: var(--accent-primary-hover);
}

.btn-eventual-scan-compact {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-eventual-scan-compact:hover {
  background: #f59e0b;
  color: #0f172a;
}

.scanner-status-right {
  flex-shrink: 0;
}

/* Cuadrícula Principal de Escaneo (Dividida en 2 Columnas Ajustadas) */
.scanner-view-grid {
  flex: 1;
  min-height: 480px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.65rem;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .scanner-view-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .side-card {
    height: 500px !important;
    max-height: 65vh !important;
  }
}

/* Tarjeta Gigante de Última Caja Escaneada (Ajustada al 100% de la altura sin desbordes) */
.last-scan-hero-card {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.95rem;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow-y: auto;
  transition: all 0.25s ease;
}

.last-scan-hero-card.success-flash {
  border-color: var(--status-success);
  box-shadow: var(--shadow-glow-success);
  animation: flash-green 0.5s ease-out;
}

.last-scan-hero-card.error-flash {
  border-color: var(--status-danger);
  box-shadow: var(--shadow-glow-danger);
  animation: flash-red 0.5s ease-out;
}

@keyframes flash-green {
  0% { background-color: rgba(16, 185, 129, 0.35); }
  100% { background-color: var(--bg-card); }
}

@keyframes flash-red {
  0% { background-color: rgba(239, 68, 68, 0.35); }
  100% { background-color: var(--bg-card); }
}

.last-scan-empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  margin: auto;
}

.last-scan-empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 0.35rem;
  opacity: 0.4;
  color: var(--accent-garlic);
}

.last-scan-empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.last-scan-content {
  display: none;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
}

.last-scan-content.visible {
  display: flex;
}

.last-scan-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
}

.scan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.scan-status-badge.success {
  background-color: var(--status-success-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.scan-status-badge.duplicate {
  background-color: var(--status-warning-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.scan-status-badge.error {
  background-color: var(--status-danger-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.scan-timestamp {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.employee-hero-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  margin: 0.1rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-hero-code {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-garlic);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0;
}

/* Frase Destacada de Acumulado de la Caja (Ej: Juan Pérez 10 cajas - 22/08/26) */
.hero-accum-statement {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1.5px solid #3b82f6;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.scan-hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  margin-top: auto;
}

.hero-stat-item {
  text-align: center;
}

.hero-stat-label {
  font-size: 0.64rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.05rem;
  letter-spacing: 0.02em;
}

.hero-stat-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.hero-stat-value.highlight-green {
  color: #34d399;
}

.hero-stat-value.highlight-yellow {
  color: var(--accent-garlic);
}

/* Panel Lateral: Tabs y Acumulado por Empleado */
.side-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
  max-height: 100%;
  overflow: hidden;
}

.card-header {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.side-tab-buttons {
  display: flex;
  gap: 0.25rem;
}

.btn-side-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

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

.btn-side-tab.active {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.card-body {
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.live-scans-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 rgba(15, 23, 42, 0.7);
}

/* Scrollbar industrial de alta visibilidad para que el usuario deslice sin esfuerzo */
.live-scans-scroll::-webkit-scrollbar {
  width: 8px !important;
  display: block !important;
}

.live-scans-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 4px;
}

.live-scans-scroll::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.live-scans-scroll::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}

/* Filas de Acumulado de Empleados (Con Números Gigantes de Alta Visibilidad) */
.emp-accum-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
  gap: 0.75rem;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.emp-accum-item:hover {
  background-color: var(--bg-card-hover);
}

.emp-accum-item.has-boxes {
  background-color: rgba(56, 189, 248, 0.04);
}

.emp-accum-item.leader {
  background-color: rgba(245, 158, 11, 0.09);
  border-left: 4px solid #f59e0b;
}

.emp-accum-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.emp-accum-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.emp-accum-avatar.leader-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.emp-accum-name-line {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
}

.emp-accum-meta-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

/* Contador Gigante de Cajas Acumuladas (Legible a distancia) */
.emp-accum-big-count {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.emp-accum-big-count .count-num {
  font-size: 1.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #34d399;
  line-height: 1;
  letter-spacing: -0.02em;
}

.emp-accum-big-count .count-unit {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.emp-accum-big-count.leader-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.emp-accum-big-count.leader-badge .count-num {
  color: #fbbf24;
}

.emp-accum-big-count.leader-badge .count-unit {
  color: #fde68a;
}

.emp-accum-big-count.zero-badge {
  background: rgba(148, 163, 184, 0.08);
  border-color: #334155;
  padding: 0.25rem 0.65rem;
}

.emp-accum-big-count.zero-badge .count-num {
  color: #64748b;
  font-size: 1.25rem;
}

.emp-accum-big-count.zero-badge .count-unit {
  color: #64748b;
}

.scan-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.scan-log-item:hover {
  background-color: var(--bg-card-hover);
}

.scan-log-item:first-child {
  background-color: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
}

.log-emp-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.emp-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.log-emp-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.1;
}

.log-emp-code {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.log-meta-info {
  text-align: right;
  flex-shrink: 0;
}

.log-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  line-height: 1;
}

.log-price-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  font-family: var(--font-mono);
  margin-bottom: 0.15rem;
}

/* ==============================================================================
   TAB 2: EMPLOYEE MANAGEMENT & BARCODE STICKER GENERATOR
   ============================================================================== */

.section-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

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

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}

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

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.btn-success {
  background-color: #059669;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-success:hover {
  background-color: #047857;
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background-color: var(--bg-card-hover);
}

.badge-active {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--status-success-bg);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-inactive {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--status-danger-bg);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Printable Barcode Label Card */
.barcode-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}


/* ==============================================================================
   TAB 3: RECURSOS HUMANOS & LIQUIDACIÓN DE PAGO A DESTAJO
   ============================================================================== */

.filter-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.filter-select, .filter-date {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.filter-select:focus, .filter-date:focus {
  border-color: var(--accent-primary);
}

.payroll-summary-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  border: 1px solid #3b82f6;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.payroll-banner-info h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
}

.payroll-banner-info p {
  color: #bfdbfe;
  font-size: 0.85rem;
}

.payroll-banner-total {
  text-align: right;
}

.payroll-banner-total .amount {
  font-size: 2.25rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #fef08a;
}

.payroll-breakdown-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.payroll-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.payroll-pill-30 {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.payroll-pill-10 {
  background: rgba(74, 222, 128, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.payroll-pill-20 {
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #facc15;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-primary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

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

.toast-msg {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.2s ease-out;
}

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

/* ==============================================================================
   ESTILOS DE LA VISTA EJECUTIVA (TABLERO MÓVIL Y EJECUTIVO)
   ============================================================================== */
.executive-dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.25rem 0 1.5rem;
}

.exec-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.exec-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.exec-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.exec-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}

.exec-live-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseLight 1.5s infinite;
}

.exec-date-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: capitalize;
}

.exec-hero-body {
  padding: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.exec-hero-number {
  font-size: clamp(3.2rem, 10vw, 4.5rem);
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 40%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.3));
  margin-bottom: 0.35rem;
  text-align: center;
}

.exec-hero-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

/* Barra de Calidad Minimalista */
.exec-quality-bar-wrap {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.exec-quality-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.exec-quality-progress {
  height: 8px;
  background: rgba(245, 158, 11, 0.3);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.exec-quality-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Mini Cards Grid (2x2) */
.exec-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.exec-mini-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.exec-mini-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.exec-mini-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.exec-mini-icon.speed { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.exec-mini-icon.users { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.exec-mini-icon.trophy { background: rgba(250, 204, 21, 0.15); color: #fde047; }
.exec-mini-icon.clock { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.exec-mini-data {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.exec-mini-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.2;
}

.exec-mini-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Sección de Lista de Rendimiento por Empleado */
.exec-section-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.exec-section-header {
  padding: 0.85rem 1.15rem;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exec-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.exec-section-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.exec-emp-list {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.4rem;
}

.exec-emp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.exec-emp-item.has-boxes {
  border-left: 3.5px solid var(--accent-primary);
}

.exec-emp-item.leader-item {
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.06) 0%, var(--bg-primary) 100%);
}

.exec-emp-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.exec-rank-badge {
  font-size: 0.85rem;
  font-weight: 800;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.exec-emp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.exec-emp-avatar.leader-avatar {
  background: rgba(250, 204, 21, 0.25);
  color: #fde047;
  border: 1.5px solid #fde047;
}

.exec-emp-details {
  min-width: 0;
  flex: 1;
}

.exec-emp-name-line {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.exec-emp-meta-line {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.exec-emp-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  margin-top: 0.35rem;
  overflow: hidden;
}

.exec-emp-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 9999px;
}

.exec-emp-count-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  min-width: 75px;
  text-align: right;
  flex-shrink: 0;
}

.exec-emp-count-box.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.exec-emp-count-box.leader-count {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.5);
}

.exec-count-num {
  font-size: 1.35rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #ffffff;
  line-height: 1;
}

.exec-count-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

.exec-emp-count-box.active .exec-count-num { color: #34d399; }
.exec-emp-count-box.leader-count .exec-count-num { color: #fde047; }

/* ==============================================================================
   RESPONSIVE DESIGN FOR SMARTPHONES & TABLETS (EJECUTIVOS & MÓVILES)
   ============================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
  }

  .app-header {
    height: auto !important;
    padding: 0.5rem 0.65rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .header-container {
    flex-direction: column !important;
    gap: 0.4rem !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .brand-section {
    justify-content: space-between !important;
    width: 100% !important;
  }

  .nav-tabs {
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding-bottom: 0.25rem !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .nav-tab {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
  }

  .header-actions {
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
  }

  .connection-status {
    font-size: 0.68rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .user-session-chip {
    padding: 0.2rem 0.5rem !important;
  }

  .user-session-name {
    font-size: 0.72rem !important;
    max-width: 110px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .user-session-role {
    font-size: 0.6rem !important;
    padding: 0.05rem 0.3rem !important;
  }

  .main-container {
    padding: 0.5rem 0.5rem 4rem 0.5rem !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .tab-content,
  #tab-scanner {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    display: none;
  }

  .tab-content.active,
  #tab-scanner.active {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* Vista Ejecutiva en Móvil */
  .executive-dashboard-view {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 0 3rem 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }

  .exec-hero-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 1.1rem 0.85rem 0.9rem !important;
    border-radius: var(--radius-lg) !important;
    text-align: center !important;
  }

  .exec-hero-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.35rem 0 0.65rem !important;
  }

  .exec-hero-number {
    font-size: clamp(3rem, 12vw, 4rem) !important;
    width: 100% !important;
    text-align: center !important;
  }

  .exec-hero-label {
    font-size: 0.78rem !important;
    letter-spacing: 0.08em !important;
    text-align: center !important;
    width: 100% !important;
  }

  .exec-quality-bar-wrap {
    padding: 0.5rem 0.75rem !important;
  }

  .exec-quality-labels {
    font-size: 0.72rem !important;
  }

  .exec-metrics-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .exec-mini-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem 0.6rem !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
  }

  .exec-mini-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
    flex-shrink: 0 !important;
  }

  .exec-mini-data {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .exec-mini-val {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .exec-mini-title {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .exec-section-card {
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-lg) !important;
  }

  .exec-section-header {
    padding: 0.7rem 0.85rem !important;
  }

  .exec-section-title {
    font-size: 0.85rem !important;
  }

  .exec-emp-list {
    padding: 0.4rem !important;
    gap: 0.35rem !important;
  }

  .exec-emp-item {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem 0.65rem !important;
    gap: 0.45rem !important;
  }

  .exec-emp-left {
    min-width: 0 !important;
    flex: 1 !important;
    gap: 0.5rem !important;
  }

  .exec-emp-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.8rem !important;
  }

  .exec-emp-details {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .exec-emp-name-line {
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .exec-emp-meta-line {
    font-size: 0.68rem !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }

  .exec-emp-count-box {
    min-width: 58px !important;
    padding: 0.25rem 0.45rem !important;
    flex-shrink: 0 !important;
  }

  .exec-count-num {
    font-size: 1.15rem !important;
  }

  .kpi-compact-strip {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    display: flex;
  }

  .kpi-chip {
    flex-shrink: 0;
    min-width: 130px;
  }

  .scanner-view-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .last-scan-hero-card {
    height: auto;
    min-height: 250px;
  }

  .side-card {
    height: 480px !important;
    max-height: 65vh !important;
  }

  .production-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .payroll-summary-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==============================================================================
   AUTHENTICATION & SECURITY MODAL (LOGIN & ROLES)
   ============================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95) 0%, rgba(11, 15, 25, 0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.3s ease;
}

.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 35px rgba(56, 189, 248, 0.15);
  animation: authScaleUp 0.3s ease-out;
}

@keyframes authScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 58px;
  height: 58px;
  font-size: 1.75rem;
  margin: 0 auto 0.75rem;
  box-shadow: var(--shadow-glow-cyan);
}

.auth-brand h2 {
  font-size: 1.75rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.auth-brand p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin: 0;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 2.75rem !important;
  width: 100%;
}

.btn-toggle-eye {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s;
}

.btn-toggle-eye:hover {
  color: #38bdf8;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-footer-hint {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* User Session Header Chip */
.user-session-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem 0.25rem 0.4rem;
  border-radius: var(--radius-full);
}

.user-session-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.user-session-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-session-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
}

.user-session-role {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-admin, .role-badge.role-admin {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.role-ejecutivo, .role-badge.role-ejecutivo {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.role-rrhh, .role-badge.role-rrhh {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.role-usuario, .role-badge.role-usuario {
  color: #cbd5e1;
  background: rgba(203, 213, 225, 0.15);
  border: 1px solid rgba(203, 213, 225, 0.3);
}

.role-operador, .role-badge.role-operador {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
}

.btn-logout:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* ==============================================================================
   PRINT STYLESHEET FOR PAYROLL SLIPS & BARCODE LABELS
   ============================================================================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  
  .app-header, .nav-tabs, .header-actions, .scanner-input-container,
  .section-actions-bar, .filter-bar, .modal-backdrop, .btn-print-single,
  .audio-controls, .connection-status, .toast-container, .btn-primary,
  .btn-secondary, .btn-success, .pwa-floating-install-container {
    display: none !important;
  }
  
  .main-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  .tab-content {
    display: none !important;
  }
  .tab-content.active {
    display: block !important;
  }

  .data-table {
    border-collapse: collapse !important;
    width: 100% !important;
    color: #000000 !important;
  }
  .data-table th, .data-table td {
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
    padding: 6px 8px !important;
  }
  .payroll-summary-banner {
    background: #f1f5f9 !important;
    border: 1px solid #94a3b8 !important;
    color: #000000 !important;
  }
  .payroll-banner-info h2, .payroll-banner-info p, .payroll-banner-total .amount {
    color: #000000 !important;
  }
}
  
/* ==============================================================================
   PWA FLOATING INSTALL BUTTON (DESKTOP & MOBILE)
   ============================================================================== */
.pwa-floating-install-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  animation: floatBounce 3s infinite ease-in-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.btn-pwa-floating {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem 0.5rem 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.3);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.btn-pwa-floating:hover {
  border-color: #38bdf8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.5);
  transform: scale(1.03);
}

.pwa-floating-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  flex-shrink: 0;
}

.pwa-floating-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.1;
}

.pwa-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.pwa-sub {
  font-size: 0.65rem;
  color: #38bdf8;
  font-weight: 700;
  text-transform: uppercase;
}

.pwa-icon-download {
  font-size: 0.9rem;
  color: #38bdf8;
  margin-left: 0.25rem;
  animation: pulseLight 2s infinite;
}

.btn-pwa-dismiss {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pwa-dismiss:hover {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

@media (max-width: 768px) {
  .pwa-floating-install-container {
    bottom: 1rem;
    right: 1rem;
  }
  .btn-pwa-floating {
    padding: 0.45rem 0.85rem 0.45rem 0.5rem;
  }
  .pwa-floating-logo {
    width: 28px;
    height: 28px;
  }
}

/* ==============================================================================
   BARRA HORIZONTAL COMPACTA DE ENVASES EN PRODUCCIÓN (PANTALLA PRINCIPAL)
   1 sola línea horizontal, ultra clara para el operador
   ============================================================================== */
.active-packing-strip {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.95rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.packing-strip-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.packing-strip-items {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.packing-strip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.packing-strip-badge.badge-primera {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.packing-strip-badge.badge-primera strong {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.packing-strip-badge.badge-segunda {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.packing-strip-badge.badge-segunda strong {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.btn-goto-config-packing {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-goto-config-packing:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: #38bdf8;
}

/* ==============================================================================
   CONFIGURACIÓN DE ENVASE DE JORNADA (PESTAÑA CONFIGURACIÓN - 1 LÍNEA HORIZONTAL)
   ============================================================================== */
.packing-config-horizontal-card {
  background: var(--bg-card);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.config-h-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.config-h-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.config-h-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
}

.config-h-select {
  width: auto !important;
  min-width: 175px;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  background: #0b0f19 !important;
  color: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.config-h-select:focus {
  outline: none;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
}

/* ==============================================================================
   CARTEL MODAL DE ALERTA: CORRELATIVO DUPLICADO (ALTO IMPACTO VISUAL)
   ============================================================================== */
.duplicate-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInModal 0.15s ease-out;
}

.duplicate-alert-dialog {
  background: #111827;
  border: 2px solid #ef4444;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.4), 0 20px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: popAlert 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popAlert {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.duplicate-alert-header {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.4));
  border-bottom: 1px solid rgba(239, 68, 68, 0.4);
  padding: 1.5rem 1.5rem 1.2rem;
  text-align: center;
}

.duplicate-alert-icon-wrap {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.25);
  border: 2px solid #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  color: #f87171;
  font-size: 2rem;
  animation: pulseIcon 1.2s infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.duplicate-alert-header h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 0.35rem;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.duplicate-alert-subtitle {
  font-size: 0.88rem;
  color: #fca5a5;
  margin: 0;
  line-height: 1.4;
}

.duplicate-alert-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.duplicate-correlativo-highlight {
  background: rgba(239, 68, 68, 0.12);
  border: 1px dashed rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: center;
}

.duplicate-correlativo-highlight .dup-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.duplicate-correlativo-highlight .dup-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.duplicate-details-grid {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.dup-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dup-detail-item:last-child {
  border-bottom: none;
}

.dup-detail-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.dup-detail-val {
  color: #ffffff;
  font-weight: 700;
  font-family: var(--font-mono);
}

.dup-detail-val.highlight {
  color: #38bdf8;
  font-family: inherit;
}

.duplicate-warning-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fee2e2;
  font-size: 0.85rem;
  line-height: 1.4;
}

.duplicate-warning-box i {
  font-size: 1.4rem;
  color: #ef4444;
  flex-shrink: 0;
}

.duplicate-alert-footer {
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
}

.btn-ack-duplicate {
  width: 100%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
}

.btn-ack-duplicate:hover,
.btn-ack-duplicate:focus {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  outline: none;
}

/* ==============================================================================
   BOTÓN Y MODAL DE ESCANEO POR CÁMARA (OPTIMIZADO PARA CELULAR)
   ============================================================================== */
.btn-camera-scan-compact {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-camera-scan-compact:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.camera-scanner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  animation: fadeIn 0.15s ease-out;
}

.camera-scanner-dialog {
  background: var(--bg-card);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.camera-scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid var(--border-color);
}

.camera-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
}

.camera-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-camera-ctrl {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-camera-ctrl:hover {
  color: #38bdf8;
  border-color: #38bdf8;
}

.btn-camera-close {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-camera-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.camera-scanner-body {
  position: relative;
  width: 100%;
  height: 320px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.camera-video-viewport {
  width: 100% !important;
  height: 100% !important;
}

.camera-video-viewport video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.camera-targeting-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 55%;
  pointer-events: none;
  box-sizing: border-box;
}

.laser-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #38bdf8, #34d399, transparent);
  box-shadow: 0 0 12px #38bdf8, 0 0 4px #34d399;
  animation: laserScanAnim 2s infinite ease-in-out;
}

@keyframes laserScanAnim {
  0% { top: 5%; opacity: 0.9; }
  50% { top: 92%; opacity: 1; }
  100% { top: 5%; opacity: 0.9; }
}

.corner-bracket {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #38bdf8;
  border-style: solid;
}

.corner-bracket.top-left { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 4px; }
.corner-bracket.top-right { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 4px; }
.corner-bracket.bottom-left { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 4px; }
.corner-bracket.bottom-right { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 4px; }

.camera-scan-feedback {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 150, 105, 0.96);
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: 14px;
  border: 1.5px solid rgba(52, 211, 153, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.25;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  animation: popIn 0.2s ease-out;
  max-width: 92%;
  text-align: left;
  z-index: 10;
}

.camera-scan-feedback.is-processing {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(56, 189, 248, 0.75);
}

.camera-scan-feedback.is-error {
  background: rgba(185, 28, 28, 0.96);
  border-color: rgba(248, 113, 113, 0.85);
}

.camera-scanner-footer {
  padding: 0.75rem 1rem;
  background: rgba(30, 41, 59, 0.95);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.camera-tip {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.camera-footer-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.camera-continuous-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.camera-continuous-toggle input[type="checkbox"] {
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
}

/* ==============================================================================
   SECCIÓN TABLERO / DASHBOARD DE ESTADÍSTICAS Y PICKING (DISEÑO MODERNO)
   ============================================================================== */
#tab-dashboard {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0 2.5rem 0;
}

.dash-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.dash-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-title-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md, 8px);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
}

.dash-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.02em;
}

.dash-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 0.2rem;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Tarjeta de Filtros */
.dash-filters-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3));
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.dash-filters-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.dash-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-filters-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.dash-filters-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.dash-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  align-items: flex-end;
  width: 100%;
}

.dash-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.dash-filter-search {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .dash-filter-search {
    grid-column: span 1;
  }
}

.dash-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.dash-input {
  width: 100% !important;
  max-width: 100% !important;
  height: 38px !important;
  box-sizing: border-box !important;
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  padding: 0.45rem 0.75rem !important;
  transition: all 0.2s ease;
  display: block !important;
}

.dash-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2) !important;
  outline: none;
}

select.dash-input {
  cursor: pointer;
}

.dash-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid de KPIs */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
  width: 100%;
}

.dash-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: dashCardPop 0.4s ease backwards;
}

@keyframes dashCardPop {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.dash-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.4);
}

.dash-kpi-card.blue:hover { border-color: rgba(59, 130, 246, 0.5); box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15); }
.dash-kpi-card.cyan:hover { border-color: rgba(56, 189, 248, 0.5); box-shadow: 0 10px 25px rgba(56, 189, 248, 0.15); }
.dash-kpi-card.green:hover { border-color: rgba(52, 211, 153, 0.5); box-shadow: 0 10px 25px rgba(52, 211, 153, 0.15); }
.dash-kpi-card.amber:hover { border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15); }
.dash-kpi-card.purple:hover { border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 10px 25px rgba(168, 85, 247, 0.15); }
.dash-kpi-card.gold:hover { border-color: rgba(250, 204, 21, 0.6); box-shadow: 0 10px 25px rgba(250, 204, 21, 0.2); }

.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.dash-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.dash-kpi-card.blue .dash-kpi-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.dash-kpi-card.cyan .dash-kpi-icon { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.dash-kpi-card.green .dash-kpi-icon { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.dash-kpi-card.amber .dash-kpi-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.dash-kpi-card.purple .dash-kpi-icon { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.dash-kpi-card.gold .dash-kpi-icon { background: rgba(250, 204, 21, 0.2); color: #facc15; }

.dash-kpi-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.dash-kpi-value {
  font-size: 2.1rem;
  font-weight: 900;
  color: #ffffff;
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.dash-kpi-leader {
  font-size: 1.25rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #facc15;
}

.dash-kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dash-pill-pct {
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.dash-pill-pct.cyan { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.dash-pill-pct.green { background: rgba(52, 211, 153, 0.2); color: #34d399; }

/* Grid de Análisis */
.dash-analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .dash-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.dash-card:hover {
  border-color: rgba(56, 189, 248, 0.25);
}

.dash-card-header {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.dash-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.dash-card-body {
  padding: 1.25rem;
}

/* Matriz Calidad × Envase */
.dash-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.dash-matrix-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dash-matrix-item:hover {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-2px);
}

.dash-matrix-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.dash-matrix-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.dash-matrix-tag.primera { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.dash-matrix-tag.segunda { background: rgba(52, 211, 153, 0.15); color: #34d399; }

.dash-matrix-count {
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #ffffff;
}

.dash-matrix-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.dash-matrix-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.dash-matrix-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-matrix-bar-fill.primera { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.dash-matrix-bar-fill.segunda { background: linear-gradient(90deg, #059669, #34d399); }

/* Lista de Turnos */
.dash-shift-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dash-shift-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.dash-shift-item:hover {
  border-color: rgba(52, 211, 153, 0.4);
}

.dash-shift-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-shift-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.dash-shift-icon.manana { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.dash-shift-icon.tarde { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.dash-shift-icon.noche { background: rgba(99, 102, 241, 0.15); color: #818cf8; }

.dash-shift-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
}

.dash-shift-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dash-shift-right {
  text-align: right;
}

.dash-shift-val {
  font-size: 1.25rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #ffffff;
}

.dash-shift-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
}

/* Gráfico de Picking Horario */
.dash-hourly-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 180px;
  padding-top: 1.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.dash-hourly-col {
  flex: 1;
  min-width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  justify-content: flex-end;
}

.dash-hourly-bar-container {
  width: 100%;
  max-width: 38px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.dash-hourly-bar {
  width: 100%;
  background: linear-gradient(180deg, #38bdf8 0%, rgba(56, 189, 248, 0.3) 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
  min-height: 4px;
  cursor: pointer;
  position: relative;
}

.dash-hourly-bar:hover {
  background: linear-gradient(180deg, #7dd3fc 0%, #0284c7 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.dash-hourly-tooltip {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  border: 1px solid #38bdf8;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.dash-hourly-bar:hover .dash-hourly-tooltip {
  opacity: 1;
}

.dash-hourly-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Tabla de Ranking */
.dash-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 900;
}

.dash-rank-badge.top-1 { background: rgba(250, 204, 21, 0.2); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.4); }
.dash-rank-badge.top-2 { background: rgba(226, 232, 240, 0.2); color: #e2e8f0; border: 1px solid rgba(226, 232, 240, 0.4); }
.dash-rank-badge.top-3 { background: rgba(217, 119, 6, 0.2); color: #f59e0b; border: 1px solid rgba(217, 119, 6, 0.4); }
.dash-rank-badge.standard { color: var(--text-secondary); font-size: 0.8rem; font-weight: 800; }

.dash-plant-share-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.dash-plant-share-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.dash-envase-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  margin: 0.1rem 0.15rem;
  white-space: nowrap;
}

/* ==============================================================================
   CAJAS DE SEGUNDA EVENTUALES (NO REMUNERADAS)
   ============================================================================== */
.eventual-banner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.eventual-badge-calibre {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.78rem;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

@media (max-width: 640px) {
  .btn-eventual-scan-compact .btn-eventual-text {
    display: none;
  }
}

/* ==============================================================================
   DETECTOR DE HUECOS / SALTOS EN LA SECUENCIA (MODAL & CHIPS)
   ============================================================================== */
.seq-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.seq-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.seq-chip-scanned {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.seq-chip-missing {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px dashed rgba(239, 68, 68, 0.6);
  font-weight: 800;
}
.seq-chip-duplicate {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.6);
}

/* ==============================================================================
   CENTRO DE GESTIÓN Y ADMINISTRACIÓN DE HUECOS / SECUENCIA (MODAL EXPANDIDO)
   ============================================================================== */
.modal-card-seq-manager {
  max-width: 1100px !important;
  width: 96% !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
}

.seq-filter-grid {
  display: grid;
  grid-template-columns: 180px 140px 140px 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  align-items: flex-end;
}

.seq-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.seq-kpi-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.seq-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.seq-kpi-data {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.seq-kpi-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seq-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  line-height: 1.2;
}

.seq-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-seq-tab {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-seq-tab:hover {
  color: var(--text-primary);
  border-color: #38bdf8;
}

.btn-seq-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.seq-badge-missing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  font-size: 0.92rem;
}

.btn-seq-register {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-seq-register:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.btn-seq-view {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-seq-view:hover {
  background: #0284c7;
  color: #ffffff;
}

@media (max-width: 900px) {
  .seq-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .seq-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   CARTEL MODAL CENTRALIZADO DE CARGA DE DATOS (DASHBOARD)
   ============================================================================== */
.dash-loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.dash-loading-modal {
  background: linear-gradient(145deg, #091e3a 0%, #0f2d54 50%, #07172c 100%);
  border: 2.5px solid #00d2ff;
  border-radius: 24px;
  padding: 2.5rem 2.75rem;
  max-width: 490px;
  width: 92%;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 210, 255, 0.55), 0 25px 60px rgba(0, 0, 0, 0.9);
  animation: dashLoadingPulse 2.2s infinite ease-in-out;
  box-sizing: border-box;
}

@keyframes dashLoadingPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.5), 0 25px 60px rgba(0, 0, 0, 0.9);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 0 75px rgba(0, 210, 255, 0.75), 0 30px 70px rgba(0, 0, 0, 0.95);
  }
}

.dash-loading-icon-wrap {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-loading-gear-main {
  font-size: 4rem;
  color: #00d2ff;
  --fa-animation-duration: 3s;
  filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.9));
}

.dash-loading-gear-sub {
  font-size: 1.85rem;
  color: #f59e0b;
  position: absolute;
  --fa-animation-duration: 1.3s;
  --fa-animation-direction: reverse;
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.9));
}

.dash-loading-title {
  font-weight: 900;
  font-size: 1.4rem;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin-bottom: 0.65rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.dash-loading-subtitle {
  font-size: 0.95rem;
  color: #bae6fd;
  line-height: 1.5;
  font-weight: 500;
}

.dash-loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(0, 210, 255, 0.16);
  border: 1.5px solid #00d2ff;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 1.35rem;
  border-radius: 30px;
  margin-top: 1.25rem;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.3);
}






