/* AGRANDAR IMAGEN EN PRODUCTOS */
.imagen-agrandable {
  cursor: pointer;
  transition: transform 0.2s;
}

.imagen-agrandada {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(10);
  z-index: 9999;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* columna fija, fijar*/

html.dark table.dataTable thead tr>.dtfc-fixed-left,
html.dark table.dataTable thead tr>.dtfc-fixed-right,
html.dark table.dataTable tfoot tr>.dtfc-fixed-left,
html.dark table.dataTable tfoot tr>.dtfc-fixed-right {
  background-color: var(--dt-html-background)
}

html.dark table.dataTable tbody tr>.dtfc-fixed-left,
html.dark table.dataTable tbody tr>.dtfc-fixed-right {
  background-color: var(--dt-html-background)
}

html.dark div.dtfc-left-top-blocker,
html.dark div.dtfc-right-top-blocker {
  background-color: var(--dt-html-background)
}

.mi_card {
  background-color: rgb(94, 0, 0);
}

/* Estilos específicos para ciertos elementos en el modo oscuro */
.dark-mode .navbar {
  background-color: #343A40;
  /* Cambia el color de fondo de la barra de navegación a un tono oscuro */
  color: #ffffff;
  /* Cambia el color del texto en la barra de navegación a blanco */
}

.dark-mode .btn {

  color: #ffffff !important;
  /* Cambia el color del texto a blanco en modo oscuro */
}

.dark-mode .miBodyColor {
  background-color: #343A40 !important;
  /* Cambia el color de fondo a un tono oscuro en modo oscuro */
  color: #ffffff !important;
  /* Cambia el color del texto a blanco en modo oscuro */
}

/*--------------------------------------------*/
.color_general {
  color: #ffffff !important;
  border-radius: 1px;
  padding: 5px 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.color_general.active {
  background-color: #007bff !important;
  /* Color de resaltado cuando está activo */
  color: #fff !important;
}

/* BOTON DE HABILITAR Y DESHABILITAR O ENCENDER Y APAGAR */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  /* Reducido de 60px */
  height: 28px;
  /* Reducido de 34px */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  /* Reducido de 26px */
  width: 22px;
  /* Reducido de 26px */
  left: 3px;
  /* Ajustado según el nuevo tamaño */
  bottom: 3px;
  /* Ajustado según el nuevo tamaño */
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #15a51a;
}

input:checked+.slider:before {
  transform: translateX(22px);
  /* Ajustado según el nuevo width */
}

/* GIF DE LOADER CARGAR */
.loader {
  display: none;
  /* Oculto por defecto */
  position: fixed;
  /* Posición fija para mantenerla en la pantalla */
  top: 50%;
  /* Centrado verticalmente */
  left: 50%;
  /* Centrado horizontalmente */

  transform: translate(-50%, -50%);
  /* Ajuste para centrar la imagen */
  z-index: 9999;
  width: 250px;
  /* Ajusta el ancho */
  height: 250px;
  /* Ajusta la altura */
}

.chart-container {
  width: 100%;
  overflow-x: auto;
  /* Habilita el scroll horizontal */
}

#barChart {
  min-width: 400px;
  /* Ancho mínimo del gráfico */
  width: 100%;
}

/* Caja de login */
.login-box {
  width: 400px;
  background: rgba(255, 255, 255, 0.804);
  /* Fondo semitransparente */
  padding: 30px;
  /* Mayor espacio interno */
  border-radius: 20px;
  /* Bordes más suaves */
  box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);
  /* Sombra más intensa */
  transition: all 0.3s ease;
  /* Transición suave para todo */
  animation: slideIn 1s ease-out;
  /* Animación al ingresar */
}

.login-box:hover {
  box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.2);
  /* Sombra más grande al pasar el cursor */
}

@keyframes slideIn {
  0% {
    transform: translateY(-50px);
    /* Empieza desde más arriba */
    opacity: 0;
    /* Comienza invisible */
  }

  100% {
    transform: translateY(0);
    /* Se mueve a su posición original */
    opacity: 1;
    /* Se vuelve completamente visible */
  }
}

/* Estilo del título */
.login-box h3 {
  margin-bottom: 30px;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Estilos para los inputs */
.input-group .form-control {
  border-radius: 30px;
  border: 1px solid #0c315bc4;

  /* Transición suave */
  position: relative;
}

.input-group .form-control:focus {
  border-color: #0c315bc4;
  box-shadow: 0 0 8px #0c315bc4;
  outline: none;

  /* Aumenta ligeramente el tamaño */
}

/* Animación del borde con before */
.input-group .form-control::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #0056b3;
  transition: all 0.3s ease-in-out;
}

.input-group .form-control:focus::before {
  width: 100%;
  left: 0;
}

/* Agregamos una animación en el label si usas uno */
.input-group label {
  transition: transform 0.3s ease-in-out, font-size 0.3s ease-in-out;
  transform-origin: left;
}

.input-group .form-control:focus+label {
  transform: translateY(-25px) scale(0.9);
  font-weight: bold;
  color: #0056b3;
}

/* Botón personalizado */
.btn-custom {
  background-color: #4A90E2;
  color: #fff;
  border-radius: 30px;
  padding: 10px 30px;
  transition: background-color 0.3s ease;
}

.btn-custom:hover {
  background-color: #357ABD;
}

/* Responsive */
@media (max-width: 768px) {
  .login-box {
    width: 90%;
  }
}

.login-box img {
  width: 200px;
  margin-bottom: 10px;
}

.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  /* Ocupa toda la pantalla */
  overflow: hidden;
  /* Evita que se salga el fondo */
}

.login-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/sistema_ventas_fel/vistas/assets/dist/img/fondoLogin.png') no-repeat left center;
  /* Alinea la imagen a la izquierda */
  background-size: cover;
  /* Asegura que la imagen cubra toda la pantalla */
  opacity: 0.3;
  /* Ajusta la opacidad */
  z-index: -1;
}

.btn-login {
  background-color: #0c315b;
  /* Color de fondo */
  color: white;
  /* Color del texto */
  border: none;
  /* Eliminar bordes */
  padding: 12px 24px;
  /* Añadir espacio alrededor del texto */
  font-size: 16px;
  /* Tamaño de la fuente */
  border-radius: 8px;
  /* Bordes redondeados */
  cursor: pointer;
  /* Cambiar el cursor al pasar sobre el botón */
  text-transform: uppercase;
  /* Convertir el texto a mayúsculas */
  font-weight: bold;
  /* Hacer el texto más grueso */
  transition: background-color 0.3s, box-shadow 0.3s;
  /* Transiciones suaves */
}

.btn-login:hover {
  background-color: #0c315bc4;
  /* Color de fondo cuando el mouse pasa sobre el botón */
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
  /* Sombra suave alrededor del botón */
}

.btn-login:focus {
  outline: none;
  /* Eliminar el borde de enfoque predeterminado */
  box-shadow: 0 0 0 3px #0c315bc4;
  /* Añadir sombra cuando el botón está en foco */
}

.btn-login:active {
  background-color: #0c315bc4;
  /* Color cuando se hace clic en el botón */
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.4);
  /* Sombra más pequeña cuando el botón está presionado */
}

.switch-icon {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch-icon input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
  border-radius: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
}

.success-container {
  text-align: center;
  padding: 40px;
  animation: fadeIn 1s ease-in-out;
}

.success-checkmark {
  width: 120px;
  height: 120px;
  display: inline-block;
  border-radius: 50%;
  background-color: #4BB543;
  position: relative;
  animation: pop 0.6s ease forwards;
  box-shadow: 0 0 30px rgba(75, 181, 67, 0.5);
}

.check-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: white;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  animation: drawCheck 0.5s 0.6s ease forwards, growCheck 0.3s 0.6s ease forwards;
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes growCheck {
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-text {
  color: #4BB543;
  font-size: 26px;
  font-weight: bold;
  margin-top: 20px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: fadeIn 1s ease-in-out 0.8s forwards;
  opacity: 0;
}

.cancel-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #dc3545;
  /* rojo */
  position: relative;
  animation: pop 0.4s ease;
}

.cancel-icon {
  width: 50px;
  height: 50px;
  stroke: #dc3545;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-top: 15px;
}

.cancel-text {
  margin-top: 15px;
  font-size: 20px;
  font-weight: bold;
  color: #dc3545;
}

@keyframes pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.custom-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.custom-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-switch-label {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: .4s;
}

.custom-switch-label::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}

/* Activado */
.custom-switch-input:checked+.custom-switch-label {
  background-color: #198754;
  /* Bootstrap success */
}

.custom-switch-input:checked+.custom-switch-label::before {
  transform: translateX(22px);
}

#lstProductosVenta .iptPrecioVenta,
#lstProductosVenta .iptDescuento {
  min-width: 70px;
  max-width: 100px;
}

#lstProductosVenta .input-group {
  flex-wrap: nowrap !important;
}

#lstVentas tbody td {
  cursor: pointer;
  /* cambia el cursor */
  transition: background-color 0.2s ease;
  /* transición suave */
  background-clip: padding-box;
  /* asegura que el color se vea completo */
}

/* Cambia el color de toda la celda al pasar el cursor */
#lstVentas tbody tr:hover td {
  background-color: #b7d9eb !important;
  cursor: pointer;
}

/* Mostrar SOLO en pantallas pequeñas */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  display: flex;
  justify-content: space-around;
  z-index: 9999;
}

/* Estilos de los botones */
.mobile-action-bar button {
  flex: 1;
  margin: 0 5px;
  font-size: 12px;
  padding: 8px 0;
  border-radius: 10px;
}

/* Ocultar botones de escritorio en pantallas pequeñas */
.desktop-buttons {
  display: none;
}

@media (min-width: 768px) {

  /* Mostrar solo en pantallas grandes */
  .desktop-buttons {
    display: block;
  }

  /* Ocultar barra móvil en pantallas grandes */
  .mobile-action-bar {
    display: none;
  }
}

.dropdown-menu-lg {
  padding: 0 !important;
}

.nav-sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.brand-link {
  background-color: rgba(0, 0, 0, 0.2);
}

.main-sidebar {
  height: 100vh;
  overflow: hidden;
}

.main-sidebar .sidebar {
  height: calc(100vh - 57px);
  /* 57px = altura del brand-link */
  overflow-y: auto;
}

.scroll-kpi {
  max-height: 500px;

  overflow-y: auto;
  padding-right: 6px;
}

/* Scroll moderno */
.scroll-kpi::-webkit-scrollbar {
  width: 6px;
}

.scroll-kpi::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-kpi::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, .25);
  border-radius: 10px;
}

.scroll-kpi::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, .45);
}

.scroll-card {
  max-height: 235px;
  /* Ajusta la altura que necesites */
  overflow-y: auto;
  /* Scroll vertical */
  overflow-x: hidden;
  /* Evita scroll horizontal */
}

/* Opcional: estilo del scroll */
.scroll-card::-webkit-scrollbar {
  width: 6px;
}

.scroll-card::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.scroll-card::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

#chartdiv {
  width: 100%;
  height: 450px;
}

.acciones-producto .btnAccion {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

.acciones-producto .btnAccion:hover {
    background-color: #f1f3f5;
    transform: translateY(-1px);
}

.acciones-producto .btnAccion:active {
    transform: scale(0.95);
}

/* Switch más alineado */
.acciones-producto .form-switch {
    padding-left: 2.5rem;
}

#mdlGestionarStock .form-control-lg {
    font-size: 1rem;
}

#mdlGestionarStock .alert-info {
    font-size: 0.95rem;
}

tr.fila-seleccionada {

    background-color: #079dc269 !important;
}

/* =========================
   HEADER DE GRUPO NORMAL
========================= */

.group-container {
    background-color: #d9d9da;
    border-left: 4px solid #5e5e5e;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.group-row td {
    background: transparent !important;
    border: none !important;
}

/* =========================
   MODO OSCURO (si usas clase .dark-mode)
========================= */

.dark-mode .group-container {
    background-color: #2c2f33;
    border-left: 4px solid #4dabf7;
    color: #f1f3f5;
}

/* =========================
   BOOTSTRAP 5 data-bs-theme="dark"
========================= */

[data-bs-theme="dark"] .group-container {
    background-color: var(--bs-tertiary-bg);
    border-left: 4px solid var(--bs-primary);
}

.dashboard-card {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: 18px;
    padding: 25px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
}

/* Header */
.card-header-modern {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 16px 20px;
}

/* Texto centro gráfico */
.texto-centro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.texto-label {
    font-size: 13px;
    color: #9aa0ac;
}

.texto-total {
    font-size: 22px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 992px) {
    .grafico-container {
        height: 250px;
    }
}

[data-bs-theme="dark"] .card-header-modern {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

[data-bs-theme="dark"] .texto-label {
    color: #aaa;
}

.input-group.shadow-sm {
    background: white;
    border-radius: 10px;
    transition: all 0.2s ease;
}

/* Sombra más visible al enfocar */
.input-group.shadow-sm:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

canvas {
    max-width: 100%;
}

/* Contenedor gráfico */
.grafico-container {
    position: relative;
    height: 300px;
    max-height: 300px;
}

/* Canvas */
#graficoTipoMovimientoCaja{
    width:100% !important;
    height:100% !important;
}

#tblHistorialCaja tbody tr:hover{
background:#f5f7fb;
transition:.2s;
}

#tblHistorialCaja thead th{
font-size:13px;
letter-spacing:.3px;
}

.dataTables_wrapper .dt-buttons .btn{
border-radius:8px;
font-weight:500;
}

/* =========================================================
   SELECT DE USUARIOS DE CAJA
   ========================================================= */

.select-usuario-caja + .select2-container {
    width: 100% !important;
}

.select-usuario-caja + .select2-container .select2-selection--single {
    height: 46px !important;
    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    box-shadow: none !important;
}

.select-usuario-caja + .select2-container
.select2-selection--single
.select2-selection__rendered {

    padding-left: 14px !important;
    padding-right: 35px !important;
    line-height: 44px !important;
    color: #343a40 !important;
    font-size: 14px;
}

.select-usuario-caja + .select2-container
.select2-selection--single
.select2-selection__arrow {

    height: 44px !important;
    right: 8px !important;
}

/* =========================================================
   DROPDOWN
   ========================================================= */

.select2-container--open .select2-dropdown {

    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    overflow: hidden;
}

/* =========================================================
   OPCIONES
   ========================================================= */

.usuario-caja-option {

    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    transition: background .15s ease;
}

.usuario-caja-option:last-child {
    border-bottom: none;
}

.usuario-caja-option:hover {

    background: #f8f9fa;
}

/* =========================================================
   NOMBRE
   ========================================================= */

.usuario-caja-nombre {

    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 14px;
    font-weight: 600;
    color: #343a40;
}

/* =========================================================
   INFORMACIÓN SECUNDARIA
   ========================================================= */

.usuario-caja-info {

    margin-top: 4px;

    font-size: 12px;
    color: #6c757d;
}

/* =========================================================
   ESTADO
   ========================================================= */

.usuario-caja-estado {

    display: inline-flex;
    align-items: center;

    font-size: 10px;
    font-weight: 600;

    padding: 3px 7px;

    border-radius: 20px;

    letter-spacing: .2px;
}

.usuario-caja-estado.activa {

    color: #198754;
    background: #e9f7ef;
}

.usuario-caja-estado.inactiva {

    color: #6c757d;
    background: #f1f3f5;
}

/* =========================================================
   PUNTO DE ESTADO
   ========================================================= */

.usuario-caja-estado .punto {

    width: 6px;
    height: 6px;

    border-radius: 50%;

    margin-right: 5px;

    background: currentColor;
}

.tarjetaCajaCompartida{

    cursor:pointer;

    transition:all .20s ease;

}

.tarjetaCajaCompartida:hover{

    transform:scale(1.01);

}

.tarjetaCajaCompartida.border-primary{

    border:2px solid #a98f0d !important;

}

/* Select2 dentro de un input-group */
.input-group .select2-container {
    flex: 1 1 auto;
    width: 1% !important;
}

.input-group .select2-container .select2-selection--single {
    height: 38px;
    border-radius: 0;
    border-color: #ced4da;
}

.input-group .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
}

.input-group .select2-container .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Bordes para que quede como un solo control */
.input-group-prepend .input-group-text {
    height: 38px;
}

.input-group-append .btn {
    height: 38px;
}

/* ========================================================= MODAL GESTIÓN DE PRODUCTO Diseño profesional - No modifica IDs ni funcionalidad ========================================================= */
    #mdlGestionarProducto .modal-content {
        border: 0;
        border-radius: 18px;
        overflow: hidden;
        background: #f8fafc;
    }

    #mdlGestionarProducto .modal-header {
        border: 0;
        padding: 18px 24px;
        background: var(--bs-primary);
        color: #fff;
    }

    #mdlGestionarProducto .modal-title {
        font-size: 1.05rem;
        font-weight: 600;
        letter-spacing: .1px;
    }

    #mdlGestionarProducto .modal-header .btn-close {
        filter: brightness(0) invert(1);
        opacity: .85;
    }

    #mdlGestionarProducto .modal-body {
        padding: 24px;
        background: #f8fafc;
    }

    /* Secciones */
    #mdlGestionarProducto .producto-section {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 20px;
        margin-bottom: 18px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
    }

    #mdlGestionarProducto .producto-section-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 1px solid #eef0f3;
    }

    #mdlGestionarProducto .producto-section-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--bs-primary-rgb), .10);
        color: var(--bs-primary);
        font-size: 16px;
    }

    #mdlGestionarProducto .producto-section-title {
        margin: 0;
        font-size: .92rem;
        font-weight: 700;
        color: #1f2937;
    }

    #mdlGestionarProducto .producto-section-subtitle {
        margin: 2px 0 0;
        font-size: .76rem;
        color: #6b7280;
    }

    /* Labels */
    #mdlGestionarProducto .form-label {
        font-size: .78rem;
        font-weight: 600;
        color: #374151;
        margin-bottom: 7px;
    }

    #mdlGestionarProducto .form-label i {
        color: var(--bs-primary);
    }

    /* Inputs */
    #mdlGestionarProducto .form-control,
    #mdlGestionarProducto .form-select {
        border-radius: 9px;
        border: 1px solid #dce1e7;
        background-color: #fff;
        min-height: 43px;
        font-size: .87rem;
        box-shadow: none;
        transition: all .18s ease;
    }

    #mdlGestionarProducto .form-control:focus,
    #mdlGestionarProducto .form-select:focus {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .10);
    }

    #mdlGestionarProducto .form-control-lg,
    #mdlGestionarProducto .form-select-lg {
        min-height: 45px;
        font-size: .88rem;
    }

    /* Input precio */
    #mdlGestionarProducto input[type="number"] {
        font-weight: 600;
    }

    /* Imagen */
    #mdlGestionarProducto .producto-imagen-container {
        height: 100%;
        min-height: 260px;
        border: 1px dashed #cbd5e1;
        border-radius: 13px;
        background: #f8fafc;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px;
        text-align: center;
        transition: all .2s ease;
    }

    #mdlGestionarProducto .producto-imagen-container:hover {
        border-color: var(--bs-primary);
        background: #f5f8ff;
    }

    #mdlGestionarProducto #icon-image {
        width: 46px;
        height: 46px;
        border-radius: 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-bottom: 10px;
    }

    #mdlGestionarProducto #img-preview {
        display: block;
        max-width: 180px;
        max-height: 150px;
        margin-top: 10px;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
        object-fit: contain;
        background: #fff;
    }

    #mdlGestionarProducto .imagen-ayuda {
        font-size: .72rem;
        color: #9ca3af;
        margin-top: 5px;
    }

    /* Proveedores */
    #mdlGestionarProducto .proveedores-box {
        border: 1px solid #e1e5ea;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    #mdlGestionarProducto .proveedores-search {
        padding: 10px;
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
    }

    #mdlGestionarProducto .proveedores-search .input-group {
        background: #fff;
        border-radius: 9px;
    }

    #mdlGestionarProducto .proveedores-search .input-group-text {
        background: #fff;
        border-color: #dce1e7;
        color: #94a3b8;
    }

    #mdlGestionarProducto #buscarProveedor {
        border-left: 0;
    }

    #mdlGestionarProducto #contenedorProveedores {
        max-height: 205px;
        overflow-y: auto;
        padding: 6px;
    }

    #mdlGestionarProducto #contenedorProveedores::-webkit-scrollbar {
        width: 6px;
    }

    #mdlGestionarProducto #contenedorProveedores::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

    /* IMPORTANTE: Estas reglas permiten que los elementos que actualmente genera tu JS dentro de #contenedorProveedores se vean mejor sin modificar su funcionamiento. */
    #mdlGestionarProducto #contenedorProveedores>div {
        border-radius: 9px;
        padding: 8px 10px;
        margin-bottom: 4px;
        transition: background .15s ease;
    }

    #mdlGestionarProducto #contenedorProveedores>div:hover {
        background: #f1f5f9;
    }

    #mdlGestionarProducto #contenedorProveedores label {
        cursor: pointer;
        font-size: .82rem;
        color: #374151;
        margin: 0;
    }

    #mdlGestionarProducto #contenedorProveedores input[type="checkbox"],
    #mdlGestionarProducto #contenedorProveedores input[type="radio"] {
        accent-color: var(--bs-primary);
    }

    .proveedores-contador {
        font-size: .72rem;
        color: #64748b;
        margin-top: 6px;
        padding-left: 3px;
    }

    /* Resumen financiero */
    #mdlGestionarProducto .producto-resumen {
        border: 1px solid #dbeafe;
        border-radius: 12px;
        background: linear-gradient(135deg, #f8fbff, #ffffff);
        overflow: hidden;
    }

    #mdlGestionarProducto .producto-resumen-header {
        padding: 10px 14px;
        border-bottom: 1px solid #e5eefc;
        background: #f8fbff;
        font-size: .78rem;
        font-weight: 700;
        color: #334155;
    }

    #mdlGestionarProducto .producto-resumen-body {
        padding: 14px;
    }

    #mdlGestionarProducto .resumen-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding: 5px 0;
        font-size: .78rem;
    }

    #mdlGestionarProducto .resumen-item span {
        color: #64748b;
    }

    #mdlGestionarProducto .resumen-item strong {
        color: #1f2937;
        font-size: .85rem;
    }

    #mdlGestionarProducto .producto-resumen .progress {
        height: 7px;
        border-radius: 10px;
        background: #e5e7eb;
    }

    /* Switches */
    #mdlGestionarProducto .config-card {
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 15px;
        background: #fff;
        height: 100%;
    }

    #mdlGestionarProducto .config-card-title {
        font-size: .8rem;
        font-weight: 700;
        color: #374151;
    }

    #mdlGestionarProducto .config-card-text {
        font-size: .7rem;
        color: #94a3b8;
        margin-top: 3px;
    }

    /* Escalas */
    #mdlGestionarProducto #contenedorPreciosEscalonados {
        margin-top: 5px;
    }

    #mdlGestionarProducto #contenedorPreciosEscalonados .card {
        border: 1px solid #dbeafe !important;
        border-radius: 12px;
        overflow: hidden;
    }

    #mdlGestionarProducto #contenedorPreciosEscalonados .card-header {
        background: #f8fbff;
        border-bottom: 1px solid #e5eefc;
        padding: 12px 15px;
    }

    #mdlGestionarProducto #listaEscalas {
        padding: 14px;
    }

    /* Footer */
    #mdlGestionarProducto .producto-footer {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
        padding-top: 5px;
    }

    #mdlGestionarProducto .producto-footer .btn {
        min-width: 155px;
        min-height: 43px;
        border-radius: 9px;
        font-size: .83rem;
        font-weight: 600;
    }

    /* Responsive */
    @media (max-width: 767.98px) {
        #mdlGestionarProducto .modal-body {
            padding: 15px;
        }

        #mdlGestionarProducto .producto-section {
            padding: 15px;
        }

        #mdlGestionarProducto .producto-imagen-container {
            min-height: 220px;
        }

        #mdlGestionarProducto .producto-footer {
            flex-direction: column-reverse;
        }

        #mdlGestionarProducto .producto-footer .btn {
            width: 100%;
        }
    }

/* ===== MODAL PROVEEDORES DEL PRODUCTO ===== */

#mdlProveedoresProducto .mdl-proveedores-dialog {
    max-width: 1200px;
    width: calc(100% - 30px);
}

#mdlProveedoresProducto .mdl-proveedores-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

/* Encabezado corporativo */
#mdlProveedoresProducto .mdl-proveedores-header {
    background: var(--color-general, #1769aa);
    color: #fff;
    padding: 22px 26px;
    border-bottom: 0;
}

#mdlProveedoresProducto .mdl-proveedores-header .modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

#mdlProveedoresProducto .mdl-proveedores-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.3rem;
}

#mdlProveedoresProducto .mdl-proveedores-subtitle {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.84rem;
}

/* Cuerpo */
#mdlProveedoresProducto .mdl-proveedores-body {
    padding: 25px;
    background: #f7f9fc;
}

#mdlProveedoresProducto .mdl-proveedores-intro {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px 18px;
    margin-bottom: 22px;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
}

#mdlProveedoresProducto .mdl-proveedores-intro-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf5ff;
    color: #1769aa;
    border-radius: 10px;
    font-size: 1rem;
}

#mdlProveedoresProducto .mdl-proveedores-intro-title {
    color: #253247;
    font-size: 0.94rem;
    font-weight: 700;
    margin-bottom: 4px;
}

#mdlProveedoresProducto .mdl-proveedores-intro-text {
    color: #6b7788;
    font-size: 0.84rem;
    line-height: 1.6;
}

/* Tabla */
#mdlProveedoresProducto #contenidoProveedores .table-responsive {
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 12px;
    overflow-x: auto;
}

#mdlProveedoresProducto #contenidoProveedores table {
    margin-bottom: 0;
    min-width: 850px;
    font-size: 0.87rem;
    border-color: #edf0f5;
}

#mdlProveedoresProducto #contenidoProveedores thead th {
    padding: 14px 12px;
    background: #eef3f9;
    color: #35445a;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    white-space: nowrap;
    vertical-align: middle;
    border-color: #e2e8f0;
}

#mdlProveedoresProducto #contenidoProveedores tbody td {
    padding: 15px 12px;
    color: #39465a;
    vertical-align: middle;
    border-color: #edf0f5;
}

#mdlProveedoresProducto #contenidoProveedores tbody tr {
    transition: background-color 0.18s ease;
}

#mdlProveedoresProducto #contenidoProveedores tbody tr:hover {
    background: #f5f9ff;
}

#mdlProveedoresProducto #contenidoProveedores tbody td:first-child {
    font-weight: 600;
    color: #26364b;
}

/* Mejor precio */
#mdlProveedoresProducto #contenidoProveedores .alert-warning {
    background: #fff9e9;
    border: 1px solid #f3dfaa;
    color: #795514;
    border-radius: 11px;
    padding: 15px;
    font-size: 0.93rem;
}

/* Alertas del contenido AJAX */
#mdlProveedoresProducto #contenidoProveedores .alert-danger {
    border-radius: 10px;
}

/* Pie */
#mdlProveedoresProducto .mdl-proveedores-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    background: #fff;
    border-top: 1px solid #e9edf3;
}

#mdlProveedoresProducto .mdl-proveedores-footer-info {
    color: #7b8797;
    font-size: 0.79rem;
}

#mdlProveedoresProducto .mdl-proveedores-btn-cerrar {
    padding: 9px 18px;
    background: #f0f3f7;
    border: 1px solid #e1e6ed;
    border-radius: 9px;
    color: #35445a;
    font-size: 0.86rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#mdlProveedoresProducto .mdl-proveedores-btn-cerrar:hover {
    background: #e3e9f1;
}

/* Adaptación móvil */
@media (max-width: 767.98px) {
    #mdlProveedoresProducto .mdl-proveedores-dialog {
        width: calc(100% - 16px);
        margin: 8px auto;
    }

    #mdlProveedoresProducto .mdl-proveedores-content {
        border-radius: 12px;
    }

    #mdlProveedoresProducto .mdl-proveedores-header {
        padding: 17px;
    }

    #mdlProveedoresProducto .mdl-proveedores-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    #mdlProveedoresProducto .mdl-proveedores-body {
        padding: 15px;
    }

    #mdlProveedoresProducto .mdl-proveedores-intro {
        padding: 13px;
    }

    #mdlProveedoresProducto .mdl-proveedores-footer {
        padding: 13px 15px;
        flex-wrap: wrap;
    }

    #mdlProveedoresProducto .mdl-proveedores-footer-info {
        flex: 1 1 100%;
    }
}

/* ==========================================
   CARD VENTAS MENSUALES
========================================== */

.card-ventas-mensuales {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

/* ENCABEZADO */

.card-ventas-mensuales .card-header {
    border-bottom: 0;
    padding: 15px 18px;
}

.ventas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.ventas-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.ventas-icono {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.ventas-titulo .card-title {
    float: none;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.ventas-titulo small {
    display: block;
    font-size: 10px;
    opacity: 0.8;
    margin-top: 3px;
}

/* FILTROS */

.ventas-filtros {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.filtro-ventas {
    min-width: 115px;
    flex: 1;
    max-width: 155px;
}

.filtro-ventas label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.9;
}

.filtro-ventas .input-group {
    flex-wrap: nowrap;
}

.filtro-ventas .input-group-text,
.filtro-ventas .form-control {
    height: 32px;
    font-size: 11px;
    border: 0;
}

.filtro-ventas .input-group-text {
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
}

.filtro-ventas .form-control {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    min-width: 0;
    border-radius: 0 5px 5px 0;
}

.filtro-ventas select {
    border-radius: 0 5px 5px 0 !important;
}

/* CUERPO DEL GRÁFICO */

.card-ventas-mensuales .card-body {
    flex: 1;
    min-height: 0;
    padding: 12px 15px !important;
}

#graficoCategoriasWrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

#graficoMes {
    width: 100%;
    min-width: 400px;
}

/* RESPONSIVE */

@media (max-width: 991px) {
    .ventas-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ventas-titulo {
        width: 100%;
    }

    .ventas-filtros {
        width: 100%;
        justify-content: flex-start;
    }

    .filtro-ventas {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .ventas-filtros {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filtro-usuario {
        grid-column: 1 / -1;
    }

    .ventas-titulo .card-title {
        font-size: 12px;
    }
}