:root {
  --qs-primary: #0f4c81;
  --qs-primary-rgb: 15, 76, 129;
  --qs-secondary: #11151c;
  --qs-secondary-rgb: 17, 21, 28;
  --qs-accent: #3399ff;
  --qs-accent-rgb: 51, 153, 255;
  --qs-success: #24c17c;
  --qs-success-rgb: 36, 193, 124;
  --qs-warning: #f5a524;
  --qs-warning-rgb: 245, 165, 36;
  --qs-light: #f5f9ff;
  --qs-dark: #06090f;
  --qs-brand-font: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --qs-nav-font: 'Roboto Condensed', 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--qs-light);
  color: var(--qs-dark);
}

/* Selector de sucursal: apariencia de botón, sin cursor de texto ni borde de foco */
#sucursalSelector {
  cursor: pointer;
  user-select: none;
}

#sucursalSelector:focus {
  outline: none;
  box-shadow: none;
}

/* Selector de sucursal integrado dentro del navbar */
#sucursalSelectorBar {
  background: linear-gradient(135deg, #ffffff 0%, #e8f0f8 30%, var(--qs-primary) 100%) !important;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  display: block !important;
  border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  cursor: default;
  user-select: none;
  padding-bottom: 0.75rem !important;
  margin-bottom: 0;
}

/* Estilos para filas inactivas en tablas */
.table-row-inactive {
  opacity: 0.65;
  background-color: rgba(0, 0, 0, 0.02) !important;
}

.table-row-inactive:hover {
  opacity: 0.8;
  background-color: rgba(0, 0, 0, 0.04) !important;
}

.table-row-inactive td {
  position: relative;
}

/* Icono de advertencia para entidades inactivas */
.table-row-inactive .bi-exclamation-triangle {
  font-size: 0.9rem;
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

#sucursalSelectorBar > * {
  cursor: default;
  user-select: none;
}

#sucursalSelectorBar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

#sucursalSelectorBar:hover {
  background: linear-gradient(135deg, #ffffff 0%, #dde8f5 30%, var(--qs-primary) 100%) !important;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
}

/* Estilos para el nombre de la sucursal clickeable */
.sucursal-nombre-display {
  user-select: none;
  color: #000000;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.sucursal-nombre-display:hover {
  opacity: 0.8;
}

.sucursal-nombre-display i {
  transition: transform 0.2s ease;
}

.sucursal-nombre-display:hover i {
  transform: translateY(1px);
}

/* Estilos para el modal dropdown de sucursales */
#sucursalModalDropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sucursal-dropdown-list {
  max-height: 300px;
  overflow-y: auto;
}

.sucursal-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
}

.sucursal-dropdown-item:last-child {
  border-bottom: none;
}

.sucursal-dropdown-item:hover {
  background-color: rgba(15, 76, 129, 0.08);
  color: var(--qs-primary);
}

.sucursal-dropdown-item.active {
  background-color: rgba(15, 76, 129, 0.12);
  color: var(--qs-primary);
  font-weight: 600;
}

.sucursal-item-nombre {
  flex: 1;
  font-size: 0.9rem;
}

.sucursal-dropdown-item i {
  font-size: 1rem;
  color: var(--qs-primary);
}

/* Scrollbar personalizado para el dropdown */
.sucursal-dropdown-list::-webkit-scrollbar {
  width: 6px;
}

.sucursal-dropdown-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sucursal-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(15, 76, 129, 0.3);
  border-radius: 3px;
}

.sucursal-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 76, 129, 0.5);
}

#sucursalSelectorBar i {
  font-size: 1.15rem;
  color: #000000;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  transition: transform 0.2s ease, color 0.2s ease;
}

#sucursalSelectorBar:hover i {
  transform: scale(1.05);
  color: #000000;
  opacity: 1;
}

#sucursalSelectorBar span {
  color: #000000 !important;
  opacity: 0.85;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: default;
  user-select: none;
}

#sucursalSelectorBar:hover span {
  opacity: 1;
}

#sucursalSelectorBar i {
  cursor: default;
  user-select: none;
}

/* ==================== NUEVO DISEÑO INSPIRADO EN BSALE ==================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(to right, #225a8a 0%, #225a8a 50%, #fafafb 50%, #fafafb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1060;
  overflow: hidden;
  user-select: none; /* Evitar selección de texto en toda la pantalla de login */
}

/* Evitar que otros elementos reciban foco o muestren cursor de edición */
.auth-overlay * {
  cursor: default;
  outline: none;
  user-select: none;
}

/* Asegurar que los íconos se muestren correctamente */
.auth-overlay i,
.auth-overlay .bi,
.auth-overlay .bi-check-circle,
.auth-overlay .bi-check-circle::before,
.auth-overlay .auth-feature-item i {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  cursor: default;
  font-family: "bootstrap-icons" !important;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: -.125em;
}

/* Permitir selección y foco solo en los inputs del formulario */
.auth-overlay input[type="email"],
.auth-overlay input[type="password"],
.auth-overlay input[type="text"],
.auth-overlay input[type="email"]:focus,
.auth-overlay input[type="password"]:focus,
.auth-overlay input[type="text"]:focus {
  user-select: text !important;
  cursor: text !important;
}

/* Restaurar cursor para botones */
.auth-overlay button,
.auth-overlay button:focus {
  cursor: pointer !important;
  user-select: none;
}

/* Permitir outline solo en inputs cuando tienen foco */
.auth-overlay input[type="email"]:focus,
.auth-overlay input[type="password"]:focus,
.auth-overlay input[type="text"]:focus {
  outline: 2px solid #4a5568 !important;
  outline-offset: 2px;
}

.auth-container-new {
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  background: #fafafb;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border-radius: 0;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.auth-sidebar {
  flex: 0 0 45%;
  background: #225a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-radius: 0 30px 30px 0;
}

.auth-sidebar::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: transparent; /* Eliminado gradiente para color uniforme */
  animation: rotate 20s linear infinite;
}

.auth-sidebar::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: transparent; /* Eliminado gradiente para color uniforme */
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(20px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.auth-sidebar-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.auth-logo-container-new {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.auth-logo-image {
  width: 180px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.auth-logo-text {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
}

.auth-sidebar-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  line-height: 1.3;
  color: #ffffff;
}

.auth-sidebar-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  opacity: 0.95;
  margin: 0 0 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.95);
}

.auth-feature-item i {
  font-size: 1.25rem;
  color: #ffffff;
}

.auth-form-panel {
  flex: 0 0 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2.5rem;
  background: #fafafb;
  overflow: hidden;
  position: relative;
}

.auth-form-panel::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: transparent; /* Eliminado gradiente para color uniforme */
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.auth-form-panel::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -150px;
  width: 400px;
  height: 400px;
  background: transparent; /* Eliminado gradiente para color uniforme */
  border-radius: 50%;
  animation: float 10s ease-in-out infinite reverse;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: #fafafb; /* Color uniforme igual al fondo del panel */
  backdrop-filter: none; /* Eliminado para evitar variaciones */
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.auth-form-header {
  margin-bottom: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.auth-form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.auth-form-subtitle {
  font-size: 0.875rem;
  color: #718096;
  margin: 0;
}

.auth-form-new {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.form-group-new {
  margin-bottom: 1rem;
}

.form-label-new {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: #718096;
  font-size: 1.125rem;
  z-index: 1;
  transition: all 0.3s ease;
}

.form-input-new:focus ~ .input-icon {
  color: #4a5568;
  transform: scale(1.05);
}

.input-wrapper:focus-within .input-icon {
  color: #4a5568;
  transform: scale(1.05);
}

.form-input-new {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #fafafb; /* Color uniforme sin gradiente */
  color: #2d3748;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-input-new:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.form-input-new:focus {
  outline: 2px solid #4a5568;
  outline-offset: 2px;
  border-color: #4a5568;
  box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  background: #ffffff; /* Blanco para el input cuando tiene foco */
  transform: translateY(-1px);
  cursor: text;
}

.form-input-new::placeholder {
  color: #a0aec0;
}

.alert-danger-new {
  padding: 0.75rem 1rem;
  background: #fed7d7;
  border: 1px solid #fc8181;
  border-radius: 8px;
  color: #c53030;
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.btn-login-new {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #2d3748;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(45, 55, 72, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-login-new::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-login-new:hover::before {
  left: 100%;
}

.btn-login-new:hover {
  background: #1a202c;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 55, 72, 0.3);
}

.btn-login-new:active {
  transform: translateY(0);
}

.btn-login-new i {
  transition: transform 0.2s ease;
}

.btn-login-new:hover i {
  transform: translateX(4px);
}


/* Responsive */
/* Tablets */
@media (max-width: 992px) {
  .auth-overlay {
    padding: 1rem;
    align-items: flex-start;
    background: linear-gradient(to bottom, #225a8a 0%, #225a8a 40%, #fafafb 40%, #fafafb 100%);
  }

  .auth-container-new {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    max-height: none;
    border-radius: 12px;
    overflow-y: auto;
  }

  .auth-sidebar {
    flex: 0 0 auto;
    width: 100%;
    padding: 2rem 1.5rem;
    min-height: auto;
    border-radius: 12px 12px 0 0;
  }

  .auth-sidebar-content {
    max-width: 100%;
  }

  .auth-logo-container-new {
    margin-bottom: 1.25rem;
  }

  .auth-logo-image {
    width: 140px;
    max-height: 140px;
  }

  .auth-logo-text {
    font-size: 2rem;
  }

  .auth-sidebar-title {
    font-size: 1.5rem;
  }

  .auth-sidebar-description {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .auth-form-panel {
    flex: 0 0 auto;
    width: 100%;
    padding: 2rem 1.5rem;
    align-items: center;
  }

  .auth-form-wrapper {
    max-width: 100%;
    max-height: none;
    padding: 1.5rem;
  }

  .auth-form-title {
    font-size: 1.625rem;
  }
}

/* Móviles */
@media (max-width: 768px) {
  .auth-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(to bottom, #225a8a 0%, #225a8a 30%, #fafafb 30%, #fafafb 100%);
  }

  .auth-container-new {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  .auth-sidebar {
    padding: 1.5rem 1rem;
    min-height: auto;
    flex: 0 0 auto;
    border-radius: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .auth-logo-container-new {
    margin-bottom: 1rem;
    gap: 0.75rem;
  }

  .auth-logo-image {
    width: 120px;
    max-width: 120px;
    height: auto;
    max-height: 120px;
  }

  .auth-logo-text {
    font-size: 1.875rem;
  }

  .auth-sidebar-title {
    font-size: 1.125rem;
    margin-bottom: 0.625rem;
    line-height: 1.4;
  }

  .auth-sidebar-description {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
  }

  .auth-features {
    gap: 0.75rem;
    margin-top: 0.5rem;
  }

  .auth-feature-item {
    font-size: 0.875rem;
    padding: 0.375rem 0;
  }

  .auth-form-panel {
    padding: 2rem 1rem;
    align-items: flex-start;
    justify-content: flex-start;
    flex: 1 1 auto;
    overflow: visible;
    display: flex;
    min-height: 0;
  }

  .auth-form-wrapper {
    max-width: 100%;
    width: 100%;
    padding: 1.75rem;
    margin-top: 0.75rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .auth-form-title {
    font-size: 1.625rem;
  }

  .auth-form-subtitle {
    font-size: 0.9375rem;
  }

  .auth-form-header {
    margin-bottom: 2rem;
  }

  .form-group-new {
    margin-bottom: 1.25rem;
  }

  .form-input-new {
    padding: 0.875rem 1.125rem 0.875rem 2.75rem;
    font-size: 16px; /* Evita zoom en iOS */
  }

  .btn-login-new {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    margin-top: 1rem;
  }
}

@media (max-width: 576px) {
  .auth-overlay {
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(to bottom, #225a8a 0%, #225a8a 28%, #fafafb 28%, #fafafb 100%);
  }

  .auth-container-new {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
  }

  .auth-sidebar {
    padding: 1.25rem 0.875rem;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .auth-logo-container-new {
    margin-bottom: 0.875rem;
  }

  .auth-logo-image {
    width: 110px;
    max-width: 110px;
    height: auto;
    max-height: 110px;
  }

  .auth-logo-text {
    font-size: 1.625rem;
  }

  .auth-sidebar-title {
    font-size: 1.0625rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }

  .auth-sidebar-description {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  .auth-features {
    gap: 0.625rem;
    margin-top: 0.375rem;
  }

  .auth-feature-item {
    font-size: 0.8125rem;
    gap: 0.5rem;
    padding: 0.25rem 0;
  }

  .auth-feature-item i {
    font-size: 1rem;
  }

  .auth-form-panel {
    padding: 1.5rem 0.875rem;
    flex: 1 1 auto;
    overflow: visible;
    min-height: 0;
  }

  .auth-form-wrapper {
    padding: 1.5rem;
    margin-top: 0.5rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .auth-form-title {
    font-size: 1.5rem;
  }

  .auth-form-subtitle {
    font-size: 0.875rem;
  }

  .auth-form-header {
    margin-bottom: 1.75rem;
  }

  .form-group-new {
    margin-bottom: 1.125rem;
  }

  .btn-login-new {
    padding: 0.9375rem 1.25rem;
    font-size: 0.9375rem;
    margin-top: 0.75rem;
  }
}

/* Móviles muy pequeños (Redmi A1, etc.) */
@media (max-width: 400px) {
  .auth-overlay {
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(to bottom, #225a8a 0%, #225a8a 25%, #fafafb 25%, #fafafb 100%);
  }

  .auth-container-new {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .auth-sidebar {
    padding: 1rem 0.75rem;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: visible;
  }

  .auth-logo-container-new {
    margin-bottom: 0.75rem;
  }

  .auth-logo-image {
    width: 100px;
    max-width: 100px;
    height: auto;
    max-height: 100px;
  }

  .auth-logo-text {
    font-size: 1.5rem;
  }

  .auth-sidebar-title {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }

  .auth-sidebar-description {
    font-size: 0.75rem;
    margin-bottom: 0.875rem;
    line-height: 1.5;
  }

  .auth-features {
    gap: 0.5rem;
    margin-top: 0.25rem;
  }

  .auth-feature-item {
    font-size: 0.75rem;
    gap: 0.375rem;
    padding: 0.25rem 0;
  }

  .auth-feature-item i {
    font-size: 0.875rem;
  }

  .auth-form-panel {
    padding: 1.25rem 0.75rem;
    flex: 1 1 auto;
    overflow: visible;
    min-height: 0;
  }

  .auth-form-wrapper {
    padding: 1.25rem;
    border-radius: 16px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .auth-form-title {
    font-size: 1.375rem;
  }

  .auth-form-subtitle {
    font-size: 0.8125rem;
  }

  .auth-form-header {
    margin-bottom: 1.5rem;
  }

  .form-group-new {
    margin-bottom: 1rem;
  }

  .form-input-new {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 16px;
  }

  .btn-login-new {
    padding: 0.875rem 1.125rem;
    font-size: 0.875rem;
    width: 100%;
    margin-top: 0.75rem;
  }
}
/* ==================== FIN NUEVO DISEÑO ==================== */

#appShell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#appShell main {
  flex: 1 1 auto;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.stats-card {
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(var(--qs-secondary-rgb), 0.08);
  position: relative;
  overflow: hidden;
}

.stats-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(var(--qs-primary-rgb), 0.1),
    rgba(var(--qs-accent-rgb), 0.08)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stats-card:hover::after {
  opacity: 1;
}

.stats-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.25rem;
}

.highlight-card {
  border-radius: 1rem;
  background: linear-gradient(
    135deg,
    rgba(var(--qs-primary-rgb), 0.15),
    rgba(var(--qs-accent-rgb), 0.12)
  );
  padding: 1.5rem;
  height: 100%;
}

.highlight-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.chart-card canvas {
  width: 100%;
  height: 100%;
}

.chart-card .card-body {
  min-height: 320px;
}

.dashboard-hero .btn {
  align-self: center;
}

.navbar {
  background: linear-gradient(135deg, var(--qs-primary) 0%, #0a3d6b 50%, var(--qs-secondary) 100%) !important;
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding-top: 1.25rem;
  padding-bottom: 0;
  overflow-x: auto;
  overflow-y: visible !important;
  overflow: visible !important;
  width: 100%;
  min-height: 80px;
  max-height: none !important;
  height: auto !important;
  border-bottom: none;
  backdrop-filter: blur(10px);
}

.navbar .container-fluid {
  display: flex;
  align-items: flex-start; /* Logo y opciones alineados en la parte superior */
  padding-left: 1rem;
  padding-right: 1rem;
  overflow-x: auto;
  overflow-y: visible !important;
  overflow: visible !important;
  width: 100%;
  max-width: 100%;
  max-height: none !important;
  flex-wrap: nowrap;
  position: relative;
  gap: 1.5rem;
}

.navbar-brand {
  font-family: var(--qs-brand-font);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff !important;
  text-transform: uppercase;
  font-size: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 0;
  padding: 0.25rem 0;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.9;
}

#navbarNav {
  flex: 1;
  overflow-x: auto;
  overflow-y: visible !important;
  overflow: visible !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: static;
  max-height: none !important;
}

.navbar-nav-compact {
  flex-wrap: nowrap;
  gap: 0.15rem;
  align-items: center;
  overflow-x: auto;
  overflow-y: visible !important;
  overflow: visible !important;
  flex: 1;
  min-width: 0;
  position: static;
  max-height: none !important;
  margin-left: 0.5rem;
}

#navUserArea {
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 0.5rem;
}

#navUserArea .text-end {
  min-width: 0;
}

#btnLogout {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.btn-primary {
  background-color: var(--qs-primary);
  border-color: var(--qs-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #0c3a63;
  border-color: #0c3a63;
}

.btn-outline-primary {
  color: var(--qs-primary);
  border-color: var(--qs-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--qs-primary);
  color: #ffffff;
  border-color: var(--qs-primary);
}

.text-primary {
  color: var(--qs-primary) !important;
}

.text-info {
  color: var(--qs-accent) !important;
}

.bg-primary-subtle {
  background-color: rgba(var(--qs-primary-rgb), 0.14) !important;
  color: var(--qs-primary) !important;
}

.bg-info-subtle {
  background-color: rgba(var(--qs-accent-rgb), 0.18) !important;
  color: #8a5a00 !important;
}

#mainNav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible !important;
  overflow: visible !important;
  max-width: 100%;
  max-height: none !important;
  min-width: 0;
  position: static;
}

#mainNav .nav-link {
  font-family: var(--qs-nav-font);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  position: relative;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  white-space: nowrap;
  line-height: 1.2;
}

#mainNav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

#mainNav .nav-link.active {
  color: #ffffff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
}

#mainNav .nav-link::after {
  display: none;
}

.navbar-nav .nav-item {
  display: flex;
  align-items: center;
  position: relative;
}

.navbar .dropdown {
  position: relative;
}

.navbar .dropdown-toggle[aria-expanded="true"] + .dropdown-menu,
.navbar .dropdown-toggle[aria-expanded="true"] ~ .dropdown-menu {
  display: block !important;
}

.navbar .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  padding: 0.5rem 0;
  z-index: 1060;
  max-height: none;
  overflow: visible;
}

.navbar .dropdown-menu.show,
.navbar .dropdown.show .dropdown-menu,
.navbar .dropdown.show > .dropdown-menu,
.navbar .dropdown[aria-expanded="true"] .dropdown-menu {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.navbar .dropdown-item {
  color: #333333;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.navbar .dropdown-item:visited {
  color: #333333 !important;
}

.navbar .dropdown-item.active {
  color: #333333 !important;
  background-color: transparent !important;
}

.navbar .dropdown-item.active:hover {
  background: rgba(15, 76, 129, 0.1) !important;
  color: var(--qs-primary) !important;
}

.navbar .dropdown-item:hover {
  background: rgba(15, 76, 129, 0.1);
  color: var(--qs-primary);
}

.navbar .dropdown-item:hover:visited {
  background: rgba(15, 76, 129, 0.1);
  color: var(--qs-primary) !important;
}

.navbar .dropdown-item i {
  width: 18px;
  text-align: center;
}

#navUserArea {
  display: none;
}

.app-authenticated #navUserArea {
  display: flex !important;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card {
  border: none;
  border-radius: 1rem;
}

.card .table thead th {
  border-top: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: #6c757d;
}

.list-materias {
  max-height: 360px;
  overflow-y: auto;
  border-radius: 0.75rem;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.list-materias .list-group-item {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: grab;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.list-materias .list-group-item:last-child {
  border-bottom: none;
}

.list-materias .list-group-item:hover {
  background-color: rgba(var(--qs-primary-rgb), 0.12);
  transform: translateX(4px);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.6);
}

.materia-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background-color: rgba(var(--qs-primary-rgb), 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.materia-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone {
  background: repeating-linear-gradient(
      45deg,
      rgba(var(--qs-secondary-rgb), 0.05),
      rgba(var(--qs-secondary-rgb), 0.05) 10px,
      rgba(0, 0, 0, 0) 10px,
      rgba(0, 0, 0, 0) 20px
    ),
    linear-gradient(135deg, rgba(var(--qs-primary-rgb), 0.06), rgba(var(--qs-accent-rgb), 0.06));
  border: 2px dashed rgba(var(--qs-primary-rgb), 0.45);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone.active {
  border-color: var(--qs-success);
  background: rgba(43, 182, 115, 0.1);
}

.ingrediente-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 20px rgba(var(--qs-secondary-rgb), 0.08);
}

.ingrediente-card .btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background-color: rgba(var(--qs-secondary-rgb), 0.1);
  color: var(--qs-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ingrediente-card .btn-icon:hover {
  background-color: var(--qs-secondary);
  color: #ffffff;
}

.badge-soft {
  padding: 0.35rem 0.75rem;
  border-radius: 50rem;
  font-weight: 600;
}

.badge-soft-success {
  background-color: rgba(var(--qs-success-rgb), 0.18);
  color: var(--qs-success);
}

.badge-soft-warning {
  background-color: rgba(var(--qs-warning-rgb), 0.18);
  color: var(--qs-warning);
}

.badge-soft-danger {
  background-color: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.toast-success {
  border-left: 4px solid var(--qs-success);
}

.toast-error {
  border-left: 4px solid #dc3545;
}

.toast-info {
  border-left: 4px solid var(--qs-accent);
}

.app-footer {
  background: var(--qs-secondary);
  color: rgba(255, 255, 255, 0.8);
  padding: 2.5rem 0;
}

.app-footer .text-muted {
  color: rgba(255, 255, 255, 0.65) !important;
}

.app-footer h5,
.app-footer h6 {
  color: #ffffff;
}

.app-footer a {
  color: inherit;
}

.report-summary {
  background: rgba(var(--qs-primary-rgb), 0.1);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.report-summary-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--qs-secondary);
}

.report-summary-item p {
  margin: 0;
  font-size: 0.85rem;
  color: #0f253c;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.report-card {
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 10px 30px rgba(var(--qs-secondary-rgb), 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.report-card-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.report-card-meta {
  font-size: 0.85rem;
  color: #6c7a89;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.report-metric {
  background: rgba(var(--qs-primary-rgb), 0.06);
  border-radius: 0.75rem;
  padding: 1rem;
}

.report-metric h5 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--qs-secondary);
}

.report-metric p {
  margin: 0;
  font-size: 0.85rem;
  color: #0f253c;
}

.report-periods {
  border-top: 1px dashed rgba(var(--qs-primary-rgb), 0.2);
  padding-top: 1rem;
}

.report-periods h6 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--qs-secondary);
}

.report-periods ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: #0f253c;
}

@media (max-width: 991.98px) {
  .navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .navbar .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .navbar-brand {
    order: 1;
    margin-right: auto;
    flex-shrink: 0;
  }

  .navbar-toggler {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.375rem 0.625rem;
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
  }

  /* Permitir que Bootstrap controle el collapse correctamente */
  #navbarNav.collapse:not(.show) {
    display: none !important;
  }
  
  #navbarNav.collapse.show {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  #navUserArea {
    display: none !important;
  }

  .navbar .navbar-nav {
    width: 100%;
    gap: 0.5rem !important;
  }

  #mainNav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
  }

  #mainNav .nav-item {
    width: 100%;
  }

  #mainNav .nav-link {
    width: 100%;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  #mainNav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
  }

  #mainNav .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.3);
  }

  #mainNav .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.125rem;
    flex-shrink: 0;
  }

  #mainNav .nav-link span {
    flex: 1;
  }

  /* Dropdowns en móvil */
  .navbar .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    margin-top: 0.5rem;
    margin-left: 0;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    padding: 0.5rem 0;
    border-radius: 8px;
  }

  .navbar .dropdown-item {
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    border-radius: 6px;
    margin: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .navbar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
  }

  .navbar .dropdown-item i {
    width: 22px;
    text-align: center;
    font-size: 1.125rem;
    flex-shrink: 0;
  }
}

  #mainNav .nav-link::after {
    bottom: 10px;
    background: var(--qs-primary);
  }

  #mainNav .nav-link::after {
    display: none;
  }

  #cardTotalProduccion:hover,
  #cardTotalCosto:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
  }

  #cardTotalProduccion:active,
  #cardTotalCosto:active {
    transform: translateY(-2px);
  }

  .section-header {
    align-items: stretch;
  }

  .dashboard-hero {
    gap: 1rem;
  }

  .stats-card {
    padding: 1.25rem;
  }

  .chart-card .card-body {
    min-height: 260px;
  }

  .app-footer {
    text-align: center;
  }

  .app-footer .border-top {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Estilos originales comentados - ver sección de estilos originales arriba */
}

/* Botón flotante de calculadora - Flotante */
#btnCalculadora.btn-calculadora,
button#btnCalculadora.btn-calculadora,
button.btn-calculadora#btnCalculadora {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  min-height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  background: var(--qs-primary) !important;
  background-color: var(--qs-primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50% !important;
  font-size: 20px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
              0 4px 10px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.3s ease !important;
  z-index: 9999 !important;
  margin: 0 !important;
  padding: 0 !important;
  top: auto !important;
  left: auto !important;
  line-height: 1 !important;
  text-align: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

/* Ocultar calculadora en página de login */
#authOverlay:not(.d-none) ~ #btnCalculadora,
body:has(#authOverlay:not(.d-none)) #btnCalculadora {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#btnCalculadora.btn-calculadora:hover,
button#btnCalculadora.btn-calculadora:hover,
button.btn-calculadora#btnCalculadora:hover {
  background: var(--qs-accent) !important;
  background-color: var(--qs-accent) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5),
              0 6px 14px rgba(0, 0, 0, 0.4) !important;
  transform: translateY(-3px) !important;
}

#btnCalculadora.btn-calculadora:active,
button#btnCalculadora.btn-calculadora:active,
button.btn-calculadora#btnCalculadora:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Panel de calculadora - Estilo modal redondo */
.calculadora-panel {
  position: fixed !important;
  bottom: 100px !important;
  right: 30px !important;
  width: 220px !important;
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  border: 1px solid #333 !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
  z-index: 1060 !important; /* Mayor que modales de Bootstrap (1050) */
  display: none !important;
  overflow: hidden !important;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  user-select: none !important;
  transform: translate(0, 0) !important;
}

.calculadora-panel.show {
  display: block !important;
}

.calculadora-panel.dragging {
  cursor: grabbing;
  transition: none;
  /* CRÍTICO: Forzar que bottom y right no se usen durante el arrastre */
  /* Esto previene el estiramiento cuando bottom y top están activos simultáneamente */
  bottom: unset !important;
  right: unset !important;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.calculadora-header {
  background: #0f0f0f !important;
  background-color: #0f0f0f !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid #333 !important;
  cursor: grab !important;
  user-select: none !important;
  border-radius: 16px 16px 0 0 !important;
}

.calculadora-header:active {
  cursor: grabbing;
}

.calculadora-title {
  font-weight: 500 !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  flex: 1 !important;
}

.btn-cerrar-calculadora {
  background: transparent !important;
  border: none !important;
  color: #999 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  transition: all 0.2s !important;
  line-height: 1 !important;
  margin-left: 8px !important;
}

.btn-cerrar-calculadora:hover {
  background: #333 !important;
  color: #fff !important;
}

.calculadora-body {
  padding: 10px !important;
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
}

.calculadora-display {
  margin-bottom: 10px !important;
}

.calculadora-input {
  width: 100% !important;
  height: 40px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  text-align: right !important;
  border: 1px solid #333 !important;
  border-radius: 5px !important;
  padding: 0 10px !important;
  background: #0f0f0f !important;
  background-color: #0f0f0f !important;
  color: #ffffff !important;
  outline: none !important;
  transition: border-color 0.2s !important;
  font-family: 'Courier New', monospace !important;
}

.calculadora-input:focus {
  border-color: #555 !important;
}

.calculadora-buttons {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 5px !important;
}

.calc-btn {
  height: 32px !important;
  border: 1px solid #333 !important;
  border-radius: 5px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.calc-btn-number {
  background: #2a2a2a !important;
  background-color: #2a2a2a !important;
  color: #ffffff !important;
  border-color: #333 !important;
}

.calc-btn-number:hover {
  background: #333 !important;
  border-color: #444 !important;
}

.calc-btn-operator {
  background: #252525 !important;
  background-color: #252525 !important;
  color: #ffffff !important;
  border-color: #333 !important;
}

.calc-btn-operator:hover {
  background: #333 !important;
  border-color: #444 !important;
}

.calc-btn-clear {
  background: #3a3a3a !important;
  background-color: #3a3a3a !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

.calc-btn-clear:hover {
  background: #4a4a4a !important;
  border-color: #555 !important;
}

.calc-btn-equals {
  background: #0f4c81 !important;
  background-color: #0f4c81 !important;
  color: #ffffff !important;
  border-color: #1a5a9a !important;
  grid-column: span 2 !important;
}

.calc-btn-equals:hover {
  background: #0d3d6b !important;
  border-color: #1a5a9a !important;
}

.calc-btn-zero {
  grid-column: span 1;
}

/* Responsive para calculadora */
/* Responsive adjustments para botón calculadora */
@media (max-width: 768px) {
  .btn-calculadora {
    bottom: 20px !important;
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
  }

  .calculadora-panel {
    bottom: 80px !important;
    right: 20px !important;
    width: 190px !important;
    max-height: 260px !important;
    overflow: hidden !important;
  }

  .calculadora-header {
    padding: 5px 8px !important;
    min-height: 28px !important;
  }

  .calculadora-title {
    font-size: 9px !important;
  }

  .calculadora-body {
    padding: 6px !important;
  }

  .calculadora-display {
    margin-bottom: 6px !important;
  }

  .calculadora-input {
    height: 30px !important;
    font-size: 13px !important;
    padding: 0 6px !important;
  }

  .calculadora-buttons {
    gap: 3px !important;
  }

  .calc-btn {
    height: 24px !important;
    font-size: 10px !important;
    min-height: 24px !important;
  }

  .btn-cerrar-calculadora {
    font-size: 11px !important;
    padding: 1px 4px !important;
  }
}

@media (max-width: 576px) {
  .btn-calculadora {
    bottom: 15px !important;
    right: 15px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 16px !important;
  }

  .calculadora-panel {
    width: 170px !important;
    bottom: 70px !important;
    right: 15px !important;
    max-height: 240px !important;
    overflow: hidden !important;
  }

  .calculadora-header {
    padding: 4px 6px !important;
    min-height: 24px !important;
  }

  .calculadora-title {
    font-size: 8px !important;
  }

  .calculadora-body {
    padding: 5px !important;
  }

  .calculadora-display {
    margin-bottom: 5px !important;
  }

  .calculadora-input {
    height: 28px !important;
    font-size: 12px !important;
    padding: 0 5px !important;
  }

  .calculadora-buttons {
    gap: 2px !important;
  }

  .calc-btn {
    height: 22px !important;
    font-size: 9px !important;
    min-height: 22px !important;
  }

  .btn-cerrar-calculadora {
    font-size: 10px !important;
    padding: 1px 3px !important;
  }
}

/* Botón extra pequeño */
.btn-xs {
  padding: 0.15rem 0.4rem !important;
  font-size: 0.75rem !important;
  line-height: 1.3 !important;
  border-radius: 0.25rem !important;
}

/* Botón actualizar estado - más pequeño con texto en dos líneas */
.btn-actualizar-estado {
  padding: 0.1rem 0.3rem !important;
  font-size: 0.7rem !important;
  line-height: 1.1 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  text-align: center !important;
  min-width: 60px !important;
  max-width: 70px !important;
  height: auto !important;
}

/* Botón eliminar producción - pequeño solo con icono */
.btn-eliminar-produccion {
  padding: 0.15rem 0.35rem !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
  width: 28px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  max-width: 28px !important;
}

.btn-eliminar-produccion i {
  font-size: 0.85rem !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ajustes de columnas en tabla de producción */
#tablaProduccion {
  table-layout: fixed;
  width: 100%;
}

/* Estilos para drag and drop de columnas */
.column-draggable {
  position: relative;
  cursor: move;
  user-select: none;
  transition: background-color 0.2s ease;
}

.column-draggable:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.column-draggable.dragging {
  opacity: 0.5;
  background-color: rgba(15, 76, 129, 0.1) !important;
}

.column-content {
  display: inline-block;
  margin-right: 0.5rem;
}

.column-drag-handle {
  display: inline-block;
  color: #6c757d;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: grab;
}

.column-draggable:hover .column-drag-handle {
  opacity: 1;
}

.column-draggable:active .column-drag-handle {
  cursor: grabbing;
}

/* Anchos de columnas por clase */
#tablaProduccion th[data-column="fecha"],
#tablaProduccion td.col-fecha {
  width: 10%;
  min-width: 100px;
  white-space: nowrap;
}

#tablaProduccion th[data-column="producto"],
#tablaProduccion td.col-producto {
  width: 25%;
  min-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tablaProduccion th[data-column="formula"],
#tablaProduccion td.col-formula {
  width: 25%;
  min-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tablaProduccion th[data-column="cantidad"],
#tablaProduccion td.col-cantidad {
  width: 10%;
  min-width: 80px;
}

#tablaProduccion th[data-column="etapa"],
#tablaProduccion td.col-etapa {
  width: 18%;
  min-width: 140px;
}

#tablaProduccion th[data-column="acciones"],
#tablaProduccion td.col-acciones {
  width: 12%;
  min-width: 100px;
  max-width: 120px;
}

/* Responsive para móviles y tablets */
@media (max-width: 992px) {
  #tablaProduccion {
    table-layout: auto;
    min-width: 800px;
  }

  #tablaProduccion th[data-column],
  #tablaProduccion td {
    min-width: 120px;
  }

  #tablaProduccion th[data-column="fecha"],
  #tablaProduccion td.col-fecha {
    min-width: 100px;
  }

  #tablaProduccion th[data-column="producto"],
  #tablaProduccion td.col-producto {
    min-width: 140px;
  }

  #tablaProduccion th[data-column="formula"],
  #tablaProduccion td.col-formula {
    min-width: 140px;
  }

  #tablaProduccion th[data-column="cantidad"],
  #tablaProduccion td.col-cantidad {
    min-width: 80px;
  }

  #tablaProduccion th[data-column="etapa"],
  #tablaProduccion td.col-etapa {
    min-width: 130px;
  }

  #tablaProduccion th[data-column="acciones"],
  #tablaProduccion td.col-acciones {
    min-width: 90px;
  }
}

@media (max-width: 768px) {
  #tablaProduccion {
    min-width: 700px;
  }

  .column-drag-handle {
    display: none;
  }

  #tablaProduccion th[data-column],
  #tablaProduccion td {
    font-size: 0.875rem;
    padding: 0.5rem;
  }

  #tablaProduccion th[data-column="fecha"],
  #tablaProduccion td.col-fecha {
    min-width: 90px;
  }

  #tablaProduccion th[data-column="producto"],
  #tablaProduccion td.col-producto {
    min-width: 120px;
  }

  #tablaProduccion th[data-column="formula"],
  #tablaProduccion td.col-formula {
    min-width: 120px;
  }

  #tablaProduccion th[data-column="etapa"],
  #tablaProduccion td.col-etapa {
    min-width: 120px;
  }
}

@media (max-width: 576px) {
  #tablaProduccion {
    min-width: 600px;
  }

  #tablaProduccion th[data-column],
  #tablaProduccion td {
    font-size: 0.8125rem;
    padding: 0.375rem;
  }
}

/* Última actualización: 2025-01-27 - Estilos de calculadora modal redonda */

/* ==================== ESTILOS TIMELINE DE ETAPAS DE PRODUCCIÓN ==================== */
.timeline-etapas {
  position: relative;
  padding-left: 2rem;
}

.timeline-etapa {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 2.5rem;
}

.timeline-etapa:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 2rem;
  bottom: -2rem;
  width: 2px;
  background: #dee2e6;
}

.timeline-etapa.completada:not(:last-child)::before {
  background: var(--qs-success);
}

.timeline-etapa.en-proceso:not(:last-child)::before {
  background: linear-gradient(to bottom, var(--qs-success) 0%, var(--qs-success) 50%, #dee2e6 50%, #dee2e6 100%);
}

.timeline-etapa-icono {
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border: 2px solid;
  background: white;
  z-index: 1;
}

.timeline-etapa.completada .timeline-etapa-icono {
  background: var(--qs-success);
  border-color: var(--qs-success);
  color: white;
}

.timeline-etapa.en-proceso .timeline-etapa-icono {
  background: var(--qs-warning);
  border-color: var(--qs-warning);
  color: white;
  animation: pulse 2s infinite;
}

.timeline-etapa.pendiente .timeline-etapa-icono {
  background: #e9ecef;
  border-color: #dee2e6;
  color: #6c757d;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.timeline-etapa-contenido {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
  border-left: 3px solid transparent;
}

.timeline-etapa.completada .timeline-etapa-contenido {
  background: #e8f5e9;
  border-left-color: var(--qs-success);
}

.timeline-etapa.en-proceso .timeline-etapa-contenido {
  background: #fff3cd;
  border-left-color: var(--qs-warning);
}

.timeline-etapa.pendiente .timeline-etapa-contenido {
  background: #f8f9fa;
  border-left-color: #dee2e6;
}

.timeline-etapa-titulo {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.timeline-etapa-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.timeline-etapa-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-etapa-info-item i {
  width: 1rem;
  text-align: center;
}

.timeline-etapa-tiempo {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.timeline-etapa.completada .timeline-etapa-tiempo {
  color: var(--qs-success);
}

.timeline-etapa.en-proceso .timeline-etapa-tiempo {
  color: var(--qs-warning);
}

.timeline-etapa.pendiente .timeline-etapa-tiempo {
  color: #6c757d;
}

/* ==================== MODAL NOTIFICACIONES EN PROCESO ==================== */
.modal-notificaciones-proceso {
  position: fixed;
  bottom: 30px;
  right: 90px; /* A la izquierda de la calculadora (que está en right: 30px) */
  width: 380px;
  max-width: calc(100vw - 40px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 9998; /* Debajo de la calculadora (z-index: 9999) */
  display: none;
  animation: slideInNotification 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-notificaciones-proceso.show {
  display: block;
}

@keyframes slideInNotification {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.modal-notificaciones-content {
  position: relative;
}

.modal-notificaciones-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #0f4c81 0%, #1e88e5 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-notificaciones-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.modal-notificaciones-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  flex: 1;
}

.modal-notificaciones-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.modal-notificaciones-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-notificaciones-body {
  padding: 1.25rem;
}

.modal-notificaciones-estados {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-notificaciones-estado-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 3px solid #0f4c81;
}

.modal-notificaciones-estado-item.programada {
  border-left-color: #ffc107;
}

.modal-notificaciones-estado-item.aprobada {
  border-left-color: #0d6efd;
}

.modal-notificaciones-estado-item.fabricada {
  border-left-color: #0dcaf0;
}

.modal-notificaciones-estado-item.envasada {
  border-left-color: #0dcaf0;
}

.modal-notificaciones-estado-item.completada {
  border-left-color: #198754;
}

.modal-notificaciones-estado-nombre {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a202c;
  /* No usar text-transform: capitalize para preservar la 's' minúscula en (s) */
}

/* Estilos para columna de stock actual en tabla de materias primas */
#tablaMaterias td:nth-child(3) {
  text-align: right;
}

#tablaMaterias td:nth-child(3) .stock-actual-value {
  color: #000000 !important;
}

/* Estilo para mensaje de error del número de compra */
#compraNumeroError {
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.modal-notificaciones-estado-cantidad {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f4c81;
  background: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  min-width: 40px;
  text-align: center;
}

.modal-notificaciones-vacio {
  text-align: center;
  padding: 1.5rem 0;
  color: #718096;
  font-size: 0.9375rem;
}

.modal-notificaciones-vacio i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
  color: #cbd5e0;
}

.modal-notificaciones-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.modal-notificaciones-actions .btn {
  flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-notificaciones-proceso {
    right: 20px;
    bottom: 90px;
    width: calc(100vw - 40px);
    max-width: 340px;
  }
}

/* ===== Tarjetas de Reportes Dinámicos ===== */
#vistaPreviaReporte .card {
  cursor: default;
}

#vistaPreviaReporte .row.g-4 > div > .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18) !important;
}

#vistaPreviaReporte .card .card-header {
  position: relative;
  overflow: hidden;
}

#vistaPreviaReporte .card .card-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

#vistaPreviaReporte .card .card-body .border-bottom:last-child {
  border-bottom: none !important;
}


