/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
}

body {
  background-color: #f9fafb;
  color: #111827;
  line-height: 1.6;
}

/* Layout principal */
.page-container {
  display: flex;
  min-height: 100vh;
}

main {
  flex: 1;
  padding: 2rem;
}

/* --- NAV --- */
nav {
  background-color: #1e3a8a;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #93c5fd;
}

/* --- Títulos --- */
h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #1d4ed8;
}

h2 {
  margin: 2rem 0 1rem;
  font-size: 1.25rem;
  color: #1e3a8a;
}

/* --- Secciones del formulario --- */
section.section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Grid de inputs */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.field-row {
  display: flex;
  flex-direction: column;
  overflow: auto;
  max-height: 126px;
}

label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #1e3a8a;
}

/* Inputs y selects */
input,
select,
textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Radios y checks */
.radios.inline {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.radios label {
  font-weight: normal;
}

/* Botones */
button {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button.primary {
  background-color: #3b82f6;
  color: white;
}

button.primary:hover {
  background-color: #1d4ed8;
}

button.secundary {
  background-color: #e0f2fe;
  color: #1d4ed8;
}

button.secundary:hover {
  background-color: #bfdbfe;
}

button.danger {
  background-color: #f87171;
  color: white;
}

button.danger:hover {
  background-color: #ef4444;
}

button.ghost {
  background-color: transparent;
  color: #1e3a8a;
  border: 1px solid #1e3a8a;
}

button.ghost:hover {
  background-color: #1e3a8a;
  color: white;
}

/* Errores y notas */
.error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.note {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background-color: #1e3a8a;
  color: white;
  transition: left 0.3s ease;
  padding: 20px;
  padding-top: 70px;
  overflow-y: auto;
  z-index: 999;
}

/* Sidebar visible */
.sidebar.active {
  left: 0;
}

/* Estilos lista */
.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 10px;
}

.sidebar strong {
  font-size: 16px;
}

.sidebar small {
  display: block;
  font-size: 13px;
  color: #ddd;
}

/* Botón flotante */
.menu-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: black;
}

.recepcion-side-info--pedido {
  position: relative
}

.extras-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;

  & #extraSelect {
    grid-column: 1 / 3;
  }
}

& #mainContent {
  display: grid;
  grid-template-columns: 81% 1fr;

  & .recepcion-header {
    grid-column: 1 / 3;
  }
}

.actions {
  width: 100%;
  grid-column: 1 / 5;
  /* justify-self: end; */
  /* align-self: end; */
  display: flex;
  justify-content: end;
}

/* Contenedor lateral */
.container-detalle-pedido {
  position: fixed;
  top: 90px;
  right: 0;
  background: #f9fafb;
  border-left: 3px solid #1d4ed8;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  overflow-y: auto;
  z-index: 1000;
}

.container-detalle-pedido h3 {
  color: #1e3a8a;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 0.5rem;
}

/* Lista de detalles */
.detalle-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 250px;
}

/* Tarjetas */
.detalle-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.detalle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Cabecera */
.detalle-header {
  background: #3b82f6;
  color: #fff;
  font-weight: bold;
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.8rem;
  text-align: center;
}

/* Cuerpo */
.detalle-body p {
  margin: 0.3rem 0;
  font-size: 0.95rem;
  color: #111827;
}

.detalle-body b {
  color: #1e3a8a;
}

.data-display {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.data-display strong {
  color: #1e3a8a;
  font-size: 1.1rem;
}

.data-display small {
  color: #6c757d;
  font-size: 0.9rem;
}

.empleado-seleccionado {
  margin-top: 0.5rem;
}

.empleado-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #e3f2fd;
  border: 2px solid #2196f3;
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.empleado-card.oculto {
  display: none;
}

.empleado-avatar {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empleado-info {
  flex: 1;
}

.empleado-nombre {
  font-size: 1.2rem;
  font-weight: bold;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.empleado-cargo {
  color: #6c757d;
  font-size: 0.9rem;
}

.costos-resumen {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.costo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

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

.costo-item.total {
  font-weight: bold;
  font-size: 1.1rem;
  color: #1e3a8a;
  border-top: 2px solid #1e3a8a;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

#resumenProcesamiento {
  background: #e8f5e8;
  border: 1px solid #4caf50;
  color: #2e7d32;
}

/* -------------------
   ESTILOS PARA PROCESAMIENTO CON CAMPOS GRANDES
------------------- */
.cliente-grupo {
  background: #f5f5f5;
  border: 2px solid #d1d5db;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cliente-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #e5e7eb;
  border-radius: 12px;
  border: 1px solid #9ca3af;
}

.cliente-header h2 {
  color: #1e3a8a;
  font-size: 1.4rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pedidos-count {
  background: #3b82f6;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
}

.pedido-card-large {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.pedido-card-large:last-child {
  margin-bottom: 0;
}

.pedido-card-large h3 {
  color: #1e3a8a;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 1px solid #3b82f6;
  padding-bottom: 0.5rem;
}

.pedido-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.pedido-zona {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.2rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.pedido-zona h4 {
  color: #1e3a8a;
  font-size: 1rem;
  margin-bottom: 0.8rem;
  text-align: center;
  padding: 0.4rem;
  background: #e3f2fd;
  border-radius: 6px;
  border: 1px solid #2196f3;
}

.zona-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cliente-info {
  text-align: center;
}

.cliente-info strong {
  display: block;
  font-size: 1.1rem;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
}

.cliente-info p {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.materiales-info {
  text-align: center;
}

.materiales-info strong {
  display: block;
  font-size: 1rem;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
}

.materiales-info p {
  color: #6b7280;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  font-style: italic;
}

.extras-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.extra-tag {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.2rem 0.6rem;
  border-radius: 15px;
  font-size: 0.7rem;
  border: 1px solid #3b82f6;
}

.empleado-select {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  margin-bottom: 0.8rem;
  transition: border-color 0.3s;
}

.empleado-select:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.empleado-card-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #e8f5e8;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 0.6rem;
  transition: all 0.3s ease;
}

.empleado-card-mini.oculto {
  display: none;
}

.empleado-avatar-mini {
  font-size: 1.5rem;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empleado-info-mini {
  flex: 1;
}

.empleado-nombre-mini {
  font-size: 0.9rem;
  font-weight: bold;
  color: #1e3a8a;
  margin-bottom: 0.1rem;
}

.empleado-cargo-mini {
  color: #6c757d;
  font-size: 0.7rem;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .pedido-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .pedido-zona {
    min-height: auto;
  }
  
  .pedido-card-large {
    padding: 1rem;
  }
  
  .cliente-grupo {
    padding: 1rem;
  }
  
  .cliente-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Estados de validación */
.empleado-select.error-border {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

#resumenProcesamiento {
  background: #f1f5f9;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 500;
}

#resumenProcesamiento.procesando {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

#resumenProcesamiento.completado {
  background: #d4edda;
  border: 1px solid #28a745;
  color: #155724;
}

/* -------------------
   ESTILOS PARA PANTALLA COMPLETA
------------------- */
.page-container-full {
  min-height: 100vh;
  background: #f5f7fa;
}

.main-full {
  width: 100%;
  min-height: 100vh;
}

.container-full {
  max-width: 100%;
  margin: 0;
  background: #fff;
  padding: 1rem;
  min-height: 100vh;
}

.container-full h1 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
  text-align: center;
  color: #1e3a8a;
}

.container-full .lead {
  text-align: center;
  color: #555;
  margin-bottom: 1rem;
}

/* -------------------
   LAYOUT DE DOS COLUMNAS
------------------- */
.pedidos-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.columna-izquierda,
.columna-derecha {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* -------------------
   ESTILOS PARA PROCESAMIENTO CON CAMPOS GRANDES
------------------- */
.cliente-grupo {
  background: #f5f5f5;
  border: 2px solid #d1d5db;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cliente-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #e5e7eb;
  border-radius: 12px;
  border: 1px solid #9ca3af;
}

.cliente-header h2 {
  color: #1e3a8a;
  font-size: 1.4rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pedidos-count {
  background: #3b82f6;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
}

.pedido-card-large {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.pedido-card-large:last-child {
  margin-bottom: 0;
}

.pedido-card-large h3 {
  color: #1e3a8a;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 1px solid #3b82f6;
  padding-bottom: 0.5rem;
}

.pedido-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.pedido-zona {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.2rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.pedido-zona h4 {
  color: #1e3a8a;
  font-size: 1rem;
  margin-bottom: 0.8rem;
  text-align: center;
  padding: 0.4rem;
  background: #e3f2fd;
  border-radius: 6px;
  border: 1px solid #2196f3;
}

.zona-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cliente-info {
  text-align: center;
}

.cliente-info strong {
  display: block;
  font-size: 1.1rem;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
}

.cliente-info p {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.materiales-info {
  text-align: center;
}

.materiales-info strong {
  display: block;
  font-size: 1rem;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
}

.materiales-info p {
  color: #6b7280;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  font-style: italic;
}

.extras-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.extra-tag {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.2rem 0.6rem;
  border-radius: 15px;
  font-size: 0.7rem;
  border: 1px solid #3b82f6;
}

/* -------------------
   SELECT MÚLTIPLE DE EMPLEADOS
------------------- */
.empleado-select {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  margin-bottom: 0.8rem;
  transition: border-color 0.3s;
  min-height: 120px;
}

.empleado-select:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.empleado-seleccionado {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empleado-card-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #e8f5e8;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 0.6rem;
  transition: all 0.3s ease;
}

.empleado-card-mini.oculto {
  display: none;
}

.empleado-avatar-mini {
  font-size: 1.5rem;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empleado-info-mini {
  flex: 1;
}

.empleado-nombre-mini {
  font-size: 0.9rem;
  font-weight: bold;
  color: #1e3a8a;
  margin-bottom: 0.1rem;
}

.empleado-cargo-mini {
  color: #6c757d;
  font-size: 0.7rem;
}

/* -------------------
   SECCIÓN DE ACCIONES
------------------- */
.acciones-full {
  margin-top: 2rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .pedidos-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .pedido-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .pedido-zona {
    min-height: auto;
  }
  
  .pedido-card-large {
    padding: 1rem;
  }
  
  .cliente-grupo {
    padding: 1rem;
  }
  
  .cliente-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Estados de validación */
.empleado-select.error-border {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

#resumenProcesamiento {
  background: #f1f5f9;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 500;
}

#resumenProcesamiento.procesando {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

#resumenProcesamiento.completado {
  background: #d4edda;
  border: 1px solid #28a745;
  color: #155724;
}

/* -------------------
   ESTILOS PARA SELECCIÓN MÚLTIPLE MEJORADA
------------------- */
.empleado-select {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  margin-bottom: 0.8rem;
  transition: border-color 0.3s;
  min-height: 120px;
}

.empleado-select:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.empleado-select option {
  padding: 0.5rem;
  font-size: 0.9rem;
}

.empleado-seleccionado {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.mensaje-seleccion {
  font-size: 0.8rem;
  color: #1e3a8a;
  font-weight: bold;
  margin-bottom: 0.5rem;
  padding: 0.3rem;
  background: #e3f2fd;
  border-radius: 4px;
  border: 1px solid #2196f3;
}

.mensaje-vacio {
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
  text-align: center;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 4px;
  border: 1px dashed #d1d5db;
}

.empleado-card-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #e8f5e8;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 0.6rem;
  transition: all 0.3s ease;
  position: relative;
}

.empleado-card-mini:hover {
  background: #d4edda;
  border-color: #28a745;
}

.btn-remover {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dc3545;
  color: white;
  border: none;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-remover:hover {
  background: #c82333;
  transform: scale(1.1);
}

.empleado-avatar-mini {
  font-size: 1.5rem;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empleado-info-mini {
  flex: 1;
}

.empleado-nombre-mini {
  font-size: 0.9rem;
  font-weight: bold;
  color: #1e3a8a;
  margin-bottom: 0.1rem;
}

.empleado-cargo-mini {
  color: #6c757d;
  font-size: 0.7rem;
}

/* Instrucciones para el usuario */
.instrucciones-seleccion {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.3rem;
  padding: 0.3rem;
  background: #f3f4f6;
  border-radius: 4px;
  border-left: 3px solid #3b82f6;
}

/* Estados de validación */
.empleado-select.error-border {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.empleado-select:valid {
  border-color: #10b981;
}

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

.empleado-card-mini {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .empleado-select {
    min-height: 100px;
    font-size: 0.8rem;
  }
  
  .empleado-card-mini {
    padding: 0.5rem;
  }
  
  .empleado-avatar-mini {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
  
  .btn-remover {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

/* -------------------
   ESTILOS PARA CONFIGURACIÓN DE HORARIOS
------------------- */
.empleado-horario {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.empleado-horario:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.empleado-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.empleado-header h3 {
  color: #1e3a8a;
  font-size: 1.1rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-toggle {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-toggle:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-toggle.active {
  background: #10b981;
}

.empleado-config {
  animation: slideDown 0.3s ease-out;
}

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

.horario-dia {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.horario-dia input[type="time"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.9rem;
  width: 100px;
}

.horario-dia input[type="time"]:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.horario-dia span {
  color: #6b7280;
  font-weight: 500;
}

.horario-dia label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #6b7280;
  cursor: pointer;
  margin-left: 0.5rem;
}

.horario-dia input[type="checkbox"] {
  margin: 0;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.checkbox-group label:hover {
  background: #f3f4f6;
}

.checkbox-group input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
}

.note {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.3rem;
  font-style: italic;
}

/* Responsive para móviles - horarios */
@media (max-width: 768px) {
  .empleado-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .horario-dia {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  
  .horario-dia input[type="time"] {
    width: 100%;
  }
  
  .checkbox-group {
    grid-template-columns: 1fr;
  }
}

/* Estados de validación para horarios */
.horario-dia input[type="time"].error-border {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

#resumenHorarios {
  background: #f1f5f9;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 500;
}

#resumenHorarios.procesando {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

#resumenHorarios.completado {
  background: #d4edda;
  border: 1px solid #28a745;
  color: #155724;
}

/* -------------------
   ESTILOS PARA HISTORIAL DE EMPLEADOS
------------------- */
.resumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.resumen-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.resumen-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.resumen-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e3f2fd;
  border-radius: 50%;
  border: 2px solid #2196f3;
}

.resumen-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

.resumen-content p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e3a8a;
}

.historial-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.pagination-info {
  color: #6b7280;
  font-size: 0.9rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-pagination {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-pagination:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-pagination:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

.historial-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accion-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.accion-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.accion-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.accion-empleado {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.empleado-avatar {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 50%;
  border: 2px solid #d1d5db;
}

.empleado-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: #1e3a8a;
}

.empleado-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.accion-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.accion-fecha {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

.accion-hora {
  font-size: 0.8rem;
  color: #9ca3af;
}

.accion-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accion-tipo {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tipo-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tipo-procesamiento {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #3b82f6;
}

.tipo-entrega {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #22c55e;
}

.tipo-configuracion {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.tipo-login {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #6366f1;
}

.tipo-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.estado-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.estado-exitoso {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #22c55e;
}

.estado-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.estado-pendiente {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.accion-descripcion h5 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #374151;
  font-weight: 600;
}

.accion-descripcion p {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
}

.accion-detalles {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
}

.accion-detalles h5 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #374151;
  font-weight: 600;
}

.detalle-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.detalle-item strong {
  color: #374151;
  font-weight: 600;
  min-width: 120px;
}

.detalle-item span {
  color: #6b7280;
  text-align: right;
  flex: 1;
}

.accion-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-detalles, .btn-exportar {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-detalles:hover, .btn-exportar:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.estadisticas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.estadistica-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.estadistica-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.estadistica-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.estadistica-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.estadistica-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.estadistica-item .label {
  color: #6b7280;
  font-weight: 500;
}

.estadistica-item .value {
  color: #1e3a8a;
  font-weight: bold;
}

/* Responsive para móviles - historial */
@media (max-width: 768px) {
  .resumen-grid {
    grid-template-columns: 1fr;
  }
  
  .historial-controls {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .accion-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .accion-meta {
    align-items: flex-start;
  }
  
  .accion-actions {
    justify-content: center;
  }
  
  .estadisticas-grid {
    grid-template-columns: 1fr;
  }
  
  .detalle-item {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .detalle-item strong {
    min-width: auto;
  }
  
  .detalle-item span {
    text-align: left;
  }
}

/* -------------------
   ESTILOS PARA RECARGA AUTOMÁTICA
------------------- */
.autoreload-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.autoreload-toggle {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.autoreload-toggle:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.autoreload-toggle.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.autoreload-toggle.active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.autoreload-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.autoreload-toggle.active .autoreload-icon {
  animation: spin 1s linear infinite;
}

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

.autoreload-status {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.autoreload-status.show {
  opacity: 1;
}

.autoreload-timer {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.autoreload-timer.show {
  opacity: 1;
}

.autoreload-timer.warning {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.autoreload-timer.danger {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

/* Responsive para móviles - autoreload */
@media (max-width: 768px) {
  .autoreload-container {
    top: 10px;
    right: 10px;
  }
  
  .autoreload-toggle {
    width: 45px;
    height: 45px;
  }
  
  .autoreload-icon {
    font-size: 1rem;
  }
}

/* -------------------
   ESTILOS PARA GESTIÓN DE EMPLEADOS
------------------- */
.iconos-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.empleado-selector {
  margin-bottom: 1.5rem;
}

.empleado-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.empleado-selector select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
}

.icono-preview {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.preview-header h3 {
  margin: 0 0 1rem 0;
  color: #1e3a8a;
  font-size: 1.1rem;
}

.preview-empleado {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-avatar {
  font-size: 3rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 50%;
  border: 3px solid #d1d5db;
}

.preview-info h4 {
  margin: 0 0 0.5rem 0;
  color: #1e3a8a;
  font-size: 1.2rem;
}

.preview-info p {
  margin: 0;
  color: #6b7280;
  font-size: 1rem;
}

.iconos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.icono-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #f8f9fa;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.5rem;
}

.icono-item:hover {
  border-color: #3b82f6;
  background: #e3f2fd;
  transform: scale(1.05);
}

.icono-item.selected {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.icono-display {
  font-size: 1.5rem;
}

.icono-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.empleados-filtros {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.filtro-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filtro-item {
  display: flex;
  flex-direction: column;
}

.filtro-item label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.filtro-item select,
.filtro-item input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.empleados-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empleado-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.empleado-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.empleado-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.empleado-avatar {
  font-size: 2.5rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 50%;
  border: 3px solid #d1d5db;
}

.empleado-info {
  flex: 1;
}

.empleado-info h3 {
  margin: 0 0 0.5rem 0;
  color: #1e3a8a;
  font-size: 1.2rem;
}

.empleado-info p {
  margin: 0 0 0.5rem 0;
  color: #6b7280;
  font-size: 1rem;
}

.departamento-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1e40af;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.empleado-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit, .btn-delete {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-edit:hover {
  background: #e3f2fd;
  border-color: #3b82f6;
  color: #1e40af;
}

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

.empleado-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.detail-item strong {
  color: #374151;
  font-weight: 600;
  min-width: 80px;
}

.estado-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.estado-activo {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #22c55e;
}

.estado-inactivo {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.estado-vacaciones {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.estado-licencia {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #6366f1;
}

.estadisticas-empleados {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.stat-card h3 {
  margin: 0 0 0.5rem 0;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card p {
  margin: 0;
  color: #1e3a8a;
  font-size: 2rem;
  font-weight: bold;
}

/* Responsive para móviles - empleados */
@media (max-width: 768px) {
  .iconos-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
  }
  
  .icono-item {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .filtro-row {
    grid-template-columns: 1fr;
  }
  
  .empleado-header {
    flex-direction: column;
    text-align: center;
  }
  
  .empleado-actions {
    justify-content: center;
  }
  
  .empleado-details {
    grid-template-columns: 1fr;
  }
  
  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .detail-item strong {
    min-width: auto;
  }
  
  .estadisticas-empleados {
    grid-template-columns: repeat(2, 1fr);
  }
}
