.view-panel table thead th,
.modal table thead th {
  position: sticky !important;
  top: 0 !important;
  background: #f1f5f9 !important;
  z-index: 10 !important;
  box-shadow: inset 0 -1.5px 0 #e2e8f0 !important;
}

#table-hist-salidas thead th,
#table-hist-entradas thead th,
#table-hist-traspasos thead th,
#view-salidas-listado table thead th,
#view-entradas-listado table thead th,
#view-ventas-generales table thead th,
#view-cuentas-por-pagar table thead th,
#view-cuentas-por-cobrar table thead th {
  color: #1e3a7a !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
}

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --gray-light: #f0f0f0;
  --gray-mid: #cccccc;
  --gray-dark: #1e3a7a;
  --accent: #555555;
  --primary-blue: #1A316B;
  --secondary-blue: #1e3a7a;
  --gold-accent: #f59e0b;
}

/* REGLA GLOBAL: Cabeceras siempre en Azul Institucional */
.view-header {
  background: linear-gradient(135deg, #1A316B 0%, #1e3a7a 100%) !important;
  border-bottom: 2px solid #f59e0b !important;
  color: white !important;
}

.pharma-table thead,
.pharma-table thead tr,
#view-ventas-farmacia .pharma-table thead,
#view-ventas-farmacia .pharma-table thead tr {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: linear-gradient(90deg, #1E40AF 0%, #3B82F6 100%) !important;
  box-shadow: inset 0 -2px 0 #1E3A8A !important;
}

.pharma-table thead th,
#view-ventas-farmacia .pharma-table thead th {
  color: #FFFFFF !important;
  background: transparent !important;
  background-color: transparent !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  box-shadow: none !important;
}

@keyframes pharmaSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pharmaSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.pharma-toast {
  min-width: 480px;
  max-width: 580px;
  background: white;
  color: #1e293b;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 6px solid #ef4444;
  pointer-events: auto;
  animation: pharmaSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-family: 'Outfit', sans-serif;
  border: 1px solid #f1f5f9;
}

/* Standardizing Scrollbar for verification */
#exist-viewer-panel::-webkit-scrollbar,
#existFarmacia-viewer-panel::-webkit-scrollbar {
  width: 14px;
}

#exist-viewer-panel::-webkit-scrollbar-thumb,
#existFarmacia-viewer-panel::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

/* Premium Dashboard Layout Designer Button */
#btn-edit-layout {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  outline: none;
}

#btn-edit-layout:hover {
  background: #eff6ff;
}

#btn-edit-layout.active-edit {
  background: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}

#btn-edit-layout.active-edit:hover {
  background: #0d9488 !important;
}

#btn-reset-layout {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  outline: none;
}

#btn-reset-layout:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Corel Draw Style Canvas Designer */
#dashboard-canvas {
  position: relative;
  width: 100%;
  min-height: 850px;
  background: #ffffff;
  box-sizing: border-box;
}

.designer-widget {
  position: absolute;
  box-sizing: border-box;
  user-select: none;
  touch-action: none;
}

#widget-ventas-sucursal,
#widget-ventas-departamento,
#widget-ingresos-forma-pago {
  display: flex !important;
  flex-direction: column;
  min-height: 320px;
}

#widget-body-sucursal,
#widget-body-departamento,
#widget-body-forma-pago {
  flex: 1;
  overflow-y: auto;
  min-height: 180px;
  padding-right: 4px;
}

#widget-body-sucursal::-webkit-scrollbar,
#widget-body-departamento::-webkit-scrollbar,
#widget-body-forma-pago::-webkit-scrollbar {
  width: 6px;
}

#widget-body-sucursal::-webkit-scrollbar-track,
#widget-body-departamento::-webkit-scrollbar-track,
#widget-body-forma-pago::-webkit-scrollbar-track {
  background: transparent;
}

#widget-body-sucursal::-webkit-scrollbar-thumb,
#widget-body-departamento::-webkit-scrollbar-thumb,
#widget-body-forma-pago::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#widget-body-sucursal::-webkit-scrollbar-thumb:hover,
#widget-body-departamento::-webkit-scrollbar-thumb:hover,
#widget-body-forma-pago::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sizing handle styles */
.resizer-r,
.resizer-b,
.resizer-br {
  display: none;
  touch-action: none;
}

.active-edit .resizer-r,
.active-edit .resizer-b,
.active-edit .resizer-br {
  display: block;
}

.active-edit .designer-widget {
  outline: 2px dashed #3b82f6 !important;
  cursor: move !important;
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.25) !important;
}