/* Ajustes propios sobre Material Dashboard. */

.nav-link.disabled {
  pointer-events: none;
}

/* Modo oscuro: elementos con fondo blanco fijo que el template no cubre. */
.dark-version .nav-pills.bg-white {
  background: #1d1d1d !important;
}

.dark-version .nav-pills .nav-link:not(.active) {
  color: #fff;
}

/* Modales: el template no los adapta al modo oscuro (quedaban texto blanco sobre fondo blanco). */
.dark-version .modal-content {
  background: #1d1d1d;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-version .modal-header,
.dark-version .modal-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-version .modal .btn-close {
  filter: invert(1);
}

.dark-version .modal .border {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Botones de contorno oscuros: invisibles sobre fondo oscuro. */
.dark-version .btn-outline-dark,
.dark-version .btn-outline-secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.dark-version .btn-outline-dark:hover,
.dark-version .btn-outline-secondary:hover {
  color: #171717;
  background-color: #fff;
  border-color: #fff;
}

/* Las pestañas son páginas separadas: se oculta la animación "moving-tab" que agrega el JS del template. */
.nav-pills .moving-tab {
  display: none !important;
}

/* Planilla mensual de turnos ------------------------------------------------ */
.planilla-contenedor {
  max-height: 72vh;
  overflow: auto;
}

.planilla {
  border-collapse: separate;
  border-spacing: 0;
}

.planilla th,
.planilla td {
  vertical-align: middle;
}

.planilla thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.planilla .columna-empleado {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  min-width: 210px;
  max-width: 210px;
}

.planilla thead .columna-empleado {
  z-index: 3;
}

.planilla td.celda {
  min-width: 36px;
  height: 34px;
  cursor: pointer;
}

.planilla td.celda:hover {
  outline: 2px solid #344767;
  outline-offset: -2px;
}

.planilla.modo-pincel td.celda {
  cursor: crosshair;
}

.planilla .codigo {
  min-width: 28px;
  padding: 0.35em 0.4em;
}

.planilla .fin-de-semana {
  background-color: rgba(52, 71, 103, 0.05);
}

.planilla .feriado {
  background-color: rgba(233, 30, 99, 0.1);
}

.planilla th.hoy {
  box-shadow: inset 0 -3px 0 #1a73e8;
}

.planilla td.cambio {
  box-shadow: inset 0 0 0 2px #fb8c00;
}

.planilla td.guardando {
  opacity: 0.4;
}

.leyenda {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 2px;
}

.leyenda.fin-de-semana {
  background-color: rgba(52, 71, 103, 0.12);
}

.leyenda.feriado {
  background-color: rgba(233, 30, 99, 0.25);
}

.leyenda.cambio-muestra {
  box-shadow: inset 0 0 0 2px #fb8c00;
}

.pincel.activo {
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.6);
}

.dark-version .planilla thead th,
.dark-version .planilla .columna-empleado {
  background: #1d1d1d;
}

.dark-version .planilla .fin-de-semana {
  background-color: rgba(255, 255, 255, 0.04);
}

.dark-version .planilla td.celda:hover {
  outline-color: #fff;
}

/* Encabezados fijos: necesitan fondo opaco para que no se vea la grilla al desplazar. */
.planilla thead th.fin-de-semana {
  background-color: #f2f3f6;
}

.planilla thead th.feriado {
  background-color: #fde4ee;
}

.dark-version .planilla thead th.fin-de-semana {
  background-color: #252525;
}

.dark-version .planilla thead th.feriado {
  background-color: #3a1d28;
}

/* ==========================================================================
   Color y gráficos
   ========================================================================== */

/* Colores de los gráficos: paleta validada para daltonismo, en modo claro y oscuro. */
body {
  --serie-1: #2a78d6;
  --serie-2: #eb6834;
  --serie-3: #1baf7a;
  --serie-4: #eda100;
  --serie-5: #e87ba4;
  --serie-6: #008300;
  --serie-7: #4a3aa7;
  --serie-otras: #9e9d98;
  --viz-texto: #344767;
  --viz-texto-suave: #7b809a;
  --viz-grilla: rgba(52, 71, 103, 0.1);
  --viz-superficie: #ffffff;
  --acento: #1a73e8;
  --acento-degradado: linear-gradient(195deg, #49a3f1 0%, #1a73e8 100%);
}

body.dark-version {
  --serie-1: #3987e5;
  --serie-2: #d95926;
  --serie-3: #199e70;
  --serie-4: #c98500;
  --serie-5: #d55181;
  --serie-6: #008300;
  --serie-7: #9085e9;
  --serie-otras: #75746f;
  --viz-texto: #ffffff;
  --viz-texto-suave: rgba(255, 255, 255, 0.6);
  --viz-grilla: rgba(255, 255, 255, 0.08);
  --viz-superficie: #1d1d1d;
}

/* Un poco más de color en modo claro: fondo apenas azulado y acento azul. */
body.bg-gray-100:not(.dark-version) {
  background: linear-gradient(180deg, #eef3fb 0%, #f4f6fa 320px) fixed;
}

/* Elemento activo del menú lateral y pestañas con el acento azul en lugar de negro. */
.sidenav .nav-link.active.bg-gradient-dark,
.nav-pills .nav-link.active.bg-gradient-dark {
  background-image: var(--acento-degradado) !important;
  box-shadow: 0 4px 10px -2px rgba(26, 115, 232, 0.45);
}

/* Tarjetas de datos del inicio: una línea de color arriba según el tema de la tarjeta. */
.tarjeta-dato {
  border-top: 3px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tarjeta-dato:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.2);
}

.tarjeta-info { border-top-color: #1a73e8; }
.tarjeta-success { border-top-color: #43a047; }
.tarjeta-primary { border-top-color: #e91e63; }
.tarjeta-danger { border-top-color: #e53935; }

/* Encabezado de bienvenida */
.encabezado-inicio {
  background-image: var(--acento-degradado);
}

.encabezado-inicio .btn-outline-white {
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #fff;
}

.encabezado-inicio .btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Barra de "trabajando hoy" */
.barra-progreso {
  height: 10px;
  border-radius: 6px;
  background: rgba(52, 71, 103, 0.1);
  overflow: hidden;
  margin-top: 4px;
}

.barra-progreso-relleno {
  height: 100%;
  border-radius: 6px;
  background-image: var(--acento-degradado);
  transition: width 0.6s ease;
}

.dark-version .barra-progreso {
  background: rgba(255, 255, 255, 0.1);
}

.contenedor-grafico {
  position: relative;
}

/* Casillas de verificación: el template dibuja la tilde con la fuente Font Awesome,
   que no usamos; se reemplaza por una tilde dibujada (SVG) y el color de acento. */
.form-check:not(.form-switch) .form-check-input[type=checkbox]::after {
  content: none !important;
}

.form-check:not(.form-switch) .form-check-input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  border-color: #b3b8c4;
}

.form-check:not(.form-switch) .form-check-input[type=checkbox]:checked {
  background: var(--acento) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") center / 100% no-repeat;
  border-color: var(--acento);
}

.form-check:not(.form-switch) .form-check-input[type=checkbox]:indeterminate {
  background: var(--acento) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e") center / 100% no-repeat;
  border-color: var(--acento);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
}

/* Interruptores (activo / inactivo) con el mismo acento. */
.form-switch .form-check-input:checked {
  background-color: var(--acento);
  border-color: var(--acento);
}

/* Campo del código de 6 dígitos */
.letras-separadas {
  letter-spacing: 0.4em;
  font-weight: 600;
}

@media print {
  .ocultar-al-imprimir,
  .main-content form { display: none !important; }
}


/* Vista previa de reportes (mismo contenido que el PDF) */
.vista-previa h2 { font-size: 1rem; margin: 0.5rem 0 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid rgba(52, 71, 103, 0.15); color: var(--acento); }
.vista-previa h3 { font-size: 0.9rem; margin-top: 1rem; }
.vista-previa table { width: 100%; border-collapse: collapse; }
.vista-previa table.datos th { background: rgba(26, 115, 232, 0.08); font-size: 0.7rem; text-transform: uppercase; padding: 0.4rem 0.5rem; text-align: left; }
.vista-previa table.datos td { font-size: 0.8rem; padding: 0.35rem 0.5rem; border-bottom: 1px solid rgba(52, 71, 103, 0.08); }
.vista-previa table.datos tr.fin-de-semana td { background: rgba(52, 71, 103, 0.04); }
.vista-previa table.datos .numero { text-align: right; }
.vista-previa table.datos .centro { text-align: center; }
.vista-previa table.datos tfoot td { border-top: 2px solid rgba(52, 71, 103, 0.2); }
.vista-previa .resumen-totales td.caja { border: 1px solid rgba(52, 71, 103, 0.15); border-radius: 8px; padding: 0.5rem 0.75rem; }
.vista-previa .resumen-totales { border-collapse: separate; border-spacing: 6px; }
.vista-previa .total { font-size: 1.25rem; font-weight: 700; }
.vista-previa .chico { font-size: 0.72rem; opacity: 0.75; }
.vista-previa .estado { font-weight: 600; }
.vista-previa .estado-AUSENTE { color: #e53935; }
.vista-previa .estado-TARDANZA, .vista-previa .estado-SAL_ANTICIPADA { color: #fb8c00; }
.vista-previa .estado-SIN_SALIDA, .vista-previa .estado-SIN_ENTRADA { color: #1a73e8; }
.vista-previa .estado-PRESENTE { color: #43a047; }
.vista-previa .estado-LICENCIA { color: #8e24aa; }
.dark-version .vista-previa table.datos td { border-bottom-color: rgba(255, 255, 255, 0.06); }
.dark-version .vista-previa table.datos th { background: rgba(255, 255, 255, 0.06); }
