@media (max-width: 540px) {
  nav .dropdown-menu {
    position: static !important;
    transform: none !important;
  }
}

/* Navbar dropdowns: ancho fijo, no estirar al 100% del layout */
#navbar .dropdown {
  position: relative;
}

#navbar .dropdown-menu {
  width: max-content;
  max-width: min(20rem, calc(100vw - 1.5rem));
  /* Fondo sólido: no debe verse el contenido detrás */
  background-color: #ffffff !important;
  opacity: 1 !important;
  z-index: 300 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

html.dark #navbar .dropdown-menu {
  background-color: #0f1824 !important;
}

#navbar .dropdown-menu.dropdown-menu-profile {
  width: 14rem !important;
  min-width: 14rem !important;
  max-width: 14rem !important;
}

#navbar .dropdown-menu.w-48 {
  width: 12rem !important;
  min-width: 12rem !important;
  max-width: 12rem !important;
}

#navbar .dropdown-menu.w-80 {
  width: 20rem !important;
  min-width: 16rem !important;
  max-width: min(20rem, calc(100vw - 1.5rem)) !important;
}

.navbar li button {
  @apply text-black/40 hover:text-black/20;
}

.navbar li.active button {
  @apply text-white;
}

.navbar li .dropdown-menu ul li .nav-link {
  @apply text-black/40 dark:text-white/30 md:text-black/70;
}

.navbar li.active .dropdown-menu ul li .nav-link.active {
  @apply text-info/50 bg-black/90 md:bg-black/50 dark:bg-black/70;
}
/* Sidebar: solo un menu expandido a la vez (URLs duplicadas no abren varias secciones) */
.sidebar-menu .group:not(.selected) > ul {
  max-height: 0 !important;
  overflow: hidden !important;
}
.sidebar-menu .group.selected > ul {
  max-height: none;
}

/* Theme settings: apply --border-radius to cards / inputs / buttons */
.box,
.form-input,
.form-select,
.form-control,
.btn,
.rounded-md,
.page-header,
#navbar,
footer {
  border-radius: var(--border-radius, 0.375rem);
}

html[data-radius="0"] .box,
html[data-radius="0"] .form-input,
html[data-radius="0"] .form-select,
html[data-radius="0"] .btn,
html[data-radius="0"] .rounded-md {
  border-radius: 0 !important;
}

/* Fondo de imagen: NUNCA en el menú lateral */
.sidebar-menu,
.sidebar-menu.has-bg,
html.sidebar-has-bg .sidebar-menu,
html[data-sidebar-theme="brand"].sidebar-has-bg .sidebar-menu,
html[data-sidebar-theme="brand"] .sidebar-menu.has-bg {
  background-image: none !important;
}

.sidebar-menu.has-bg,
html.sidebar-has-bg .sidebar-menu {
  background-color: rgb(255 255 255) !important;
}

html.dark .sidebar-menu.has-bg,
html.dark.sidebar-has-bg .sidebar-menu {
  background-color: rgb(15 24 36) !important;
}

/* Cerrar sesión y textos muted del menú lateral en dark */
html.dark .sidebar-menu .sidebar-logout-link,
html.dark .sidebar-menu .sidebar-logout-link span,
html.dark .sidebar-menu .sidebar-logout-link i {
  color: rgba(248, 250, 252, 0.9) !important;
}

html.dark .sidebar-menu .sidebar-logout-link:hover,
html.dark .sidebar-menu .sidebar-logout-link:hover span,
html.dark .sidebar-menu .sidebar-logout-link:hover i {
  color: rgb(248, 113, 113) !important;
}

html.dark .sidebar-menu .text-black\/70,
html.dark .sidebar-menu .text-black\/50,
html.dark .sidebar-menu .dark\:text-white\/70,
html.dark .sidebar-menu .dark\:text-white\/80 {
  color: rgba(248, 250, 252, 0.88) !important;
}

html[data-sidebar-theme="brand"] .sidebar-menu .sidebar-logout-link,
html[data-sidebar-theme="brand"] .sidebar-menu .sidebar-logout-link span,
html[data-sidebar-theme="brand"] .sidebar-menu .sidebar-logout-link i {
  color: rgba(255, 255, 255, 0.92) !important;
}

#sidebar-bg,
#sidebar-overlay,
.sidebar-menu #sidebar-bg,
.sidebar-menu #sidebar-overlay,
.sidebar-menu.has-bg #sidebar-bg,
.sidebar-menu.has-bg #sidebar-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  background-image: none !important;
  pointer-events: none !important;
}

/* Fondo de página: solo en el área de contenido (page-wrapper), no en el menú */
.app-page-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.app-page-bg.is-active {
  opacity: 0.32;
}

.app-page-bg.app-page-bg--auth {
  position: fixed;
}

html.dark .app-page-bg.is-active {
  opacity: 0.28;
}

html.app-has-bg .page-wrapper {
  background-color: rgba(236, 242, 247, 0.55) !important;
}

html.dark.app-has-bg .page-wrapper {
  background-color: rgba(0, 0, 0, 0.55) !important;
}

/* Cards e info legibles sobre el fondo (sin transparencia que deje ver detrás) */
html.app-has-bg .box,
html.app-has-bg .pipeline-stage.box {
  background-color: #ffffff !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.dark.app-has-bg .box,
html.dark.app-has-bg .pipeline-stage.box {
  background-color: #0f1824 !important;
}

html.app-has-bg .page-wrapper > .relative.z-\[1\],
html.app-has-bg .page-wrapper > div.relative {
  position: relative;
  z-index: 1;
}

/* Tipografía del encabezado de página: más contraste sobre fondos claros/imagen */
.page-header h4,
.page-header .page-title {
  color: #0f172a;
}

.page-header p,
.page-header .page-subtitle {
  color: rgba(15, 23, 42, 0.78);
  font-weight: 500;
}

.breadcrumb {
  color: rgba(15, 23, 42, 0.72);
}

.breadcrumb a {
  color: rgba(15, 23, 42, 0.78);
}

.breadcrumb .separator {
  color: rgba(15, 23, 42, 0.42);
}

html.dark .page-header h4,
html.dark .page-header .page-title {
  color: #f8fafc;
}

html.dark .page-header p,
html.dark .page-header .page-subtitle {
  color: rgba(248, 250, 252, 0.78);
}

html.dark .breadcrumb,
html.dark .breadcrumb a {
  color: rgba(248, 250, 252, 0.72);
}

html.dark .breadcrumb .separator {
  color: rgba(248, 250, 252, 0.4);
}

/* Con fondo de aplicación: panel legible + textos secundarios más oscuros */
html.app-has-bg .page-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.85rem 1.1rem;
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

html.dark.app-has-bg .page-header {
  background: rgba(15, 24, 36, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html.app-has-bg .box .text-black\/40,
html.app-has-bg .box .text-black\/45,
html.app-has-bg .box .text-black\/50 {
  color: rgba(15, 23, 42, 0.68) !important;
}

/*
  Modo oscuro: textos “muted” (black/* o white/30–55) deben permanecer legibles.
  Muchas pantallas usan text-black/55 sin dark: → casi invisible sobre fondo oscuro.
*/
html.dark .text-black\/20,
html.dark .text-black\/25,
html.dark .text-black\/30,
html.dark .text-black\/35,
html.dark .text-black\/40,
html.dark .text-black\/45,
html.dark .text-black\/50,
html.dark .text-black\/55 {
  color: rgba(226, 232, 240, 0.78) !important;
}

html.dark .text-black\/60,
html.dark .text-black\/65,
html.dark .text-black\/70,
html.dark .text-black\/75 {
  color: rgba(241, 245, 249, 0.88) !important;
}

html.dark .text-black\/80,
html.dark .text-black\/85,
html.dark .text-black\/90,
html.dark .text-black\/95,
html.dark .text-black {
  color: rgba(248, 250, 252, 0.94) !important;
}

html.dark .text-white\/20,
html.dark .text-white\/25,
html.dark .text-white\/30,
html.dark .text-white\/35,
html.dark .text-white\/40,
html.dark .text-white\/45,
html.dark .text-white\/50,
html.dark .text-white\/55,
html.dark .dark\:text-white\/20,
html.dark .dark\:text-white\/25,
html.dark .dark\:text-white\/30,
html.dark .dark\:text-white\/35,
html.dark .dark\:text-white\/40,
html.dark .dark\:text-white\/45,
html.dark .dark\:text-white\/50,
html.dark .dark\:text-white\/55 {
  color: rgba(226, 232, 240, 0.82) !important;
}

html.dark .text-white\/60,
html.dark .text-white\/65,
html.dark .text-white\/70,
html.dark .text-white\/75,
html.dark .dark\:text-white\/60,
html.dark .dark\:text-white\/65,
html.dark .dark\:text-white\/70,
html.dark .dark\:text-white\/75,
html.dark .dark\:text-white {
  color: rgba(248, 250, 252, 0.92) !important;
}

/* text-primary (#845adf) pierde contraste en fondos oscuros → tono más claro */
html.dark .text-primary,
html.dark .text-primary\/80,
html.dark .text-primary\/90 {
  color: rgb(196, 181, 253) !important;
}

html.dark .text-primary\/70 {
  color: rgba(196, 181, 253, 0.9) !important;
}

/* Con fondo de app: no forzar texto oscuro sobre .box en modo dark */
html.dark.app-has-bg .box .text-black\/40,
html.dark.app-has-bg .box .text-black\/45,
html.dark.app-has-bg .box .text-black\/50 {
  color: rgba(226, 232, 240, 0.82) !important;
}

/* —— Ayuda de sección: legible en todo el ERP —— */
html.dark .erp-section-help {
  color: rgba(248, 250, 252, 0.9);
}

html.dark .erp-section-help__eyebrow,
html.dark .erp-section-help .text-primary\/80 {
  color: rgb(196, 181, 253) !important;
}

html.dark .erp-section-help__icon,
html.dark .erp-section-help__icon.text-primary {
  color: rgb(196, 181, 253) !important;
  background-color: rgba(132, 90, 223, 0.28) !important;
}

html.dark .erp-section-help__link,
html.dark .erp-section-help a.btn {
  color: rgb(221, 214, 254) !important;
  border-color: rgba(196, 181, 253, 0.45) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .erp-section-help__link:hover,
html.dark .erp-section-help a.btn:hover {
  color: #fff !important;
  background-color: rgba(132, 90, 223, 0.35) !important;
  border-color: rgba(196, 181, 253, 0.65) !important;
}

html.dark .text-gray\/40,
html.dark .text-gray\/50,
html.dark .text-gray\/60,
html.dark .text-gray\/70,
html.dark .text-gray\/80,
html.dark .text-gray\/90,
html.dark .text-gray {
  color: rgba(226, 232, 240, 0.88) !important;
}

/* Cuerpo: @apply text-gray/80 en taiwind es gris oscuro; forzar legible en dark */
html.dark body {
  color: rgba(241, 245, 249, 0.9) !important;
}

/* Placeholders e iconos de búsqueda en dark */
html.dark .text-black\/35,
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: rgba(203, 213, 225, 0.65) !important;
}

html.dark .erp-list-pagination,
html.dark .erp-list-pagination p,
html.dark .form-label,
html.dark label.form-label {
  color: rgba(226, 232, 240, 0.82);
}

html.dark .box .text-\[11px\].text-black\/55,
html.dark .box .text-\[11px\].text-black\/50,
html.dark .box .text-\[11px\].text-black\/45 {
  color: rgba(226, 232, 240, 0.8) !important;
}

html.dark.app-has-bg .box .text-white\/40,
html.dark.app-has-bg .box .text-white\/45,
html.dark.app-has-bg .box .text-white\/50 {
  color: rgba(241, 245, 249, 0.82) !important;
}

/* —— Estándar de listados ERP (cabecera + filtros + tabla) —— */
.erp-list {
  overflow: hidden;
  min-width: 0;
}

.erp-list-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

html.dark .erp-list-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.erp-list-toolbar__top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .erp-list-toolbar__top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.erp-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.erp-list-filters {
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(148, 163, 184, 0.08);
  padding: 0.75rem 1rem;
}

html.dark .erp-list-filters {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.erp-list-table thead th {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.62);
  padding: 0.75rem 1rem;
  text-align: left;
  background: rgb(var(--color-primary) / 0.1);
}

html.dark .erp-list-table thead th {
  color: rgba(248, 250, 252, 0.55);
}

.erp-list-table tbody tr {
  transition: background-color 0.12s ease;
}

.erp-list-table tbody tr:hover {
  background: rgb(var(--color-primary) / 0.05);
}

.erp-list-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

/* Texto legible en modo oscuro (celdas sin color / text-black sin dark:) */
html.dark .erp-list-table tbody {
  color: rgba(248, 250, 252, 0.88);
}

html.dark .erp-list-table .text-black:not([class*="dark:text"]),
html.dark .erp-list-table [class*="text-black\/"]:not([class*="dark:text"]) {
  color: rgba(248, 250, 252, 0.72);
}

html.dark .erp-list-table .text-black\/40:not([class*="dark:text"]),
html.dark .erp-list-table .text-black\/45:not([class*="dark:text"]),
html.dark .erp-list-table .text-black\/50:not([class*="dark:text"]) {
  color: rgba(248, 250, 252, 0.5);
}

html.dark .erp-list-pagination,
html.dark .erp-list-pagination p {
  color: rgba(248, 250, 252, 0.65);
}

.erp-list-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 11px;
  font-weight: 600;
}

/* Listado documentos (facturas, etc.): filtros en fila + celda Documento */
.erp-list-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.625rem;
}

.erp-list-filters__search {
  position: relative;
  flex: 1 1 14rem;
  min-width: 12rem;
}

.erp-list-filters__search > i {
  pointer-events: none;
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(15, 23, 42, 0.35);
}

html.dark .erp-list-filters__search > i {
  color: rgba(248, 250, 252, 0.35);
}

.erp-list-filters__select {
  flex: 0 1 8.5rem;
  min-width: 7.5rem;
  width: auto;
}

.erp-list-filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.erp-list-doc {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.erp-list-doc__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: rgb(var(--color-primary));
  text-decoration: none;
  line-height: 1.25;
}

.erp-list-doc__id:hover {
  text-decoration: underline;
}

.erp-list-doc__meta {
  font-size: 11px;
  line-height: 1.3;
  color: rgba(15, 23, 42, 0.45);
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.dark .erp-list-doc__meta {
  color: rgba(248, 250, 252, 0.45);
}

.erp-list--docs .erp-list-table tbody td {
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* —— Formularios / líneas de documento en dark (todo el ERP) —— */
html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea,
html.dark .form-control,
html.dark input.form-input,
html.dark textarea.form-input,
html.dark select.form-input {
  color: rgba(248, 250, 252, 0.95) !important;
  background-color: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
}

html.dark .form-input:disabled,
html.dark .form-input[readonly],
html.dark .form-select:disabled,
html.dark input:disabled,
html.dark input[readonly] {
  color: rgba(248, 250, 252, 0.85) !important;
  opacity: 1;
  -webkit-text-fill-color: rgba(248, 250, 252, 0.85);
}

/* Impuesto / subtotal de líneas (spans calculados, no inputs) */
html.dark .facturacion-line-tax,
html.dark .fp-line-tax,
html.dark .oc-line-tax,
html.dark .solicitud-line-tax,
html.dark .cotizacion-line-tax,
html.dark .facturacion-line-subtotal,
html.dark .fp-line-subtotal,
html.dark .oc-line-subtotal,
html.dark .solicitud-line-subtotal,
html.dark .cotizacion-line-subtotal,
html.dark .facturacion-lines-dt__sub,
html.dark .fp-lines-dt__sub,
html.dark .oc-lines-dt__sub,
html.dark .solicitud-lines-dt__sub,
html.dark .cotizacion-lines-dt__sub {
  color: rgba(248, 250, 252, 0.92) !important;
}

html.dark .facturacion-lines-dt td,
html.dark .fp-lines-dt td,
html.dark .oc-lines-dt td,
html.dark .solicitud-lines-dt td,
html.dark .cotizacion-lines-dt td {
  color: rgba(248, 250, 252, 0.9);
}

/* SweetAlert2 — espacio entre Cancelar / Confirmar */
.swal2-actions.erp-swal-actions {
  gap: 0.75rem !important;
  margin: 1.25rem auto 0 !important;
}
.swal2-actions.erp-swal-actions .btn + .btn {
  margin-left: 0 !important;
}
/* No mostrar Choices/select vacío dentro de modales SweetAlert2 */
.swal2-container .swal2-select,
.swal2-container .choices.erp-choices,
.swal2-popup .choices {
  display: none !important;
}

/* —— Ghost buttons (tema Turbine) ——
   --color-primary es "R G B" (sin rgb()), no un color CSS válido solo.
   Usar rgb(var(--color-*)) / hex fijos para hover con fondo real. */
.btn-ghost {
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transition: color 0.2s ease, background-color 0.2s ease;
}
a.btn-ghost,
button.btn-ghost {
  text-decoration: none !important;
}
.btn-ghost-black {
  color: #1d252d !important;
}
.btn-ghost-black:hover,
.btn-ghost-black:focus-visible {
  background-color: #1d252d !important;
  color: #fff !important;
}
html.dark .btn-ghost-black {
  color: rgba(255, 255, 255, 0.85) !important;
}
html.dark .btn-ghost-black:hover,
html.dark .btn-ghost-black:focus-visible {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}
.btn-ghost-danger {
  color: #e7515a !important;
}
.btn-ghost-danger:hover,
.btn-ghost-danger:focus-visible {
  background-color: #e7515a !important;
  color: #fff !important;
}
.btn-ghost-success {
  color: #00ab55 !important;
}
.btn-ghost-success:hover,
.btn-ghost-success:focus-visible {
  background-color: #00ab55 !important;
  color: #fff !important;
}
.btn-ghost-primary {
  color: rgb(var(--color-primary)) !important;
}
.btn-ghost-primary:hover,
.btn-ghost-primary:focus-visible {
  background-color: rgb(var(--color-primary)) !important;
  color: #fff !important;
}
.btn-ghost-info {
  color: #2196f3 !important;
}
.btn-ghost-info:hover,
.btn-ghost-info:focus-visible {
  background-color: #2196f3 !important;
  color: #fff !important;
}
.btn-ghost-warning {
  color: #e2a03f !important;
}
.btn-ghost-warning:hover,
.btn-ghost-warning:focus-visible {
  background-color: #e2a03f !important;
  color: #fff !important;
}
.btn-ghost-muted {
  color: rgba(0, 0, 0, 0.55) !important;
}
.btn-ghost-muted:hover,
.btn-ghost-muted:focus-visible {
  background-color: rgba(0, 0, 0, 0.75) !important;
  color: #fff !important;
}
html.dark .btn-ghost-muted {
  color: rgba(255, 255, 255, 0.55) !important;
}
html.dark .btn-ghost-muted:hover,
html.dark .btn-ghost-muted:focus-visible {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* —— Action toolbar: mismo alto/ancho mínimo, más aire —— */
.erp-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.625rem;
}
.erp-action-bar > form {
  display: inline-flex;
  margin: 0;
}
.erp-action-bar > .btn,
.erp-action-bar > a.btn,
.erp-action-bar > span.btn,
.erp-action-bar > form > .btn,
.erp-action-bar > form > button.btn {
  min-width: 11.5rem;
  min-height: 2.35rem;
  justify-content: center;
  white-space: nowrap;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}
.erp-action-bar > .btn.btn-ghost-disabled,
.erp-action-bar > span.btn-ghost-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
@media (max-width: 640px) {
  .erp-action-bar > .btn,
  .erp-action-bar > a.btn,
  .erp-action-bar > span.btn,
  .erp-action-bar > form > .btn,
  .erp-action-bar > form > button.btn {
    min-width: calc(50% - 0.35rem);
    flex: 1 1 calc(50% - 0.35rem);
  }
}

/* —— Form / modal footers: Ghost + tamaño uniforme —— */
.erp-form-actions,
.modal-footer,
.usr-foot,
.erp-modal [class$="-foot"],
.hs-overlay .modal-footer {
  display: flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.625rem !important;
}
.erp-form-actions > form,
.modal-footer > form,
.usr-foot > form {
  display: inline-flex;
  margin: 0;
}
.erp-form-actions > .btn,
.erp-form-actions > a.btn,
.erp-form-actions > button,
.erp-form-actions > form > .btn,
.modal-footer > .btn,
.modal-footer > a.btn,
.modal-footer > button,
.modal-footer > form > .btn,
.usr-foot > .btn,
.usr-foot > a.btn,
.usr-foot > button,
.erp-modal [class$="-foot"] > .btn,
.erp-modal [class$="-foot"] > a.btn,
.erp-modal [class$="-foot"] > button {
  min-width: 11.5rem;
  min-height: 2.35rem;
  justify-content: center !important;
  white-space: nowrap;
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
  box-shadow: none !important;
}

/* Remap sólidos / outline → ghost en footers */
.erp-form-actions .btn-primary,
.erp-form-actions .btn.bg-primary,
.modal-footer .btn-primary,
.modal-footer .btn.bg-primary,
.usr-foot .btn-primary,
.erp-modal [class$="-foot"] .btn-primary {
  background-color: transparent !important;
  border-color: transparent !important;
  color: rgb(var(--color-primary)) !important;
}
.erp-form-actions .btn-primary:hover,
.erp-form-actions .btn-primary:focus-visible,
.erp-form-actions .btn.bg-primary:hover,
.modal-footer .btn-primary:hover,
.modal-footer .btn-primary:focus-visible,
.modal-footer .btn.bg-primary:hover,
.usr-foot .btn-primary:hover,
.erp-modal [class$="-foot"] .btn-primary:hover {
  background-color: rgb(var(--color-primary)) !important;
  color: #fff !important;
}

.erp-form-actions .btn-success,
.erp-form-actions .btn.bg-success,
.modal-footer .btn-success,
.modal-footer .btn.bg-success,
.usr-foot .btn-success,
.erp-modal [class$="-foot"] .btn-success {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #00ab55 !important;
}
.erp-form-actions .btn-success:hover,
.erp-form-actions .btn-success:focus-visible,
.erp-form-actions .btn.bg-success:hover,
.modal-footer .btn-success:hover,
.modal-footer .btn-success:focus-visible,
.modal-footer .btn.bg-success:hover,
.usr-foot .btn-success:hover,
.erp-modal [class$="-foot"] .btn-success:hover {
  background-color: #00ab55 !important;
  color: #fff !important;
}

.erp-form-actions .btn-danger,
.erp-form-actions .btn.bg-danger,
.modal-footer .btn-danger,
.modal-footer .btn.bg-danger,
.usr-foot .btn-danger,
.erp-modal [class$="-foot"] .btn-danger {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #e7515a !important;
}
.erp-form-actions .btn-danger:hover,
.erp-form-actions .btn-danger:focus-visible,
.modal-footer .btn-danger:hover,
.modal-footer .btn-danger:focus-visible,
.usr-foot .btn-danger:hover,
.erp-modal [class$="-foot"] .btn-danger:hover {
  background-color: #e7515a !important;
  color: #fff !important;
}

.erp-form-actions .btn-warning,
.modal-footer .btn-warning,
.usr-foot .btn-warning {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #e2a03f !important;
}
.erp-form-actions .btn-warning:hover,
.modal-footer .btn-warning:hover,
.usr-foot .btn-warning:hover {
  background-color: #e2a03f !important;
  color: #fff !important;
}

/* Cancelar / outline neutro → ghost muted */
.erp-form-actions .btn.border,
.erp-form-actions a.btn.border,
.modal-footer .btn.border,
.modal-footer a.btn.border,
.usr-foot .btn.border,
.erp-modal [class$="-foot"] .btn.border {
  background-color: transparent !important;
  border-color: transparent !important;
  color: rgba(0, 0, 0, 0.55) !important;
}
.erp-form-actions .btn.border:hover,
.erp-form-actions a.btn.border:hover,
.modal-footer .btn.border:hover,
.modal-footer a.btn.border:hover,
.usr-foot .btn.border:hover,
.erp-modal [class$="-foot"] .btn.border:hover {
  background-color: rgba(0, 0, 0, 0.75) !important;
  color: #fff !important;
}
html.dark .erp-form-actions .btn.border,
html.dark .erp-form-actions a.btn.border,
html.dark .modal-footer .btn.border,
html.dark .modal-footer a.btn.border,
html.dark .usr-foot .btn.border,
html.dark .erp-modal [class$="-foot"] .btn.border {
  color: rgba(255, 255, 255, 0.55) !important;
}
html.dark .erp-form-actions .btn.border:hover,
html.dark .modal-footer .btn.border:hover,
html.dark .usr-foot .btn.border:hover,
html.dark .erp-modal [class$="-foot"] .btn.border:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

@media (max-width: 640px) {
  .erp-form-actions > .btn,
  .erp-form-actions > a.btn,
  .modal-footer > .btn,
  .modal-footer > a.btn,
  .usr-foot > .btn {
    min-width: calc(50% - 0.35rem);
    flex: 1 1 calc(50% - 0.35rem);
  }
}

/* —— Bloqueo de sesión (cubre toda la app) —— */
html.erp-session-locked body > *:not(.swal2-container) {
  pointer-events: none !important;
  user-select: none !important;
}
html.erp-session-locked body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99980;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(13, 148, 136, 0.18), transparent 55%),
    rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
html.erp-session-locked .swal2-container {
  pointer-events: auto !important;
  z-index: 99990 !important;
}
.erp-swal-pin-input {
  letter-spacing: 0.22em !important;
  text-align: center !important;
  font-size: 1.15rem !important;
}
