:root {
  --lubexa-blue: #00B4D8;
  --lubexa-green: #17C3B2;
  --lubexa-teal: #20B2AA;
  --lubexa-dark: #2C3E50;
  --lubexa-light: #F8F9FA;
  --lubexa-border: #D1D5DB;
  --lubexa-gray: #6B7280;
}

html {
  font-size: clamp(12px, 1vw, 14px);
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: clamp(12px, 1vw, 14px);
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #edf4f8 0%, #f7fbfd 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Container Responsive - Márgenes optimizados */
.container-fluid {
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 100%;
}

@media (max-width: 768px) {
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Buttons - Estilo de la referencia */
.btn {
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.btn:focus, .btn:active:focus {
  box-shadow: none;
  outline: none;
}

/* Botones secundarios - estilo blanco con borde */
.btn-outline-secondary,
.btn-secondary {
  background-color: white;
  border: 2px solid var(--lubexa-border);
  color: var(--lubexa-gray);
  font-weight: 500;
}

.btn-outline-secondary:hover,
.btn-secondary:hover {
  background-color: #F9FAFB;
  border-color: var(--lubexa-gray);
  color: var(--lubexa-dark);
}

/* Botón principal verde - como "Guardar cantidades" */
.btn-lubexa-green,
.btn-success {
  background-color: var(--lubexa-green);
  border: 2px solid var(--lubexa-green);
  color: white;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(23, 195, 178, 0.3);
}

.btn-lubexa-green:hover,
.btn-success:hover {
  background-color: #15B5A5;
  border-color: #15B5A5;
  color: white;
  box-shadow: 0 2px 5px rgba(23, 195, 178, 0.4);
}

/* Botón azul */
.btn-lubexa-blue,
.btn-primary {
  background-color: var(--lubexa-blue);
  border: 2px solid var(--lubexa-blue);
  color: white;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 180, 216, 0.3);
}

.btn-lubexa-blue:hover,
.btn-primary:hover {
  background-color: #0096c7;
  border-color: #0096c7;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 180, 216, 0.4);
}

/* Botones pequeños */
.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Lubexa Colors */
.lubexa-blue {
  color: var(--lubexa-blue) !important;
}

.lubexa-green {
  color: var(--lubexa-green) !important;
}

.lubexa-teal {
  color: var(--lubexa-teal) !important;
}

.lubexa-blue-bg {
  background-color: var(--lubexa-blue) !important;
}

.lubexa-green-bg {
  background-color: var(--lubexa-green) !important;
}

.lubexa-teal-bg {
  background-color: var(--lubexa-teal) !important;
}

/* Navbar */
.lubexa-navbar {
  background: linear-gradient(135deg, #11a7c7 0%, #18b0ba 58%, #1bb7ab 100%) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  min-height: 64px;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.16), 0 12px 30px rgba(15, 23, 42, 0.16);
}

.navbar-logo {
  height: 32px;
  width: auto;
  display: block;
}

.lubexa-navbar .navbar-brand {
  color: white !important;
  font-size: 1.25rem;
  font-weight: 700;
  transition: all 0.3s ease;
  padding: 0.3rem 0.55rem;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lubexa-navbar .navbar-brand:hover {
  transform: translateY(-1px);
  background-color: rgba(255, 255, 255, 0.08);
}

.lubexa-navbar .logo-icon {
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
}

.lubexa-navbar .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: all 0.3s ease;
  border-radius: 6px;
}

.lubexa-navbar .nav-link:hover,
.lubexa-navbar .nav-link.active {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.lubexa-navbar .dropdown-menu {
  border: 1px solid rgba(18, 175, 208, 0.15);
  box-shadow: 0 10px 32px rgba(18, 175, 208, 0.12);
  border-radius: 12px;
  margin-top: 0.6rem;
  background: #fff;
  padding: 0.3rem 0;
}

.lubexa-navbar .dropdown-item {
  padding: 0.65rem 1.2rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.93rem;
}

.lubexa-navbar .dropdown-item:hover {
  background-color: rgba(18, 175, 208, 0.08);
  color: #0a7fa1;
  transform: translateX(4px);
}

.lubexa-navbar .dropdown-item i {
  width: 18px;
  text-align: center;
  margin-right: 0.4rem;
  transition: transform 0.25s ease;
}

.lubexa-navbar .dropdown-item:hover i {
  transform: scale(1.1);
}

.creador-nombre {
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1.2;
}

.creador-rol {
  display: inline-flex;
  align-items: center;
  margin-top: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.creador-rol-admin {
  background-color: #fee2e2;
  color: #b91c1c;
}

.creador-rol-usuario {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.creador-rol-ventas {
  background-color: #dcfce7;
  color: #15803d;
}

.creador-rol-repartidor {
  background-color: #f3e8ff;
  color: #7e22ce;
}

.creador-rol-sinrol {
  background-color: #e5e7eb;
  color: #4b5563;
}

.btn-user-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.18) 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: white;
  min-width: 175px;
  max-width: 175px;
  min-height: 44px;
  padding: 0.35rem 0.85rem;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.05;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-user-menu:hover,
.btn-user-menu:focus,
.btn-user-menu.show {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.25) 100%);
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

.btn-user-menu::after {
  margin-left: 0.7rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85rem;
}

.btn-user-menu.show::after {
  transform: rotate(180deg);
}

.btn-user-menu .fw-semibold {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.btn-user-menu .small {
  font-size: 0.71rem;
  opacity: 0.95;
  font-weight: 500;
}

.user-menu-dropdown {
  min-width: 250px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #e0f2f7;
  box-shadow: 0 12px 40px rgba(18, 175, 208, 0.15);
  background: #fff;
  padding: 0.6rem 0;
}

.user-menu-dropdown .dropdown-item {
  padding: 0.75rem 1.3rem;
  border-radius: 10px;
  margin: 0.3rem 0.6rem;
  font-size: 0.95rem;
  color: #1f2937;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.user-menu-dropdown .dropdown-item i {
  width: 20px;
  text-align: center;
  margin-right: 0.8rem;
  transition: transform 0.3s ease, color 0.3s ease;
  color: #0b7aa1;
  font-size: 1.05rem;
}

.user-menu-dropdown .dropdown-item:hover {
  background: linear-gradient(135deg, #b3e5fc 0%, #80deea 100%);
  color: #004d73;
  transform: translateX(6px);
  font-weight: 600;
}

.user-menu-dropdown .dropdown-item:hover i {
  transform: scale(1.25) rotate(10deg);
  color: #00838f;
}

.user-menu-dropdown .dropdown-item.text-danger {
  color: #e63946;
}

.user-menu-dropdown .dropdown-item.text-danger i {
  color: #e63946;
}

.user-menu-dropdown .dropdown-item.text-danger:hover {
  background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
  color: #b71c1c;
}

.user-menu-dropdown .dropdown-item.text-danger:hover i {
  transform: scale(1.25) rotate(-10deg);
  color: #b71c1c;
}

.user-menu-dropdown .dropdown-divider {
  margin: 0.5rem 0.6rem;
  opacity: 0.15;
  border-color: #b3e5fc;
}

/* Navbar Responsive */
@media (max-width: 991px) {
  .lubexa-navbar {
    padding: 0.5rem 0;
  }

  .lubexa-navbar .navbar-collapse {
    margin-top: 1rem;
  }

  .lubexa-navbar .nav-link {
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0;
  }

  .lubexa-navbar .dropdown-menu {
    border: none;
    box-shadow: none;
    background-color: rgba(255, 255, 255, 0.05);
    margin-top: 0;
  }

  .lubexa-navbar .dropdown-item:hover {
    transform: none;
    padding-left: 2rem;
  }
}

@media (max-width: 576px) {
  .lubexa-navbar .navbar-brand {
    font-size: 1.1rem;
  }

  .lubexa-navbar .logo-icon {
    font-size: 1.25rem;
  }

  .btn-user-menu {
    min-width: auto;
    max-width: 145px;
    padding: 0.25rem 0.55rem;
  }

  .btn-user-menu .fw-semibold {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 88px;
  }

  .btn-user-menu .small {
    font-size: 0.68rem;
  }
}

/* Cards - Espaciados optimizados */
.lubexa-card {
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: white;
  transition: box-shadow 0.2s;
  margin-bottom: 0.75rem;
}

.lubexa-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lubexa-card .card-body {
  padding: 1rem;
}

.lubexa-card .card-header {
  padding: 0.75rem 1rem;
  background-color: white;
  border-bottom: 1px solid #E5E7EB;
}

.card-header.bg-white {
  padding: 0.75rem 1rem !important;
}

.card-body.p-0 {
  padding: 0 !important;
}

.lubexa-card-stat {
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: white;
  transition: all 0.2s;
}

.lubexa-card-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lubexa-card-stat .card-body {
  padding: 1.25rem;
}

/* Tables - Espaciados optimizados */
.table {
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0.5rem;
}

.table thead th {
  background-color: #1F2937;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.75rem;
  border: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table thead th:first-child {
  border-top-left-radius: 8px;
}

.table thead th:last-child {
  border-top-right-radius: 8px;
}

.table tbody td {
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
  font-size: 0.9rem;
}

.table-hover tbody tr {
  transition: background-color 0.15s;
}

.table-hover tbody tr:hover {
  background-color: #F9FAFB;
}

/* Row colors - como en la referencia */
.table-success-light {
  background-color: #D1FAE5 !important;
}

.table-danger-light {
  background-color: #FEE2E2 !important;
}

.table-warning-light {
  background-color: #FEF3C7 !important;
}

.table-info-light {
  background-color: #DBEAFE !important;
}

/* Fix para última fila - agregar padding al final de tbody para que no se corte */
.table tbody tr:last-child td {
  padding-bottom: 1rem !important;
}

/* Asegurar que la tabla responsive tenga padding al final */
.table-responsive {
  padding-bottom: 0.5rem;
}

/* Hero Section */
.hero-section {
  background: white;
  border-radius: 10px;
  border: 1px solid #E5E7EB;
}

/* Modal */
.lubexa-modal-header {
  background: linear-gradient(135deg, var(--lubexa-blue) 0%, var(--lubexa-teal) 100%);
  color: white;
  border-radius: 8px 8px 0 0;
}

.lubexa-modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-content {
  border-radius: 10px;
  border: 1px solid #E5E7EB;
}

/* Process Steps */
.process-step .step-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Module Icons */
.module-icon i {
  transition: transform 0.3s;
}

.lubexa-card:hover .module-icon i {
  transform: scale(1.1);
}

/* Form Elements - Estilo limpio de la referencia */
.form-control,
.form-select {
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lubexa-blue);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: var(--lubexa-dark);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.input-group-text {
  background-color: #F9FAFB;
  border: 2px solid #E5E7EB;
  border-right: none;
  color: var(--lubexa-gray);
}

.input-group .form-control {
  border-left: none;
}

.input-group:focus-within .input-group-text {
  border-color: var(--lubexa-blue);
}

.input-group:focus-within .form-control {
  border-color: var(--lubexa-blue);
}

/* Toast Notifications */
.toast-container {
  z-index: 9999;
}

.toast {
  min-width: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
}

/* Responsive Toasts */
@media (max-width: 576px) {
  .toast-container {
    width: 100%;
    padding: 0.75rem !important;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .toast-body {
    font-size: 0.9rem;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hide {
  animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-body {
  padding: 1rem;
  font-size: 0.95rem;
}

.toast.bg-success {
  background-color: #10B981 !important;
}

.toast.bg-danger {
  background-color: #EF4444 !important;
}

.toast.bg-info {
  background-color: #3B82F6 !important;
}

.toast.bg-warning {
  background-color: #F59E0B !important;
}

.toast .btn-close {
  opacity: 0.8;
}

.toast .btn-close:hover {
  opacity: 1;
}

/* ========================================
   RESPONSIVE DESIGN - PRODUCTOS
   ======================================== */

/* Header Responsive */
.productos-header h3 {
  font-size: 1.5rem;
}

@media (max-width: 576px) {
  .productos-header h3 {
    font-size: 1.25rem;
  }
}

/* Badges Personalizados */
.badge-marca {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
}

.badge-tipo {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
}

.badge-presentacion {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
}

/* Tabla de Productos - Desktop */
.productos-table {
  margin-bottom: 0;
}

.productos-table thead th {
  background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
  color: white;
  font-weight: 600;
  padding: 1rem;
  border: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Asegurar que el encabezado se vea sobre el contenido */
.productos-table thead {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Filas con colores sutiles alternados */
.productos-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #E5E7EB;
}

.productos-table tbody tr:nth-child(6n+1) {
  background-color: rgba(239, 246, 255, 0.5); /* Azul muy suave */
}

.productos-table tbody tr:nth-child(6n+2) {
  background-color: rgba(243, 244, 246, 0.5); /* Gris muy suave */
}

.productos-table tbody tr:nth-child(6n+3) {
  background-color: rgba(254, 249, 239, 0.5); /* Amarillo muy suave */
}

.productos-table tbody tr:nth-child(6n+4) {
  background-color: rgba(236, 253, 245, 0.5); /* Verde muy suave */
}

.productos-table tbody tr:nth-child(6n+5) {
  background-color: rgba(253, 242, 248, 0.5); /* Rosa muy suave */
}

.productos-table tbody tr:nth-child(6n+6) {
  background-color: rgba(245, 243, 255, 0.5); /* Púrpura muy suave */
}

.productos-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.1) !important;
  transform: scale(1.005);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.productos-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  font-size: 0.9rem;
  color: #374151;
}

.producto-nombre {
  color: #1F2937;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Cards de Productos - Mobile/Tablet */
.producto-card {
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  transition: all 0.3s ease;
}

.producto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.producto-card .producto-nombre {
  color: #2C3E50;
  font-size: 1rem;
  line-height: 1.4;
}

/* Información de productos en móvil */
.producto-info-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.producto-info-mobile .info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background-color: #F9FAFB;
  border-radius: 6px;
  border-left: 3px solid var(--lubexa-blue);
}

.producto-info-mobile .info-label {
  font-weight: 600;
  color: #6B7280;
  font-size: 0.85rem;
}

.producto-info-mobile .info-value {
  font-weight: 500;
  color: #1F2937;
  font-size: 0.9rem;
}

/* Botones Responsivos */
@media (max-width: 576px) {
  .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  .btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Input de Búsqueda */
.input-group-text {
  border-right: none;
}

.form-control:focus + .input-group-text,
.input-group-text + .form-control:focus {
  border-color: var(--lubexa-blue);
}

/* Empty State */
#emptyState i {
  opacity: 0.3;
}

/* Modales Responsivos */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-lg {
    max-width: 100%;
  }
}

/* Gap utilities for older Bootstrap versions */
.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .producto-card,
  .btn,
  .modal {
    transition: none !important;
  }
}

/* Estilos para checkboxes de selección múltiple */
.form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  border: 2px solid var(--lubexa-border);
}

.form-check-input:checked {
  background-color: var(--lubexa-green);
  border-color: var(--lubexa-green);
}

.form-check-input:hover {
  border-color: var(--lubexa-green);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(23, 195, 178, 0.25);
}

/* Checkbox en la tabla */
.productos-table th input.form-check-input {
  width: 1.3rem;
  height: 1.3rem;
}

/* Checkbox en cards móviles */
.producto-checkbox-mobile {
  flex-shrink: 0;
}

/* Badge contador de seleccionados */
#contadorSeleccionados {
  min-width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Animación para el botón de eliminar seleccionados */
#btnEliminarSeleccionados {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo para filas seleccionadas */
.productos-table tbody tr:has(.producto-checkbox:checked) {
  background-color: rgba(23, 195, 178, 0.1) !important;
}

/* Card seleccionada en móvil */
.producto-card:has(.producto-checkbox-mobile:checked) {
  border-color: var(--lubexa-green) !important;
  background-color: rgba(23, 195, 178, 0.05);
}

/* Responsive para el botón de eliminar seleccionados */
@media (max-width: 576px) {
  #btnEliminarSeleccionados {
    width: 100%;
  }
}
  .productos-table tbody tr {
    transition: none;
  }
}

/* Print styles */
@media print {
  .btn,
  .productos-header,
  .card-header {
    display: none;
  }

  .d-none.d-lg-block {
    display: block !important;
  }

  .d-lg-none {
    display: none !important;
  }
}

/* Modal de Confirmación de Eliminación */
#confirmarEliminarModal .modal-content {
  border-radius: 20px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#confirmarEliminarModal .icon-warning-wrapper {
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

#confirmarEliminarModal .btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

#confirmarEliminarModal .btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

#confirmarEliminarModal .btn-outline-secondary {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
}

#confirmarEliminarModal .alert {
  border-radius: 10px;
  border: none;
  background-color: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
}

#nombreProductoEliminar {
  font-size: 1.1rem;
  color: #ef4444;
}

/* Badges - Estilo moderno */
.badge {
  font-weight: 600;
  padding: 0.4em 0.9em;
  border-radius: 6px;
  font-size: 0.85rem;
}

.badge.bg-primary {
  background-color: var(--lubexa-blue) !important;
}

.badge.bg-success {
  background-color: var(--lubexa-green) !important;
}

.badge.bg-info {
  background-color: var(--lubexa-teal) !important;
}

.badge.bg-secondary {
  background-color: var(--lubexa-gray) !important;
}

/* Card Header */
.card-header {
  border-bottom: 2px solid #F3F4F6;
  background-color: white;
  padding: 1rem 1.25rem;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: 1px solid;
  padding: 0.9rem 1.1rem;
}

.alert-success {
  background-color: #D1FAE5;
  border-color: var(--lubexa-green);
  color: #065F46;
}

.alert-info {
  background-color: #DBEAFE;
  border-color: var(--lubexa-blue);
  color: #1E40AF;
}

.lubexa-toast-container {
  top: 78px !important;
}

.lubexa-toast {
  min-width: 340px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
}

.lubexa-toast .toast-body {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem 1.1rem;
}

.lubexa-toast .btn-close {
  opacity: 0.9;
}

.lubexa-toast.bg-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.lubexa-toast.bg-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.lubexa-toast.bg-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
}

.lubexa-toast.bg-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
}

.lubexa-message-modal {
  border-radius: 24px;
  overflow: hidden;
}

.lubexa-message-modal-header {
  background: linear-gradient(135deg, #0f8fb3 0%, #17c3b2 100%);
  color: #fff;
  padding: 1.2rem 1.4rem;
  border-bottom: none;
}

.lubexa-message-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lubexa-message-text {
  font-size: 1rem;
  line-height: 1.65;
  color: #1f2937;
  font-weight: 500;
}

.modal-backdrop.show {
  opacity: 0.45;
  backdrop-filter: blur(2px);
}

/* Responsive */
@media (max-width: 768px) {
  .lubexa-toast {
    min-width: auto;
    width: calc(100vw - 1.5rem);
  }

  .lubexa-card-stat {
    margin-bottom: 1rem;
  }

  .hero-section {
    padding: 2rem 1rem !important;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* ========================================
   SIDEBAR MENU LATERAL COLAPSABLE
   ======================================== */

/* Ajustar body para el sidebar */
body {
  padding-top: 64px; /* Altura del navbar */
}

/* Navbar ajustado para sidebar */
.lubexa-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: 64px;
}

/* Botón toggle del sidebar para móviles */
.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  width: 260px;
  height: calc(100vh - 64px);
  background: linear-gradient(180deg, #0f86a7 0%, #1492b5 42%, #18abae 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 14px 0 34px rgba(15, 23, 42, 0.14);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s ease;
  z-index: 1020;
  border-right: 1px solid rgba(10, 74, 102, 0.2);
}

/* Sidebar Colapsado - Solo iconos */
.sidebar.collapsed {
  width: 70px;
}

/* Header del sidebar */
.sidebar-header {
  padding: 1rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 60px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

/* Botón de colapsar/expandir */
.sidebar-collapse-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sidebar-collapse-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.16) 100%);
  transform: translateY(-1px);
}

.sidebar-collapse-btn i {
  font-size: 1.1rem;
}

.sidebar-title {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 0;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.3s ease;
  letter-spacing: 0.02em;
}

.sidebar.collapsed .sidebar-title {
  opacity: 0;
  width: 0;
}

/* Menú del sidebar */
.sidebar-menu {
  list-style: none;
  padding: 0.8rem 0.55rem 1rem;
  margin: 0;
}

.sidebar-item {
  margin: 0.22rem 0;
}

/* Enlaces del sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.74rem 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 0;
  position: relative;
  gap: 0.65rem;
  border-radius: 14px;
}

.sidebar-link:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
  color: white;
  transform: translateX(0);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.96);
  color: #0d5d82;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-50%);
  transition: height 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}

.sidebar-link:hover::before,
.sidebar-link.active::before {
  height: 55%;
  opacity: 1;
}

.sidebar-link.active::before {
  background: linear-gradient(180deg, #12afd0 0%, #1fc0b0 100%);
}

.sidebar-link i:first-child {
  width: 28px;
  height: 28px;
  min-width: 28px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-link:hover i:first-child {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-link.active i:first-child {
  background: linear-gradient(135deg, #12afd0 0%, #1fc0b0 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(18, 175, 208, 0.22);
}

.sidebar-link.active .sidebar-text,
.sidebar-link.active .submenu-arrow {
  color: #0d5d82;
}

/* Texto del sidebar */
.sidebar-text {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.3s ease;
  flex: 1;
}

.sidebar.collapsed .sidebar-text {
  opacity: 0;
  width: 0;
}

/* Flecha del submenú */
.submenu-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar.collapsed .submenu-arrow {
  opacity: 0;
  width: 0;
}

.sidebar-item.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
}

/* Submenú */
.sidebar-submenu {
  list-style: none;
  padding: 0.25rem 0.25rem 0.15rem;
  margin: 0.15rem 0 0.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.login-page {
  min-height: 100vh;
  padding-top: 0 !important;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 180, 216, 0.16), transparent 26%),
    radial-gradient(circle at 84% 78%, rgba(23, 195, 178, 0.14), transparent 24%),
    linear-gradient(135deg, #f4fbff 0%, #ffffff 45%, #f8fcff 100%);
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: 1.75rem;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
  align-items: stretch;
}

.login-brand-panel {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.48), transparent 42%),
    linear-gradient(145deg, rgba(216, 244, 252, 0.92) 0%, rgba(237, 250, 249, 0.88) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(215, 231, 245, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 45px rgba(15, 23, 42, 0.06);
}

.login-brand-panel::before,
.login-brand-panel::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.login-brand-panel::before {
  width: 280px;
  height: 280px;
  top: -88px;
  left: -82px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0) 72%);
}

.login-brand-panel::after {
  width: 220px;
  height: 220px;
  right: -62px;
  bottom: -58px;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.14) 0%, rgba(0, 180, 216, 0) 72%);
}

.login-brand-content {
  max-width: 500px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.login-logo {
  height: 64px;
  width: auto;
  margin-bottom: 0;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(18, 50, 74, 0.12);
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.8rem;
  margin-bottom: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #0d5d82;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(18, 50, 74, 0.08);
}

.login-brand-content h1 {
  font-size: 3.2rem;
  color: #12324a;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.login-brand-content p {
  color: #3b4b5c;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 540px;
  line-height: 1.6;
}

.login-feature-list {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.login-feature-item {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #21445f;
  box-shadow: 0 12px 28px rgba(18, 50, 74, 0.08);
}

.login-feature-item i {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.18), rgba(23, 195, 178, 0.22));
  color: #0d6c95;
}

.login-illustration {
  font-size: 7rem;
  color: rgba(0, 180, 216, 0.64);
  text-align: center;
  filter: drop-shadow(0 20px 30px rgba(0, 180, 216, 0.12));
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 251, 255, 0.96) 100%);
  backdrop-filter: blur(10px);
  border-radius: 34px;
  border: 1px solid rgba(226, 236, 247, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 24px 45px rgba(15, 23, 42, 0.05);
}

.login-card {
  width: 100%;
  max-width: 470px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 252, 255, 0.96) 100%);
  border-radius: 28px;
  padding: 2.55rem 2.45rem;
  border: 1px solid rgba(219, 231, 243, 0.98);
  box-shadow: 0 28px 65px rgba(15, 23, 42, 0.12) !important;
}

.login-card-header {
  margin-bottom: 1.25rem;
}

.login-card-kicker {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: #0d6c95;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.login-card h2 {
  font-size: 2.15rem;
  margin-bottom: 0;
  color: #1f2937;
  letter-spacing: -0.02em;
}

.login-card-header p {
  color: #64748b;
  margin-bottom: 0;
}

.login-alert {
  border-radius: 14px;
  margin-bottom: 1.25rem;
}

.login-card .form-label {
  color: #29475f;
  font-weight: 600;
}

.login-input-group {
  position: relative;
}

.login-input-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: #7b91a6;
  pointer-events: none;
  z-index: 2;
}

.login-input-group .form-control {
  min-height: 54px;
  padding-left: 2.9rem;
  padding-right: 3rem;
  border-radius: 16px;
  border: 1px solid #d7e7f5;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
  box-shadow: none;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #7b91a6;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.login-password-toggle:hover,
.login-password-toggle:focus {
  color: #0d6c95;
  outline: none;
}

.login-input-group .form-control:focus {
  border-color: #7dc5e9;
  background: white;
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 215, 0.12);
}

.btn-login {
  background: linear-gradient(135deg, var(--lubexa-blue) 0%, var(--lubexa-green) 100%);
  color: white;
  border: none;
  padding: 0.9rem 1rem;
  font-weight: 600;
  border-radius: 16px;
  box-shadow: 0 16px 28px rgba(14, 165, 215, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-login:hover {
  color: white;
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(14, 165, 215, 0.22);
}

@media (max-width: 992px) {
  .login-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .login-brand-panel {
    display: flex;
    padding: 1.5rem 1rem 1rem;
    min-height: auto;
    border-radius: 24px;
  }

  .login-brand-content {
    max-width: none;
    width: 100%;
    text-align: center;
  }

  .login-logo {
    height: 56px;
  }

  .login-brand-content h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
  }

  .login-illustration {
    font-size: 3rem;
  }

  .login-form-panel {
    padding: 0.5rem 1rem 1.5rem;
    border-radius: 24px;
  }

  .login-card {
    max-width: 100%;
  }
}

.sidebar-item.has-submenu.open .sidebar-submenu {
  max-height: 500px;
}

.sidebar.collapsed .sidebar-submenu {
  display: none;
}

.sidebar-submenu .sidebar-link {
  padding: 0.62rem 0.8rem 0.62rem 2.35rem;
  font-size: 0.84rem;
  border-radius: 14px;
}

.sidebar.collapsed .sidebar-submenu .sidebar-link {
  padding-left: 1rem;
}

/* Tooltip para sidebar colapsado */
.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.85rem 0.5rem;
  gap: 0;
}

.sidebar.collapsed .sidebar-link::before {
  display: none;
}

/* Main content ajustado - Optimizado para aprovechar espacio */
.main-content {
  margin-left: 260px;
  height: calc(100vh - 64px);
  transition: margin-left 0.3s ease;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid rgba(211, 226, 237, 0.9);
  box-shadow: inset 10px 0 20px rgba(15, 23, 42, 0.03);
}

.sidebar.collapsed ~ .main-content {
  margin-left: 70px;
}

/* Container principal sin márgenes excesivos */
.main-container {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(249, 252, 254, 0.96) 100%);
}

.main-container main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* Wrapper para páginas con tablas que necesitan altura completa */
.productos-header {
  flex-shrink: 0;
}

/* Ajustar cards y espaciados generales */
.card.lubexa-card {
  margin-bottom: 0.5rem;
}

/* Cards con tablas que deben ocupar todo el espacio */
.d-none.d-lg-block {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}

.d-none.d-lg-block .card.lubexa-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}

.d-none.d-lg-block .card.lubexa-card .table-responsive {
  flex: 1;
  overflow-y: auto;
}

.row.mb-4 {
  margin-bottom: 0.75rem !important;
}

.row.mb-3 {
  margin-bottom: 0.5rem !important;
}

.row.mt-4 {
  margin-top: 0.75rem !important;
}

.row.mt-3 {
  margin-top: 0.5rem !important;
}

.row.mt-5 {
  margin-top: 1rem !important;
}

/* Table responsive optimizado para usar toda la altura */
.table-responsive {
  max-height: none !important;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  flex: 1;
}

/* Overlay para móviles */
.sidebar-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: calc(100vh - 64px);
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1019;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive - Móviles y tablets */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: 260px !important;
  }

  .sidebar.collapsed .sidebar-text {
    opacity: 1;
    width: auto;
  }

  .sidebar.collapsed .submenu-arrow {
    opacity: 1;
    width: auto;
  }

  .sidebar.collapsed .sidebar-title {
    opacity: 1;
    width: auto;
  }

  .main-content {
    margin-left: 0 !important;
    height: auto;
    min-height: calc(100vh - 64px);
  }

  .sidebar-toggle {
    display: block !important;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .main-container {
    padding-top: 0.75rem !important;
    padding-bottom: 1rem !important;
  }

  .card.lubexa-card {
    border-radius: 12px;
  }

  .table-responsive {
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .modal-dialog {
    margin: 0.75rem;
  }

  .modal-xl,
  .modal-lg {
    max-width: calc(100vw - 1.5rem);
  }

  .modal-footer {
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .modal-footer.justify-content-between {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer.justify-content-between > .btn,
  .modal-footer.justify-content-between > div {
    width: 100%;
  }

  .modal-footer.justify-content-between > div {
    display: flex;
    flex-direction: column;
  }

  .modal-footer.justify-content-between > div .btn {
    width: 100%;
  }

  .ventas-dashboard-card .card-header {
    gap: 0.75rem;
    align-items: flex-start !important;
    flex-direction: column;
  }

  .ventas-dashboard-card .card-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }

  .ventas-dashboard-card .card-header .form-select,
  .ventas-dashboard-card .card-header .btn {
    width: 100%;
  }

  .ventas-kanban-col {
    flex: 0 0 100%;
    width: 100%;
  }

  .kanban-column {
    min-height: auto;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  html {
    font-size: 13px;
  }

  .container-fluid.main-container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .lubexa-navbar .container-fluid {
    gap: 0.75rem;
  }

  .lubexa-navbar .navbar-brand {
    padding: 0.2rem 0.4rem;
  }

  .navbar-logo {
    height: 28px;
  }

  .btn-user-menu {
    min-width: 148px;
    max-width: 148px;
  }

  .btn-user-menu .fw-semibold {
    max-width: 92px;
  }

  .main-container {
    padding-top: 0.85rem !important;
  }

  .row.mb-4 > .col-12 > .d-flex,
  .productos-header .row,
  .card-header .row.align-items-center,
  .card-header > .d-flex {
    row-gap: 0.75rem;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    min-width: 760px;
  }

  .modal-lg,
  .modal-xl {
    max-width: calc(100vw - 2rem);
    margin: 1rem auto;
  }
}

@media (min-width: 992px) and (max-width: 1180px) {
  html {
    font-size: 13px;
  }

  .container-fluid.main-container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .lubexa-navbar .container-fluid {
    gap: 0.75rem;
  }

  .lubexa-navbar .navbar-brand {
    padding: 0.2rem 0.4rem;
  }

  .navbar-logo {
    height: 30px;
  }

  .btn-user-menu {
    min-width: 150px;
    max-width: 150px;
  }

  .btn-user-menu .fw-semibold {
    max-width: 94px;
  }

  .sidebar-menu {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  .sidebar-link {
    padding: 0.68rem 0.72rem;
    font-size: 0.85rem;
    gap: 0.55rem;
  }

  .sidebar-link i:first-child {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }

  .sidebar-submenu .sidebar-link {
    padding-left: 2rem;
  }

  .main-container {
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
  }

  .card-header,
  .card-body {
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }

  .table {
    font-size: 0.86rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.65rem 0.6rem;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .modal-lg,
  .modal-xl {
    max-width: calc(100vw - 2.5rem);
  }

  .login-wrapper {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
    gap: 1rem;
  }

  .login-brand-panel,
  .login-form-panel {
    border-radius: 26px;
  }

  .login-card {
    padding: 2rem 1.75rem;
  }
}

@media (max-width: 767px) {
  html {
    font-size: 13px;
  }

  body {
    overflow-x: hidden;
  }

  .container-fluid.main-container {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .lubexa-navbar {
    min-height: 58px;
    height: auto;
    padding: 0.45rem 0;
  }

  body {
    padding-top: 58px;
  }

  .sidebar {
    top: 58px;
    height: calc(100vh - 58px);
  }

  .sidebar-overlay {
    top: 58px;
    height: calc(100vh - 58px);
  }

  .btn-user-menu {
    max-width: 120px;
    min-height: 38px;
    padding: 0.2rem 0.45rem;
  }

  .btn-user-menu .fw-semibold {
    max-width: 64px;
    font-size: 0.76rem;
  }

  .btn-user-menu .small {
    font-size: 0.62rem;
  }

  .row.mb-4 > .col-12 > .d-flex,
  .productos-header .row,
  .card-header .row.align-items-center {
    row-gap: 0.75rem;
  }

  .card-header,
  .card-body {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .card.lubexa-card,
  .hero-section,
  .lubexa-card-stat,
  .modal-content {
    border-radius: 12px;
  }

  .table-responsive {
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .form-control,
  .form-select,
  .input-group-text {
    min-height: 44px;
    font-size: 0.95rem;
  }

  textarea.form-control {
    min-height: 96px;
  }

  .row.mb-4 .btn,
  .productos-header .btn,
  .card-header .btn,
  .card-header .form-select,
  .card-header .input-group,
  .card-header .badge {
    width: 100%;
  }

  .row.mb-4 .d-flex.flex-column.flex-sm-row,
  .productos-header .d-flex.flex-column.flex-sm-row,
  .card-header .d-flex.flex-column.flex-sm-row {
    width: 100%;
  }

  .row.mb-4 .d-flex.flex-column.flex-sm-row .btn,
  .productos-header .d-flex.flex-column.flex-sm-row .btn,
  .card-header .d-flex.flex-column.flex-sm-row .btn {
    margin-right: 0 !important;
  }

  .table {
    font-size: 0.88rem;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }

  .row.g-3 > [class*='col-'],
  .row.g-2 > [class*='col-'] {
    margin-top: 0.65rem;
  }

  .input-group {
    flex-wrap: nowrap;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    max-height: calc(100vh - 1rem);
    overflow: hidden;
  }

  .modal-body {
    overflow-y: auto;
  }

  .login-form-panel {
    padding: 1rem;
  }

  .login-card {
    padding: 1.5rem 1.1rem;
    border-radius: 18px;
  }

  .login-card h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 575px) {
  html {
    font-size: 12px;
  }

  .container-fluid {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .lubexa-navbar .container-fluid {
    gap: 0.5rem;
  }

  .lubexa-navbar .navbar-brand {
    padding: 0.15rem 0.25rem;
  }

  .navbar-logo {
    height: 24px;
  }

  .sidebar {
    width: min(88vw, 280px) !important;
  }

  .btn {
    font-size: 0.88rem;
    padding: 0.55rem 0.9rem;
  }

  .btn-user-menu {
    max-width: 104px;
    min-height: 36px;
    padding: 0.15rem 0.35rem;
  }

  .btn-user-menu::after {
    margin-left: 0.4rem;
  }

  .btn-user-menu .fw-semibold {
    max-width: 48px;
    font-size: 0.72rem;
  }

  .btn-user-menu .small {
    font-size: 0.58rem;
  }

  .user-menu-dropdown {
    min-width: min(88vw, 220px);
  }

  .modal-body {
    padding: 0.9rem;
  }

  .modal-dialog {
    margin: 0.45rem;
  }

  .modal-content {
    max-height: calc(100vh - 0.9rem);
    border-radius: 14px;
  }

  .main-container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.75rem !important;
  }

  .card-header,
  .card-body {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .row.g-3,
  .row.g-2 {
    --bs-gutter-x: 0.75rem;
  }

  .row.mb-4 > .col-12 > .d-flex,
  .productos-header .row,
  .card-header .row.align-items-center,
  .card-header > .d-flex {
    row-gap: 0.65rem;
  }

  .table {
    font-size: 0.84rem;
  }

  .btn-user-menu {
    max-width: 108px;
  }

  .btn-user-menu .fw-semibold {
    max-width: 54px;
  }

  .badge {
    font-size: 0.78rem;
  }

  .table th,
  .table td {
    padding: 0.55rem 0.6rem;
  }

  .table-responsive table {
    min-width: 640px;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .table-operacion {
    min-width: 980px;
  }

  .operacion-actions-wrap {
    gap: 0.5rem !important;
  }

  .operacion-actions-wrap > div,
  .operacion-actions-wrap > button {
    width: 100%;
  }

  .login-logo {
    height: 48px;
  }

  .login-brand-content h1 {
    font-size: 1.75rem;
  }

  .login-brand-panel,
  .login-form-panel,
  .login-card {
    border-radius: 18px;
  }
}

/* Desktop */
@media (min-width: 992px) {
  .sidebar-toggle {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }

  body {
    padding-top: 64px;
  }

  .lubexa-navbar {
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    min-height: 64px;
    padding: 0.75rem 0;
    border-radius: 0;
  }

  .sidebar {
    top: 64px;
    left: 0;
    width: 260px;
    height: calc(100vh - 64px);
    border-radius: 0;
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.12);
  }

  .sidebar.collapsed {
    width: 70px;
  }

  .main-content {
    margin-left: 260px;
    height: calc(100vh - 64px);
    padding: 0;
  }

  .sidebar.collapsed ~ .main-content {
    margin-left: 70px;
  }
}

/* Scrollbar del sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

