/* Estilos Generales */
body {
  font-family: "Open Sans", sans-serif;
}

.gj-datepicker-bootstrap [role="right-icon"] button {
  border: none !important;
}

.bi-check-all {
  font-size: 20px;
}

.bi-arrow-left-circle:hover {
  color: #222;
}

.font_size_17 {
  font-size: 17px;
}

.btnMovil {
  display: flex;
  justify-content: flex-end;
  text-align: end;
  background-color: #fff;
}

.bx-menu {
  background-color: #124a8b !important;
  color: #fff;
  padding: 10px 10px;
  border-radius: 50%;
}

.noLeido {
  color: #272e37;
  font-weight: 600;
}

tbody tr {
  border-bottom: 1px solid #eee !important;
}

tbody tr:hover {
  cursor: pointer;
}

.checkedTodos:hover {
  cursor: pointer;
}

.form-check-input[disabled] ~ .form-check-label,
.form-check-input:disabled ~ .form-check-label {
  opacity: initial !important;
}

.borderCheckbox {
  cursor: pointer;
  border-color: #124a8b;
  box-shadow: 0 2px 4px 0 #124a8b;
}

.pagination {
  justify-content: center;
}

.pesos {
  background-color: #124a8b;
  color: #fff;
  padding: 2px;
  border-radius: 10%;
  margin-right: 10px;
}

.colorTheadTrTh {
  color: #fff !important;
}

.input_vacio {
  border-color: #dc3545 !important;
}

.input_lleno {
  border-color: #124a8b !important;
}

.alert-success {
  background-color: #124a8b !important;
  color: #fff !important;
}

.mayuscula {
  text-transform: uppercase !important;
}

.btn-primary {
  background-color: #124a8b !important;
  border: none !important;
}

.btn-close {
  width: auto !important;
  height: auto !important;
}

.bi-x {
  color: #222 !important;
}

.form-check-input {
  width: 1.8em !important;
  height: 1.9em !important;
}

.difference {
  padding: 5px 10px;
  font-size: 15px;
  color: #222;
}

.bi-star-fill {
  padding: 0px 10px 0px 0px;
}

#informe_general:hover {
  cursor: pointer;
  border-bottom: dotted 1px #124a8b;
}

#search {
  min-width: 44% !important;
  background-color: #f3efef !important;
}

@media (min-width: 1400px) {
  .container-xxl,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm,
  .container {
    max-width: 95% !important;
  }
}

/* Loader */
#loader-out {
  background-color: #cecece;
  opacity: 0.5;
  position: fixed;
  width: 100%;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100000000;
}

#loader-container {
  width: 150px;
  height: 150px;
  color: white;
  margin: 0 auto;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-right: -50%;
  transform: translate(-50%, -50%);
  border: 5px solid #cecece;
  border-radius: 50%;
  -webkit-animation: borderScale 1s infinite ease-in-out;
  animation: borderScale 1s infinite ease-in-out;
}

#loading-text {
  color: #222;
  font-size: 1.5em;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-right: -50%;
  transform: translate(-50%, -50%);
}

@-webkit-keyframes borderScale {
  0% {
    border: 5px solid white;
  }
  50% {
    border: 25px solid #124a8b;
  }
  100% {
    border: 5px solid white;
  }
}

@keyframes borderScale {
  0% {
    border: 5px solid white;
  }
  50% {
    border: 25px solid #124a8b;
  }
  100% {
    border: 5px solid white;
  }
}

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000000;
  background-color: #cecece;
  opacity: 0.5;
}

/* ============================================================
   SIDEBAR - Rediseño moderno con scroll correcto
   ============================================================ */

/* Convertir el aside en columna flex: header fijo + nav scrolleable + footer fijo */
.layout-menu {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}

/* Header: logo, no scrollea nunca */
.sidebar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid #eef0f4;
  position: relative;
  z-index: 10;
  background: inherit;
}

.sidebar-header img {
  width: 82%;
  height: auto;
}

/* Nav central: ocupa el espacio restante y tiene su propio scroll.
   .menu-inner se mantiene porque el JS del framework (Sneat) lo necesita
   para que funcione el toggle móvil. Los overrides evitan que las reglas
   del framework (height:100%, flex:1 1 auto, padding:0) rompan el layout. */
.sidebar-nav.menu-inner {
  flex: 1 1 0 !important;
  min-height: 0;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 0.5rem 0 0.75rem !important;
  scrollbar-width: thin;
  scrollbar-color: #d1d9e6 transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #d1d9e6; border-radius: 4px; }

/* Footer: usuario y salir, no scrollea */
.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid #eef0f4;
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Label de sección (ej. "DASHBOARDS") */
.snav-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a0aec0;
  padding: 0.8rem 1.2rem 0.3rem;
}

/* Listas */
.snav-list,
.snav-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Item nivel 1 (link directo) */
.snav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1px 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  color: #344767;
  font-size: 1.40rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.snav-item i {
  font-size: 1.25rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: #8898aa;
  transition: color 0.15s;
}

.snav-item:hover { background: rgba(18,74,139,.07); color: #124a8b; text-decoration: none; }
.snav-item:hover i { color: #124a8b; }
.snav-item.is-active { background: rgba(18,74,139,.11); color: #124a8b; font-weight: 600; }
.snav-item.is-active i { color: #124a8b; }

/* Botón colapsable de sección */
.snav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 1rem);
  margin: 1px 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #344767;
  font-size: 1.40rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.snav-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.snav-toggle-left i {
  font-size: 1.25rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: #8898aa;
  transition: color 0.15s;
}

.snav-chevron {
  font-size: 0.75rem;
  color: #a0aec0;
  transition: transform 0.25s ease;
}

.snav-toggle:hover { background: rgba(18,74,139,.07); color: #124a8b; }
.snav-toggle:hover .snav-toggle-left i { color: #124a8b; }
.snav-toggle[aria-expanded="true"] .snav-chevron { transform: rotate(90deg); }
.snav-toggle[aria-expanded="true"] { background: rgba(18,74,139,.05); color: #124a8b; }
.snav-toggle[aria-expanded="true"] .snav-toggle-left i { color: #124a8b; }

/* Subitems (dentro del collapse) */
.snav-subitem {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1px 0.5rem 1px 1.5rem;
  padding: 0.48rem 0.9rem;
  border-radius: 8px;
  color: #5a6a85;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.snav-subitem i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: #b0bac7;
  transition: color 0.15s;
}

.snav-subitem:hover { background: rgba(18,74,139,.06); color: #124a8b; text-decoration: none; }
.snav-subitem:hover i { color: #124a8b; }
.snav-subitem.is-active { background: rgba(18,74,139,.09); color: #124a8b; font-weight: 600; }
.snav-subitem.is-active i { color: #124a8b; }

/* Footer items (usuario / logout) */
.snav-footer-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.90rem;
  border-radius: 8px;
  color: #5a6a85;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.snav-footer-item i { font-size: 1.2rem; flex-shrink: 0; color: #8898aa; }
.snav-footer-item:hover { background: rgba(18,74,139,.06); color: #124a8b; text-decoration: none; }
.snav-footer-item.snav-logout:hover { background: rgba(220,53,69,.06); color: #dc3545; }
.snav-footer-item.snav-logout:hover i { color: #dc3545; }
.snav-footer-item.is-active { background: rgba(18,74,139,.08); color: #124a8b; }

.auto-resize {
  resize: none;
  max-width: 100%;
  min-height: 38px;
  height: auto;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 6px 12px;
  box-sizing: border-box;
}

/* Estilos para la tabla y DataTables */
.table-responsive {
  max-height: 700px !important;
  overflow-y: auto;
  position: relative; /* Combinado para mantener todas las propiedades */
}

.dataTables_wrapper {
  overflow: visible;
}

.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
  margin-bottom: 10px;
}

.dataTables_paginate {
  padding-bottom: 20px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  position: sticky;
  bottom: 0;
  background: #f8f9fa;
  z-index: 10;
}

.btn-sm {
  margin-right: 5px;
  padding: 2px 8px;
  font-size: 0.85rem;
}

.btn-sm:last-child {
  margin-right: 0;
}

/* Nuevos estilos para alinear el encabezado con el desplazamiento horizontal */
#tbl_operaciones thead th,
#tbl_ordenproduccion thead th  {
  position: sticky;
  top: 0;
  background: #395c83;
  color: white;
  z-index: 1;
  left: 0; /* Añadido para alinear con el desplazamiento horizontal */
}

#tbl_operaciones,
#tbl_ordenproduccion {
  width: 100% !important;
}

.dataTables_scrollBody {
  overflow-x: auto !important;
}

/* Modern Form Styles */
.card-modern {
  border: none;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
}

.card-modern:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-header-modern {
  background: linear-gradient(135deg, #124a8b 0%, #0d3666 100%);
  color: white;
  border-radius: 15px 15px 0 0 !important;
  padding: 1.5rem;
  border-bottom: none;
}

.form-label-modern {
  font-weight: 600;
  color: #344767;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control-modern, .select2-container--default .select2-selection--single {
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  height: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px !important;
    padding-left: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}

.form-control-modern:focus, .select2-container--default.select2-container--open .select2-selection--single {
  border-color: #124a8b;
  box-shadow: 0 0 0 4px rgba(18, 74, 139, 0.1);
  background-color: #fff;
}

/* Custom Toggle Switch for 'Inicio de Jornada' */
.toggle-switch-container {
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  border-radius: 50px; /* Makes it pill-shaped */
  padding: 8px 15px; /* Increase padding for height/width */
  border: 1px solid #e0e6ed;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative; /* For absolute positioning of label if needed, or just flex */
  width: fit-content; /* Adjust to content */
}

.toggle-switch-container:hover {
  border-color: #124a8b;
  background-color: #eef2f7;
}

.toggle-switch-container.active {
  background-color: #e3f2fd; /* Light blue background when active */
  border-color: #124a8b;
}

/* The actual checkbox (hidden) */
.toggle-switch-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* The slider */
.toggle-switch-slider {
  position: relative;
  display: inline-block;
  width: 44px; /* Slightly wider */
  height: 24px; /* Slightly taller */
  background-color: #ccc;
  border-radius: 34px;
  transition: .4s;
  margin-right: 12px;
}

.toggle-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch-checkbox:checked + .toggle-switch-slider {
  background-color: #124a8b;
}

.toggle-switch-checkbox:focus + .toggle-switch-slider {
  box-shadow: 0 0 1px #124a8b;
}

.toggle-switch-checkbox:checked + .toggle-switch-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-weight: 600;
  color: #555;
  user-select: none;
  font-size: 0.9rem;
}

.toggle-switch-container.active .toggle-label {
    color: #124a8b;
}

.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e6ed, transparent);
    margin: 2rem 0;
}

.btn-modern {
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-modern:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-modern-primary {
    background: linear-gradient(135deg, #124a8b 0%, #0d3666 100%);
    border: none;
    color: white;
}

.btn-modern-success {
    background: linear-gradient(135deg, #2dce89 0%, #2dcecc 100%);
    border: none;
    color: white;
}