/* ==========================================================================
   DECLARA FÁCIL MX — ESTILOS GLASSMORPHISM PROFESIONALES (DESKTOP-FIRST)
   Biselado Luxury 3D (Bordes Luminosos, Inset Highlights & Resplandor Esmeralda)
   Soporte Completo para 7 Temas Visuales (Incluyendo Prisma Arcoíris)
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* ========================================================================
     TEMA PREDETERMINADO: AZUL ZAFIRO CORPORATIVO (LUXURY FINTECH BEVEL & GLOW)
     ======================================================================== */
  --bg-gradient: radial-gradient(circle at 20% 15%, #0B2545 0%, #051329 55%, #020813 100%);
  --bg-primary: #020813;
  --bg-secondary: #071933;
  --sidebar-bg: rgba(5, 17, 36, 0.88);
  --card-bg: rgba(13, 38, 71, 0.68);
  --card-border: rgba(56, 189, 248, 0.35);
  --card-highlight: rgba(255, 255, 255, 0.5);
  --card-border-hover: rgba(56, 189, 248, 0.70);
  --accent: #0284C7;
  --accent-glow: rgba(56, 189, 248, 0.45);
  --accent-bright: #38BDF8;
  --text-main: #FFFFFF;
  --text-sub: #BAE6FD;
  --text-muted: #7DD3FC;
  --primary-btn-bg: linear-gradient(180deg, #38BDF8 0%, #0284C7 55%, #0369A1 100%);
  --primary-btn-shadow: 0 8px 24px rgba(2, 132, 199, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(5, 17, 36, 0.88);
  --pill-bg: rgba(11, 40, 75, 0.78);
  --pill-border: rgba(56, 189, 248, 0.4);
  --sidebar-width: 255px;
  --header-height: 64px;
  --glass-blur: blur(28px) saturate(190%);
  --bevel-box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  --invoice-btn-bg: linear-gradient(135deg, rgba(2, 132, 199, 0.16) 0%, rgba(5, 19, 41, 0.45) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(2, 132, 199, 0.28) 0%, rgba(5, 19, 41, 0.65) 100%);
  --invoice-btn-border: rgba(56, 189, 248, 0.45);
  --invoice-btn-border-hover: #38BDF8;
  --invoice-icon-bg: rgba(2, 132, 199, 0.25);
  --invoice-icon-border: rgba(56, 189, 248, 0.5);
  --invoice-icon-color: #38BDF8;
  --invoice-sub-color: #BAE6FD;
}

/* ==========================================================================
   LOS 7 TEMAS VISUALES CON BISELADO Y CONTRASTES LUMINOSOS
   ========================================================================== */

/* 1. Esmeralda RESICO */
[data-theme="emerald"] {
  --bg-gradient: radial-gradient(circle at 20% 15%, #062b1d 0%, #03130d 55%, #010805 100%);
  --bg-primary: #020b07;
  --bg-secondary: #051a12;
  --sidebar-bg: rgba(4, 22, 15, 0.88);
  --card-bg: rgba(6, 38, 26, 0.65);
  --card-border: rgba(52, 211, 153, 0.35);
  --card-border-hover: rgba(52, 211, 153, 0.70);
  --card-highlight: rgba(255, 255, 255, 0.45);
  --accent: #10B981;
  --accent-glow: rgba(16, 185, 129, 0.45);
  --accent-bright: #34D399;
  --text-main: #FFFFFF;
  --text-sub: #A7F3D0;
  --text-muted: #6EE7B7;
  --pill-bg: rgba(10, 52, 36, 0.78);
  --pill-border: rgba(52, 211, 153, 0.4);
  --primary-btn-bg: linear-gradient(180deg, #34D399 0%, #10B981 55%, #059669 100%);
  --primary-btn-shadow: 0 8px 24px rgba(16, 185, 129, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(4, 22, 15, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(6, 78, 59, 0.28) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(6, 78, 59, 0.45) 100%);
  --invoice-btn-border: rgba(52, 211, 153, 0.45);
  --invoice-btn-border-hover: #34D399;
  --invoice-icon-bg: rgba(16, 185, 129, 0.25);
  --invoice-icon-border: rgba(52, 211, 153, 0.5);
  --invoice-icon-color: #34D399;
  --invoice-sub-color: #A7F3D0;
}

/* 2. Azul Zafiro Corporativo (Honorarios / Act. Empresarial) */
[data-theme="sapphire"] {
  --bg-gradient: radial-gradient(circle at 20% 15%, #0B2545 0%, #051329 55%, #020813 100%);
  --bg-primary: #020813;
  --bg-secondary: #071933;
  --sidebar-bg: rgba(5, 17, 36, 0.88);
  --card-bg: rgba(13, 38, 71, 0.68);
  --card-border: rgba(56, 189, 248, 0.35);
  --card-border-hover: rgba(56, 189, 248, 0.70);
  --card-highlight: rgba(255, 255, 255, 0.5);
  --accent: #0284C7;
  --accent-glow: rgba(56, 189, 248, 0.45);
  --accent-bright: #38BDF8;
  --text-main: #FFFFFF;
  --text-sub: #BAE6FD;
  --text-muted: #7DD3FC;
  --pill-bg: rgba(11, 40, 75, 0.78);
  --pill-border: rgba(56, 189, 248, 0.4);
  --primary-btn-bg: linear-gradient(180deg, #38BDF8 0%, #0284C7 55%, #0369A1 100%);
  --primary-btn-shadow: 0 8px 24px rgba(2, 132, 199, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(5, 17, 36, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(2, 132, 199, 0.16) 0%, rgba(5, 19, 41, 0.45) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(2, 132, 199, 0.28) 0%, rgba(5, 19, 41, 0.65) 100%);
  --invoice-btn-border: rgba(56, 189, 248, 0.45);
  --invoice-btn-border-hover: #38BDF8;
  --invoice-icon-bg: rgba(2, 132, 199, 0.25);
  --invoice-icon-border: rgba(56, 189, 248, 0.5);
  --invoice-icon-color: #38BDF8;
  --invoice-sub-color: #BAE6FD;
}

/* 3. Púrpura Amatista Fiscal */
[data-theme="amethyst"] {
  --bg-gradient: radial-gradient(circle at 20% 15%, #250b44 0%, #110423 55%, #06010d 100%);
  --bg-primary: #06010d;
  --bg-secondary: #17072d;
  --sidebar-bg: rgba(18, 4, 34, 0.88);
  --card-bg: rgba(43, 15, 75, 0.68);
  --card-border: rgba(192, 132, 252, 0.36);
  --card-border-hover: rgba(192, 132, 252, 0.70);
  --card-highlight: rgba(255, 255, 255, 0.5);
  --accent: #9333EA;
  --accent-glow: rgba(168, 85, 247, 0.48);
  --accent-bright: #C084FC;
  --text-main: #FFFFFF;
  --text-sub: #E9D5FF;
  --text-muted: #D8B4FE;
  --pill-bg: rgba(48, 17, 84, 0.78);
  --pill-border: rgba(192, 132, 252, 0.4);
  --primary-btn-bg: linear-gradient(180deg, #C084FC 0%, #9333EA 55%, #7E22CE 100%);
  --primary-btn-shadow: 0 8px 24px rgba(147, 51, 234, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(18, 4, 34, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(147, 51, 234, 0.16) 0%, rgba(23, 7, 45, 0.45) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(147, 51, 234, 0.28) 0%, rgba(23, 7, 45, 0.65) 100%);
  --invoice-btn-border: rgba(192, 132, 252, 0.45);
  --invoice-btn-border-hover: #C084FC;
  --invoice-icon-bg: rgba(147, 51, 234, 0.25);
  --invoice-icon-border: rgba(192, 132, 252, 0.5);
  --invoice-icon-color: #C084FC;
  --invoice-sub-color: #E9D5FF;
}

/* 4. Naranja Ámbar Cálido */
[data-theme="amber"] {
  --bg-gradient: radial-gradient(circle at 20% 15%, #381a04 0%, #1a0c02 55%, #080300 100%);
  --bg-primary: #0a0401;
  --bg-secondary: #220f04;
  --sidebar-bg: rgba(26, 11, 2, 0.88);
  --card-bg: rgba(54, 25, 8, 0.68);
  --card-border: rgba(251, 146, 60, 0.35);
  --card-border-hover: rgba(251, 146, 60, 0.70);
  --card-highlight: rgba(255, 255, 255, 0.45);
  --accent: #EA580C;
  --accent-glow: rgba(249, 115, 22, 0.45);
  --accent-bright: #FB923C;
  --text-main: #FFFFFF;
  --text-sub: #FED7AA;
  --text-muted: #FDBA74;
  --pill-bg: rgba(62, 28, 7, 0.78);
  --pill-border: rgba(251, 146, 60, 0.4);
  --primary-btn-bg: linear-gradient(180deg, #FB923C 0%, #EA580C 55%, #C2410C 100%);
  --primary-btn-shadow: 0 8px 24px rgba(234, 88, 12, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(26, 11, 2, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(234, 88, 12, 0.16) 0%, rgba(34, 15, 4, 0.45) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(234, 88, 12, 0.28) 0%, rgba(34, 15, 4, 0.65) 100%);
  --invoice-btn-border: rgba(251, 146, 60, 0.45);
  --invoice-btn-border-hover: #FB923C;
  --invoice-icon-bg: rgba(234, 88, 12, 0.25);
  --invoice-icon-border: rgba(251, 146, 60, 0.5);
  --invoice-icon-color: #FB923C;
  --invoice-sub-color: #FED7AA;
}

/* 5. Amarillo Oro Premium (Auditoría) */
[data-theme="gold"] {
  --bg-gradient: radial-gradient(circle at 20% 15%, #332603 0%, #171101 55%, #080600 100%);
  --bg-primary: #0a0801;
  --bg-secondary: #211903;
  --sidebar-bg: rgba(23, 17, 1, 0.88);
  --card-bg: rgba(51, 39, 6, 0.68);
  --card-border: rgba(250, 204, 21, 0.38);
  --card-border-hover: rgba(250, 204, 21, 0.70);
  --card-highlight: rgba(255, 255, 255, 0.5);
  --accent: #CA8A04;
  --accent-glow: rgba(234, 179, 8, 0.45);
  --accent-bright: #FDE047;
  --text-main: #FFFFFF;
  --text-sub: #FEF08A;
  --text-muted: #FACC15;
  --pill-bg: rgba(58, 44, 7, 0.78);
  --pill-border: rgba(250, 204, 21, 0.4);
  --primary-btn-bg: linear-gradient(180deg, #FDE047 0%, #CA8A04 55%, #A16207 100%);
  --primary-btn-shadow: 0 8px 24px rgba(202, 138, 4, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(23, 17, 1, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(202, 138, 4, 0.16) 0%, rgba(33, 25, 3, 0.45) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(202, 138, 4, 0.28) 0%, rgba(33, 25, 3, 0.65) 100%);
  --invoice-btn-border: rgba(250, 204, 21, 0.45);
  --invoice-btn-border-hover: #FDE047;
  --invoice-icon-bg: rgba(202, 138, 4, 0.25);
  --invoice-icon-border: rgba(250, 204, 21, 0.5);
  --invoice-icon-color: #FDE047;
  --invoice-sub-color: #FEF08A;
}

/* 6. Cian Neón Tech (Plataformas) */
[data-theme="cyan"] {
  --bg-gradient: radial-gradient(circle at 20% 15%, #052936 0%, #02141c 55%, #01070a 100%);
  --bg-primary: #01070a;
  --bg-secondary: #041d27;
  --sidebar-bg: rgba(3, 20, 28, 0.88);
  --card-bg: rgba(8, 44, 59, 0.68);
  --card-border: rgba(34, 211, 238, 0.36);
  --card-border-hover: rgba(34, 211, 238, 0.70);
  --card-highlight: rgba(255, 255, 255, 0.5);
  --accent: #0891B2;
  --accent-glow: rgba(6, 182, 212, 0.45);
  --accent-bright: #22D3EE;
  --text-main: #FFFFFF;
  --text-sub: #A5F3FC;
  --text-muted: #67E8F9;
  --pill-bg: rgba(7, 49, 66, 0.78);
  --pill-border: rgba(34, 211, 238, 0.4);
  --primary-btn-bg: linear-gradient(180deg, #67E8F9 0%, #0891B2 55%, #0E7490 100%);
  --primary-btn-shadow: 0 8px 24px rgba(8, 145, 178, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(3, 20, 28, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(8, 145, 178, 0.16) 0%, rgba(4, 29, 39, 0.45) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(8, 145, 178, 0.28) 0%, rgba(4, 29, 39, 0.65) 100%);
  --invoice-btn-border: rgba(34, 211, 238, 0.45);
  --invoice-btn-border-hover: #22D3EE;
  --invoice-icon-bg: rgba(8, 145, 178, 0.25);
  --invoice-icon-border: rgba(34, 211, 238, 0.5);
  --invoice-icon-color: #22D3EE;
  --invoice-sub-color: #A5F3FC;
}

/* 7. Prisma Arcoíris / Inclusivo (Diversity Glow & Aurora Spectrum) */
[data-theme="rainbow"] {
  --bg-gradient: radial-gradient(circle at 10% 20%, #2e0854 0%, #0f172a 40%, #032b1d 80%, #020617 100%);
  --bg-primary: #070913;
  --bg-secondary: #101426;
  --sidebar-bg: rgba(14, 16, 32, 0.88);
  --card-bg: rgba(22, 24, 48, 0.70);
  --card-border: rgba(244, 63, 94, 0.45);
  --card-border-hover: rgba(244, 63, 94, 0.75);
  --card-highlight: rgba(255, 255, 255, 0.6);
  --accent: #EC4899;
  --accent-glow: rgba(236, 72, 153, 0.5);
  --accent-bright: #F472B6;
  --text-main: #FFFFFF;
  --text-sub: #E2E8F0;
  --text-muted: #F472B6;
  --pill-bg: rgba(34, 22, 58, 0.78);
  --pill-border: rgba(244, 63, 94, 0.45);
  --primary-btn-bg: linear-gradient(135deg, #F43F5E 0%, #FB923C 25%, #FBBF24 50%, #34D399 75%, #38BDF8 100%);
  --primary-btn-shadow: 0 8px 24px rgba(236, 72, 153, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  --dock-bg: rgba(14, 16, 32, 0.88);
  --invoice-btn-bg: linear-gradient(135deg, rgba(244, 63, 94, 0.16) 0%, rgba(56, 189, 248, 0.16) 100%);
  --invoice-btn-hover-bg: linear-gradient(135deg, rgba(244, 63, 94, 0.28) 0%, rgba(56, 189, 248, 0.28) 100%);
  --invoice-btn-border: rgba(244, 63, 94, 0.45);
  --invoice-btn-border-hover: #F472B6;
  --invoice-icon-bg: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(56, 189, 248, 0.25));
  --invoice-icon-border: rgba(244, 63, 94, 0.5);
  --invoice-icon-color: #F472B6;
  --invoice-sub-color: #E2E8F0;
}

[data-theme="rainbow"] .rainbow-text-glow {
  background: linear-gradient(135deg, #F43F5E 0%, #FB923C 20%, #FBBF24 40%, #34D399 60%, #38BDF8 80%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.4));
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT RESPONSIVE ESCRITORIO (OPTIMIZADO PARA MAC 13", 14" Y PANTALLAS ANCHAS)
   ========================================================================== */
.app-container {
  display: flex;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* BARRA LATERAL (SIDEBAR) CON BISEL SUPERIOR Y SOMBRA PROFUNDA */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--card-border);
  border-top: 1.5px solid var(--card-highlight);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 18px 12px;
  box-shadow: 10px 0 32px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), padding 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.38);
}

.sidebar > * {
  flex-shrink: 0;
}

/* MODO SIDEBAR COLAPSADA (MÁXIMO ESPACIO PARA LAPTOPS MAC 13") */
.app-container.sidebar-collapsed {
  --sidebar-width: 68px;
}

.app-container.sidebar-collapsed .sidebar {
  padding: 16px 8px;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-container.sidebar-collapsed .brand-wrap {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  width: 100%;
}

.app-container.sidebar-collapsed .brand-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto;
}

.app-container.sidebar-collapsed .brand-icon img {
  width: 40px;
  height: 40px;
}

.app-container.sidebar-collapsed .brand-text-block,
.app-container.sidebar-collapsed .regimen-selector-container,
.app-container.sidebar-collapsed .nav-item span,
.app-container.sidebar-collapsed .sidebar-footer {
  display: none !important;
}

.app-container.sidebar-collapsed .nav-menu {
  align-items: center;
  width: 100%;
  gap: 10px;
}

.app-container.sidebar-collapsed .nav-item {
  justify-content: center;
  align-items: center;
  padding: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin: 0 auto;
}

.app-container.sidebar-collapsed .nav-item svg {
  width: 22px;
  height: 22px;
  margin: 0;
}

/* BOTÓN DISCRETO DE COLAPSO DE SIDEBAR */
.sidebar-collapse-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1.2px solid rgba(255, 255, 255, 0.4);
  color: var(--text-sub);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--pill-bg);
  border-color: var(--accent-bright);
  color: #FFF;
  transform: scale(1.08);
}

.app-container.sidebar-collapsed .sidebar-collapse-btn {
  margin: 2px auto 0;
  width: 34px;
  height: 24px;
  border-radius: 6px;
}

.app-container.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.app-container.sidebar-collapsed .sidebar-collapse-btn:hover {
  transform: rotate(180deg) scale(1.08);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
  position: relative;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* ICONO OFICIAL ESTÁTICO DE PRISMA FISCAL (IDENTIDAD INMUTABLE Y ALTAMENTE VISIBLE) */
.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 16px rgba(0, 245, 255, 0.45));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  user-select: none;
}

.brand-icon:hover {
  transform: translateY(-1.5px) scale(1.05);
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 24px rgba(0, 245, 255, 0.65));
}

.brand-icon img {
  width: 48px;
  height: 48px;
  display: block;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.4px;
  color: #FFFFFF;
}

.brand-subtitle {
  font-size: 0.70rem;
  color: #38BDF8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 800;
  opacity: 0.9;
}

/* ==========================================================================
   TARJETA / BOTÓN DE PERFIL FISCAL EN SIDEBAR (RFC DEL CONTRIBUYENTE)
   ========================================================================== */
.sidebar-taxpayer-card {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-top: 1.5px solid var(--card-highlight);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  user-select: none;
}

.sidebar-taxpayer-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 12px var(--accent-glow);
}

.sidebar-taxpayer-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--invoice-icon-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.sidebar-taxpayer-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  flex: 1;
}

.sidebar-taxpayer-lbl {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.sidebar-taxpayer-rfc {
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.sidebar-taxpayer-edit-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-sub);
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-taxpayer-card:hover .sidebar-taxpayer-edit-btn {
  background: var(--accent-bright);
  color: #04160F;
  border-color: #FFFFFF;
}

/* Modo Sidebar Colapsado */
.app-container.sidebar-collapsed .sidebar-taxpayer-card {
  justify-content: center;
  padding: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin: 0 auto 12px;
}

.app-container.sidebar-collapsed .sidebar-taxpayer-info,
.app-container.sidebar-collapsed .sidebar-taxpayer-edit-btn {
  display: none !important;
}

/* PÍLDORA INFORMATIVA DE RFC EN DROPZONE */
.dropzone-rfc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.25);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dropzone-rfc-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-bright);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.dropzone-pill-hint {
  font-size: 0.70rem;
  color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* ==========================================================================
   SELECTOR COMPACTO DE RÉGIMEN EN SIDEBAR (AHORRO MÁXIMO DE ESPACIO)
   ========================================================================== */
.regimen-selector-container {
  position: relative;
  margin-bottom: 20px;
}

.sidebar-section-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 8px;
}

.custom-regimen-select {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-top: 1.5px solid var(--card-highlight);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  user-select: none;
}

.custom-regimen-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-border-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 12px var(--accent-glow);
}

.regimen-select-current {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.regimen-dot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-bright);
  border: 1.5px solid #FFF;
  box-shadow: 0 0 10px var(--accent-bright);
  flex-shrink: 0;
}

.regimen-select-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.regimen-select-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #FFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.regimen-select-sub {
  font-size: 0.70rem;
  color: var(--accent-bright);
  font-weight: 600;
  line-height: 1.2;
}

.regimen-chevron {
  color: var(--text-sub);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  margin-left: 6px;
}

.regimen-selector-container.open .regimen-chevron {
  transform: rotate(180deg);
  color: #FFF;
}

/* MENÚ DESPLEGABLE FLOTANTE CON BISEL Y GLASSOVER */
.regimen-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  border-radius: 16px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75), 0 0 24px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  animation: dropdownSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.regimen-selector-container.open .regimen-dropdown-menu {
  display: flex;
}

@keyframes dropdownSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.regimen-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.regimen-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.regimen-dropdown-item.active {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--card-border);
  border-top: 1.5px solid var(--card-highlight);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.regimen-item-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.regimen-item-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #FFF;
  line-height: 1.25;
}

.regimen-item-desc {
  font-size: 0.70rem;
  color: var(--text-sub);
  line-height: 1.25;
}

.regimen-dropdown-item.active .regimen-item-title {
  color: var(--accent-bright);
}

/* NAV LINKS CON EFECTOS DE BISEL */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 14px;
  color: var(--text-sub);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.nav-item.active {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: 1.5px solid var(--card-highlight);
  color: var(--accent-bright);
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 14px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   SIDEBAR FOOTER & SELECTOR DE ESTILOS / TEMAS DESPLEGABLE
   ========================================================================== */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-customizer-wrap {
  position: relative;
}

.theme-style-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  user-select: none;
}

.theme-style-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--card-border-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 14px var(--accent-glow);
}

.theme-style-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-style-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1.2px solid #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}

.theme-style-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.theme-style-main-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFF;
  line-height: 1.2;
}

.theme-style-sub-label {
  font-size: 0.70rem;
  color: var(--text-sub);
  line-height: 1.2;
}

.theme-current-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #FFF;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}

/* POPOVER DESPLEGABLE DE TEMAS FLOTANTE HACIA ARRIBA */
.theme-dropdown-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  border-radius: 18px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.75), 0 0 28px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  animation: popoverSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.theme-customizer-wrap.open .theme-dropdown-popover {
  display: flex;
}

@keyframes popoverSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.theme-popover-title {
  font-size: 0.70rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-options-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
}

.theme-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.theme-option-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.theme-option-row.active {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--card-border);
  border-top: 1.5px solid var(--card-highlight);
}

.theme-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-color-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.theme-option-name {
  font-size: 0.80rem;
  font-weight: 700;
  color: #FFF;
}

.theme-check-icon {
  color: var(--accent-bright);
  font-size: 0.85rem;
  font-weight: 900;
  display: none;
}

.theme-option-row.active .theme-check-icon {
  display: inline-block;
}

/* AREA PRINCIPAL (MAIN WRAPPER) ADAPTATIVA */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 20px 36px;
  box-sizing: border-box;
  overflow-x: hidden;
  transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1), width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   TOP NAVBAR DE ESCRITORIO CON BISEL LUXURY 3D & FLOATING COMMAND CENTER
   ========================================================================== */
.top-navbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: clamp(8px, 1.2vw, 16px);
  margin: 12px 0 20px 0;
  padding: 7px clamp(18px, 2vw, 26px) 7px clamp(12px, 1.4vw, 18px);
  position: sticky;
  top: 10px;
  z-index: 95;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  
  /* Cápsula flotante ejecutiva con degradado adaptativo y cristal esmerilado */
  background: linear-gradient(180deg, var(--card-bg) 0%, var(--sidebar-bg) 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  
  /* Biselado Luxury 3D con resplandor neón adaptativo a cada tema */
  border: 1px solid var(--card-border);
  border-top: 2px solid var(--card-highlight);
  border-bottom: 1.2px solid rgba(0, 0, 0, 0.7);
  box-shadow: 
    0 16px 36px -8px rgba(0, 0, 0, 0.75), 
    0 0 24px -4px var(--accent-glow), 
    inset 0 1.2px 1.5px rgba(255, 255, 255, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-navbar:hover {
  border-top-color: #FFFFFF;
  box-shadow: 
    0 20px 44px -6px rgba(0, 0, 0, 0.8), 
    0 0 32px -2px var(--accent-glow), 
    inset 0 1.5px 2px rgba(255, 255, 255, 0.45);
}

/* CONTENEDOR DE ESTADO SUPERIOR IZQUIERDO: PERIODO Y RÉGIMEN ARMONIZADOS */
.top-left-status {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 12px);
  flex-wrap: wrap;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}

/* PILL BISELADA DE PERIODO ACTIVO (INTERACTIVA 3D) */
.active-period-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, var(--pill-bg) 100%);
  border: 1px solid var(--pill-border);
  border-top: 2px solid #FFFFFF;
  padding: 8px 18px 8px 12px;
  border-radius: 999px;
  font-size: 0.90rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.5), 
    0 0 16px var(--accent-glow), 
    inset 0 1.2px 1.5px #FFFFFF;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.active-period-pill:hover {
  border-color: var(--accent-bright);
  border-top-color: #FFFFFF;
  box-shadow: 
    0 8px 24px var(--accent-glow), 
    0 0 24px var(--accent-glow), 
    inset 0 1.5px 2px #FFFFFF;
  transform: translateY(-1.5px);
  filter: brightness(1.12);
}

.active-period-pill:active {
  transform: translateY(0);
}

.period-pill-icon-box {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: var(--accent-bright);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.period-pill-text {
  letter-spacing: 0.2px;
  color: #FFFFFF;
}

.period-chevron-icon {
  width: 14px;
  height: 14px;
  stroke: var(--text-sub);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.active-period-pill:hover .period-chevron-icon {
  stroke: #FFFFFF;
  transform: translateY(1px);
  opacity: 1;
}

/* DIVISOR VERTICAL ENTRE PERIODO Y RÉGIMEN */
.top-status-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

/* CÁPSULA ESTÉTICA DEL RÉGIMEN ACTIVO */
.top-regimen-indicator {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1.4px solid rgba(255, 255, 255, 0.28);
  padding: 5px 14px 5px 12px;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.top-regimen-indicator.has-subactivity {
  padding: 6px 14px 6px 14px;
  border-radius: 16px;
  background: rgba(18, 12, 34, 0.48);
  border-color: rgba(192, 132, 252, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.regimen-line-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-regimen-indicator.has-subactivity .regimen-line-main {
  align-items: flex-start;
}

.regimen-pulse-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.top-regimen-indicator.has-subactivity .regimen-pulse-wrapper {
  margin-top: 5px;
}

.regimen-badge-column {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  position: relative;
}

.platform-subactivity-row {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

/* MICRO LED PULSANTE DE ESTADO DEL RÉGIMEN */
.regimen-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-bright);
  animation: pulseDot 2.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.85;
    box-shadow: 0 0 6px var(--accent-bright);
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
    box-shadow: 0 0 14px var(--accent-bright);
  }
}

.regimen-indicator-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.regimen-active-badge {
  color: #FFFFFF;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-top: 1.4px solid rgba(255, 255, 255, 0.65);
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

/* SELECTOR DE ACTIVIDAD EN PLATAFORMAS TECNOLÓGICAS (ART. 113-A LISR) - SEGUNDO RENGLÓN */
.platform-activity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  background: rgba(192, 132, 252, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.42);
  color: #F3E8FF;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.platform-activity-btn:hover {
  background: rgba(192, 132, 252, 0.28);
  border-color: #C084FC;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.35);
  transform: translateY(-1px);
}

.platform-activity-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 290px;
  background: rgba(8, 20, 42, 0.96);
  border: 1.5px solid rgba(192, 132, 252, 0.4);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 20px rgba(192, 132, 252, 0.15);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 4px;
}

.platform-activity-dropdown.open {
  display: flex;
}

.platform-dropdown-header {
  font-size: 0.66rem;
  font-weight: 800;
  color: #C084FC;
  letter-spacing: 0.6px;
  padding: 6px 8px 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
}

.platform-dropdown-item:hover {
  background: rgba(192, 132, 252, 0.15);
}

.platform-dropdown-item.active {
  background: rgba(192, 132, 252, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.45);
}

.platform-item-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.platform-item-content {
  flex: 1;
  text-align: left;
}

.platform-item-title {
  font-size: 0.80rem;
  font-weight: 750;
  color: #FFF;
  line-height: 1.2;
}

.platform-item-apps {
  font-size: 0.68rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.platform-item-rate {
  font-size: 0.74rem;
  font-weight: 800;
  color: #C084FC;
  background: rgba(192, 132, 252, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.platform-dropdown-footer {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px 2px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   COMMAND CENTER HEADER — ACCIONES SUPERIORES, AGRUPAMIENTO & ALTA ADAPTABILIDAD
   ========================================================================== */
.top-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 10px);
  flex-wrap: wrap;
  flex-shrink: 0;
  min-width: 0;
  justify-content: flex-end;
  max-width: 100%;
  margin-left: auto;
}

/* ==========================================================================
   CLÚSTER 2x2: LOS 4 BOTONES (2 ARRIBA, 2 ABAJO - MÁXIMO AHORRO DE ESPACIO)
   ========================================================================== */
.header-actions-cluster-2x2 {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  flex-shrink: 1;
  min-width: 0;
}

.header-actions-cluster-2x2 .header-actions-group {
  display: inline-flex;
  align-items: center;
  gap: clamp(2px, 0.4vw, 4px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1.2px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  padding: 2px clamp(2px, 0.3vw, 4px);
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.header-actions-cluster-2x2 .btn-header-action {
  height: 27px;
  padding: 0 clamp(6px, 0.7vw, 9px);
  font-size: clamp(0.70rem, 0.72vw, 0.74rem);
  border-radius: 7px;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  justify-content: center;
}

.header-actions-cluster-2x2 .btn-header-action .svg-icon {
  width: 13px;
  height: 13px;
}

/* GRUPOS FUNCIONALES DE ACCIONES (CÁPSULAS SEGMENTADAS DE CRISTAL PULIDO) */
.header-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1.2px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  padding: 3px;
  border-radius: 14px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3), 
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 1;
  min-width: 0;
}

/* GRUPO DE OPERACIONES CFDI / EXPORTACIÓN & CARGA (2 RENGLONES UNO SOBRE OTRO - ALTA ADAPTABILIDAD & FLEXIBILIDAD) */
.header-actions-group[data-group="actions"] {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1.2px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  padding: 2px 3px;
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 1;
  min-width: 0;
  justify-content: center;
  box-sizing: border-box;
  max-width: 100%;
}

.header-actions-group[data-group="actions"] .btn-header-action {
  height: 27px;
  padding: 0 clamp(8px, 0.9vw, 12px);
  font-size: clamp(0.71rem, 0.74vw, 0.76rem);
  border-radius: 7px;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  box-sizing: border-box;
}

.header-actions-group[data-group="actions"] .btn-header-action .svg-icon {
  width: 13px;
  height: 13px;
}

/* SEPARADOR ESTÉTICO ENTRE GRUPOS */
.top-actions-divider {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22) 20%, rgba(255, 255, 255, 0.22) 80%, transparent);
  margin: 0 clamp(1px, 0.3vw, 3px);
  flex-shrink: 0;
}

/* HOMOGENEIZACIÓN MATEMÁTICA DE TODOS LOS BOTONES DEL HEADER */
.btn-header-action {
  height: 35px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-header-action .svg-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* BOTÓN SECUNDARIO EN HEADER & BOTÓN MODO PANTALLA */
.top-actions .btn-secondary,
.btn-layout-mode {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(0, 0, 0, 0.45) 100%);
  border: 1px solid var(--card-border);
  border-top: 1.5px solid rgba(255, 255, 255, 0.55);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.top-actions .btn-secondary:hover,
.btn-layout-mode:hover {
  background: var(--pill-bg);
  border-color: var(--accent-bright);
  border-top-color: #FFFFFF;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 14px var(--accent-glow), inset 0 1.2px 1.5px #FFFFFF;
  transform: translateY(-1px);
}

/* BOTÓN PRIMARIO (SUBIR FACTURAS XML - CTA PRINCIPAL) */
.top-actions .btn-primary {
  background: var(--primary-btn-bg);
  border: 1px solid var(--accent-bright);
  border-top: 2px solid #FFFFFF;
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 18px var(--accent-glow), inset 0 1.2px 1.2px #FFFFFF;
}

.top-actions .btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
  box-shadow: 0 10px 28px var(--accent-glow), inset 0 1.8px 1.8px #FFFFFF;
}

.top-actions .btn-primary:active,
.top-actions .btn-secondary:active,
.btn-layout-mode:active {
  transform: translateY(0);
}

/* BADGE PLAN (FREEMIUM / PRO) ESTILIZADO */
.btn-header-plan {
  position: relative;
}

.header-plan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  transition: all 0.3s ease;
}

/* BADGE BÓVEDA CON FACTURAS PENDIENTES DE RESPALDO */
.vault-backup-badge {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
  line-height: 1.2;
}

/* RESPONSIVIDAD DE ETIQUETAS */
.btn-label-mobile {
  display: none;
}

@media (max-width: 1480px) {
  .top-navbar .btn-label-desktop {
    display: none;
  }
  .top-navbar .btn-label-mobile {
    display: inline;
  }
}

@media (max-width: 1260px) {
  .regimen-indicator-label {
    display: none;
  }
  .top-navbar {
    padding: 7px clamp(16px, 1.8vw, 22px) 7px clamp(10px, 1.2vw, 14px);
    gap: clamp(6px, 1vw, 10px);
  }
  .top-left-status {
    gap: clamp(4px, 0.7vw, 8px);
  }
  .active-period-pill {
    padding: 6px 12px 6px 10px;
    font-size: 0.82rem;
    gap: 7px;
  }
  .header-actions-group[data-group="actions"] .btn-header-action {
    padding: 0 clamp(6px, 0.7vw, 9px);
    font-size: 0.72rem;
  }
}

@media (max-width: 1080px) {
  .header-actions-cluster-2x2 .btn-header-action {
    padding: 0 5px;
    font-size: 0.68rem;
  }
  .header-actions-group[data-group="actions"] .btn-header-action {
    padding: 0 6px;
    font-size: 0.70rem;
  }
}

.mode-compact .top-navbar .btn-label-desktop {
  display: none;
}

.mode-compact .top-navbar .btn-label-mobile {
  display: inline;
}


/* ==========================================================================
   COMPONENTES GLASSMORPHISM CON BISELADO LUXURY 3D
   ========================================================================== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--bevel-box-shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.glass-card:hover {
  border-color: var(--card-border-hover);
  border-top: 2px solid #FFF;
}

/* STATS OVERVIEW GRID (TARJETAS BISELADAS SUPERIORES ADAPTATIVAS) */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-item-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--bevel-box-shadow);
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: all 0.25s ease;
}

.stat-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-bright);
  border-top: 2px solid #FFF;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 20px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.stat-item-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-item-value {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-item-sub {
  font-size: 0.72rem;
  color: var(--accent-bright);
  margin-top: 4px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BOTONES BISELADOS LUXURY 3D EXACTOS A LA CAPTURA */
.btn-primary {
  background: var(--primary-btn-bg);
  border: 1px solid var(--accent-bright);
  border-top: 1.8px solid #FFFFFF;
  color: #FFF;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 18px var(--accent-glow), inset 0 1.2px 1.2px #FFFFFF;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
  box-shadow: 0 10px 26px var(--accent-glow), inset 0 1.5px 1.5px #FFFFFF;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-top: 1.5px solid rgba(255, 255, 255, 0.45);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--card-border-hover);
  border-top: 1.8px solid #FFF;
  transform: translateY(-1px);
}

/* DROPZONE PANORÁMICO BISELADO */
.desktop-dropzone {
  border: 2px dashed var(--card-border);
  border-top: 2px dashed var(--card-highlight);
  border-radius: 24px;
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transition: all 0.25s ease;
  margin-bottom: 28px;
}

.desktop-dropzone:hover {
  border-color: var(--accent-bright);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 32px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.desktop-dropzone.dragover,
.desktop-dropzone.drag-over {
  border-color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 0 45px var(--accent-glow), inset 0 0 30px rgba(52, 211, 153, 0.28);
  transform: scale(1.015);
}

.dropzone-icon-large {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.35) 100%);
  border: 1.5px solid var(--card-border);
  border-top: 1.8px solid #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  box-shadow: 0 0 24px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   ENCABEZADOS DE TARJETAS Y CONTROLES DE ACCIÓN (EQUILIBRADO Y ESPACIOSO)
   ========================================================================== */
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  row-gap: 18px;
  column-gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.card-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title-main {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.2px;
  margin: 0;
}

.card-subtitle-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.45;
  margin: 0;
  padding-left: 32px;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-table-delete {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-top: 1.2px solid rgba(255, 255, 255, 0.4);
  color: #FCA5A5;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-table-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
  color: #FFF;
  transform: translateY(-1px);
}

/* ==========================================================================
   BARRA DE HERRAMIENTAS DE TABLA: FILTROS, BUSCADOR Y ALCANCE
   ========================================================================== */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* GRUPO DE PILLS DE FILTRADO */
.filter-pills-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.table-filter-pill {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.table-filter-pill:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.08);
}

.table-filter-pill.active {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.7);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 12px var(--accent-glow);
}

.pill-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text-muted);
}

.table-filter-pill.active .pill-badge {
  background: rgba(0, 0, 0, 0.6);
  color: var(--accent-bright);
}

.dot-ingreso {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 6px #34D399;
}

.dot-gasto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F87171;
  box-shadow: 0 0 6px #F87171;
}

.dot-deduccion {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C084FC;
  box-shadow: 0 0 6px #C084FC;
}

/* BUSCADOR EN TIEMPO REAL */
.table-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  flex: 1 1 200px;
}

.table-search-input {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 7px 32px 7px 34px;
  font-size: 0.82rem;
  color: #FFF;
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
  transition: all 0.25s ease;
  outline: none;
}

.table-search-input:focus {
  max-width: 300px;
  border-color: var(--accent-bright);
  box-shadow: 0 0 16px var(--accent-glow);
}

.table-search-wrap .search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-sub);
  pointer-events: none;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
}

/* BOTÓN DE ALCANCE (ESTE MES VS HISTORIAL) */
.scope-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pill-border);
  border-top: 1.5px solid rgba(255, 255, 255, 0.5);
  color: var(--text-main);
  font-size: 0.80rem;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  user-select: none;
}

.scope-toggle-btn:hover {
  background: var(--pill-bg);
  border-color: var(--accent-bright);
  color: #FFF;
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.scope-toggle-btn.all-active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(14, 165, 233, 0.08) 100%);
  border-color: #38BDF8;
  color: #BAE6FD;
}

/* TABLA ANCHA BISELADA ESTILO HOJA DE CÁLCULO */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.desktop-tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.desktop-tax-table th {
  background: rgba(0, 0, 0, 0.5);
  padding: 16px 18px;
  color: var(--text-sub);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--card-border);
}

.desktop-tax-table td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.desktop-tax-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* RESUMEN DE TOTALES AL PIE DE LA TABLA */
.table-totals-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--card-border);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  padding: 14px 22px;
  flex-wrap: wrap;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.total-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.total-label {
  color: var(--text-sub);
  font-weight: 700;
}

.total-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFF;
  font-variant-numeric: tabular-nums;
}

.total-item.total-highlight {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

/* ==========================================================================
   MODALES GLASSMORPHISM CON BISELADO Y DOBLE CONFIRMACIÓN
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-window-bevel {
  background: var(--bg-secondary);
  border: 1.5px solid var(--card-border);
  border-top: 2px solid #FFFFFF;
  border-radius: 26px;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.9), 0 0 40px var(--accent-glow), inset 0 1.2px 1.2px rgba(255, 255, 255, 0.5);
  padding: 26px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.4;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1.2px solid rgba(255, 255, 255, 0.35);
  color: #FFF;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #F87171;
  transform: rotate(90deg);
}

/* ==========================================================================
   SELECTOR ENCAPSULADO DE PERIODO / MES FISCAL (ESTILO RESICO CON BISEL)
   ========================================================================== */
.period-encapsulated-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  border-top: 1.5px solid var(--card-highlight);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.15), 0 10px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
  margin-bottom: 18px;
}

.period-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.period-card-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-preview-badge {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--accent-bright);
  border-top: 1.5px solid #FFF;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #FFF;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 0 12px var(--accent-glow);
}

.period-year-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1.2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
}

.year-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1.2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.year-toggle-btn:hover {
  background: var(--accent);
  border-color: var(--accent-bright);
  color: #fff;
  transform: scale(1.08);
}

.year-toggle-btn:active {
  transform: scale(0.95);
}

.current-year-display {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1.5px;
  font-family: 'JetBrains Mono', monospace;
}

.period-month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.month-chip-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1.2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 4px;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  user-select: none;
  box-sizing: border-box;
  min-height: 48px;
}

.month-chip-btn .m-code {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e2e8f0;
  line-height: 1;
}

.month-chip-btn .m-name {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
  opacity: 0.85;
}

.month-chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-2px);
}

.month-chip-btn.active {
  background: var(--card-bg);
  border: 1.5px solid var(--accent-bright);
  border-top: 1.8px solid #FFFFFF;
  box-shadow: 0 0 18px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  transform: scale(1.03);
}

.month-chip-btn.active .m-code {
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 0 8px var(--accent-bright);
}

.month-chip-btn.active .m-name {
  color: var(--accent-bright);
  font-weight: 700;
  opacity: 1;
}

.period-tip-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.period-tip-text {
  font-size: 0.78rem;
  color: #E2E8F0;
  line-height: 1.45;
}

/* ==========================================================================
   SVG ICONS HELPER
   ========================================================================== */
.svg-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}
.svg-xs { width: 12px; height: 12px; }
.svg-sm { width: 14px; height: 14px; }
.svg-md { width: 20px; height: 20px; }
.svg-lg { width: 28px; height: 28px; }

/* TOAST */
.toast-notification {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-bright);
  border-top: 1.8px solid #FFF;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 24px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  padding: 14px 22px;
  border-radius: 14px;
  color: #FFF;
  font-size: 0.90rem;
  font-weight: 700;
  z-index: 2000;
  display: none;
}

/* ==========================================================================
   SIMULADOR DE IMPUESTOS: TÍTULOS Y ETIQUETAS CENTRADOS CON 2 RENGLONES
   ========================================================================== */
.sim-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 28px;
}

.sim-title-centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.3px;
}

.sim-subtitle-centered {
  font-size: 0.85rem;
  color: var(--text-sub);
  text-align: center;
  max-width: 680px;
  line-height: 1.4;
}

.sim-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 20px 0;
}

.sim-input-card {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.sim-input-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border-hover);
}

.sim-input-label {
  display: block;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}

.sim-label-main {
  display: block;
  font-size: 0.80rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
}

.sim-label-paren {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-top: 3px;
  text-align: center;
  letter-spacing: 0.3px;
}

.sim-input-field {
  width: 100%;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.2px solid var(--card-border);
  border-top: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFF;
  outline: none;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.sim-input-field:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent-glow), inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.sim-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.sim-result-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  border-top: 1.8px solid var(--card-highlight);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--bevel-box-shadow);
}

.sim-result-header {
  font-size: 0.90rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.sim-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sim-result-row-label {
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.sim-result-row-paren {
  font-size: 0.70rem;
  color: var(--text-muted);
}

.sim-regimen-tab {
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.sim-regimen-tab:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.06);
}

.sim-regimen-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.sim-tab-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.sim-grand-total-card {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
  .sim-results-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECCIÓN: RESUMEN FISCAL ANUAL (CONCENTRADO DE 12 MESES)
   ========================================================================== */

/* SELECTOR DE EJERCICIO FISCAL ANUAL */
.annual-year-selector {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.35);
  padding: 4px;
  border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.annual-year-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.annual-year-btn:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.08);
}

.annual-year-btn.active {
  background: var(--primary-btn-bg);
  color: #FFFFFF;
  border-top: 1.2px solid #FFFFFF;
  box-shadow: 0 4px 12px var(--accent-glow);
  font-weight: 800;
}

/* TABLA DE RESUMEN ANUAL 12 MESES */
.annual-summary-table th {
  padding: 11px 8px;
  font-size: 0.74rem;
  text-align: center !important;
  vertical-align: middle;
  line-height: 1.25;
  letter-spacing: 0.3px;
  white-space: normal;
}

.annual-summary-table td {
  padding: 11px 8px;
  font-size: 0.84rem;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.annual-summary-table th:first-child,
.annual-summary-table td:first-child {
  text-align: left !important;
  padding-left: 20px !important;
  padding-right: 10px !important;
}

.annual-month-cell-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.annual-month-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.annual-summary-table tr.row-empty td {
  opacity: 0.75;
}

.annual-summary-table tr.row-with-data td {
  opacity: 1;
}

.month-bullet {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: inline-block;
  flex-shrink: 0;
}

.month-bullet.active {
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
}

.annual-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
  letter-spacing: 0.3px;
}

.annual-badge-active {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #A7F3D0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.annual-badge-empty {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.btn-goto-month {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.35);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-goto-month:hover {
  background: var(--pill-bg);
  border-color: var(--accent-bright);
  border-top-color: #FFFFFF;
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--accent-glow);
  transform: translateY(-1px);
}

/* FILA DE TOTALES ANUALES CON BISEL DE ORO/ESMERALDA */
.annual-total-row td {
  background: rgba(10, 52, 36, 0.55) !important;
  border-top: 2.2px solid var(--accent-bright) !important;
  border-bottom: 2.2px solid var(--accent-bright) !important;
  padding: 14px 8px !important;
  text-align: center !important;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   ADAPTABILIDAD ESPECÍFICA PARA PANTALLAS MAC 13", 14" Y RESOLUCIONES MENORES (≤ 1360px)
   ========================================================================== */
@media (max-width: 1360px) {
  :root {
    --sidebar-width: 245px;
  }

  .main-wrapper {
    padding: 0 16px 28px;
  }

  /* Grid 2x2 para tarjetas métricas superiores: amplio, legible y 100% dentro del margen */
  .stats-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-item-card {
    padding: 14px 16px;
  }

  .stat-item-value {
    font-size: 1.35rem;
  }

  /* Header compacto para Mac 13" */
  .top-navbar {
    padding: 8px clamp(16px, 1.8vw, 22px) 8px clamp(10px, 1.2vw, 14px);
    gap: clamp(6px, 1vw, 10px);
    margin: 10px 0 18px 0;
  }

  .active-period-pill {
    padding: 6px 12px;
    font-size: 0.82rem;
    gap: 8px;
  }

  .period-pill-icon-box {
    width: 24px;
    height: 24px;
  }

  .top-regimen-indicator {
    padding: 4px 10px;
    gap: 6px;
    font-size: 0.76rem;
  }

  .regimen-active-badge {
    padding: 3px 10px;
    font-size: 0.76rem;
  }

  .top-regimen-indicator.has-subactivity {
    padding: 5px 10px 5px 10px;
    border-radius: 14px;
  }

  .platform-activity-btn {
    padding: 2.5px 8px;
    font-size: 0.70rem;
  }

  .btn-header-action {
    height: 33px;
    padding: 0 9px;
    font-size: 0.76rem;
    gap: 5px;
  }

  .header-actions-group {
    padding: 2px;
    gap: 4px;
    border-radius: 12px;
  }

  .top-actions {
    gap: 6px;
  }

  .btn-label-desktop {
    display: none;
  }

  .btn-label-mobile {
    display: inline;
  }

  .card-header-flex {
    gap: 12px;
  }

  .card-title-main {
    font-size: 1.05rem;
  }

  .annual-summary-table th {
    padding: 9px 6px;
    font-size: 0.70rem;
    text-align: center !important;
    vertical-align: middle;
    line-height: 1.2;
    white-space: normal;
  }

  .annual-summary-table td {
    padding: 9px 6px;
    font-size: 0.80rem;
    vertical-align: middle;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  .annual-summary-table th:first-child,
  .annual-summary-table td:first-child {
    padding-left: 14px !important;
    padding-right: 6px !important;
    text-align: left !important;
  }
}

/* ==========================================================================
   MODO PANTALLA ANCHA / FULL ULTRAWIDE (MONITORES EXTERNOS)
   ========================================================================== */
.app-container.mode-wide .stats-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px;
}

.app-container.mode-wide .main-wrapper {
  padding: 0 32px 48px;
  max-width: 100%;
}

.app-container.mode-wide .stat-item-card {
  padding: 22px 24px;
}

.app-container.mode-wide .stat-item-value {
  font-size: 1.8rem;
}

.app-container.mode-wide .top-navbar {
  padding: 10px clamp(18px, 2vw, 26px) 10px clamp(14px, 1.5vw, 20px);
  gap: clamp(10px, 1.4vw, 18px);
}

.app-container.mode-wide .btn-header-action {
  height: 35px;
  padding: 0 12px;
  font-size: 0.80rem;
}

/* Proporciones elegantes y adaptativas en grupos de 2 renglones en modo panorámico */
.app-container.mode-wide .header-actions-cluster-2x2 .btn-header-action,
.app-container.mode-wide .header-actions-group[data-group="actions"] .btn-header-action {
  height: 28px !important;
  padding: 0 clamp(8px, 0.9vw, 12px) !important;
  font-size: 0.76rem !important;
}

.app-container.mode-wide .header-actions-group[data-group="actions"],
.app-container.mode-wide .header-actions-cluster-2x2 .header-actions-group {
  padding: 2px 3px !important;
  gap: 3px !important;
  border-radius: 9px !important;
}

/* ==========================================================================
   MODO VISTA COMPACTA (ALTA DENSIDAD)
   ========================================================================== */
.app-container.mode-compact {
  font-size: 0.88rem;
}

.app-container.mode-compact .main-wrapper {
  padding: 0 14px 24px;
}

.app-container.mode-compact .top-navbar {
  padding: 6px 12px;
  margin: 8px 0 14px 0;
}

.app-container.mode-compact .btn-header-action {
  height: 31px;
  padding: 0 8px;
  font-size: 0.74rem;
}

.app-container.mode-compact .header-actions-group {
  padding: 2px;
  gap: 3px;
  border-radius: 11px;
}

.app-container.mode-compact .btn-label-desktop {
  display: none;
}

.app-container.mode-compact .btn-label-mobile {
  display: inline;
}

.app-container.mode-compact .stats-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px;
}

.app-container.mode-compact .stat-item-card {
  padding: 12px 14px;
}

.app-container.mode-compact .stat-item-value {
  font-size: 1.25rem;
}

/* ==========================================================================
   PROTECCIÓN ANTI-DEFORMACIÓN EN VENTANAS COMPACTAS / DIVIDIDAS (SPLIT-SCREEN)
   Aplica incluso cuando está activo el modo "Panorámica" (.mode-wide) o "Compacta" (.mode-compact)
   ========================================================================== */
@media (max-width: 1180px) {
  .stats-overview-grid,
  .app-container.mode-wide .stats-overview-grid,
  .app-container.mode-compact .stats-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .app-container.mode-wide .stat-item-card {
    padding: 15px 16px;
  }

  .app-container.mode-wide .stat-item-value {
    font-size: 1.4rem;
  }

  .app-container.mode-wide .main-wrapper {
    padding: 0 16px 32px;
  }
}

@media (max-width: 1120px) {
  .top-navbar,
  .app-container.mode-wide .top-navbar,
  .app-container.mode-compact .top-navbar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 12px;
  }

  .top-left-status {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .top-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
  }
}

@media (max-width: 960px) {
  .sim-inputs-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
  }

  .desktop-dropzone {
    padding: 24px 16px;
  }

  .desktop-dropzone h3 {
    font-size: 1.1rem !important;
  }

  .glass-card {
    padding: 16px 14px;
  }
}

@media (max-width: 680px) {
  .stats-overview-grid,
  .app-container.mode-wide .stats-overview-grid,
  .app-container.mode-compact .stats-overview-grid {
    grid-template-columns: 1fr !important;
  }

  .top-left-status,
  .top-actions {
    width: 100%;
    justify-content: center;
  }

  .top-actions-divider {
    display: none;
  }
}

/* ==========================================================================
   CÉDULA DE PRE-DECLARACIÓN OFICIAL SAT (DyP) — SEÑALIZACIÓN Y CASILLAS NUMERADAS
   ========================================================================== */
.sat-guide-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 0.80rem;
}

.sat-casillas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 820px) {
  .sat-casillas-grid {
    grid-template-columns: 1fr;
  }
}

.sat-col-card {
  background: rgba(0, 0, 0, 0.38);
  border: 1.5px solid var(--card-border);
  border-top: 1.5px solid var(--card-highlight);
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--bevel-box-shadow);
  display: flex;
  flex-direction: column;
}

.sat-col-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sat-col-title {
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sat-col-subtitle {
  font-size: 0.70rem;
  color: var(--text-sub);
  margin-top: 3px;
  opacity: 0.85;
}

.sat-casilla-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  gap: 10px;
}

.sat-casilla-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.sat-casilla-row.highlight-cargo {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.28);
  margin-top: 8px;
  padding: 12px 14px;
}

.sat-casilla-row.highlight-favor {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.28);
  margin-top: 8px;
  padding: 12px 14px;
}

.sat-casilla-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.casilla-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-weight: 850;
  font-size: 0.74rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.casilla-badge.badge-isr {
  background: rgba(252, 211, 77, 0.14);
  color: #FCD34D;
  border: 1px solid rgba(252, 211, 77, 0.35);
}

.casilla-badge.badge-iva {
  background: rgba(56, 189, 248, 0.14);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.casilla-badge.badge-cargo {
  background: rgba(248, 113, 113, 0.20);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.casilla-badge.badge-favor {
  background: rgba(52, 211, 153, 0.20);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.casilla-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.casilla-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  white-space: normal;
}

.casilla-tags-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.casilla-tag {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tag-prellenado {
  background: rgba(52, 211, 153, 0.12);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.tag-captura-alerta {
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tag-auto {
  background: rgba(148, 163, 184, 0.12);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tag-cifras-enteras {
  background: rgba(192, 132, 252, 0.14);
  color: #E9D5FF;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.sat-casilla-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.casilla-val {
  font-size: 0.85rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
}

.casilla-val.val-large {
  font-size: 1.2rem;
  font-weight: 850;
}

.casilla-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-sub);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.2s ease;
}

.casilla-copy-btn:hover {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.sat-payment-summary-card {
  background: rgba(6, 38, 26, 0.55);
  border: 1.5px solid rgba(52, 211, 153, 0.4);
  border-top: 1.5px solid var(--card-highlight);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--bevel-box-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.sat-payment-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sat-payment-title {
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sat-payment-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  opacity: 0.9;
  max-width: 580px;
}

.sat-payment-badges-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.sat-payment-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
}

.sat-payment-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sat-total-amount-box {
  text-align: right;
}

.sat-total-amount-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.sat-total-amount-val {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ==========================================================================
   LEYENDA EXPLICATIVA DE CASILLAS Y ADVERTENCIA DE DISCREPANCIAS SAT
   ========================================================================== */
.sat-casillas-legend-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-left: 4px solid #F59E0B;
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sat-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.sat-legend-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.sat-legend-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #FCD34D;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.sat-legend-dismiss-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FCD34D;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sat-legend-dismiss-btn:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.sat-legend-restore-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FCD34D;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.70rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.sat-legend-restore-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #FFFFFF;
  border-color: rgba(245, 158, 11, 0.6);
}

.sat-legend-text {
  font-size: 0.78rem;
  color: #CBD5E1;
  line-height: 1.5;
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
}

.sat-legend-warning {
  font-size: 0.77rem;
  color: #FDE68A;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.45;
  margin: 2px 0 0 0;
  text-align: justify;
  text-justify: inter-word;
}

/* ==========================================================================
   PERFIL FISCAL DEL CONTRIBUYENTE (RFC EMISOR / RECEPTOR)
   ========================================================================== */
.sidebar-taxpayer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sidebar-taxpayer-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.taxpayer-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--invoice-icon-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-taxpayer-card:hover .taxpayer-card-avatar {
  background: var(--invoice-btn-hover-bg);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.taxpayer-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.taxpayer-card-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.taxpayer-card-rfc {
  font-size: 0.82rem;
  font-weight: 850;
  color: #FFFFFF;
  letter-spacing: 0.6px;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taxpayer-card-action {
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-taxpayer-card:hover .taxpayer-card-action {
  opacity: 1;
  transform: scale(1.1);
}

/* Modo Sidebar Colapsada */
.app-container.sidebar-collapsed .sidebar-taxpayer-card {
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
}

.app-container.sidebar-collapsed .sidebar-taxpayer-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-border-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.app-container.sidebar-collapsed .sidebar-taxpayer-card .taxpayer-card-avatar {
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
  height: 100%;
  color: var(--accent-bright);
}

.app-container.sidebar-collapsed .taxpayer-card-info,
.app-container.sidebar-collapsed .taxpayer-card-action {
  display: none !important;
}

/* Dropzone RFC Indicator Pill */
.dropzone-rfc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--card-border);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.dropzone-rfc-pill:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.5);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.dropzone-rfc-pill.configured {
  border-color: rgba(52, 211, 153, 0.4);
  color: #A7F3D0;
}

.dropzone-rfc-pill.unconfigured {
  border-color: rgba(245, 158, 11, 0.4);
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.1);
}

/* Profile Modal Elements */
.profile-rfc-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.profile-rfc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid var(--card-border);
  border-top: 1.2px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  font-family: monospace;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.profile-rfc-input:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 16px var(--accent-glow);
}

.profile-rfc-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  transition: color 0.2s ease;
}

.profile-rfc-feedback.valid {
  color: #34D399;
}

.profile-rfc-feedback.invalid {
  color: #F87171;
}

.profile-rfc-feedback.neutral {
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL DE APOYO PEDAGÓGICO: MANUAL DE USUARIO
   ========================================================================== */
.edu-modal-content {
  font-size: 0.88rem;
  color: #CBD5E1;
  line-height: 1.7;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 12px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.edu-step-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.edu-step-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.edu-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.edu-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  border: 1.5px solid var(--accent-bright);
  color: #BAE6FD;
  font-weight: 900;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   ESTILOS DE DEDUCCIONES PERSONALES (ART. 151 LISR - PRISMA FISCAL MX)
   ========================================================================== */
.btn-badge-deduccion {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #C084FC;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.2);
  white-space: nowrap;
}

.btn-badge-deduccion:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(192, 132, 252, 0.7);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.badge-ley-tag {
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #E9D5FF;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.deducciones-personales-card {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.25) 0%, rgba(30, 27, 75, 0.45) 100%);
  border: 1.2px solid rgba(168, 85, 247, 0.45);
  border-top: 1.5px solid rgba(216, 180, 254, 0.65);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 24px rgba(168, 85, 247, 0.18);
  position: relative;
  overflow: hidden;
}

.deducciones-personales-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #C084FC 0%, #EC4899 100%);
}

.deduccion-stat-chip {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #F3E8FF;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-badge-deduccion-action {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #E9D5FF;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-badge-deduccion-action:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: #C084FC;
  color: #FFF;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* ==========================================================================
   SEMÁFORO RESICO 3.5 MDP (ART. 113-E LISR)
   ========================================================================== */
.semaforo-resico-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 78, 59, 0.28) 100%);
  border: 1.2px solid rgba(52, 211, 153, 0.35);
  border-top: 1.5px solid rgba(167, 243, 208, 0.6);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.semaforo-resico-card.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(120, 53, 15, 0.3) 100%);
  border-color: rgba(245, 158, 11, 0.45);
  border-top-color: rgba(253, 230, 138, 0.6);
}

.semaforo-resico-card.alert {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18) 0%, rgba(124, 45, 18, 0.35) 100%);
  border-color: rgba(249, 115, 22, 0.5);
  border-top-color: rgba(254, 215, 170, 0.7);
}

.semaforo-resico-card.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22) 0%, rgba(127, 29, 29, 0.4) 100%);
  border-color: rgba(239, 68, 68, 0.55);
  border-top-color: rgba(254, 202, 202, 0.7);
}

.semaforo-bar-track {
  width: 100%;
  height: 9px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.semaforo-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
  position: relative;
}

.semaforo-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: semaforoShimmer 2.2s infinite;
}

@keyframes semaforoShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   WIDGETS FISCALES EN BARRA LATERAL (SIDEBAR)
   ========================================================================== */
.sidebar-fiscal-widget {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1.2px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.sidebar-fiscal-widget:hover {
  background: rgba(0, 0, 0, 0.52);
  border-color: rgba(52, 211, 153, 0.45);
}

/* Modo Expandido por defecto */
.deadline-expanded-content {
  display: block;
}

/* Modo Colapsado por defecto oculto */
.deadline-collapsed-icon-wrap {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

/* Contenedor circular / squircle del ícono colapsado */
.deadline-icon-squircle {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.deadline-collapsed-icon-wrap:hover .deadline-icon-squircle {
  background: rgba(6, 78, 59, 0.45);
  border-color: var(--accent-bright);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  transform: scale(1.06);
}

/* Ícono SVG estilizado de Campana / Alerta Fiscal */
.deadline-svg-icon {
  width: 22px;
  height: 22px;
  color: #FCD34D;
  transition: all 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.deadline-collapsed-icon-wrap:hover .deadline-svg-icon {
  color: #FFF;
  transform: rotate(-8deg) scale(1.08);
}

/* Punto de pulso luminoso animado en la esquina */
.deadline-pulse-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FBBF24;
  box-shadow: 0 0 8px #FBBF24;
  animation: deadlinePulseGlow 1.8s infinite;
}

@keyframes deadlinePulseGlow {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 5px rgba(251, 191, 36, 0); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* Micro-badge de texto ("1d", "3d", "¡Hoy!") */
.deadline-mini-pill {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 0.54rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 5px;
  background: #EF4444;
  color: #FFF;
  letter-spacing: 0.2px;
  line-height: 1.1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* FLYOUT TOOLTIP CARD (FLOTANTE A LA DERECHA EN MODO COLAPSADO) */
.deadline-flyout-tooltip {
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  min-width: 230px;
  background: rgba(6, 20, 15, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-top: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(52, 211, 153, 0.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  text-align: left;
}

/* Triangulito indicador apuntando al icono */
.deadline-flyout-tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid rgba(52, 211, 153, 0.45);
}

.deadline-collapsed-icon-wrap:hover .deadline-flyout-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(12px);
}

.flyout-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.64rem;
  font-weight: 850;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.flyout-date {
  font-size: 0.90rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 3px;
}

.flyout-sub {
  font-size: 0.68rem;
  color: var(--text-sub);
  line-height: 1.35;
  margin-bottom: 8px;
}

.flyout-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.flyout-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(52, 211, 153, 0.2);
  color: #34D399;
}

.flyout-hint {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--accent-bright);
  opacity: 0.85;
}

/* ==========================================================================
   TRANSFORMACIÓN EN MODO SIDEBAR COLAPSADA (.sidebar-collapsed)
   ========================================================================== */
.app-container.sidebar-collapsed #sidebarFiscalWidgetsContainer {
  align-items: center;
  width: 100%;
}

.app-container.sidebar-collapsed .sidebar-fiscal-widget#sidebarRfcDeadlineWidget {
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 6px auto;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-top: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  overflow: visible !important;
}

.app-container.sidebar-collapsed .sidebar-fiscal-widget#sidebarRfcDeadlineWidget:hover {
  border-color: var(--accent-bright);
  background: rgba(4, 22, 15, 0.95);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transform: scale(1.06);
}

.app-container.sidebar-collapsed .deadline-expanded-content,
.app-container.sidebar-collapsed #sidebarResicoSemaforoWidget {
  display: none !important;
}

.app-container.sidebar-collapsed .deadline-collapsed-icon-wrap {
  display: flex !important;
}

/* ==========================================================================
   BADGES DE AUDITOR ANTI-MULTAS SAT
   ========================================================================== */
.badge-auditor-alert {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
}

.badge-auditor-alert:hover {
  transform: translateY(-1px);
}

.badge-auditor-alert.danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

.badge-auditor-alert.warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: #FCD34D;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.badge-auditor-alert.info {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #BAE6FD;
}

/* ==========================================================================
   BOTÓN DE ACCIÓN LATERAL: FACTURACIÓN CFDI 4.0 (PRE-FACTURA VIP)
   ========================================================================== */
.sidebar-invoice-action-wrap {
  padding: 0 4px;
}

.sidebar-invoice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--invoice-btn-bg);
  border: 1.2px solid var(--invoice-btn-border);
  border-top: 1.5px solid var(--card-highlight);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-main);
  text-align: left;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  user-select: none;
}

.sidebar-invoice-btn:hover {
  background: var(--invoice-btn-hover-bg);
  border-color: var(--invoice-btn-border-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px var(--accent-glow), 0 0 14px var(--accent-glow);
}

.sidebar-invoice-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--invoice-icon-bg);
  border: 1px solid var(--invoice-icon-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--invoice-icon-color);
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transition: all 0.22s ease;
}

.sidebar-invoice-btn:hover .sidebar-invoice-btn-icon {
  border-color: var(--invoice-btn-border-hover);
  box-shadow: 0 0 10px var(--accent-glow);
}

.sidebar-invoice-btn-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.sidebar-invoice-btn-main {
  font-size: 0.82rem;
  font-weight: 850;
  color: #FFFFFF;
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-invoice-btn-sub {
  font-size: 0.68rem;
  color: var(--invoice-sub-color);
  font-weight: 600;
  line-height: 1.2;
  margin-top: 1px;
  transition: color 0.22s ease;
}

.sidebar-invoice-badge {
  font-size: 0.62rem;
  font-weight: 900;
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* Modo Sidebar Colapsada */
.app-container.sidebar-collapsed .sidebar-invoice-action-wrap {
  padding: 0;
  margin: 6px 0;
}

.app-container.sidebar-collapsed .sidebar-invoice-btn {
  justify-content: center;
  align-items: center;
  padding: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin: 0 auto;
  background: var(--invoice-btn-bg);
  border: 1.2px solid var(--invoice-btn-border);
}

.app-container.sidebar-collapsed .sidebar-invoice-btn:hover {
  background: var(--invoice-btn-hover-bg);
  border-color: var(--invoice-btn-border-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.app-container.sidebar-collapsed .sidebar-invoice-btn .sidebar-invoice-btn-icon {
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
  height: 100%;
  color: var(--invoice-icon-color);
}

.app-container.sidebar-collapsed .sidebar-invoice-btn-text,
.app-container.sidebar-collapsed .sidebar-invoice-badge {
  display: none !important;
}

/* ==========================================================================
   VENTANA MODAL DE PRE-FACTURACIÓN FISCAL VIP CFDI 4.0 (DESKTOP-OPTIMIZED)
   ========================================================================== */
.prefactura-modal-box {
  max-width: 1040px !important;
  width: 95% !important;
  max-height: 92vh !important;
  padding: 24px 28px !important;
  border-radius: 18px !important;
  background: var(--card-bg) !important;
  border: 1.5px solid var(--card-border) !important;
  border-top: 2px solid var(--card-highlight) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 28px var(--accent-glow) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
}

.pf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.pf-modal-title {
  font-size: 1.30rem;
  font-weight: 850;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.pf-modal-sub {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-top: 3px;
  font-weight: 500;
}

.pf-section-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--accent-bright);
  border-radius: 2px;
}

.pf-grid-receptor {
  display: grid;
  grid-template-columns: 1.3fr 2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.pf-grid-receptor-row2 {
  display: grid;
  grid-template-columns: 2fr 1.3fr;
  gap: 14px;
  margin-bottom: 18px;
}

.pf-grid-sat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .pf-grid-receptor {
    grid-template-columns: 1fr;
  }
  .pf-grid-receptor-row2 {
    grid-template-columns: 1fr;
  }
  .pf-grid-sat {
    grid-template-columns: 1fr;
  }
}

.pf-form-group {
  display: flex;
  flex-direction: column;
}

.pf-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 750;
  color: #F1F5F9;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.pf-label .required-star {
  color: #EF4444;
  font-weight: 900;
}

.pf-input,
.pf-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(4, 16, 34, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
  color: #FFFFFF;
  font-size: 0.94rem;
  font-weight: 600;
  min-height: 44px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pf-input:focus,
.pf-select:focus {
  border-color: var(--accent-bright);
  background: rgba(5, 22, 48, 0.92);
  box-shadow: 0 0 14px var(--accent-glow), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  outline: none;
}

.pf-input.mono {
  font-family: "JetBrains Mono", Consolas, Menlo, monospace;
  font-size: 0.94rem;
  letter-spacing: 0.5px;
}

.pf-help-text {
  font-size: 0.76rem;
  color: var(--text-sub);
  margin-top: 4px;
  font-weight: 500;
  line-height: 1.35;
}

.pf-text-justify {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.6;
}

.pf-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 750;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  border: 1px solid transparent;
}

.pf-toolbar-btn:hover {
  transform: translateY(-1px);
}

/* ==========================================================================
   DOCUMENTO OFICIAL: PRE-FACTURA FISCAL CON MEMBRETE VIP EJECUTIVO
   ========================================================================== */
.prefactura-vip-document {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  line-height: 1.4;
  position: relative;
  border: 1.5px solid #CBD5E1;
}

.pvip-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid #064E3B;
  padding-bottom: 16px;
  margin-bottom: 20px;
  gap: 16px;
}

.pvip-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pvip-brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.pvip-brand-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: #064E3B;
  letter-spacing: -0.5px;
}

.pvip-brand-sub {
  font-size: 0.75rem;
  color: #047857;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.pvip-folio-box {
  text-align: right;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 14px;
}

.pvip-folio-label {
  font-size: 0.68rem;
  color: #64748B;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.pvip-folio-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0F172A;
  font-family: monospace;
}

.pvip-status-badge {
  display: inline-block;
  background: #ECFDF5;
  border: 1px solid #10B981;
  color: #065F46;
  font-size: 0.68rem;
  font-weight: 850;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  margin-top: 4px;
}

.pvip-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.pvip-party-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.78rem;
}

.pvip-party-title {
  font-size: 0.72rem;
  font-weight: 850;
  color: #064E3B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  border-bottom: 1px solid #CBD5E1;
  padding-bottom: 4px;
}

.pvip-party-row {
  margin-bottom: 3px;
  color: #334155;
}

.pvip-party-row strong {
  color: #0F172A;
}

.pvip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 18px;
}

.pvip-table th {
  background: #064E3B;
  color: #FFFFFF;
  padding: 8px 10px;
  text-align: left;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pvip-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #E2E8F0;
  color: #1E293B;
}

.pvip-totals-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.pvip-totals-left {
  flex: 1;
  font-size: 0.75rem;
  color: #475569;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 12px;
}

.pvip-totals-right {
  min-width: 330px;
  width: 44%;
  max-width: 390px;
}

.pvip-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 5px 0;
  font-size: 0.84rem;
  color: #334155;
  border-bottom: 1px solid #E2E8F0;
}

.pvip-total-label {
  flex: 1;
  white-space: normal;
  line-height: 1.35;
}

.pvip-total-val {
  white-space: nowrap !important;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  color: #0F172A;
  min-width: 95px;
}

.pvip-total-row.grand-total {
  font-size: 1.05rem;
  font-weight: 900;
  color: #064E3B;
  border-top: 2px solid #064E3B;
  border-bottom: none;
  padding-top: 8px;
  margin-top: 4px;
}

.pvip-total-row.grand-total .pvip-total-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #064E3B;
}

.pvip-security-block {
  border-top: 1px solid #CBD5E1;
  padding-top: 14px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.pvip-qr-box {
  width: 90px;
  height: 90px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}

.pvip-qr-box svg,
.pvip-qr-box canvas {
  width: 100%;
  height: 100%;
}

.pvip-seal-data {
  flex: 1;
  font-size: 0.66rem;
  color: #475569;
  font-family: monospace;
  word-break: break-all;
  line-height: 1.35;
}

.pvip-legal-disclaimer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #CBD5E1;
  font-size: 0.68rem;
  color: #475569;
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.45;
}

/* Clases Oficiales para Representación Impresa CFDI (SAT) */
.pvip-sat-section-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0F172A;
  margin: 14px 0 6px 0;
  letter-spacing: -0.2px;
}

.pvip-sat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 0.74rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.pvip-sat-grid-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pvip-sat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px 0;
  border: 1px solid #CBD5E1;
  font-size: 0.70rem;
}

.pvip-sat-table th {
  background: #E2E8F0;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  padding: 6px 4px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.pvip-sat-table td {
  border: 1px solid #CBD5E1;
  padding: 6px 8px;
  color: #1E293B;
  vertical-align: middle;
}

.pvip-sat-seal-title {
  font-weight: 850;
  font-size: 0.68rem;
  color: #0F172A;
  margin-top: 8px;
  margin-bottom: 2px;
}

.pvip-sat-seal-text {
  font-family: monospace;
  font-size: 0.60rem;
  color: #475569;
  word-break: break-all;
  line-height: 1.25;
  background: #F8FAFC;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #E2E8F0;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN Y EXPORTACIÓN PDF (ARIAL 11PT, MÁRGENES AMPLIOS)
   ========================================================================== */
@media print {
  @page {
    size: letter;
    margin: 14mm 14mm;
  }
  body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .app-sidebar,
  .app-top-header,
  .toast,
  .modal-overlay:not(#prefacturaModalOverlay),
  .casilla-copy-btn,
  .card-header-actions button,
  .sat-legend-dismiss-btn,
  .sat-legend-restore-btn {
    display: none !important;
  }
  #sectionDeclaration {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .glass-card {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Modo de Impresión Especial: Pre-Factura VIP */
  body.printing-prefactura-vip {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.printing-prefactura-vip .app-container,
  body.printing-prefactura-vip .sidebar,
  body.printing-prefactura-vip .top-navbar,
  body.printing-prefactura-vip .prefactura-no-print,
  body.printing-prefactura-vip #sectionDeclaration,
  body.printing-prefactura-vip .modal-overlay:not(#prefacturaModalOverlay) {
    display: none !important;
  }
  body.printing-prefactura-vip #prefacturaModalOverlay {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    z-index: 99999 !important;
  }
  body.printing-prefactura-vip #prefacturaModalBox {
    background: #FFFFFF !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    color: #000000 !important;
  }
  body.printing-prefactura-vip .prefactura-vip-document {
    border: 1px solid #CBD5E1 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 8mm 10mm !important;
  }

  /* Modo de Impresión Especial: Factura Oficial CFDI 4.0 VIP desde Panel Administrador */
  body.printing-admin-cfdi-vip {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.printing-admin-cfdi-vip .admin-header,
  body.printing-admin-cfdi-vip .pin-modal-overlay,
  body.printing-admin-cfdi-vip #sheetsCodeModalOverlay,
  body.printing-admin-cfdi-vip .admin-no-print,
  body.printing-admin-cfdi-vip .admin-grid,
  body.printing-admin-cfdi-vip .prefactura-no-print {
    display: none !important;
  }
  body.printing-admin-cfdi-vip .admin-container,
  body.printing-admin-cfdi-vip #adminCfdiVipSection,
  body.printing-admin-cfdi-vip #adminCfdiVipPreviewWrap {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  body.printing-admin-cfdi-vip .prefactura-vip-document {
    border: 1px solid #CBD5E1 !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    padding: 7mm 9mm !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
