/* ==========================================================================
  SISTEMA DE DISEÑO Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
/* Variables globales del tema */
:root {
  /* Paleta de colores (Diseño oscuro premium) */
  --bg-primary: #080911;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-glow: rgba(99, 102, 241, 0.05);

  --primary: hsl(245, 82%, 67%);
  --primary-hover: hsl(245, 82%, 73%);
  --primary-glow: rgba(99, 102, 241, 0.3);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #080911;

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;

  /* Fuentes y Efectos */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --blur-amount: 20px;
}

/* Estilo para * */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Estilos base del documento o estado del cuerpo */
body {
  font-family: var(--font-family);
  font-size: var(--font-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary) !important;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 20px 0;
}

body.app_cargando #app_card,
/* Estilos base del documento o estado del cuerpo */
body.app_cargando .bg-animation {
  visibility: hidden;
}

/* Estilos del cargador */
.loader_app {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .loader_app {
  background: #f1f5f9;
}

/* Estilos del cargador */
.loader_app.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Estilos del cargador */
.loader_marca {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

/* Estilos del cargador */
.loader_spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: appLoaderSpin 0.8s linear infinite;
}

@keyframes appLoaderSpin {
/* Estilo para to */
  to {
    transform: rotate(360deg);
  }
}

/* Animación de fondo premium eliminada — código muerto (display:none permanente) */

/* ==========================================================================
  VISTA DE DASHBOARD
  ========================================================================== */
/* Contenedor o bloque principal */
.avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* Estilo para .avatar */
.avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  border: 3px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

/* Estilo para .user-details */
.user-details {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

/* Estilo para .detail-row */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

/* Estilo para .detail-label */
.detail-label {
  color: var(--text-muted);
  font-weight: 400;
}

/* Estilo para .detail-value */
.detail-value {
  color: #fff;
  font-weight: 500;
  word-break: break-all;
  max-width: 60%;
  text-align: right;
}

/* Estilo para .badge */
.badge {
  background: var(--success-glow);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ==========================================================================
  SISTEMA DE NOTIFICACIONES TOAST
   ========================================================================== */
/* Contenedor o bloque principal */
.contenedor_toast {
  position: fixed;
  bottom: 12px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  max-width: 380px;
  width: auto;
}

/* Estilo para .toast */
.toast {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 18px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-size: 14px;
  font-weight: 500;
  border: none;
}

@keyframes slideIn {
/* Estilo para from */
  from {
    transform: translateX(120%);
    opacity: 0;
  }

/* Estilo para to */
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Estilo para .toast.removing */
.toast.removing {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
/* Estilo para to */
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Contenedor o bloque principal */
.toast-icon-wrapper {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Estilo para .toast-icon */
.toast-icon {
  width: 14px;
  height: 14px;
  color: #fff;
}

/* Estilo para .toast-content */
.toast-content {
  flex-grow: 1;
  min-width: 0;
}

/* Estilo para .toast-title */
.toast-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  color: #ffffff;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Estilo para .toast-desc */
.toast-desc {
  font-size: 12px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Modificaciones según tipo de Toast */
.toast-success {
  background: #3ba76d;
  box-shadow: -4px 4px 0px 0px #5ec78d;
  color: #fff;
}

/* Contenedor o bloque principal */
.toast-success .toast-icon-wrapper {
  background: #5ec78d;
}

/* Estilo para .toast-success .toast-desc */
.toast-success .toast-desc {
  color: rgba(255, 255, 255, 0.85);
}

/* Estilo para .toast-error */
.toast-error {
  background: #e11d48;
  box-shadow: -4px 4px 0px 0px #fda4af;
  color: #fff;
}

/* Contenedor o bloque principal */
.toast-error .toast-icon-wrapper {
  background: #fda4af;
}

/* Estilo para .toast-error .toast-desc */
.toast-error .toast-desc {
  color: rgba(255, 255, 255, 0.85);
}

/* Estilo para .toast-info */
.toast-info {
  background: #0284c7;
  box-shadow: -4px 4px 0px 0px #38bdf8;
  color: #fff;
}

/* Contenedor o bloque principal */
.toast-info .toast-icon-wrapper {
  background: #38bdf8;
}

/* Estilo para .toast-info .toast-desc */
.toast-info .toast-desc {
  color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
  UTILIDADES Y TRANSICIONES DE PANTALLA
   ========================================================================== */
/* Estilo para .oculto */
.oculto {
  display: none !important;
}

/* Iconos y animaciones base delegados a shared.css */

/* ==========================================================================
  TEMA CLARO (LIGHT THEME)
   ========================================================================== */
/* Estilos base del documento o estado del cuerpo */
body.light-theme {
  --bg-primary: #f1f5f9;
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.9);
  --card-glow: rgba(99, 102, 241, 0.1);

  --primary: hsl(245, 82%, 55%);
  --primary-hover: hsl(245, 82%, 50%);
  --primary-glow: rgba(99, 102, 241, 0.4);

  --text-main: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  background-color: #f1f5f9 !important;
  color: #334155;
}

/* ==========================================================================================
  PANELES DE INSTALACIÓN PWA
  ========================================================================== */
/* Estilo para .pwa-install-panel */
.pwa-install-panel {
  width: 100%;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
/* Estilo para from */
  from {
    opacity: 0;
    transform: translateY(20px);
  }

/* Estilo para to */
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo para .pwa-install-logo img */
.pwa-install-logo img {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
}

/* Estilo para .pwa-install-title */
.pwa-install-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

/* Estilo para .pwa-install-subtitle */
.pwa-install-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Estilos del boton o accion */
.pwa-install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--primary), hsl(265, 82%, 60%));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: var(--transition-smooth);
}

/* Estilos del boton o accion */
.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
}

/* Estilo para .pwa-install-divider */
.pwa-install-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.pwa-install-divider::before,
/* Estilo para .pwa-install-divider::after */
.pwa-install-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Estilo para .pwa-install-steps */
.pwa-install-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Estilo para .pwa-step */
.pwa-step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .pwa-step {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.07);
}

/* Estilo para .pwa-step-num */
.pwa-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), hsl(265, 82%, 60%));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Estilo para .pwa-step-text */
.pwa-step-text {
  font-size: 13px;
  color: var(--text-main);
  flex: 1;
  line-height: 1.4;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .pwa-step-text {
  color: #1e293b;
}

/* Estilo para .pwa-step-icon */
.pwa-step-icon {
  width: 26px;
  height: 26px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Estilo para .pwa-tutorial-link */
.pwa-tutorial-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: var(--transition-smooth);
}

/* Estilo para .pwa-tutorial-link:hover */
.pwa-tutorial-link:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

/* Contenedor o bloque principal */
.main-bg {
  background-color: #26252c;
}

/* Contenedor o bloque principal */
.card-custom {
  background-color: #1a1a1a;
  border: 1px solid #333;
  transition: all 0.3s ease;
}

/* Contenedor o bloque principal */
.card-custom:hover {
  transform: translateY(-10px);
  border-color: #555;
  background-color: #222;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Estilo para .nav-item:hover */
.nav-item:hover {
  background-color: #2a2a2a;
  color: white;
}

/* ==========================================================================
  MODO DASHBOARD PC PANTALLA COMPLETA
  ========================================================================== */

/* Variables del dashboard (modo oscuro por defecto) */
:root {
  --db-sidebar-bg:     #111113;
  --db-sidebar-border: rgba(255,255,255,0.07);
  --db-sidebar-text:   #9ca3af;
  --db-nav-hover-bg:   #1f1f23;
  --db-nav-active:     #fff;
  --db-brand-color:    #ffffff;
  --db-main-bg:        #18181b;
  --db-card-bg:        #1e1e22;
  --db-card-border:    #2d2d33;
  --db-card-hover-bg:  #26262c;
  --db-card-shadow:    rgba(0,0,0,0.4);
  --db-modal-bg:       #1a1a1f;
  --db-modal-border:   #2d2d33;
  --db-text-main:      #f3f4f6;
  --db-text-muted:     #71717a;
  --db-logout-bg:      rgba(239,68,68,0.08);
  --db-logout-color:   #f87171;
  --db-logout-hover:   rgba(239,68,68,0.18);
}

/* Variables del dashboard en modo claro */
body.light-theme {
  --db-sidebar-bg:     #f8f9fb;
  --db-sidebar-border: rgba(0,0,0,0.08);
  --db-sidebar-text:   #6b7280;
  --db-nav-hover-bg:   #f0f1f5;
  --db-nav-active:     #111;
  --db-brand-color:    #111827;
  --db-main-bg:        #f1f3f7;
  --db-card-bg:        #ffffff;
  --db-card-border:    #e5e7eb;
  --db-card-hover-bg:  #f9fafb;
  --db-card-shadow:    rgba(0,0,0,0.08);
  --db-modal-bg:       #ffffff;
  --db-modal-border:   #e5e7eb;
  --db-text-main:      #111827;
  --db-text-muted:     #6b7280;
  --db-logout-bg:      rgba(239,68,68,0.07);
  --db-logout-color:   #dc2626;
  --db-logout-hover:   rgba(239,68,68,0.14);
}

/* Sidebar base el ancho lo controlan las clases Tailwind w-20 / w-64 */
.sidebar_principal {
  background-color: var(--db-sidebar-bg);
  color: var(--db-sidebar-text);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--db-sidebar-border);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 30;
}

/* Ocultar textos cuando estï¿½ colapsado ï¿½ se remueve .oculto por JS */
/* (No se necesita .expanded; Tailwind w-20/w-64 maneja el ancho) */

/* El botón de logout necesita flex cuando es visible */
.db-logout-btn {
  display: flex;
}


/* Utilidades de sidebar */
.border_sidebar {
  border-color: var(--db-sidebar-border) !important;
}
/* Estilo para .db-brand */
.db-brand {
  color: var(--db-brand-color);
}
/* Estilo para .db-nav-text */
.db-nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Centrar el logo de la cabecera cuando el sidebar está colapsado en w-20 */
.sidebar_principal.w-20 .logo_contenedor,
/* Estilos del panel lateral */
.sidebar_principal.w-20 .flex.items-center.gap-4 {
  justify-content: center !important;
  gap: 0 !important;
}

/* Estilos del panel lateral */
.sidebar_principal.w-20 img {
  margin-left: 0 !important;
}

/* Nav items */
.item_nav {
  display: flex;
  align-items: center;
  color: var(--db-sidebar-text);
  text-decoration: none;
  font-size: 14px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}
/* Estilo para .item_nav:hover */
.item_nav:hover {
  background-color: var(--db-nav-hover-bg);
  color: var(--db-nav-active);

}
/* Estilo para .item_nav i */
.item_nav i {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 15px;
}

/* Estilos del panel lateral */
.nav_sidebar {
  flex: 1 1 auto;
  margin-top: 0;
  padding: 0.25rem 0.75rem 1rem;
  overflow-y: auto;
}

/* Estilos del panel lateral */
.nav_sidebar .item_nav + .item_nav {
  margin-top: 0.25rem;
}

/* Estilo para .item_nav */
.item_nav {
  gap: 1rem;
  padding: 0.75rem;
}

.label_nav,
/* Estilo para .txt_usuario */
.txt_usuario {
  white-space: nowrap;
  min-width: 0;
}

/* Estilos del panel lateral */
.panel_perfil {
  flex-shrink: 0;
  padding: 1rem 0.75rem 1.5rem;
}

/* Estilos del panel lateral */
.row_perfil {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* Estilo para #img_avatar */
#img_avatar {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9999px;
  background: #9333ea;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Estilo para .lbl_usuario */
.lbl_usuario {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estilo para .lbl_rol */
.lbl_rol {
  font-size: 0.75rem;
}

/* Contenedor o bloque principal */
.panel_main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Estilo para .pill_agencia */
.pill_agencia {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  cursor: pointer;
  border-style: solid;
  border-width: 1px;
  border-radius: 9999px;
  padding: 0.45rem 0.5rem 0.45rem 0.95rem;
}

/* Estilo para .txt_agencia */
.txt_agencia {
  min-width: 0;
  text-align: right;
  padding-left: 0.2rem;
}

/* Estilo para .lbl_agencia */
.lbl_agencia {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estilo para #lbl_agencia_vencimiento */
#lbl_agencia_vencimiento {
  font-size: 0.62rem;
  line-height: 1.1;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estilo para #img_agencia_avatar */
#img_agencia_avatar {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6, #4f46e5);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
}

/* Estilo para .menu_agencia */
.menu_agencia {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  width: 100%;
  padding-top: 0.5rem;
}

/* Estilo para #menu_agencia_inner */
#menu_agencia_inner {
  overflow: hidden;
  border-width: 1px;
  border-style: solid;
  border-radius: 0.75rem;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.28);
}

/* Estilos del boton o accion */
.btn_menu {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Estilos del boton o accion */
.btn_menu:hover {
  background: var(--db-nav-hover-bg);
  color: var(--db-nav-active);
}

/* Estilo para .icon_menu */
.icon_menu {
  width: 1rem;
  text-align: center;
}

.emoji_menu,
/* Estilo para .swatch_menu */
.swatch_menu {
  width: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Estilo para .emoji_menu */
.emoji_menu {
  font-size: 0.875rem;
  line-height: 1;
}

.txt_principal  { color: var(--db-text-main); }
.txt_suave { color: var(--db-text-muted); }

/* Botón de logout del sidebar */
.db-logout-btn {
  background: var(--db-logout-bg);
  color: var(--db-logout-color);
  border: 1px solid transparent;
  cursor: pointer;
  justify-content: center;
}
/* Estilos del boton o accion */
.db-logout-btn:hover {
  background: var(--db-logout-hover);
}

/* Main del dashboard */
.panel_main {
  background-color: transparent;
  flex: 1;
  height: 100%;
  min-height: 0;
  position: relative;
}

/* Cards de módulos */
.db-card {
  background-color: var(--db-card-bg);
  border: 1px solid var(--db-card-border);
  color: var(--db-text-main);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-width: 120px;
}
/* Contenedor o bloque principal */
.module-card {
  width: calc(25% - 18px);
}

/* Contenedor o bloque principal */
.db-card:hover {
  transform: translateY(-8px);
  background-color: var(--db-card-hover-bg);
  border-color: var(--primary);
  box-shadow: 0 12px 28px var(--db-card-shadow), 0 0 0 1px var(--primary-glow);
}

/* Modal del dashboard */
.frm_modal .box_modal {
  background-color: var(--db-modal-bg);
  border-color: var(--db-modal-border);
  color: var(--db-text-main);
}

/* ---- Activar modo pantalla completa ---- */
body.dashboard-mode {
  display: block;
  padding: 0;
  overflow: hidden;
}
/* Estilos base del documento o estado del cuerpo */
body.dashboard-mode .bg-animation {
  display: none;
}
/* Estilos base del documento o estado del cuerpo */
body.dashboard-mode #app_card.cristal_card {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: var(--db-main-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Estilos base del documento o estado del cuerpo */
body.dashboard-mode #app_card.cristal_card:hover {
  transform: none;
  box-shadow: none;
}
body.dashboard-mode .contenedor_temas { display: none !important; }
/* Estilos base del documento o estado del cuerpo */
body.dashboard-mode #frm_dashboard {
  display: flex !important;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  animation: none;
}

/* Estilos base del documento o estado del cuerpo */
body.dashboard-mode #panel_contenido_scroll {
  align-items: flex-start !important;
  min-height: 0 !important;
}

/* Estilos base del documento o estado del cuerpo */
body.dashboard-mode #panel_contenido {
  height: 100% !important;
  min-height: 0 !important;
  background: transparent !important;
}

/* Emojis para botón de día/noche */
.theme-icon-sun, .theme-icon-moon {
  display: none;
}
/* Estilos base del documento o estado del cuerpo */
body:not(.light-theme) .theme-icon-moon {
  display: inline-block;
}
/* Estilos base del documento o estado del cuerpo */
body.light-theme .theme-icon-sun {
  display: inline-block;
}

/* ==========================================================================
  ESTILOS PARA EL ENCABEZADO / NAVBAR (HEADER)
  ========================================================================== */
/* Estilos del encabezado */
.db-header {
  background-color: var(--db-sidebar-bg);
  border-bottom: 1px solid var(--db-sidebar-border);
  backdrop-filter: blur(10px);
}

/* Estilos del encabezado */
.db-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

/* Estilos del encabezado */
.header_flotante {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  pointer-events: none;
}

/* Estilos del encabezado */
.header_flotante > * {
  pointer-events: auto;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .db-menu-btn {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .pill_agencia {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.45); /* Rojo: bridge inactivo por defecto */
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.10);
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .pill_agencia:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.35);
}

/* Contenedor o bloque principal */
#frm_dashboard .panel_main {
  position: relative;
}

/* Centrar avatar cuando el sidebar está colapsado */
.sidebar_principal.w-20 .border-t.border_sidebar .flex.items-center.justify-between {
  justify-content: center !important;
}

/* Estilos del panel lateral */
.sidebar_principal.w-20 .border-t.border_sidebar .flex.items-center.gap-3 {
  justify-content: center !important;
  width: 100% !important;
  gap: 0 !important;
}

/* Estilos del panel lateral */
.sidebar_principal.w-20 #img_avatar {
  margin: 0 auto !important;
}

/* Dropdown del avatar (Cerrar sesión) */
#menu_agencia_inner {
  background-color: var(--db-sidebar-bg);
  border-color: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  width: 100%;
}

/* Estilo para #menu_agencia */
#menu_agencia {
  width: 100%;
}

/* Estilos del boton o accion */
#menu_agencia button {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

/* Estilos del boton o accion */
#menu_agencia button {
  background: transparent;
  border: none;
  color: var(--db-text-main);
  cursor: pointer;
}

/* Estilos del boton o accion */
#menu_agencia button:hover {
  background-color: var(--db-card-bg);
}

/* Estilos del boton o accion */
#menu_agencia button:last-child {
  color: #ef4444;
}

/* Estilos del boton o accion */
#menu_agencia button:last-child:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* Estilos del boton o accion */
.db-menu-btn {
  background: var(--db-card-bg);
  border: 1px solid var(--db-card-border);
  color: var(--db-text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Estilos del boton o accion */
.db-menu-btn:hover {
  background: var(--db-nav-hover-bg);
  transform: scale(1.05);
}

/* Estilo para .pill_agencia */
.pill_agencia {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.45); /* Rojo: bridge inactivo por defecto */
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.12);
  transition: var(--transition-smooth);
}

/* Estilo para .pill_agencia:hover */
.pill_agencia:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: var(--db-card-bg);
}

/* Estilo para .pill_agencia.bridge-active */
.pill_agencia.bridge-active {
  border-color: #10b981 !important; /* Verde success */
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .pill_agencia.bridge-active {
  border-color: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

html, body { height: 100%; }
body { margin: 0; }
.flex { display: flex; }
.grid { display: grid; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.top-full { top: 100%; }
.right-0 { right: 0; }
.w-full { width: 100%; }
.w-20 { width: 5rem; }
.w-64 { width: 16rem; }
.w-9 { width: 2.25rem; }
.w-7 { width: 1.75rem; }
.w-4 { width: 1rem; }
.h-9 { height: 2.25rem; }
.h-7 { height: 1.75rem; }
.h-4 { height: 1rem; }
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid rgba(255,255,255,0.12); }
.border-b { border-bottom: 1px solid rgba(255,255,255,0.12); }
.border-t { border-top: 1px solid rgba(255,255,255,0.12); }
.border-slate-700 { border-color: #334155; }
.border-slate-700\/50 { border-color: rgba(51,65,85,0.5); }
.border-slate-700\/80 { border-color: rgba(51,65,85,0.8); }
.border-white\/10 { border-color: rgba(255,255,255,0.1); }
.border-white\/12 { border-color: rgba(255,255,255,0.12); }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-700 { background-color: #334155; }
.bg-slate-600 { background-color: #475569; }
.bg-white { background-color: #fff; }
.bg-transparent { background-color: transparent; }
.bg-black { background-color: #000; }
.bg-black\/60 { background-color: rgba(0,0,0,0.6); }
.bg-purple-600 { background-color: #9333ea; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-orange-500 { background-color: #f97316; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-teal-500 { background-color: #14b8a6; }
.bg-pink-500 { background-color: #ec4899; }
.bg-yellow-500 { background-color: #eab308; }
.bg-cyan-500 { background-color: #06b6d4; }
.bg-purple-500 { background-color: #a855f7; }
.bg-red-500 { background-color: #ef4444; }
.text-white { color: #fff; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-700 { color: #334155; }
.text-indigo-400 { color: #818cf8; }
.text-emerald-500 { color: #10b981; }
.text-rose-500 { color: #f43f5e; }
.text-sky-500 { color: #0ea5e9; }
.text-pink-500 { color: #ec4899; }
.text-yellow-500 { color: #eab308; }
.text-orange-500 { color: #f97316; }
.text-purple-500 { color: #a855f7; }
.text-blue-500 { color: #3b82f6; }
.text-teal-500 { color: #14b8a6; }
.text-cyan-500 { color: #06b6d4; }
.text-red-500 { color: #ef4444; }
.text-amber-500 { color: #f59e0b; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }
.uppercase { text-transform: uppercase; }
.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }
.transition-all { transition: all .3s ease; }
.transition-colors { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.transition-transform { transition: transform .15s ease; }
.duration-300 { transition-duration: .3s; }
.shadow-xl { box-shadow: 0 25px 50px rgba(0,0,0,0.35); }
.shadow-lg { box-shadow: 0 18px 30px rgba(0,0,0,0.25); }
.shadow { box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: .25; }
.opacity-50 { opacity: .5; }
.opacity-60 { opacity: .6; }
.opacity-75 { opacity: .75; }
.opacity-100 { opacity: 1; }
.aspect-square { aspect-ratio: 1 / 1; }
.object-cover { object-fit: cover; }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:bg-slate-600:hover { background-color: #475569; }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:text-white:hover { color: #fff; }
.hover\:border-slate-600:hover { border-color: #475569; }
.md\:col-span-2 { grid-column: span 2 / span 2; }
.md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sm\:p-8 { padding: 2rem; }
.sm\:flex-row { flex-direction: row; }
.sm\:items-center { align-items: center; }
.sm\:justify-between { justify-content: space-between; }
.lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #080911; color: #f1f5f9; }

/* Estilo para .swatch_color */
.swatch_color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    #ef4444 0deg 60deg,
    #f97316 60deg 120deg,
    #eab308 120deg 180deg,
    #22c55e 180deg 240deg,
    #06b6d4 240deg 300deg,
    #a855f7 300deg 360deg
  );
}

/* Estilos del panel lateral */
.divisor_sidebar {
  border-top: 1px solid var(--db-sidebar-border);
  border-color: var(--db-sidebar-border);
}

/* Estilos Generales para Módulos con Sidebar e Historial */
.module-view {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* Contenedor o bloque principal */
.module-main-content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  height: 100% !important;
  overflow: auto !important;
  padding-bottom: 72px !important;
}

/* ==========================================================================
   OFFLOADED JS CLASSES
   ========================================================================== */
/* Estilo para .db-avatar-img */
.db-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ==========================================================================
   MÓDULOS DEL DASHBOARD (movido desde modules.css)
   ========================================================================== */
/* ==========================================================================
  DASHBOARD: TARJETAS DE MÓDULOS
   ========================================================================== */

/* Estilo para .scroll_contenido */
.scroll_contenido {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  overflow-y: auto;

}

/* Contenedor o bloque principal */
.dashboard-grid-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Estilo para .dashboard-grid-shell */
.dashboard-grid-shell {
  width: min(100%, 860px);
  padding: 2rem 1.5rem 2rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Estilo para .panel_contenido */
.panel_contenido {
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Estilo para #panel_contenido.panel_contenido */
#panel_contenido.panel_contenido {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Estilo para #panel_contenido */
#panel_contenido {
  background: transparent;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Contenedor de módulo inyectado dinámicamente */
.module-view-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Estilo para .dashboard-hidden */
.dashboard-hidden {
  display: none !important;
}

/* Estilo para .dashboard-title */
.dashboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Estilo para .dashboard-subtitle */
.dashboard-subtitle {
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* Estilo para .dashboard-modules-grid */
.dashboard-modules-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 100%;
  margin: 0 auto;
}

/* Contenedor o bloque principal */
.dashboard-module-card {
  width: 115px;
  height: 115px;
  padding: 1rem 0.75rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--db-card-border);
  background: var(--db-card-bg);
  box-shadow: 0 4px 15px var(--db-card-shadow, rgba(0, 0, 0, 0.2));
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Contenedor o bloque principal */
.dashboard-module-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* Contenedor o bloque principal */
.dashboard-module-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--primary);
  background: var(--db-card-hover-bg);
  box-shadow: 0 0 0 1px var(--primary), 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* Contenedor o bloque principal */
.dashboard-module-card:active {
  transform: translateY(-1px) scale(0.99);
}

/* Contenedor o bloque principal */
.dashboard-module-card .txt_principal {
  display: block;
}

/* Estilo para .dashboard-module-icon */
.dashboard-module-icon {
  font-size: 1.5rem;
  margin-bottom: 0.55rem;
  transition: transform 0.2s ease;
}

/* Contenedor o bloque principal */
.dashboard-module-card:hover .dashboard-module-icon {
  transform: scale(1.1);
}

/* Estilo para .dashboard-module-label */
.dashboard-module-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--db-text-main);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.dashboard-module-icon--red { color: #ef4444; }
.dashboard-module-icon--green { color: #22c55e; }
.dashboard-module-icon--pink { color: #ec4899; }
.dashboard-module-icon--rose { color: #f43f5e; }
.dashboard-module-icon--amber { color: #f59e0b; }
.dashboard-module-icon--cyan { color: #06b6d4; }
.dashboard-module-icon--yellow { color: #eab308; }
.dashboard-module-icon--orange { color: #f97316; }
.dashboard-module-icon--purple { color: #a855f7; }
.dashboard-module-icon--blue { color: #3b82f6; }
.dashboard-module-icon--teal { color: #14b8a6; }
.dashboard-module-icon--slate { color: #94a3b8; }
.dashboard-module-icon--emerald { color: #10b981; }
.dashboard-module-icon--sky { color: #0ea5e9; }

/* Estilo para .frm_modal */
.frm_modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

/* Estilo para .box_modal — escoped al modal del dashboard para no contaminar otros módulos */
.frm_modal .box_modal {
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--db-card-border);
  text-align: center;
  width: 20rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* Estilo para .lbl_modal_titulo */
.lbl_modal_titulo {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--db-text-main);
}

/* Estilo para .txt_modal */
.txt_modal {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--db-text-muted);
}

/* Estilo para .lbl_modal_item */
.lbl_modal_item {
  font-size: 1rem;
  color: #a855f7;
}

/* Estilo para .btn_info_cerrar */
.btn_info_cerrar {
  width: 100%;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Estilo para .btn_info_cerrar:hover */
.btn_info_cerrar:hover {
  background: #6d28d9;
}

/* ==========================================================================
   MODAL GLOBAL DEL FACTOR DÓLAR (Copiado de calculadora.css)
   ========================================================================== */
/* Estilo para .overlay_calc */
.overlay_calc {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* Asegurar que se renderice sobre sidebars y headers */
}

/* Estilo para .overlay_calc.oculto */
.overlay_calc.oculto {
  display: none;
}

/* Estilo para .modal_calc */
.modal_calc {
  background: #1e1e2d;
  padding: 25px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Estilos del boton o accion */
.btn_modal_cerrar {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

/* Estilos del boton o accion */
.btn_modal_cerrar:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .btn_modal_cerrar {
  color: #64748b;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .btn_modal_cerrar:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.08);
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .modal_calc {
  background: #fff;
  color: #0f172a;
}

/* Estilo para .modal_calc h4 */
.modal_calc h4 {
  margin-top: 0;
  font-size: 18px;
  color: #fff;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .modal_calc h4 {
  color: #0f172a;
}

/* Estilo para .modal_calc p */
.modal_calc p {
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Estilo para .modal_dolar */
.modal_dolar {
  max-width: 340px;
}

/* Estilo para .icon_dolar */
.icon_dolar {
  font-size: 40px;
  margin-bottom: 6px;
}

/* Estilo para .modal_dolar h4 */
.modal_dolar h4 {
  font-size: 20px;
}

/* Contenedor o bloque principal */
.wrapper_dolar {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0 14px;
  margin: 12px auto 0;
  width: fit-content;
  min-width: 160px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Contenedor o bloque principal */
.wrapper_dolar:focus-within {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .wrapper_dolar {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
}

/* Estilo para .prefix_dolar */
.prefix_dolar {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary, #6366f1);
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  margin-right: 10px;
  line-height: 50px;
}

/* Estilos base del documento o estado del cuerpo */
body.light-theme .prefix_dolar {
  border-right-color: rgba(0, 0, 0, 0.1);
}

/* Estilo para .txt_dolar */
.txt_dolar {
  flex: none;
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: inherit;
  font-size: 22px;
  font-weight: 700;
  font-family: monospace;
  padding: 10px 0;
  width: 110px;
  text-align: left;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Estilo para .txt_dolar::placeholder */
.txt_dolar::placeholder {
  color: rgba(148, 163, 184, 0.4);
  font-size: 18px;
}

.txt_dolar::-webkit-inner-spin-button,
/* Estilos del boton o accion */
.txt_dolar::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Estilos del boton o accion */
.group_btn_modal {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

/* ==========================================================================
  MÓDULOS: BOTÓN CSS GLOBAL PARA OCULTAR/MOSTRAR EL HISTORIAL LATERAL
  Un solo checkbox (#chk_historial) controla el historial de TODOS
  los módulos: si se oculta en uno, queda oculto en todos.
  Técnica 100% CSS (checkbox + label + :has()).
   ========================================================================== */

/* El checkbox real queda invisible pero accesible para el teclado */
.chk_historial {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}

/* Manija flotante anclada al borde izquierdo del historial.
   Solo se muestra cuando hay un módulo abierto. */
.btn_chk_historial {
  position: fixed;
  top: 98.4%;
  right: 300px;
  transform: translateY(-50%);
  z-index: 30;
  width: 20px;
  height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  background: var(--db-sidebar-bg, var(--db-card-bg));
  color: var(--db-text-main);
  border: 1px solid var(--db-sidebar-border, var(--db-card-border));
  border-right: none;
  font-size: 14px;
  line-height: 1;
  transition: right 0.28s ease, background 0.2s ease, color 0.2s ease;
}

/* Mostrar la manija solo cuando el panel de contenido está activo */
body:has(#panel_contenido:not(.oculto)) .btn_chk_historial {
  display: flex;
}

.btn_chk_historial::before {
  content: "»";
}

.btn_chk_historial:hover {
  background: var(--db-nav-hover-bg, var(--db-card-hover-bg));
  color: var(--db-nav-active, #fff);
}

/* Estado oculto: la manija se pega al borde derecho y el icono cambia a "«" */
#chk_historial:checked + .btn_chk_historial {
  right: 0;
}

#chk_historial:checked + .btn_chk_historial::before {
  content: "«";
}

/* Ocultar la barra de historial en todos los módulos */
body:has(#chk_historial:checked) [id$="-sidebar"],
body:has(#chk_historial:checked) .panel_historial {
  display: none !important;
}

/* Liberar el espacio reservado por el historial en el pie fijo */
body:has(#chk_historial:checked) [id$="-footer"],
body:has(#chk_historial:checked) #panel_footer,
body:has(#chk_historial:checked) .panel_footer {
  right: 0 !important;
}

/* Liberar el espacio reservado por el historial en el contenido principal */
body:has(#chk_historial:checked) .frm_bid_cars #frm_bid_cars_vista {
  padding-right: 2rem;
}

body:has(#chk_historial:checked) .frm_revision .frm_revision_vista {
  margin-right: 0;
}

body:has(#chk_historial:checked) .frm_rtn .app-column {
  margin-right: 0;
}

/* Módulos con grilla 1fr 300px/280px: pasar a una sola columna */
body:has(#chk_historial:checked) .frm_calculadora,
body:has(#chk_historial:checked) #frm_calculadora,
body:has(#chk_historial:checked) .calculator-module,
body:has(#chk_historial:checked) .vehiculo-module,
body:has(#chk_historial:checked) .placa-module,
body:has(#chk_historial:checked) .mercaderia-module,
body:has(#chk_historial:checked) .ip500-module,
body:has(#chk_historial:checked) .factura-module,
body:has(#chk_historial:checked) .contable-module,
body:has(#chk_historial:checked) .consolidadora-module,
body:has(#chk_historial:checked) .censo-module,
body:has(#chk_historial:checked) .cafta-module,
body:has(#chk_historial:checked) .acta-module {
  grid-template-columns: 1fr !important;
}

/* La manija no debe imprimirse */
@media print {
  .btn_chk_historial {
    display: none !important;
  }
}
