/* =====================
   ESTILOS GENERALES
===================== */
body {
    font-family: 'Arial', sans-serif;
    margin: 0 auto;
    max-width: 700px;
    line-height: 1.4;
    background-color: #fafafa; /* Blanco cerámica */
}

/* Para que el contenido no quede oculto tras el header fijo */
#mainContent {
    margin-top: 70px; /* Ajusta según la altura del header */
}

h1 {
    text-align: center;
    margin-bottom: 1rem;
}

/* =====================
   HEADER FIJO
===================== */
#topHeader {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    padding: 0 20px;

    display: flex;
    align-items: center;         /* Centra verticalmente */
    justify-content: space-between; /* Input queda a la izq */
    gap: 16px;
    background-color: #fafafa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* 🔍 Estilo moderno y sobrio para el contenedor */
#searchWrapper {
  position: relative;
  display: inline-block;
  margin-top: 0px;
  margin-right: 20px;
}
/* 🔎 Input cuadrado, con borde morado elegante */
#searchInput {
  width: 220px;
  padding: 8px 12px 8px 15px; /* espacio para el ícono */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f8f8f8;
  color: #333;
  transition: all 0.3s ease;
}

/* ✨ Hover y Focus con efecto morado */
#searchInput:hover,
#searchInput:focus {
  border-color: #8a2be2;
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
  background-color: #fff;
  outline: none;
}

/* 🎯 Ícono morado dentro del input */
#searchWrapper::before {
  content: "\f002";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a2be2;
  font-size: 14px;
  pointer-events: none;
}
/* Botón de LOGOUT (arriba a la derecha) */
#logoutBtn {
    display: none;       
    position: static;  
    top: 10px;
    right: 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}
#logoutBtn:hover {
    background-color: #c82333;
}

/* =====================
   LISTA DE SUGERENCIAS
===================== */
#suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  font-size: 13px;
}

#suggestions li {
  padding: 10px 12px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

#suggestions li:last-child {
  border-bottom: none;
}

#suggestions li:hover {
  background-color: #f3f3ff;
  color: #4b00b5; /* Un morado profesional al hacer hover */
}
/* =====================
   LOADER
===================== */
#loader {
    display: none;
    text-align: center;
    margin-top: 100px; /* Ajusta si deseas */
}
#loader img {
    display: block;
    margin: 0 auto;
}
#loader p {
    color: #555;
    margin-top: 10px;
}

/* =====================
   CUANDO body TIENE .inicializando
===================== */
/* 1) Muestra el loader */
body.inicializando #loader {
    display: block !important;
}

/* 2) Oculta SOLO lo que no quieres ver mientras carga.
   IMPORTANTE: NO ocultamos #topHeader ni #logoutBtn,
   para que siempre puedas dar logout. */
body.inicializando #filterContainer,
body.inicializando #pagination,
body.inicializando #employeeDetail,
body.inicializando #employeesGrid,
body.inicializando #contadorEmpleados,
body.inicializando #resultsInfo {
    display: none !important;
}

/* =====================
   CAJA DE DETALLE
===================== */
#employeeDetail {
    min-height: 715px;
    margin-top: 1rem;
    padding: 25px 30px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}
#employeeDetail h2 {
    margin-top: 0;
}
.label {
    font-weight: bold;
    color: #555;
}

/* =====================
   LOGO DE LA EMPRESA
===================== */
.logo-empresa {
    display: block;
    width: 150px;    /* Fuerza a que todos midan 150px de ancho */
    height: 100px;   /* Fuerza a que todos midan 150px de alto */
    object-fit: contain;  /* Mantiene la proporción original dentro del cuadro */
    margin: 0 auto 1rem;
}
/* =====================
   SILUETA (según género)
===================== */
.silueta {
    top: 15px; 
    right: 15px;
    width: 150px;
    height: 150px;
    object-fit: contain;
}
/* =====================
   GRID DE EMPLEADOS
===================== */
#employeesGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.employeeCard {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.employeeCard:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}
.employeeCard img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: contain;
    margin-bottom: 0.5rem;
}
.employeeCard h3 {
    font-size: 16px;
    margin: 10px 0 5px;
}
.employeeCard p {
    font-size: 14px;
    margin: 5px 0;
}

/* =====================
   PAGINACIÓN
===================== */
#pagination {
    display: flex;
    justify-content: center;
    text-align: center;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
    width: 100%;
}
.pageButton {
    padding: 10px 18px;
    margin: 5px;
    background: linear-gradient(to right, #007bff, #0056b3);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background 0.3s ease;
}
.pageButton:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(to right, #0056b3, #003d80);
}
.pageButton:disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #666;
    box-shadow: none;
}

/* =====================
   TABLA DE DETALLE
===================== */
table {
    width: 100%;
    border-collapse: collapse;
}
td {
    padding: 2px 6px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
}
td span {
    display: inline-block;
    min-width: 60px;
    font-size: 12px;
    text-transform: capitalize;
    color: #666;
}

/* =====================
   TOASTS
===================== */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}
.toast {
    background-color: #333;
    color: #fff;
    padding: 10px 18px;
    margin-top: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.4s forwards, fadeOut 0.4s 2.5s forwards;
}
.toast.success { background-color: #28a745; }
.toast.error   { background-color: #dc3545; }
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* =====================
   CONTENEDOR GRID
===================== */
.gridContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
/* =====================
   FILTROS
===================== */
#filterContainer {
  text-align: center;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* Estilo base de los select */
#filterContainer select {
  padding: 4px 10px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  transition: all 0.2s ease;
  appearance: none;
  cursor: pointer;
  height: 30px;
  line-height: 1;
}

/* Hover y foco */
#filterContainer select:hover {
  border-color: #8a2be2;
}
#filterContainer select:focus {
  border-color: #8a2be2;
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.15);
  outline: none;
}

/* Select activo */
.filtro-activo {
  background-color: #f3e8ff !important;
  border: 1px solid #8a2be2 !important;
  font-weight: bold;
  color: #4b0082;
}

/* BOTÓN "LIMPIAR FILTROS" */
#clearFiltersBtn {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
}
#clearFiltersBtn:hover {
  background-color: #e0e0e0;
  border-color: #bbb;
}
#clearFiltersBtn i {
  color: #555;
  font-size: 14px;
}
/* =====================
   ÍCONO DE EDICIÓN
===================== */
.edit-icon {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    cursor: pointer;
    margin-left: 5px;
}
.editable-field:hover .edit-icon {
    opacity: 1;
    color: #007bff;
}

/* =====================
   ÍCONO DE ACCIÓN
===================== */
.icono-accion {
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    color: #007bff;
    transition: transform 0.2s ease;
}
.icono-accion:hover {
    transform: scale(1.2);
    color: #0056b3;
}

/* =====================
   CONTADOR DE EMPLEADOS
===================== */
#contadorEmpleados {
    text-align: center;
    width: 100%;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

/* =====================
   BOTÓN DE MENÚ (HAMBURGUESA)
===================== */
#menuToggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-right: 10px;
  color: #333;
  display: flex;
  align-items: center;
}

/* =====================
   SIDEBAR LATERAL
===================== */
#sidebar {
  position: fixed;
  top: 60px; /* justo debajo del header */
  left: -200px; /* oculto inicialmente */
  width: 160px;
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  transition: left 0.3s ease;
  z-index: 999;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Mostrar sidebar cuando tiene la clase activa */
#sidebar.abierto {
  left: 0;
}

/* Enlaces del menú lateral */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.sidebar-link:hover {
  background-color: #f3f3ff;
  color: #4b00b5;
}
.sidebar-link i {
  color: #8a2be2;
}
#particles-js {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
#logoSearchContainer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.logo-img {
  height: 40px;
  margin-top: 10px;
  cursor: pointer;
}
#particles-js canvas {
  pointer-events: auto;
}
/* ============================================
   GALERÍA DE DASHBOARDS - 2 COLUMNAS ANCHAS
============================================ */
.dashboard-gallery {
  display: grid;
  /* 2 columnas fijas: cada tarjeta tendrá mucho ancho. */
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;                 /* Espacio horizontal/vertical entre tarjetas */
  width: 90%;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
  overflow: visible; /* Permite que el hover no se recorte */
}

/* Tarjeta con efecto al hacer hover */
.paper-card {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Hover: agrandamos la tarjeta y aumenta la sombra */
.paper-card:hover {
  transform: scale(1.03);
  z-index: 2;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Título dentro de la tarjeta */
.paper-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

/* Ajuste del iframe para reportes horizontales */
.paper-card iframe {
  width: 100%;
  height: 200px;  /* Ajusta según prefieras (350, 450, etc.) */
  border: none;
  border-radius: 4px;
  box-sizing: border-box;
}

/* RESPONSIVE:
   Si la pantalla es menor a 900px, pasamos a 1 columna
   para que no quede muy apretado. */
@media (max-width: 900px) {
  .dashboard-gallery {
    grid-template-columns: 1fr;
  }
}
.switch {
  position: relative;
  display: inline-block;
  width: 30px;   /* largo total */
  height: 18px;  /* alto total */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e74c3c; /* rojo inactivo */
  transition: 0.4s;
  border-radius: 18px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  top: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #2ecc71; /* verde activo */
}

.switch input:checked + .slider:before {
  transform: translateX(40px); /* movimiento exacto */
}
.boton-cambio-empresa {
  background-color: #ffffff;
  color: #8a2be2; /* morado elegante */
  border: 1px solid #ddd;
  border-radius: 50%;
  padding: 6px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}
/* Icono de cambio de empresa y de historial */
.boton-cambio-empresa, .icono-historial {
  position: absolute;
  bottom: -8px;
  background: #007bff;
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 5;
}

.boton-cambio-empresa { left: -3px; }
.icono-historial { right: -3px; background: #17a2b8; }

/* Popup de historial */
.popup-historial {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fdfdfd;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 10000;
  max-width: 280px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.popup-historial h4 {
  margin-top: 0;
  font-size: 14px;
  color: #333;
  text-align: center;
}

.popup-historial button {
  padding: 4px 12px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#accionesHeader {
  display: flex;
  gap: 12px;
  margin-left: auto;
  align-items: center;
}
