/* ==============================================================================
   VETE - SISTEMA DE CONTROL DE EMPAQUE DE AJO 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;
  flex: 1;
  min-height: 0;
}

.tab-content.active {
  display: flex;
  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;
}

@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-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: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

/* 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);
}

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

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

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

/* 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: 0;
  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;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.live-scans-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 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;
}

.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;
}

.barcode-badge-card {
  background-color: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 2px dashed #94a3b8;
  position: relative;
}

.barcode-badge-card .company-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.barcode-badge-card .emp-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.barcode-badge-card svg.barcode-canvas {
  width: 100%;
  max-height: 80px;
}

.barcode-badge-card .actions-row {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.btn-print-single {
  flex: 1;
  background-color: #0f172a;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==============================================================================
   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;
}

/* 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: 400px;
  }

  .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);
}

.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 {
    display: none !important;
  }
  
  .main-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  .tab-content {
    display: block !important;
  }
  
  .barcode-card-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
  }
  
  .barcode-badge-card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  
/* ==============================================================================
   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;
  }
}
