        :root {
            /* Quiet Luxury: canvas slate-50 + grafito corporativo */
            --app-background: #F8FAFC;
            --app-surface: #F1F5F9;
            --app-card: #FFFFFF;
            --app-primary: #0F172A;
            --app-primary-dark: #020617;
            --primary-accent: #0F172A;
            --app-border: #E2E8F0;
            --app-border-strong: #CBD5E1;
            --app-text: #0F172A;
            --app-text-muted: #64748B;
            --app-text-secondary: #64748B;
            --app-radius: 0.5rem;
            --app-radius-sm: 0.375rem;
            --app-radius-pill: 0.5rem;
            --app-shadow-sm: none;
            --app-shadow-google: none;
            --app-shadow-google-active: none;
            --font-sans: "Inter", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
            --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            --lg-ink-stroke: none;
        }
        html,
        body {
            overflow-x: hidden;
            min-height: 100dvh;
        }
        #erp-sidebar *:focus,
        #erp-sidebar *:focus-visible,
        .erp-sidebar *:focus,
        .erp-sidebar *:focus-visible,
        .vercel-nav-item:focus,
        .vercel-nav-item:focus-visible,
        .vercel-nav-item:active,
        .erp-fly-item:focus,
        .erp-fly-item:focus-visible {
            outline: none !important;
            outline-width: 0 !important;
            outline-style: none !important;
            outline-color: transparent !important;
            outline-offset: 0 !important;
        }
        body {
            font-family: var(--font-sans);
            color: var(--app-text);
            background-color: var(--app-background);
            text-shadow: none !important;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            transition: background-color 0.2s ease, color 0.2s ease, opacity 0.18s ease;
        }
        *, *::before, *::after {
            text-shadow: none !important;
        }
        /* Anti-parpadeo durante cambio de idioma (Google Translate) */
        body.translating {
            opacity: 1 !important;
            pointer-events: auto !important;
        }
        html {
            background-color: var(--app-background);
        }
        html.dark {
            background-color: #0a0a0a;
        }
        /* Chevron de <select> desplazado hacia el interior del campo */
        select:not(#lso-fase-select):not(#lso-exp-fase):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo) {
            appearance: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%234b5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E") !important;
            background-repeat: no-repeat !important;
            background-position: right 1.5rem center !important;
            background-size: 11px 11px !important; /* Tamaño pequeño y estilizado */
            padding-right: 2.75rem !important;
        }
        html.dark select:not(#lso-fase-select):not(#lso-exp-fase):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo),
        .dark select:not(#lso-fase-select):not(#lso-exp-fase):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo) {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E") !important;
        }
        select:not(#lso-fase-select):not(#lso-exp-fase):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo)::-ms-expand {
            display: none;
        }
        html:not(.dark) body { background-color: var(--app-background) !important; }
        html:not(.dark) .bg-white { background-color: var(--app-card) !important; }
        html:not(.dark) .bg-neutral-50 { background-color: var(--app-surface) !important; }
        html:not(.dark) [class*="border-[#766355]"] { border-color: var(--app-border) !important; }
        html:not(.dark) [class*="bg-[#766355]"] { background-color: var(--app-primary) !important; }
        html:not(.dark) [class*="hover:bg-[#5a4b41]"]:hover,
        html:not(.dark) [class*="hover:bg-[#5A4B41]"]:hover { background-color: #1E293B !important; }

        /* Tipografía: títulos slate-900 + cuerpo slate-500 */
        html:not(.dark) :where(h1, h2),
        html:not(.dark) #txt-lbl-registro,
        html:not(.dark) #app-branding-title,
        html:not(.dark) .vercel-page-title,
        html:not(.dark) .vercel-row-title {
            color: #0F172A !important;
            font-weight: 600;
            letter-spacing: -0.03em;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        html:not(.dark) :where(h3, h4, h5, h6) {
            color: #0F172A !important;
            font-weight: 600;
            letter-spacing: -0.02em;
        }
        html:not(.dark) :where(.settings-card-desc, .vercel-row-meta, .vercel-breadcrumb, .dash-metric-hint),
        html:not(.dark) :where(.text-neutral-500, .text-neutral-600, .text-neutral-700, .text-slate-500, .text-slate-600, .text-gray-500, .text-gray-600),
        html:not(.dark) #txt-lbl-registro-desc {
            color: #64748B !important;
            text-shadow: none !important;
        }
        html:not(.dark) :where(p, label) {
            color: #64748B;
            font-weight: 400;
            text-shadow: none !important;
        }
        html:not(.dark) .btn-secondary,
        html:not(.dark) .btn-marfil {
            color: #0F172A !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        /* Primarios: blanco sobre negro (prioridad absoluta frente a Liquid Glass) */
        html .btn-primary,
        html .btn-primary *,
        html .app-primary-bg,
        html .app-primary-bg *,
        html [data-action="aperturarExpediente"].btn-primary,
        html [data-action="aperturarExpediente"].btn-primary *,
        html #txt-btn-aperturar-wrap,
        html #txt-btn-aperturar-wrap *,
        html #txt-btn-aperturar,
        html .vercel-env-badge,
        html.liquid-glass .btn-primary,
        html.liquid-glass .btn-primary *,
        html.liquid-glass [data-action="aperturarExpediente"],
        html.liquid-glass [data-action="aperturarExpediente"] *,
        html.liquid-glass #txt-btn-aperturar {
            color: #ffffff !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        html.liquid-glass:not(.dark) :where(h1, h2, h3, h4, h5, h6),
        html.liquid-glass:not(.dark) #txt-lbl-registro,
        html.liquid-glass:not(.dark) #app-branding-title,
        html.liquid-glass:not(.dark) #app-logo-icon {
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
            color: #0F172A !important;
        }
        html.liquid-glass:not(.dark) :where(p, label, li, a) {
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }

        /* Botones: radio técnico (rounded-lg), grafito slate-900 */
        .btn-primary,
        .lso-exp-generate,
        .app-primary-bg,
        #btn-login-submit,
        #btn-register-submit,
        #btn-confirmar-pago,
        #btn-activar-premium,
        #txt-btn-aperturar-wrap {
            background-color: var(--app-primary) !important;
            color: #ffffff !important;
            border: 1px solid var(--app-primary) !important;
            font-size: 0.75rem !important;
            font-weight: 500 !important;
            letter-spacing: 0 !important;
            text-transform: none !important;
            padding: 0.5rem 1rem !important;
            border-radius: 0.5rem !important;
            box-shadow: none !important;
            transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 150ms cubic-bezier(0, 0, 0.2, 1);
        }
        .btn-primary:hover,
        .lso-exp-generate:hover,
        .app-primary-bg:hover,
        #btn-login-submit:hover:not(:disabled),
        #btn-register-submit:hover:not(:disabled),
        #btn-confirmar-pago:hover:not(:disabled),
        #btn-activar-premium:hover,
        #txt-btn-aperturar-wrap:hover {
            background-color: var(--app-primary-dark) !important;
            border-color: var(--app-primary-dark) !important;
            color: #ffffff !important;
            transform: scale(0.98);
        }
        .btn-primary:active,
        .app-primary-bg:active,
        #btn-login-submit:active:not(:disabled),
        #btn-register-submit:active:not(:disabled),
        #btn-confirmar-pago:active:not(:disabled),
        #btn-activar-premium:active,
        #txt-btn-aperturar-wrap:active {
            transform: scale(0.96);
        }
        #form-nueva-factura button[type="submit"] {
            transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease-out;
        }
        #form-nueva-factura button[type="submit"]:hover {
            transform: scale(0.98);
        }
        #form-nueva-factura button[type="submit"]:active {
            transform: scale(0.96);
        }
        .btn-secondary,
        .lso-exp-add,
        .lso-exp-doc-btn,
        .btn-marfil {
            background-color: #ffffff !important;
            color: #0F172A !important;
            border: 1px solid #E2E8F0 !important;
            font-size: 0.75rem !important;
            font-weight: 500 !important;
            letter-spacing: 0 !important;
            text-transform: none !important;
            padding: 0.5rem 0.875rem !important;
            border-radius: 0.5rem !important;
            box-shadow: none !important;
            transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 150ms cubic-bezier(0, 0, 0.2, 1);
        }
        .btn-secondary:hover,
        .lso-exp-add:hover,
        .lso-exp-doc-btn:hover,
        .btn-marfil:hover {
            background-color: #F8FAFC !important;
            border-color: #E2E8F0 !important;
            color: #0F172A !important;
            transform: scale(0.98);
        }
        .btn-secondary:active,
        .btn-marfil:active {
            transform: scale(0.96);
            box-shadow: none !important;
        }
        /* Botones de cierre (X): sin círculo ni borde */
        button.btn-marfil[aria-label*="Cerrar"],
        button.btn-secondary[aria-label*="Cerrar"],
        button.btn-icon-close,
        #btn-toggle-historial-panel[aria-label*="Cerrar"],
        #lso-slideover-cerrar {
            border-radius: 0 !important;
            border: none !important;
            background: transparent !important;
            box-shadow: none !important;
            padding: 0 !important;
        }
        button.btn-marfil[aria-label*="Cerrar"]:hover,
        button.btn-secondary[aria-label*="Cerrar"]:hover,
        button.btn-icon-close:hover,
        #btn-toggle-historial-panel[aria-label*="Cerrar"]:hover,
        #lso-slideover-cerrar:hover {
            background: transparent !important;
            transform: scale(0.86) !important;
            border: none !important;
            color: #0a0a0a !important;
        }
        button[aria-label="Cerrar"]:not(.inset-0):not(.sheet-nueva-factura-close):hover,
        button[title="Eliminar"]:hover,
        .toast-close:hover,
        .ai-notif-prompt-close:hover {
            transform: scale(0.86) !important;
        }
        .app-primary-text { color: var(--app-text) !important; }
        .app-accent-border { border-color: var(--app-border) !important; }
        .app-accent-ring { --tw-ring-color: #000000 !important; }

        /* Badges rectangulares de alto contraste */
        .geist-badge,
        #badge-pro {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            background: #F3F4F6 !important;
            color: #0F172A !important;
            border: 1px solid #E2E8F0 !important;
            border-radius: 0.375rem !important;
            padding: 0.125rem 0.45rem !important;
            font-size: 0.6875rem !important;
            font-weight: 600 !important;
            font-family: var(--font-mono) !important;
            letter-spacing: 0 !important;
            text-transform: none !important;
            line-height: 1.25;
        }
        .geist-badge::before {
            content: '';
            width: 0.375rem;
            height: 0.375rem;
            border-radius: 0;
            background: #16a34a;
            flex-shrink: 0;
        }
        .geist-badge.ai-model-badge::before {
            background: #2563eb;
        }
        #user-premium-badge { display: none !important; }

        /* Header: radio técnico */
        #user-session-badge,
        #btn-chat-header,
        #theme-toggle.theme-toggle-btn,
        #btn-lang-toggle,
        #settings-toggle,
        #btn-toggle-historial {
            border-radius: 0.5rem !important;
            box-shadow: none !important;
            transition: background-color 0.15s ease, border-color 0.15s ease;
        }
        #user-session-badge,
        #btn-chat-header,
        #theme-toggle.theme-toggle-btn,
        #btn-toggle-historial {
            width: 2.25rem !important;
            height: 2.25rem !important;
            min-width: 2.25rem !important;
            padding: 0 !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            border: 1px solid #E5E7EB !important;
            background: #fff !important;
        }
        #btn-lang-toggle,
        #settings-toggle {
            height: 2.25rem !important;
            padding: 0 0.85rem !important;
            border: 1px solid #E5E7EB !important;
            background: #fff !important;
        }
        #user-session-badge:hover,
        #btn-chat-header:hover,
        #theme-toggle.theme-toggle-btn:hover,
        #btn-lang-toggle:hover,
        #settings-toggle:hover,
        #btn-toggle-historial:hover {
            background: #f5f5f5 !important;
        }
        #user-session-badge .user-meta { display: none !important; }
        #user-session-badge i,
        #btn-chat-header i,
        #settings-toggle,
        #btn-lang-toggle {
            color: var(--app-primary) !important;
        }

        /* Campos de formulario planos */
        .settings-group-tab,
        .payment-tab,
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.gemini-composer-input):not(#chat-input):not(.vercel-filter),
        select:not(.vercel-filter),
        textarea:not(#chat-input),
        .cliente-phone-compose {
            border-radius: 0.5rem !important;
            box-shadow: none !important;
        }
        .dash-glass,
        .glass-card,
        .glass-panel,
        .payment-shell,
        .settings-panel-shell,
        .command-palette-panel,
        #dropdown-adjuntos,
        #dropdown-chat-plus,
        #modal-confirmacion > div,
        #modal-camara > div,
        #modal-lexnet > div,
        #modal-session-lock > div,
        #modal-pago,
        #billing-checkout-panel .payment-shell,
        #modal-login > div,
        .vercel-list,
        .vercel-filter:not(#filtro-clientes),
        .vercel-sidebar-search,
        #dropzone-lexnet,
        #panel-lexnet-agenda {
            border-radius: 24px !important;
            border: 1px solid #E5E7EB !important;
            box-shadow: none !important;
        }
        #dropdown-adjuntos,
        #dropdown-chat-plus,
        .command-palette-panel {
            box-shadow: none !important;
            border: 1px solid #E5E7EB !important;
        }
        .geist-badge,
        #badge-pro {
            border-radius: 9999px !important;
        }
        /* Sidebar: solo historial */
        .sidebar-historial-block {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            background: var(--app-card);
            border-top: none;
        }
        .sidebar-historial-block .historial-heading {
            font-size: 0.6875rem;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--app-text);
        }
        .dash-glass,
        .glass-card,
        .glass-panel,
        .panel-shadow {
            background-color: var(--app-card) !important;
            border: 1px solid #E5E7EB !important;
            border-radius: 24px !important;
            box-shadow: none !important;
        }

        /* Dashboard shell: sidebar gris + main blanco (Momentic) */
        #app-shell {
            background-color: var(--app-background) !important;
        }
        #app-header:not(.app-header-floating) {
            background-color: var(--app-card) !important;
            border-bottom: none !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
        }
        #sidebar-historial {
            background-color: var(--app-surface) !important;
            border-left: 1px solid #F3F4F6 !important;
            border-right: none !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
        }
        #sidebar-historial > .border-b,
        #sidebar-historial > .border-t {
            background-color: transparent !important;
            border-color: #F3F4F6 !important;
        }
        #app-shell,
        #app-workspace,
        #main-container,
        #main-container > main {
            background-color: var(--app-background) !important;
            border-radius: 0 !important;
            box-shadow: none !important;
        }
        html:not(.dark) #app-shell.bg-white,
        html:not(.dark) #main-container.bg-white,
        html:not(.dark) #main-container > main.bg-white {
            background-color: var(--app-background) !important;
        }
        html:not(.dark) .erp-sidebar {
            background-color: #F1F5F9 !important;
            border-right: 1px solid #E2E8F0 !important;
        }
        #chat-drawer {
            background-color: var(--app-card) !important;
            border: none !important;
            border-left: none !important;
            border-right: none !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
        }

        /* Tipograf?a limpia Geist */
        h1, h2, h3, h4, h5, h6,
        #txt-lbl-registro,
        #txt-lbl-historial,
        #auth-login-title,
        #app-branding-title {
            font-weight: 600 !important;
            letter-spacing: -0.01em !important;
            text-transform: none !important;
            text-shadow: none !important;
            color: var(--app-text) !important;
        }
        #txt-lbl-historial {
            font-size: 0.75rem !important;
            font-weight: 500 !important;
            letter-spacing: 0 !important;
            text-transform: none !important;
        }
        #txt-lbl-registro.vercel-page-title,
        .vercel-page-title {
            font-size: 1.75rem !important;
            font-weight: 600 !important;
            letter-spacing: -0.035em !important;
            text-transform: none !important;
            color: #0F172A !important;
        }
        }

        /* Foco de inputs: mismo borde que en reposo (sin oscurecer) */
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.gemini-composer-input):not(#chat-input):not(#nuevo-cliente-telefono):not(.cliente-phone-number):not(.is-completo):not(.is-invalid):focus,
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.gemini-composer-input):not(#chat-input):not(#nuevo-cliente-telefono):not(.cliente-phone-number):not(.is-completo):not(.is-invalid):focus-visible,
        select:not(#lso-fase-select):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo):focus,
        select:not(#lso-fase-select):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo):focus-visible,
        textarea:focus,
        textarea:focus-visible {
            outline: none !important;
            outline-width: 0 !important;
            outline-offset: 0 !important;
            box-shadow: none !important;
            --tw-ring-offset-shadow: 0 0 #0000 !important;
            --tw-ring-shadow: 0 0 #0000 !important;
            --tw-ring-color: transparent !important;
            border-color: var(--app-border) !important;
        }
        html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.gemini-composer-input):not(#chat-input):not(#nuevo-cliente-telefono):not(.cliente-phone-number):not(.is-completo):not(.is-invalid):focus,
        html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.gemini-composer-input):not(#chat-input):not(#nuevo-cliente-telefono):not(.cliente-phone-number):not(.is-completo):not(.is-invalid):focus-visible,
        html.dark select:not(#lso-fase-select):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo):focus,
        html.dark select:not(#lso-fase-select):not(#nuevo-cliente-prefijo):not(.cliente-phone-prefix):not(#nuevo-cliente-doc-tipo):focus-visible,
        html.dark textarea:focus,
        html.dark textarea:focus-visible {
            outline: none !important;
            outline-width: 0 !important;
            outline-offset: 0 !important;
            box-shadow: none !important;
            --tw-ring-offset-shadow: 0 0 #0000 !important;
            --tw-ring-shadow: 0 0 #0000 !important;
            --tw-ring-color: transparent !important;
            border-color: #404040 !important;
        }
        .settings-group-tab[aria-selected="true"] {
            border-color: var(--app-border) !important;
            border-left: 2px solid var(--app-primary) !important;
            color: var(--app-text) !important;
            background-color: var(--app-surface) !important;
            box-shadow: none !important;
            font-weight: 500 !important;
        }
        .payment-tab.is-active {
            border-color: var(--app-primary) !important;
            box-shadow: inset 0 -2px 0 0 var(--app-primary) !important;
            color: var(--app-text) !important;
            background: var(--app-card) !important;
        }
        input[type="checkbox"],
        input[type="range"] {
            accent-color: var(--app-primary);
        }

        /* Fondo del panel — un solo lienzo (sin capas/tarjetas intermedias) */
        html,
        body,
        #app-shell,
        #app-workspace,
        #main-container,
        #main-container > main {
            background-color: var(--app-background);
        }
        html.dark,
        html.dark body,
        html.dark #app-shell,
        html.dark #app-workspace,
        html.dark #main-container,
        html.dark #main-container > main {
            background-color: var(--app-background, #0a0a0a);
        }
        #app-shell,
        #app-workspace,
        #main-container,
        #main-container > main {
            margin: 0;
            border-radius: 0 !important;
            box-shadow: none !important;
        }
        /* Wallpaper desactivado: siempre color sólido (sin imagen residual) */
        html.has-wallpaper,
        html.has-wallpaper body,
        html.has-wallpaper.dark,
        html.has-wallpaper.dark body {
            background-image: none !important;
        }
        html.has-wallpaper #app-shell,
        html.has-wallpaper #app-workspace,
        html.has-wallpaper #main-container,
        html.has-wallpaper #main-container > main,
        html.has-wallpaper main {
            background-image: none !important;
        }
        html #main-container,
        html #main-container > main {
            background-color: var(--app-background) !important;
        }
        html.dark,
        html.dark body,
        html.dark #app-shell,
        html.dark #app-workspace,
        html.dark #main-container,
        html.dark #main-container > main,
        html.has-wallpaper.dark,
        html.has-wallpaper.dark body,
        html.has-wallpaper.dark #app-shell,
        html.has-wallpaper.dark #app-workspace,
        html.has-wallpaper.dark #main-container,
        html.has-wallpaper.dark #main-container > main {
            background-color: #0a0a0a !important;
            background-image: none !important;
        }
        #wallpaper-dark-overlay {
            display: none !important;
            opacity: 0 !important;
            pointer-events: none;
        }
        /* Superficies Momentic: tarjeta plana con borde sutil */
        .glass-panel {
            background-color: var(--app-card) !important;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            border: 1px solid #E2E8F0;
            border-radius: var(--app-radius);
            box-shadow: none;
        }
        html.dark .glass-panel {
            background-color: #111111 !important;
            border-color: #262626;
            box-shadow: none;
        }
        .glass-card {
            background-color: var(--app-card) !important;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            border: 1px solid #E5E7EB;
            border-radius: var(--app-radius);
            box-shadow: none;
            position: relative;
            isolation: isolate;
            overflow: hidden;
        }
        html.dark .glass-card {
            background-color: #111111 !important;
            border-color: #262626;
            box-shadow: none;
        }
        .dash-glass {
            background-color: var(--app-card);
            border: 1px solid #E5E7EB;
            box-shadow: none;
            border-radius: var(--app-radius);
            position: relative;
            isolation: isolate;
            overflow: hidden;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }
        html.dark .dash-glass {
            background-color: #111111;
            border-color: #262626;
        }
        /* Liquid Glass ? cristal Apple global (opacidad / borde v?a CSS vars) */
        :root {
            --lg-opacity: 0.22;
            --lg-blur: 44px;
            --lg-saturate: 185%;
            --lg-noise: 0.1;
            --lg-sheen: 0.55;
            --lg-rim: 0.5;
            --lg-shadow: 0.12;
            --lg-border-width: 1px;
            --lg-border-color: 255, 255, 255;
            --lg-border-alpha: 0.55;
            --lg-ease: cubic-bezier(0.22, 1, 0.36, 1);
            --lg-duration: 560ms;
            --lg-fill-light: 255, 255, 255;
            --lg-fill-dark: 30, 41, 59;
            --lg-cast:
                0 1px 3px 0 rgba(32, 33, 36, calc(var(--lg-shadow) * 0.9)),
                0 1px 8px 0 rgba(32, 33, 36, var(--lg-shadow));
        }

        /* Superficies de cristal compartidas (NO incluir chat/historial/header: rompen fixed + animaciones) */
        html.liquid-glass .dash-glass,
        html.liquid-glass .glass-card,
        html.liquid-glass .lg-name-frame,
        html.liquid-glass #lista-expedientes .dash-glass,
        html.liquid-glass #view-ajustes .settings-panel-shell,
        html.liquid-glass #command-palette .command-palette-panel,
        html.liquid-glass #command-palette-panel,
        html.liquid-glass #modal-confirmacion > div,
        html.liquid-glass #modal-pago.payment-shell,
        html.liquid-glass #billing-checkout-panel .payment-shell,
        html.liquid-glass #modal-camara > div,
        html.liquid-glass #modal-lexnet > div,
        html.liquid-glass #modal-session-lock > div,
        html.liquid-glass #dropdown-adjuntos,
        html.liquid-glass #chat-composer {
            position: relative;
            isolation: isolate;
            overflow: hidden;
            --lexia-elev-y: 1px;
            --lexia-elev-blur: clamp(6px, 1.8cqi, 12px);
            --lexia-elev-soft: clamp(8px, 2.4cqi, 16px);
            --lexia-elev-fade-blur: clamp(10px, 3cqi, 20px);
            --lexia-elev-spread: 0px;
            background:
                linear-gradient(
                    155deg,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.95))) 0%,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.55))) 38%,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.78))) 72%,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.88))) 100%
                ) !important;
            backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate)) brightness(1.05) contrast(1.04);
            -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate)) brightness(1.05) contrast(1.04);
            border-style: solid !important;
            border-width: var(--lg-border-width) !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            box-shadow:
                var(--lg-cast),
                0 0 0 0.5px rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.45)),
                inset 0 1px 0 rgba(255, 255, 255, calc(var(--lg-opacity) * 0.82)),
                inset 0 -1px 0 rgba(255, 255, 255, calc(var(--lg-opacity) * 0.18)),
                inset 1px 0 0 rgba(255, 255, 255, calc(var(--lg-rim) * 0.35)),
                inset -1px 0 0 rgba(0, 0, 0, calc(var(--lg-opacity) * 0.05));
            transition:
                background var(--lg-duration) var(--lg-ease),
                background-color var(--lg-duration) var(--lg-ease),
                border-color var(--lg-duration) var(--lg-ease),
                border-width var(--lg-duration) var(--lg-ease),
                box-shadow var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease),
                -webkit-backdrop-filter var(--lg-duration) var(--lg-ease);
        }

        /* Chat / historial: solo aspecto cristal (sin tocar position ni transform) */
        html.liquid-glass #chat-drawer,
        html.liquid-glass #sidebar-historial,
        html.liquid-glass #panel-historial {
            isolation: isolate;
            --lexia-elev-y: 2px;
            --lexia-elev-blur: clamp(6px, 1.6cqi, 12px);
            --lexia-elev-soft: clamp(8px, 2.2cqi, 16px);
            --lexia-elev-fade-blur: clamp(10px, 2.8cqi, 20px);
            --lexia-elev-spread: 0px;
            background:
                linear-gradient(
                    155deg,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.95))) 0%,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.55))) 38%,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.78))) 72%,
                    rgba(var(--lg-fill-light), min(1, calc(var(--lg-opacity) * 0.88))) 100%
                ) !important;
            backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate)) brightness(1.05) contrast(1.04);
            -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate)) brightness(1.05) contrast(1.04);
            border-style: solid !important;
            border-width: var(--lg-border-width) !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            box-shadow:
                var(--lg-cast),
                0 0 0 0.5px rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.45)),
                inset 0 1px 0 rgba(255, 255, 255, calc(var(--lg-opacity) * 0.82)),
                inset 0 -1px 0 rgba(255, 255, 255, calc(var(--lg-opacity) * 0.18));
        }

        /* Reflejo especular + textura de cristal real */
        html.liquid-glass .dash-glass::before,
        html.liquid-glass .glass-card::before,
        html.liquid-glass .lg-name-frame::before,
        html.liquid-glass #lista-expedientes .dash-glass::before,
        html.liquid-glass #sidebar-historial::before,
        html.liquid-glass #panel-historial::before,
        html.liquid-glass #chat-drawer::before,
        html.liquid-glass #view-ajustes .settings-panel-shell::before,
        html.liquid-glass #command-palette .command-palette-panel::before,
        html.liquid-glass #command-palette-panel::before,
        html.liquid-glass #modal-confirmacion > div::before,
        html.liquid-glass #modal-pago.payment-shell::before,
        html.liquid-glass #billing-checkout-panel .payment-shell::before,
        html.liquid-glass #modal-camara > div::before,
        html.liquid-glass #modal-lexnet > div::before,
        html.liquid-glass #modal-session-lock > div::before,
        html.liquid-glass #chat-composer::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            pointer-events: none;
            z-index: 0;
            opacity: var(--lg-noise);
            mix-blend-mode: soft-light;
            transition: opacity var(--lg-duration) var(--lg-ease);
            background-image:
                url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
            background-size: 180px 180px;
        }
        html.liquid-glass .dash-glass::after,
        html.liquid-glass .glass-card::after,
        html.liquid-glass .lg-name-frame::after,
        html.liquid-glass #lista-expedientes .dash-glass::after,
        html.liquid-glass #sidebar-historial::after,
        html.liquid-glass #panel-historial::after,
        html.liquid-glass #chat-drawer::after,
        html.liquid-glass #view-ajustes .settings-panel-shell::after,
        html.liquid-glass #command-palette .command-palette-panel::after,
        html.liquid-glass #command-palette-panel::after,
        html.liquid-glass #modal-confirmacion > div::after,
        html.liquid-glass #modal-pago.payment-shell::after,
        html.liquid-glass #billing-checkout-panel .payment-shell::after,
        html.liquid-glass #modal-camara > div::after,
        html.liquid-glass #modal-lexnet > div::after,
        html.liquid-glass #modal-session-lock > div::after,
        html.liquid-glass #chat-composer::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            pointer-events: none;
            z-index: 0;
            opacity: var(--lg-sheen);
            transition: opacity var(--lg-duration) var(--lg-ease);
            background:
                radial-gradient(90% 60% at 8% -10%, rgba(255, 255, 255, 0.72) 0%, transparent 46%),
                radial-gradient(70% 50% at 92% 110%, rgba(255, 255, 255, 0.18) 0%, transparent 48%),
                linear-gradient(
                    125deg,
                    rgba(255, 255, 255, 0.42) 0%,
                    rgba(255, 255, 255, 0.08) 22%,
                    transparent 44%,
                    rgba(180, 210, 255, 0.06) 62%,
                    rgba(255, 255, 255, 0.12) 100%
                );
        }
        html.liquid-glass .dash-glass > *,
        html.liquid-glass .glass-card > *,
        html.liquid-glass .lg-name-frame > *,
        html.liquid-glass #lista-expedientes .dash-glass > *,
        html.liquid-glass #sidebar-historial > *,
        html.liquid-glass #panel-historial > *,
        html.liquid-glass #chat-drawer > *,
        html.liquid-glass #view-ajustes .settings-panel-shell > *,
        html.liquid-glass #command-palette .command-palette-panel > *,
        html.liquid-glass #command-palette-panel > *,
        html.liquid-glass #modal-confirmacion > div > *,
        html.liquid-glass #modal-pago.payment-shell > *,
        html.liquid-glass #billing-checkout-panel .payment-shell > *,
        html.liquid-glass #modal-camara > div > *,
        html.liquid-glass #modal-lexnet > div > *,
        html.liquid-glass #modal-session-lock > div > *,
        html.liquid-glass #chat-composer > * {
            position: relative;
            z-index: 1;
        }

        .lg-name-frame {
            position: relative;
            isolation: isolate;
            overflow: hidden;
            background-color: rgba(255, 255, 255, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: none;
            transition:
                background-color var(--lg-duration) var(--lg-ease),
                box-shadow var(--lg-duration) var(--lg-ease),
                border-color var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease);
        }
        html.dark .lg-name-frame {
            background-color: rgba(15, 23, 42, 0.9);
            border-color: rgba(255, 255, 255, 0.1);
        }

        /* Dark: cristal sobre wallpaper */
        html.dark.liquid-glass .dash-glass,
        html.dark.liquid-glass .glass-card,
        html.dark.liquid-glass .lg-name-frame,
        html.dark.liquid-glass #lista-expedientes .dash-glass,
        html.dark.liquid-glass #chat-drawer,
        html.dark.liquid-glass #sidebar-historial,
        html.dark.liquid-glass #panel-historial,
        html.dark.liquid-glass #app-header,
        html.dark.liquid-glass #view-ajustes .settings-panel-shell,
        html.dark.liquid-glass #command-palette .command-palette-panel,
        html.dark.liquid-glass #command-palette-panel,
        html.dark.liquid-glass #modal-confirmacion > div,
        html.dark.liquid-glass #modal-pago.payment-shell,
        html.dark.liquid-glass #billing-checkout-panel .payment-shell,
        html.dark.liquid-glass #modal-camara > div,
        html.dark.liquid-glass #modal-lexnet > div,
        html.dark.liquid-glass #modal-session-lock > div,
        html.dark.liquid-glass #dropdown-adjuntos,
        html.dark.liquid-glass #chat-composer {
            background:
                linear-gradient(
                    155deg,
                    rgba(255, 255, 255, calc(var(--lg-opacity) * 0.2)) 0%,
                    rgba(var(--lg-fill-dark), min(1, calc(var(--lg-opacity) * 0.72))) 45%,
                    rgba(var(--lg-fill-dark), min(1, var(--lg-opacity))) 100%
                ) !important;
            border-color: rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.75)) !important;
            box-shadow:
                0 1px 3px 0 rgba(0, 0, 0, calc(var(--lg-shadow) * 2.2)),
                0 1px 8px 0 rgba(0, 0, 0, calc(var(--lg-shadow) * 1.4)),
                inset 0 1px 0 rgba(255, 255, 255, calc(var(--lg-opacity) * 0.28)),
                inset 0 -1px 0 rgba(0, 0, 0, calc(var(--lg-opacity) * 0.2));
        }
        html.dark.liquid-glass .dash-glass::before,
        html.dark.liquid-glass .glass-card::before,
        html.dark.liquid-glass .lg-name-frame::before,
        html.dark.liquid-glass .header-side-right::before,
        html.dark.liquid-glass #chat-drawer::before,
        html.dark.liquid-glass #sidebar-historial::before,
        html.dark.liquid-glass #view-ajustes .settings-panel-shell::before {
            opacity: calc(var(--lg-noise) * 0.65);
            mix-blend-mode: soft-light;
        }

        html:not(.liquid-glass) .glass-card {
            background-color: #FFFFFF !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            border-color: rgba(0, 0, 0, 0.06);
            box-shadow: none;
        }
        html.dark:not(.liquid-glass) .glass-card {
            background-color: #1e293b !important;
            border-color: rgba(255, 255, 255, 0.08);
        }

        /* Interiores de paneles: transparentes para ver wallpaper a trav?s del cristal */
        html.liquid-glass #sidebar-historial > div:first-child,
        html.liquid-glass #panel-historial > div:first-child,
        html.liquid-glass #chat-drawer > div:first-child,
        html.liquid-glass #view-ajustes .settings-panel-shell > div:first-child,
        html.liquid-glass #view-ajustes nav,
        html.liquid-glass #settings-workspace-panel {
            background: rgba(255, 255, 255, calc(var(--lg-opacity) * 0.28)) !important;
            backdrop-filter: blur(calc(var(--lg-blur) * 0.35)) saturate(160%);
            -webkit-backdrop-filter: blur(calc(var(--lg-blur) * 0.35)) saturate(160%);
            border-style: solid !important;
            border-width: var(--lg-border-width) !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            transition:
                background var(--lg-duration) var(--lg-ease),
                border-color var(--lg-duration) var(--lg-ease),
                border-width var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease);
        }
        html.liquid-glass #view-ajustes nav {
            border-right-width: var(--lg-border-width) !important;
        }
        html.liquid-glass #view-ajustes .settings-panel-shell > div:first-child {
            border-bottom-width: var(--lg-border-width) !important;
            border-left-width: 0 !important;
            border-right-width: 0 !important;
            border-top-width: 0 !important;
        }
        html.liquid-glass #chat-drawer > div:first-child,
        html.liquid-glass #sidebar-historial > div:first-child,
        html.liquid-glass #panel-historial > div:first-child {
            border-bottom-width: var(--lg-border-width) !important;
            border-left-width: 0 !important;
            border-right-width: 0 !important;
            border-top-width: 0 !important;
        }
        html.dark.liquid-glass #sidebar-historial > div:first-child,
        html.dark.liquid-glass #panel-historial > div:first-child,
        html.dark.liquid-glass #chat-drawer > div:first-child,
        html.dark.liquid-glass #view-ajustes .settings-panel-shell > div:first-child,
        html.dark.liquid-glass #view-ajustes nav,
        html.dark.liquid-glass #settings-workspace-panel {
            background: rgba(15, 23, 42, calc(var(--lg-opacity) * 0.35)) !important;
        }

        /* L?nea de cristal en TODOS los marcos de Ajustes y apartados internos */
        html.liquid-glass #view-ajustes .rounded-none.border,
        html.liquid-glass #view-ajustes .rounded-none.border,
        html.liquid-glass #view-ajustes .rounded-none.border,
        html.liquid-glass #view-ajustes label.border,
        html.liquid-glass #view-ajustes .settings-group-tab[aria-selected="true"],
        html.liquid-glass #view-ajustes .setting-content-pane .rounded-none.border,
        html.liquid-glass #view-ajustes .setting-content-pane .rounded-none.border,
        html.liquid-glass #view-ajustes .setting-content-pane .rounded-none.border,
        html.liquid-glass #view-ajustes #wallpaper-preview {
            border-style: solid !important;
            border-width: var(--lg-border-width) !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            box-shadow:
                0 0 0 0.5px rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.35)),
                inset 0 1px 0 rgba(255, 255, 255, calc(var(--lg-opacity) * 0.35));
            transition:
                border-color var(--lg-duration) var(--lg-ease),
                border-width var(--lg-duration) var(--lg-ease),
                box-shadow var(--lg-duration) var(--lg-ease),
                background var(--lg-duration) var(--lg-ease);
        }
        /* Separadores internos: solo el lado correspondiente, en color de cristal */
        html.liquid-glass #view-ajustes .border-t {
            border-top-style: solid !important;
            border-top-width: var(--lg-border-width) !important;
            border-top-color: rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.9)) !important;
        }
        html.liquid-glass #view-ajustes .border-b {
            border-bottom-style: solid !important;
            border-bottom-width: var(--lg-border-width) !important;
            border-bottom-color: rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.9)) !important;
        }
        html.liquid-glass #view-ajustes .border-l {
            border-left-style: solid !important;
            border-left-width: var(--lg-border-width) !important;
            border-left-color: rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.9)) !important;
        }
        html.liquid-glass #view-ajustes .border-r {
            border-right-style: solid !important;
            border-right-width: var(--lg-border-width) !important;
            border-right-color: rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.9)) !important;
        }
        /* Workspace y nav: marco completo diferenciado */
        html.liquid-glass #settings-workspace-panel {
            border-style: solid !important;
            border-width: var(--lg-border-width) !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            border-radius: var(--app-radius);
            margin: 0.65rem 0.65rem 0.65rem 0;
            box-shadow: none;
        }
        html.liquid-glass #view-ajustes nav {
            margin: 0.65rem 0 0.65rem 0.65rem;
            border-radius: var(--app-radius);
            border-style: solid !important;
            border-width: var(--lg-border-width) !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            box-shadow: none;
        }
        html.liquid-glass #view-ajustes .settings-group-tab[aria-selected="true"] {
            background: rgba(255, 255, 255, calc(0.35 + var(--lg-opacity) * 0.35)) !important;
            box-shadow:
                0 0 0 0.5px rgba(var(--lg-border-color), var(--lg-border-alpha)),
                inset 0 1px 0 rgba(255, 255, 255, 0.45);
        }

        /* Misma l?nea en marcos del chat, historial y dashboard */
        html.liquid-glass #chat-drawer .rounded-none.border,
        html.liquid-glass #chat-drawer .rounded-none.border,
        html.liquid-glass #chat-composer,
        html.liquid-glass #dropdown-adjuntos,
        html.liquid-glass #sidebar-historial .rounded-none.border,
        html.liquid-glass #sidebar-historial .rounded-none.border,
        html.liquid-glass #lista-expedientes .rounded-none,
        html.liquid-glass #view-detalle-cliente .rounded-none.border,
        html.liquid-glass #view-detalle-cliente .rounded-none.border,
        html.liquid-glass #dropzone-lexnet {
            border-style: solid !important;
            border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            border-width: var(--lg-border-width) !important;
            transition: border-color var(--lg-duration) var(--lg-ease), border-width var(--lg-duration) var(--lg-ease);
        }
        html.liquid-glass #chat-drawer .border-b,
        html.liquid-glass #sidebar-historial .border-b,
        html.liquid-glass #chat-drawer .border-t {
            border-color: rgba(var(--lg-border-color), calc(var(--lg-border-alpha) * 0.85)) !important;
        }

        /* Ajustes (vista in-flow): sin overlay; el cristal vive en el panel */
        html.liquid-glass #view-ajustes .settings-panel-shell {
            transition:
                background var(--lg-duration) var(--lg-ease),
                border-color var(--lg-duration) var(--lg-ease),
                box-shadow var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease) !important;
        }

        /* Resto de men?s: ver wallpaper a trav?s del cristal */
        html.liquid-glass #sheet-nueva-factura,
        html.liquid-glass #sheet-nueva-factura .sheet-nueva-factura-overlay {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            background-color: transparent;
        }
        html.liquid-glass #sheet-nueva-factura .sheet-nueva-factura-overlay {
            background-color: rgb(0 0 0 / 0.4) !important;
        }

        html.liquid-glass #modal-confirmacion,
        html.liquid-glass #modal-camara,
        html.liquid-glass #modal-lexnet,
        html.liquid-glass #modal-politica-cookies,
        html.liquid-glass #modal-politica-privacidad,
        html.liquid-glass #modal-terminos-servicio,
        html.liquid-glass #command-palette,
        html.liquid-glass #modal-session-lock {
            background-color: rgba(8, 12, 20, 0.18) !important;
            backdrop-filter: blur(10px) saturate(150%);
            -webkit-backdrop-filter: blur(10px) saturate(150%);
            transition: background-color var(--lg-duration) var(--lg-ease),
                        backdrop-filter var(--lg-duration) var(--lg-ease);
        }
        html.liquid-glass #modal-login {
            background-color: #ffffff !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }

        /* Chat: cristal + width en desktop lo controla el layout */
        html.liquid-glass #chat-drawer {
            transition:
                transform 480ms var(--lg-ease, cubic-bezier(0.22, 1, 0.36, 1)),
                width 480ms var(--lg-ease, cubic-bezier(0.22, 1, 0.36, 1)),
                max-width 480ms var(--lg-ease, cubic-bezier(0.22, 1, 0.36, 1)),
                background var(--lg-duration) var(--lg-ease),
                border-color var(--lg-duration) var(--lg-ease),
                box-shadow var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease) !important;
        }

        /* Historial: cristal + width/transform */
        html.liquid-glass #sidebar-historial,
        html.liquid-glass #panel-historial {
            transition:
                transform var(--historial-duration) var(--historial-ease),
                visibility 0s linear var(--historial-duration),
                width var(--historial-duration) var(--historial-ease),
                max-width var(--historial-duration) var(--historial-ease),
                margin var(--historial-duration) var(--historial-ease),
                border-color var(--historial-duration) var(--historial-ease),
                box-shadow var(--historial-duration) var(--historial-ease),
                background var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease) !important;
        }
        html.liquid-glass #sidebar-historial.historial-abierto,
        html.liquid-glass #panel-historial.historial-abierto {
            transition:
                transform var(--historial-duration) var(--historial-ease),
                visibility 0s linear 0s,
                width var(--historial-duration) var(--historial-ease),
                max-width var(--historial-duration) var(--historial-ease),
                margin var(--historial-duration) var(--historial-ease),
                border-color var(--historial-duration) var(--historial-ease),
                box-shadow var(--historial-duration) var(--historial-ease),
                background var(--lg-duration) var(--lg-ease),
                backdrop-filter var(--lg-duration) var(--lg-ease) !important;
        }

        /* Historial tablet/desktop: borde de cristal al abrir */
        @media (min-width: 768px) {
            html.liquid-glass #sidebar-historial,
            html.liquid-glass #panel-historial {
                transition:
                    transform var(--historial-duration-close) var(--historial-ease-in),
                    visibility 0s linear var(--historial-duration-close),
                    border-color var(--historial-duration-close) var(--historial-ease),
                    box-shadow var(--historial-duration-close) var(--historial-ease),
                    background var(--lg-duration) var(--lg-ease),
                    backdrop-filter var(--lg-duration) var(--lg-ease) !important;
            }
            html.liquid-glass #sidebar-historial.historial-abierto,
            html.liquid-glass #panel-historial.historial-abierto {
                border-width: var(--lg-border-width) !important;
                border-style: solid !important;
                border-color: rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
                box-shadow: var(--lg-cast) !important;
            }
            html.liquid-glass #sidebar-historial:not(.historial-abierto),
            html.liquid-glass #panel-historial:not(.historial-abierto) {
                border-color: transparent !important;
                box-shadow: none !important;
            }
        }

        #liquid-glass-controls {
            transition: opacity 0.35s var(--lg-ease);
        }
        html:not(.liquid-glass) #liquid-glass-controls {
            opacity: 0.45;
            pointer-events: none;
        }

        /* Liquid Glass: tipograf?a s?lida (sin stroke hueco) para UI legal formal */
        html.liquid-glass {
            --lg-ink: #000000;
            --lg-ink-muted: #404040;
            --lg-ink-stroke: none;
            --lg-type-scale: 1;
            --lg-ink-dark: #000000;
            --lg-ink-dark-muted: #404040;
        }
        html.liquid-glass #app-shell,
        html.liquid-glass #chat-drawer,
        html.liquid-glass #view-ajustes,
        html.liquid-glass #modal-session-lock,
        html.liquid-glass #modal-confirmacion,
        html.liquid-glass #modal-pago,
        html.liquid-glass #modal-lexnet,
        html.liquid-glass #modal-camara,
        html.liquid-glass #command-palette {
            color: var(--lg-ink);
            font-weight: 500;
            letter-spacing: 0.01em;
        }
        html.liquid-glass #app-shell,
        html.liquid-glass #chat-drawer,
        html.liquid-glass #view-ajustes,
        html.liquid-glass #modal-session-lock {
            font-size: calc(1rem * var(--lg-type-scale));
        }
        /* Solo texto de lectura en modo claro (NO botones primarios) */
        html.liquid-glass:not(.dark) #app-shell :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, td, th, legend):not(.lexia-help-bubble, .TooltipContent),
        html.liquid-glass:not(.dark) #chat-drawer :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #view-ajustes :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #modal-session-lock :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #sidebar-historial :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #command-palette :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #modal-confirmacion :where(h1, h2, h3, h4, h5, h6, p, span, label):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #modal-pago :where(h1, h2, h3, h4, h5, h6, p, span, label):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #modal-lexnet :where(h1, h2, h3, h4, h5, h6, p, span, label):not(.lexia-help-bubble),
        html.liquid-glass:not(.dark) #modal-camara :where(h1, h2, h3, h4, h5, h6, p, span, label):not(.lexia-help-bubble) {
            color: #000000 !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
        }
        /* Anula el negro forzado arriba en el CTA (mayor especificidad: 2 IDs) */
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap,
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap :where(span, i, strong, em),
        html.liquid-glass #app-shell #txt-btn-aperturar {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
        }
        /* Debe ir DESPU?S: texto blanco en bot?n negro (evita span negro sobre negro) */
        html #txt-btn-aperturar-wrap,
        html #txt-btn-aperturar-wrap *,
        html #txt-btn-aperturar,
        html button#txt-btn-aperturar-wrap,
        html button#txt-btn-aperturar-wrap span,
        html button#txt-btn-aperturar-wrap i,
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap,
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap *,
        html.liquid-glass #app-shell #txt-btn-aperturar,
        html.liquid-glass #app-shell button.btn-primary,
        html.liquid-glass #app-shell button.btn-primary *,
        html.liquid-glass #app-shell [data-action="aperturarExpediente"],
        html.liquid-glass #app-shell [data-action="aperturarExpediente"] *,
        html.liquid-glass:not(.dark) #app-shell .lso-exp-generate,
        html.liquid-glass:not(.dark) #app-shell .lso-exp-generate *,
        html.liquid-glass:not(.dark) #app-shell #lso-exp-btn-generar,
        html.liquid-glass:not(.dark) #app-shell #lso-exp-btn-generar * {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
            opacity: 1 !important;
        }
        html.liquid-glass #app-shell :where(h1, h2, h3, h4, h5, h6),
        html.liquid-glass #chat-drawer :where(h1, h2, h3, h4, h5, h6),
        html.liquid-glass #view-ajustes :where(h1, h2, h3, h4, h5, h6) {
            font-weight: 600;
            letter-spacing: 0.04em;
            line-height: 1.25;
        }
        html.liquid-glass:not(.dark) #app-shell .dash-glass :where(i, svg),
        html.liquid-glass:not(.dark) #app-shell .lg-name-frame :where(i, svg),
        html.liquid-glass:not(.dark) #chat-drawer :where(i, svg):not(#btn-enviar-chat svg):not(#btn-chat-send svg):not(.gemini-send-btn svg):not(.chat-incognito-lock svg),
        html.liquid-glass:not(.dark) #sidebar-historial > div:first-child :where(i, svg),
        html.liquid-glass:not(.dark) #view-ajustes :where(i, svg),
        html.liquid-glass:not(.dark) #modal-session-lock :where(i, svg),
        html.liquid-glass:not(.dark) #app-header #app-logo-icon {
            color: #000000 !important;
            stroke: currentColor;
            filter: none !important;
            opacity: 1 !important;
        }
        /* Ajustes en oscuro: iconos del men? laterales blancos */
        html.dark #view-ajustes .settings-group-tab :where(i, svg),
        html.dark #view-ajustes .settings-group-tab .app-primary-text,
        html.dark.liquid-glass #view-ajustes .settings-group-tab :where(i, svg),
        html.dark.liquid-glass #view-ajustes .settings-group-tab .app-primary-text {
            color: #ffffff !important;
            stroke: #ffffff !important;
            fill: none !important;
            -webkit-text-fill-color: #ffffff !important;
            opacity: 1 !important;
            filter: none !important;
        }
        html.dark #view-ajustes .settings-group-tab :where(svg circle, svg path) {
            stroke: #ffffff !important;
        }
        html.liquid-glass:not(.dark) #app-logo-icon,
        html.liquid-glass:not(.dark) #app-branding-title,
        html.liquid-glass:not(.dark) #user-display-name,
        html.liquid-glass:not(.dark) #user-display-role,
        html.liquid-glass:not(.dark) #txt-lbl-registro,
        html.liquid-glass:not(.dark) #txt-lbl-historial,
        html.liquid-glass:not(.dark) #txt-lbl-historial span {
            color: #000000 !important;
            text-shadow: none !important;
            opacity: 1 !important;
            visibility: visible !important;
            filter: none !important;
        }
        html.dark #app-logo-icon,
        html.dark #app-branding-title,
        html.dark.liquid-glass #app-logo-icon,
        html.dark.liquid-glass #app-logo-img,
        html.dark.liquid-glass #app-branding-title {
            filter: none !important;
            color: #fafafa !important;
            -webkit-text-fill-color: #fafafa !important;
        }
        /* Botones / superficies claras: texto OSCURO intenso (especificidad alta) */
        html.liquid-glass #app-shell .btn-marfil,
        html.liquid-glass #app-shell .btn-marfil *,
        html.liquid-glass #chat-drawer .btn-marfil,
        html.liquid-glass #chat-drawer .btn-marfil *,
        html.liquid-glass #sidebar-historial .btn-marfil,
        html.liquid-glass #sidebar-historial .btn-marfil *,
        html.liquid-glass #view-ajustes .btn-marfil,
        html.liquid-glass #view-ajustes .btn-marfil *,
        html.liquid-glass #app-shell button.bg-white,
        html.liquid-glass #app-shell button.bg-white *,
        html.liquid-glass #user-session-badge,
        html.liquid-glass #user-session-badge *,
        html.liquid-glass #badge-pro,
        html.liquid-glass #btn-descargar-historial,
        html.liquid-glass #btn-refresh-historial,
        html.liquid-glass #theme-toggle {
            color: var(--lg-ink-dark) !important;
        }
        /* Liquid glass + modo oscuro: botones de cabecera en blanco (historial mantiene s?mbolo claro) */
        html.dark.liquid-glass #btn-chat-header,
        html.dark.liquid-glass #btn-chat-header *,
        html.dark.liquid-glass #btn-lang-toggle,
        html.dark.liquid-glass #btn-lang-toggle *,
        html.dark.liquid-glass #settings-toggle,
        html.dark.liquid-glass #settings-toggle *:not(.settings-icon),
        html.dark.liquid-glass #user-session-badge,
        html.dark.liquid-glass #user-session-badge * {
            color: #ffffff !important;
            stroke: #ffffff !important;
            text-shadow: none !important;
            filter: none !important;
        }
        html.dark.liquid-glass #settings-toggle .settings-icon {
            color: #ffffff !important;
            stroke: #ffffff !important;
            fill: none !important;
        }
        html.dark.liquid-glass #settings-toggle .knob {
            fill: #ffffff !important;
            stroke: none !important;
        }
        html.liquid-glass #theme-toggle .theme-icon.is-active {
            filter: none !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
        }
        html.liquid-glass #btn-descargar-historial svg,
        html.liquid-glass #btn-refresh-historial svg,
        html.liquid-glass #sidebar-historial .btn-marfil svg,
        html.liquid-glass #app-shell .btn-marfil svg,
        html.liquid-glass #app-shell .btn-marfil i {
            color: var(--lg-ink-dark) !important;
            stroke: var(--lg-ink-dark) !important;
            opacity: 1 !important;
            filter: none !important;
        }
        /* Dropzone (superficie clara): tinta oscura intensa en modo claro */
        html.liquid-glass:not(.dark) #dropzone-lexnet,
        html.liquid-glass:not(.dark) #dropzone-lexnet :where(span, p, strong, i, svg) {
            color: var(--lg-ink-dark) !important;
            stroke: var(--lg-ink-dark) !important;
            text-shadow: none !important;
            filter: none !important;
        }
        html.liquid-glass:not(.dark) #dropzone-lexnet [data-i18n="dropzone_sub"],
        html.liquid-glass:not(.dark) #dropzone-lexnet .text-slate-600,
        html.liquid-glass:not(.dark) #dropzone-lexnet .text-slate-700 {
            color: var(--lg-ink-dark-muted) !important;
        }
        /* Dropzone en modo oscuro: texto blanco n?tido */
        html.dark.liquid-glass #dropzone-lexnet,
        html.dark.liquid-glass #dropzone-lexnet :where(span, p, strong, i, svg) {
            color: #ffffff !important;
            stroke: #ffffff !important;
            text-shadow: none !important;
            filter: none !important;
        }
        html.dark.liquid-glass #dropzone-lexnet [data-i18n="dropzone_sub"] {
            color: rgba(255, 255, 255, 0.85) !important;
        }
        /* Botones oscuros / primarios: blanco puro siempre (sin invertir en dark) */
        html.liquid-glass .app-primary-bg,
        html.liquid-glass .bg-slate-900,
        html.liquid-glass .bg-red-600,
        html.liquid-glass button.bg-slate-900,
        html.liquid-glass #btn-session-unlock,
        html.liquid-glass #btn-login-submit,
        html.liquid-glass .ai-model-badge,
        html.liquid-glass .app-primary-bg *,
        html.liquid-glass button.bg-slate-900 *,
        html.liquid-glass [class*="bg-[#766355]"],
        html.liquid-glass [data-action="aperturarExpediente"].btn-primary,
        html.liquid-glass [data-action="aperturarExpediente"].btn-primary *,
        html.liquid-glass #txt-btn-aperturar-wrap,
        html.liquid-glass #txt-btn-aperturar-wrap *,
        html.liquid-glass #txt-btn-aperturar {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        html.liquid-glass [data-action="aperturarExpediente"] [data-i18n="sub_aperturar"] {
            color: rgba(255, 255, 255, 0.88) !important;
        }
        /* ?tems de agenda con fondo claro: texto oscuro intenso */
        html.liquid-glass:not(.dark) #lista-agenda-vencimientos li.bg-white\/70,
        html.liquid-glass:not(.dark) #lista-agenda-vencimientos li[class*="bg-white"],
        html.liquid-glass:not(.dark) #lista-agenda-vencimientos li[class*="bg-white"] :where(p, span, strong) {
            color: var(--lg-ink-dark) !important;
            text-shadow: none !important;
        }
        html.liquid-glass:not(.dark) #lista-agenda-vencimientos li[class*="bg-white"] .text-slate-600,
        html.liquid-glass:not(.dark) #lista-agenda-vencimientos li[class*="bg-white"] .text-slate-700,
        html.liquid-glass:not(.dark) #lista-agenda-vencimientos li[class*="bg-white"] .text-slate-500 {
            color: var(--lg-ink-dark-muted) !important;
        }
        html.dark.liquid-glass #lista-agenda-vencimientos li[class*="bg-slate"],
        html.dark.liquid-glass #lista-agenda-vencimientos li[class*="bg-slate"] :where(p, span, strong) {
            color: #ffffff !important;
            text-shadow: none !important;
        }
        html.liquid-glass #badge-pro {
            background: rgba(255, 255, 255, 0.82) !important;
            border: 1px solid rgba(15, 23, 42, 0.12) !important;
            font-size: 0.65rem !important;
            letter-spacing: 0.08em;
        }
        html.liquid-glass input,
        html.liquid-glass textarea,
        html.liquid-glass select {
            color: var(--lg-ink-dark) !important;
            text-shadow: none !important;
        }
        html.liquid-glass ::placeholder {
            color: var(--lg-ink-muted) !important;
            text-shadow: none !important;
            opacity: 1;
        }
        html.liquid-glass input::placeholder,
        html.liquid-glass textarea::placeholder {
            color: #64748b !important;
            text-shadow: none !important;
        }
        html.liquid-glass #prompt-input,
        html.liquid-glass #chat-composer textarea {
            color: var(--lg-ink) !important;
            text-shadow: none !important;
            font-size: 0.9rem;
            font-weight: 400;
            background: transparent !important;
        }
        html.liquid-glass #prompt-input::placeholder,
        html.liquid-glass #chat-composer textarea::placeholder {
            color: var(--lg-ink-muted) !important;
            text-shadow: none !important;
        }
        html.liquid-glass .ai-model-badge {
            font-size: 0.6rem !important;
            letter-spacing: 0.06em;
            font-weight: 600;
        }
        html.liquid-glass #chat-messages .bg-white,
        html.liquid-glass #chat-messages [class*="bg-white"] {
            background: rgba(255, 255, 255, calc(0.18 + var(--lg-opacity) * 0.4)) !important;
            backdrop-filter: blur(calc(var(--lg-blur) * 0.5)) saturate(160%) !important;
            -webkit-backdrop-filter: blur(calc(var(--lg-blur) * 0.5)) saturate(160%) !important;
            border: var(--lg-border-width) solid rgba(var(--lg-border-color), var(--lg-border-alpha)) !important;
            color: var(--lg-ink) !important;
            text-shadow: none !important;
            box-shadow: none !important;
        }
        html.liquid-glass #chat-messages .bg-white :where(p, span, strong, em, a),
        html.liquid-glass #chat-messages [class*="bg-white"] :where(p, span, strong, em, a) {
            color: var(--lg-ink) !important;
            text-shadow: none !important;
        }

        /* Chat: nunca tapa el header; en desktop empuja el dashboard (flex in-flow) */
        html.layout-chat-open #app-header {
            z-index: 100 !important;
        }
        #chat-drawer {
            z-index: 45 !important;
            overflow: hidden !important;
            box-sizing: border-box !important;
        }
        html.layout-chat-open #chat-drawer:not(.chat-closed) {
            z-index: 45 !important;
            pointer-events: auto !important;
            visibility: visible !important;
        }
        /* M?vil: overlay a pantalla completa */
        @media (max-width: 767px) {
            #chat-drawer {
                position: fixed !important;
                top: var(--app-header-height) !important;
                height: calc(100dvh - var(--app-header-height)) !important;
                max-height: calc(100dvh - var(--app-header-height)) !important;
                bottom: 0 !important;
            }
            html.layout-chat-min #chat-drawer:not(.chat-closed),
            html.layout-chat-open #chat-drawer:not(.chat-closed) {
                left: 0 !important;
                right: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                transform: translate3d(0, 0, 0) !important;
            }
            html.layout-chat-min #main-container,
            html.layout-chat-open #main-container {
                padding-right: 0 !important;
                visibility: hidden !important;
                pointer-events: none !important;
            }
            html.layout-chat-open #sidebar-historial {
                visibility: hidden !important;
                pointer-events: none !important;
            }
        }
        /* Desktop: columna flex que empuja #main-container (sin solape).
           Ancho animado; contenido sin slide (texto ya en posici?n). */
        @media (min-width: 768px) {
            #chat-drawer {
                position: relative !important;
                top: auto !important;
                right: auto !important;
                bottom: auto !important;
                left: auto !important;
                z-index: 20 !important;
                height: auto !important;
                max-height: none !important;
                align-self: stretch;
                flex: 0 0 auto;
                width: 0 !important;
                max-width: 0 !important;
                min-width: 0 !important;
                margin: 0 !important;
                transform: none !important;
                visibility: hidden;
                pointer-events: none;
                border-color: transparent !important;
                box-shadow: none !important;
                transition:
                    width var(--layout-duration) var(--layout-ease),
                    max-width var(--layout-duration) var(--layout-ease),
                    visibility 0s linear var(--layout-duration) !important;
            }
            html:not(.vista-erp-chat) #chat-drawer > * {
                /* Ancho bloqueado al tama?o final del panel: evita reflow/letras al abrir */
                width: var(--chat-content-lock, max(18rem, 37.5vw));
                min-width: var(--chat-content-lock, max(18rem, 37.5vw));
                max-width: var(--chat-content-lock, max(18rem, 37.5vw));
                flex-shrink: 0;
                box-sizing: border-box;
                opacity: 1;
                transform: none;
                transition: none !important;
            }
            html.layout-chat-min #chat-drawer:not(.chat-closed) {
                width: var(--chat-width-md) !important;
                max-width: var(--chat-width-md) !important;
                min-width: 0 !important;
                height: calc(100dvh - var(--app-header-height)) !important;
                max-height: calc(100dvh - var(--app-header-height)) !important;
                margin: 0 !important;
                visibility: visible !important;
                pointer-events: auto !important;
                transform: none !important;
                border-color: var(--app-border) !important;
                box-shadow: none !important;
                transition:
                    width var(--layout-duration) var(--layout-ease),
                    max-width var(--layout-duration) var(--layout-ease),
                    visibility 0s linear 0s !important;
            }
            html.layout-chat-min #chat-drawer:not(.chat-closed) > * {
                opacity: 1;
                transform: none;
            }
            html.layout-chat-min #main-container {
                padding-right: 0 !important;
                flex: 1 1 auto !important;
                min-width: 0 !important;
                max-width: 100% !important;
            }
            html.layout-chat-max #chat-drawer:not(.chat-closed) {
                position: fixed !important;
                top: var(--app-header-height) !important;
                left: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                height: calc(100dvh - var(--app-header-height)) !important;
                max-height: calc(100dvh - var(--app-header-height)) !important;
                margin: 0 !important;
                transform: translate3d(0, 0, 0) !important;
                z-index: 45 !important;
                visibility: visible !important;
                pointer-events: auto !important;
            }
            html.layout-chat-max #chat-drawer > * {
                width: auto;
                min-width: 0;
                max-width: none;
                flex-shrink: 1;
                opacity: 1;
                transform: none;
            }
        }
        html.layout-chat-max #main-container {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
            opacity: 0 !important;
        }
        /* Chat como vista ERP (drawer dentro de #main-container): no ocultar el main */
        html.vista-erp-chat.layout-chat-max #main-container,
        html.vista-erp-chat.layout-chat-open #main-container {
            display: flex !important;
            visibility: visible !important;
            pointer-events: auto !important;
            opacity: 1 !important;
        }
        /* Chat maximizado + historial: drawer FIJO a la DERECHA */
        html.layout-chat-max #sidebar-historial,
        html.layout-chat-max #panel-historial,
        html.layout-chat-max #sidebar-historial.historial-abierto,
        html.layout-chat-max #panel-historial.historial-abierto {
            position: fixed !important;
            top: 0 !important;
            right: 0 !important;
            left: auto !important;
            bottom: 0 !important;
            z-index: 90 !important;
            width: var(--historial-width) !important;
            max-width: min(var(--historial-width), 92vw) !important;
            min-width: 0 !important;
            height: 100dvh !important;
            max-height: 100dvh !important;
            margin: 0 !important;
            margin-top: 0 !important;
            opacity: 1 !important;
            overflow: hidden !important;
            border-radius: 0 !important;
            border-left: 1px solid transparent !important;
            border-right: none !important;
            box-shadow: none !important;
            align-self: auto !important;
            flex: none !important;
            will-change: transform;
            transition:
                transform var(--historial-duration-close) var(--historial-ease-in),
                visibility 0s linear var(--historial-duration-close),
                border-color var(--historial-duration-close) var(--historial-ease-in) !important;
        }
        html.layout-chat-max #sidebar-historial,
        html.layout-chat-max #panel-historial {
            pointer-events: none;
            visibility: hidden !important;
            transform: translate3d(105%, 0, 0) !important;
        }
        html.layout-chat-max.layout-historial-open #sidebar-historial.historial-abierto,
        html.layout-chat-max.layout-historial-open #panel-historial.historial-abierto {
            transform: translate3d(0, 0, 0) !important;
            pointer-events: auto !important;
            visibility: visible !important;
            border-left-color: rgba(0, 0, 0, 0.08) !important;
            box-shadow: none !important;
            transition:
                transform var(--historial-duration) var(--historial-ease),
                visibility 0s linear 0s,
                border-color var(--historial-duration) var(--historial-ease) !important;
        }
        html.dark.layout-chat-max.layout-historial-open #sidebar-historial.historial-abierto,
        html.dark.layout-chat-max.layout-historial-open #panel-historial.historial-abierto {
            border-left-color: rgba(255, 255, 255, 0.1) !important;
        }
        html.layout-chat-max #chat-drawer:not(.chat-closed) {
            transition:
                padding-right var(--historial-duration) var(--historial-ease),
                width var(--historial-duration) var(--historial-ease),
                max-width var(--historial-duration) var(--historial-ease) !important;
        }
        html.layout-chat-max.layout-historial-open #chat-drawer:not(.chat-closed),
        html.layout-chat-max.layout-historial-open #view-chat {
            padding-right: 0 !important;
        }
        html.layout-chat-open #chat-messages,
        html.layout-chat-open #chat-composer {
            max-width: 100% !important;
        }

        html:not(.dark) .settings-group-tab[aria-selected="true"] {
            background-color: var(--app-surface);
            border-color: var(--primary-accent);
            box-shadow: none;
            color: var(--primary-accent);
        }
        /* Contraste cabecera en modo oscuro: fondo cristal oscuro + dibujo blanco */
        html.dark #btn-chat-header,
        html.dark #btn-lang-toggle,
        html.dark #settings-toggle,
        html.dark #user-session-badge {
            background: rgba(15, 23, 42, 0.75) !important;
            background-image: none !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: #ffffff !important;
            box-shadow: none !important;
        }
        html.dark #btn-chat-header:hover,
        html.dark #btn-lang-toggle:hover,
        html.dark #settings-toggle:hover {
            background: rgba(30, 41, 59, 0.85) !important;
        }
        html.dark #btn-chat-header i,
        html.dark #btn-chat-header svg,
        html.dark #btn-lang-toggle .lang-text,
        html.dark #settings-toggle,
        html.dark #settings-toggle svg,
        html.dark #settings-toggle span,
        html.dark #settings-toggle .knob,
        html.dark #user-session-badge i,
        html.dark #user-session-badge svg,
        html.dark #user-session-badge span {
            color: #ffffff !important;
            stroke: #ffffff !important;
            fill: #ffffff !important;
            filter: none !important;
        }
        /* Abrir historial: mismo s?mbolo que en modo claro (fondo blanco + trazo oscuro) */
        html.dark #btn-toggle-historial,
        html.dark #btn-toggle-historial:hover {
            background: #ffffff !important;
            background-image: none !important;
            border: 1px solid #D5D3CB !important;
            color: #4b5563 !important;
            box-shadow: none !important;
        }
        html.dark #btn-toggle-historial:hover {
            background: #f5f5f5 !important;
        }
        html.dark #btn-toggle-historial svg,
        html.dark #btn-toggle-historial .toggle-historial-icon {
            color: #4b5563 !important;
            stroke: #4b5563 !important;
            fill: none !important;
            filter: none !important;
        }
        html.dark #settings-toggle .settings-icon {
            fill: none !important;
        }
        html.dark #settings-toggle .knob {
            fill: #ffffff !important;
            stroke: none !important;
        }

        /* --- Theme toggle: sol / luna (sin solapamiento) --- */
        #theme-toggle.theme-toggle-btn {
            position: relative;
            box-sizing: border-box;
            width: 2.25rem;
            height: 2.25rem;
            border-radius: 9999px !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            align-self: center;
            overflow: hidden;
            cursor: pointer;
            padding: 0;
            vertical-align: middle;
            border: 1px solid #e5e7eb !important;
            background: #f3f4f6 !important;
            box-shadow: 0 1px 2px rgba(0,0,0,0.06) !important;
            backdrop-filter: none;
            background-image: none;
            color: #9ca3af;
            transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
        }
        #theme-toggle.theme-toggle-btn::before,
        #theme-toggle.theme-toggle-btn::after {
            content: none;
            display: none;
        }
        #theme-toggle.theme-toggle-btn:hover {
            background: #e5e7eb !important;
            border-color: #d1d5db;
            color: #374151;
            transform: scale(1.1);
        }
        #theme-toggle.theme-toggle-btn:active {
            transform: translateY(1px) scale(0.94);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
        }

        #theme-toggle .icon-wrapper {
            position: relative;
            width: 1.35rem;
            height: 1.35rem;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: visible;
        }

        /* Por defecto ambos ocultos; solo .is-active se ve (evita luna enana dentro del sol) */
        #theme-toggle .theme-icon {
            position: static;
            width: 100%;
            height: 100%;
            stroke-width: 2;
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
            transform: none !important;
        }
        #theme-toggle .theme-icon.is-active {
            display: block !important;
            opacity: 1 !important;
            visibility: visible !important;
            pointer-events: auto !important;
            transform: none !important;
        }
        #theme-toggle .sun-icon.is-active {
            color: #eab308;
            stroke: #eab308;
        }
        #theme-toggle .moon-icon.is-active {
            color: #000000;
            stroke: #000000;
        }

        /* Sol: n?cleo + rayos (r?faga el?stica al modo claro) */
        #theme-toggle .sun-center {
            transform-box: view-box;
            transform-origin: center;
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        #theme-toggle .sun-rays {
            transform-box: view-box;
            transform-origin: center;
            transition: transform 0.5s cubic-bezier(0.34, 1.75, 0.64, 1), opacity 0.3s ease;
        }
        /* Estado MODO OSCURO (Los rayos van encogidos e invisibles en el centro) */
        body.dark-mode #theme-toggle .sun-rays {
            opacity: 0;
            transform: scale(0.2) rotate(-45deg);
        }
        body.dark-mode #theme-toggle .sun-center {
            transform: scale(0.6);
        }
        /* Estado MODO CLARO (Los rayos salen disparados con muelle) */
        body:not(.dark-mode) #theme-toggle .sun-rays {
            opacity: 1;
            transform: scale(1) rotate(0deg);
            transition-delay: 0.08s;
        }
        body:not(.dark-mode) #theme-toggle .sun-center {
            transform: scale(1);
        }
        /* R?faga al activar modo claro (display:none ? block no anima con transition sola) */
        #theme-toggle .sun-icon.is-active.sun-burst .sun-center {
            animation: sun-center-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }
        #theme-toggle .sun-icon.is-active.sun-burst .sun-rays {
            animation: sun-rays-burst 0.55s cubic-bezier(0.34, 1.75, 0.64, 1) 0.08s both;
        }
        @keyframes sun-center-pop {
            from { transform: scale(0.6); }
            to { transform: scale(1); }
        }
        @keyframes sun-rays-burst {
            from {
                opacity: 0;
                transform: scale(0.2) rotate(-45deg);
            }
            to {
                opacity: 1;
                transform: scale(1) rotate(0deg);
            }
        }

        /* Luna: estrellas fijas titilantes + estrellas fugaces (izq ? der) */
        body.dark-mode #theme-toggle.theme-toggle-btn,
        html.dark #theme-toggle.theme-toggle-btn {
            background: rgba(15, 23, 42, 0.75) !important; /* Cristal azulado oscuro */
            border-color: rgba(255, 255, 255, 0.2) !important;
            box-shadow:
                0 1px 3px 0 rgba(0, 0, 0, 0.28),
                0 1px 8px 0 rgba(0, 0, 0, 0.16) !important;
            color: #ffffff !important;
            overflow: visible;
        }
        body.dark-mode #theme-toggle.theme-toggle-btn:hover,
        html.dark #theme-toggle.theme-toggle-btn:hover {
            background: rgba(30, 41, 59, 0.85) !important;
        }
        body.dark-mode #theme-toggle .moon-icon,
        body.dark-mode #theme-toggle .moon-icon.is-active,
        html.dark #theme-toggle .moon-icon.is-active {
            color: #ffffff !important;
            stroke: #ffffff !important;
        }
        body.dark-mode #theme-toggle .moon-body,
        html.dark #theme-toggle .moon-body {
            fill: #ffffff !important;
            stroke: #ffffff !important;
        }
        body.dark-mode #theme-toggle .star,
        body.dark-mode #theme-toggle .shooting-star,
        html.dark #theme-toggle .star,
        html.dark #theme-toggle .shooting-star {
            fill: #ffffff !important;
            stroke: #ffffff !important;
        }
        /* Luna m?s peque?a en el centro ? aire respecto a las estrellas */
        #theme-toggle .moon-icon .moon-body-wrap {
            transform-box: view-box;
            transform-origin: center;
            transform: scale(0.62);
        }
        /* Titileo continuo de las estrellas fijas (esquinas / bordes) */
        #theme-toggle .moon-icon .star {
            transform-box: fill-box;
            transform-origin: center;
            fill: currentColor;
            stroke: none;
            opacity: 0.3;
            animation: starTwinkle 2.2s infinite ease-in-out alternate;
        }
        #theme-toggle .moon-icon .star-1 { animation-delay: 0.1s; }
        #theme-toggle .moon-icon .star-2 { animation-delay: 0.4s; }
        #theme-toggle .moon-icon .star-3 { animation-delay: 0.7s; }
        #theme-toggle .moon-icon .star-4 { animation-delay: 1.0s; }
        #theme-toggle .moon-icon .star-5 { animation-delay: 1.3s; }
        #theme-toggle .moon-icon .star-6 { animation-delay: 1.6s; }
        #theme-toggle .moon-icon .star-7 { animation-delay: 1.9s; }
        #theme-toggle .moon-icon .star-8 { animation-delay: 2.2s; }
        @keyframes starTwinkle {
            0% { opacity: 0.2; transform: scale(0.6); }
            100% { opacity: 1; transform: scale(1.3); }
        }
        /* Durante la lluvia de fugaces: ocultar todas las fijas */
        #theme-toggle .moon-icon.moon-shoot .stars-fixed,
        #theme-toggle .moon-icon.moon-shoot .star {
            opacity: 0 !important;
            visibility: hidden !important;
            animation: none !important;
            pointer-events: none !important;
        }
        /* Estrellas fugaces: destellos a la vez en todo el recuadro (no en cascada) */
        #theme-toggle .moon-icon .shooting-star {
            opacity: 0;
            stroke-linecap: round;
            stroke-dasharray: 10;
            stroke-dashoffset: 10;
            transform-origin: center;
            transform-box: fill-box;
        }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-1,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-2,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-3,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-4,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-5,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-6,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-7,
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-8 {
            animation: shootFlashInPlace 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0s 1;
        }
        /* Peque?a variaci?n de timing para que no parezcan un solo flash */
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-2 { animation-delay: 0.04s; }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-3 { animation-delay: 0.02s; }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-4 { animation-delay: 0.06s; }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-5 { animation-delay: 0.03s; }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-6 { animation-delay: 0.05s; }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-7 { animation-delay: 0.01s; }
        #theme-toggle .moon-icon.is-active.moon-shoot .shooting-star-8 { animation-delay: 0.07s; }
        @keyframes shootFlashInPlace {
            0% {
                opacity: 0;
                stroke-dashoffset: 10;
            }
            25% {
                opacity: 1;
                stroke-dashoffset: 0;
            }
            70% {
                opacity: 0.85;
                stroke-dashoffset: -4;
            }
            100% {
                opacity: 0;
                stroke-dashoffset: -12;
            }
        }
        /* Luna: el SVG ocupa el wrapper completo */
        #theme-toggle .moon-icon.is-active {
            overflow: visible;
            width: 100%;
            height: 100%;
        }
        /* Branding / logo: contraste en modo oscuro */
        html.dark #app-logo-icon,
        html.dark #app-logo-img,
        html.dark #app-branding-title,
        .dark #app-logo-icon,
        .dark #app-logo-img,
        .dark #app-branding-title {
            filter: brightness(0) invert(1) !important;
            color: #ffffff !important;
        }
        html.dark #badge-pro {
            color: #e2e8f0 !important;
            border-color: #64748b !important;
            background-color: #334155 !important;
        }
        html.dark #btn-descargar-historial {
            color: #e2e8f0 !important;
        }

        /* btn-marfil: elimina degradado claro en modo oscuro (excepto controles de cabecera y cierres X) */
        html.dark .btn-marfil:not(#btn-chat-header):not(#btn-lang-toggle):not(#settings-toggle):not(#btn-toggle-historial):not(.btn-icon-close):not([aria-label*="Cerrar"]),
        .dark .btn-marfil:not(#btn-chat-header):not(#btn-lang-toggle):not(#settings-toggle):not(#btn-toggle-historial):not(.btn-icon-close):not([aria-label*="Cerrar"]) {
            background: #334155 !important;
            background-image: none !important;
            border-color: #475569 !important;
            color: #f8fafc !important;
            box-shadow: none !important;
        }
        html.dark .btn-marfil:not(#btn-chat-header):not(#btn-lang-toggle):not(#settings-toggle):not(#btn-toggle-historial):not(.btn-icon-close):not([aria-label*="Cerrar"]):hover,
        .dark .btn-marfil:not(#btn-chat-header):not(#btn-lang-toggle):not(#settings-toggle):not(#btn-toggle-historial):not(.btn-icon-close):not([aria-label*="Cerrar"]):hover {
            background: #475569 !important;
            background-image: none !important;
            border-color: #64748b !important;
        }
        html.dark .btn-marfil:not(#btn-chat-header):not(#btn-lang-toggle):not(#settings-toggle):not(#btn-toggle-historial) svg,
        .dark .btn-marfil:not(#btn-chat-header):not(#btn-lang-toggle):not(#settings-toggle):not(#btn-toggle-historial) svg {
            color: #f8fafc !important;
            stroke: #f8fafc !important;
            fill: none !important;
        }

        /* Cabecera: fondo blanco s?lido (excepto theme-toggle en oscuro) */
        #btn-chat-header,
        #btn-lang-toggle,
        #settings-toggle,
        #btn-toggle-historial {
            background: #ffffff !important;
            background-image: none !important;
            border: 1px solid #D5D3CB !important;
            box-shadow: none !important;
        }
        #btn-chat-header:hover,
        #btn-lang-toggle:hover,
        #settings-toggle:hover,
        #btn-toggle-historial:hover,
        #theme-toggle.theme-toggle-btn:hover {
            background: #e5e7eb !important;
            background-image: none !important;
        }
        #user-session-badge {
            background: #ffffff !important;
            background-image: none !important;
            border-color: #e2e2e2 !important;
        }
        /* Modo oscuro: botones de cabecera = cristal oscuro + blanco (como theme-toggle) */
        html.dark #btn-chat-header,
        html.dark #btn-lang-toggle,
        html.dark #settings-toggle,
        html.dark #user-session-badge {
            background: rgba(15, 23, 42, 0.75) !important;
            background-image: none !important;
            border-color: rgba(255, 255, 255, 0.2) !important;
            color: #ffffff !important;
            box-shadow: none !important;
        }
        html.dark #btn-chat-header:hover,
        html.dark #btn-lang-toggle:hover,
        html.dark #settings-toggle:hover {
            background: rgba(30, 41, 59, 0.85) !important;
            background-image: none !important;
        }

        /* Bot?n idioma: slide saludo temporal (Hello / Hola ? EN / ES) */
        #btn-lang-toggle.lang-btn {
            position: relative;
            height: 36px;
            width: max-content;
            padding: 0 10px;
            box-sizing: border-box;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            cursor: pointer;
            font-weight: 600;
            font-size: 13px;
            letter-spacing: 0.5px;
        }
        #btn-lang-toggle .lang-text-wrapper {
            position: relative;
            display: grid;
            place-items: center;
            height: 100%;
            overflow: hidden;
        }
        /* Reserva el ancho exacto de la palabra m?s larga (Hello) */
        #btn-lang-toggle .lang-text-sizer {
            grid-area: 1 / 1;
            visibility: hidden;
            pointer-events: none;
            white-space: nowrap;
            line-height: 1;
            user-select: none;
        }
        #btn-lang-toggle .lang-text {
            grid-area: 1 / 1;
            display: inline-block;
            white-space: nowrap;
            line-height: 1;
            color: #4b5563;
            transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
        }
        html.dark #btn-lang-toggle .lang-text {
            color: #ffffff;
        }
        #btn-lang-toggle .lang-text.slide-out-up {
            transform: translateY(-100%);
            opacity: 0;
        }
        #btn-lang-toggle .lang-text.slide-in-bottom {
            transform: translateY(100%);
            opacity: 0;
        }

        /* --- Ajustes: microinteracci?n de knobs en el icono --- */
        #settings-toggle.settings-btn .settings-icon {
            flex-shrink: 0;
            display: block;
        }
        #settings-toggle.settings-btn .knob {
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efecto muelle el?stico */
            transform-box: fill-box;
            transform-origin: center;
        }
        /* Estado Activo / Panel Abierto (los puntos se deslizan al lado contrario) */
        #settings-toggle.settings-btn.active .knob-1,
        #settings-toggle.settings-btn[aria-expanded="true"] .knob-1 {
            transform: translateX(8px); /* De izquierda a derecha */
        }
        #settings-toggle.settings-btn.active .knob-2,
        #settings-toggle.settings-btn[aria-expanded="true"] .knob-2 {
            transform: translateX(-8px); /* De derecha a izquierda */
        }
        #settings-toggle.settings-btn.active .knob-3,
        #settings-toggle.settings-btn[aria-expanded="true"] .knob-3 {
            transform: translateX(10px); /* De izquierda a derecha */
        }
        /* Los knobs usan fill; no heredar fill:none del dark btn-marfil */
        #settings-toggle.settings-btn .knob {
            fill: currentColor !important;
            stroke: none !important;
        }
        html.liquid-glass #settings-toggle .knob {
            fill: currentColor !important;
            stroke: none !important;
            color: inherit;
        }

        /* Chat: micr?fono y enviar */
        #btn-mic #mic-icon,
        #btn-mic svg:not(.mic-stop-keep-fill):not(#mic-radial-eq) {
            width: 1rem !important;
            height: 1rem !important;
            fill: none !important;
            stroke: currentColor !important;
            color: inherit;
        }
        html.dark #btn-mic,
        .dark #btn-mic {
            background-color: transparent !important;
            border-color: transparent !important;
            color: #e5e5e5 !important;
        }
        html.dark #btn-mic svg,
        .dark #btn-mic svg,
        html.dark #mic-icon {
            fill: none !important;
            stroke: currentColor !important;
            color: inherit !important;
        }
        #btn-mic.is-recording #mic-icon,
        html.dark #mic-icon.text-red-500,
        html.dark #mic-icon.animate-pulse {
            color: #f87171 !important;
            stroke: #f87171 !important;
            fill: none !important;
        }
        input[type="color"].color-picker-input {
            -webkit-appearance: none;
            appearance: none;
            width: 2.25rem !important;
            height: 2.25rem !important;
            min-width: 2.25rem;
            padding: 0 !important;
            cursor: pointer;
            border: 1px solid var(--app-border-strong) !important;
            border-radius: 9999px !important;
            background: transparent;
            overflow: hidden;
        }
        input[type="color"].color-picker-input::-webkit-color-swatch-wrapper {
            padding: 0;
            border-radius: 9999px;
        }
        input[type="color"].color-picker-input::-webkit-color-swatch {
            border: none;
            border-radius: 9999px;
        }
        input[type="color"].color-picker-input::-moz-color-swatch {
            border: none;
            border-radius: 9999px;
        }
        ::-webkit-scrollbar { width: 8px; height: 8px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 0; }
        .panel-shadow {
            box-shadow: none;
            border: 1px solid var(--app-border);
        }
        
        /* btn-marfil ? bot?n secundario Geist (definido arriba en :root block) */

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* Selector de idiomas en Ajustes */
        #eternity-lang-select {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            width: 100%;
            background-color: #ffffff;
            border: 1px solid var(--app-border-strong);
            padding: 0.75rem 2.75rem 0.75rem 0.9rem;
            border-radius: var(--app-radius);
            color: var(--app-text);
            font-size: 0.95rem;
            font-weight: 500;
            outline: none;
            cursor: pointer;
            box-shadow: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23171717' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 1.75rem center;
            background-size: 0.75rem 0.5rem;
            transition: border-color 0.15s ease, background-color 0.15s ease;
        }
        #eternity-lang-select::-ms-expand { display: none; }
        #eternity-lang-select:hover {
            border-color: var(--app-border-strong);
            background-color: var(--app-surface);
        }
        #eternity-lang-select:focus {
            border-color: var(--app-border-strong);
            box-shadow: none;
        }
        html.dark #eternity-lang-select {
            background-color: #1f2937;
            border-color: #475569;
            color: #f1f5f9;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23f1f5f9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        }
        .lang-format-option {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.85rem 1rem;
            border: 1px solid var(--app-border);
            border-radius: var(--app-radius);
            cursor: pointer;
            transition: background-color 0.15s ease, border-color 0.15s ease;
            background: #fff;
        }
        .lang-format-option:hover {
            background: var(--app-surface);
            border-color: var(--app-border-strong);
        }
        .lang-format-option:has(input:checked) {
            border-color: var(--primary-accent);
            background: color-mix(in srgb, var(--primary-accent) 6%, #fff);
        }
        html.dark .lang-format-option {
            background: #1f2937;
            border-color: #475569;
        }
        html.dark .lang-format-option:hover,
        html.dark .lang-format-option:has(input:checked) {
            background: #374151;
            border-color: #a3a3a3;
        }

        /* --- Layout compartido: historial | dashboard | chat (sin solapes en desktop) --- */
        :root {
            --app-header-height: 3.75rem;
            --historial-width: 20rem; /* panel historial m?s ancho (antes 15rem / w-60) */
            --historial-gap: 0.5rem;
            --chat-width-md: 37.5%;
            --layout-duration: 0.28s;
            --layout-ease: cubic-bezier(0.4, 0, 0.2, 1);
            --historial-ease: cubic-bezier(0.22, 1, 0.36, 1);
            --historial-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
            --historial-ease-in: cubic-bezier(0.32, 0, 0.67, 0);
            --historial-duration: 0.42s;
            --historial-duration-close: 0.42s;
        }
        #app-shell {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            min-height: 100dvh;
            width: 100%;
            position: relative;
        }
        #app-shell.hidden {
            display: none !important;
        }
        html.auth-session,
        html.auth-session body {
            height: 100dvh;
            min-height: 100dvh;
            overflow: hidden;
            overflow-x: hidden;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        html.auth-session::-webkit-scrollbar,
        html.auth-session body::-webkit-scrollbar {
            width: 0 !important;
            height: 0 !important;
            display: none !important;
        }
        html.auth-session #app-shell {
            height: 100dvh;
            max-height: 100dvh;
            min-height: 0 !important;
            overflow: hidden;
        }
        html.auth-session #app-workspace {
            min-height: 0 !important;
            flex: 1 1 0;
            overflow: hidden;
        }
        html.auth-session #main-container {
            min-height: 0 !important;
            height: 100%;
            overflow: hidden;
        }
        html.auth-session #main-container > main {
            display: flex;
            flex-direction: column;
            min-height: 0 !important;
            height: 100%;
            overflow: hidden !important;
            overscroll-behavior: none;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        html.auth-session #main-container > main::-webkit-scrollbar,
        html.auth-session #app-shell::-webkit-scrollbar,
        html.auth-session #app-workspace::-webkit-scrollbar,
        html.auth-session #main-container::-webkit-scrollbar,
        html.auth-session #view-cartera::-webkit-scrollbar {
            width: 0 !important;
            height: 0 !important;
            display: none !important;
        }
        html.auth-session #view-cartera,
        html.auth-session #view-detalle-cliente,
        html.auth-session #view-ficha-cliente {
            width: 100%;
            flex: 1 1 auto;
            min-height: 0;
            margin-inline: auto;
            overflow-x: hidden !important;
            overflow-y: auto !important;
            overscroll-behavior: contain;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        html.auth-session #view-cartera.is-expediente-open {
            overflow-x: hidden !important;
            overflow-y: auto !important;
            scrollbar-width: none !important;
            -ms-overflow-style: none !important;
        }
        html.auth-session #view-cartera.is-expediente-open::-webkit-scrollbar {
            width: 0 !important;
            height: 0 !important;
            display: none !important;
        }
        html.auth-session #cartera-page-header:has(#cartera-page-heading[hidden]) {
            display: none !important;
        }
        html.auth-session #view-cartera > #panel-slot-herramienta-nicho,
        html.auth-session #panel-slot-herramienta-nicho > div:not(.hidden) {
            margin-top: 0 !important;
        }
        html.auth-session #main-container > main:has(#panel-slot-herramienta-nicho > div:not(.hidden)) {
            padding-top: 1.25rem !important;
            justify-content: flex-start;
        }
        html.auth-session #view-cartera:has(#panel-slot-herramienta-nicho > div:not(.hidden)) {
            padding-top: 0 !important;
        }
        html.auth-session #panel-slot-herramienta-nicho,
        html.auth-session #panel-slot-herramienta-nicho [data-canvas] {
            min-height: 0 !important;
            overflow: hidden !important;
            overscroll-behavior: none;
        }

        /* Auth gate: loading / login / sesión (anti-FOUC) */
        html.auth-boot,
        html.auth-boot body,
        html.auth-loading,
        html.auth-loading body {
            background-color: #fafafa !important;
        }
        html.dark.auth-boot,
        html.dark.auth-boot body,
        html.dark.auth-loading,
        html.dark.auth-loading body {
            background-color: #0a0a0a !important;
        }
        html.auth-boot #app-shell,
        html.auth-loading #app-shell,
        html.auth-login #app-shell,
        html.auth-boot #app-shell.hidden,
        html.auth-loading #app-shell.hidden,
        html.auth-login #app-shell.hidden {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
        html.auth-boot #modal-login,
        html.auth-loading #modal-login {
            display: none !important;
            visibility: hidden !important;
        }
        html.auth-login #modal-login,
        html.auth-login #modal-login.hidden {
            display: flex !important;
            visibility: visible !important;
        }
        html.auth-session #modal-login,
        html.auth-session #modal-login.hidden {
            display: none !important;
            visibility: hidden !important;
        }
        html.auth-colegiacion #modal-login,
        html.auth-colegiacion #view-auth {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
        html.auth-colegiacion #app-shell {
            display: flex !important;
            visibility: visible !important;
        }
        html.auth-colegiacion #modal-colegiacion,
        html.auth-colegiacion #modal-colegiacion[hidden] {
            display: flex !important;
            visibility: visible !important;
            pointer-events: auto !important;
        }
        html.auth-session #app-shell {
            display: flex !important;
            visibility: visible !important;
            pointer-events: auto !important;
        }
        html.auth-session #view-auth,
        html.auth-session #view-auth.hidden {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
        html.auth-boot #view-auth,
        html.auth-loading #view-auth,
        html.auth-loading #view-auth.hidden {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
        html.auth-login #view-auth,
        html.auth-login #view-auth.hidden {
            display: flex !important;
            visibility: visible !important;
            pointer-events: auto !important;
        }
        #app-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            width: 100%;
            height: 0;
            min-height: 0;
            z-index: 80;
            box-sizing: border-box;
            flex-shrink: 0;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            background-color: transparent !important;
            border-bottom: none !important;
            pointer-events: none;
            overflow: visible;
        }
        #app-header > * {
            pointer-events: auto;
        }
        .header-side-left {
            margin-top: 1rem;
            margin-left: 1rem;
        }
        /* Controles flotantes: estilos definitivos al final del CSS (#app-header .header-side-right) */

        /* ??? Vercel Deployments-style list ??? */
        .vercel-page-title {
            font-size: 1.75rem;
            font-weight: 600;
            letter-spacing: -0.035em;
            color: #09090B;
            line-height: 1.2;
        }
        .vercel-breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.875rem;
            color: var(--app-text-muted);
        }
        .vercel-breadcrumb .crumb-sep { color: #d4d4d4; }
        .vercel-breadcrumb .crumb-current { color: var(--app-text); font-weight: 500; }
        .vercel-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }
        #lso-kanban-shell .vercel-filters {
            align-items: flex-start;
        }
        #lso-kanban-shell #btn-filtros-expedientes.vercel-filter,
        #btn-filtros-agenda.vercel-filter,
        #lso-kanban-shell .lso-view-toggle {
            height: 2rem;
            flex-shrink: 0;
        }
        .exp-filtros-popover-wrap {
            position: relative;
            flex-shrink: 0;
        }
        .exp-filtros-btn {
            position: relative;
            overflow: hidden;
            isolation: isolate;
            cursor: pointer;
            user-select: none;
        }
        .exp-filtros-water {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            border-radius: inherit;
        }
        .exp-filtros-btn > .exp-filtros-icon,
        .exp-filtros-btn > span {
            position: relative;
            z-index: 1;
        }
        .exp-filtros-btn.is-filtered .exp-filtros-icon {
            fill: #2563eb;
            stroke: #1d4ed8;
        }
        .exp-filtros-btn.is-open,
        .exp-filtros-btn[aria-expanded="true"] {
            border-color: #d4d4d4;
            background: #fafafa;
        }
        html.dark .exp-filtros-btn.is-open,
        html.dark .exp-filtros-btn[aria-expanded="true"] {
            border-color: #404040;
            background: #171717;
        }
        .exp-filtros-popover {
            position: absolute;
            top: calc(100% + 0.5rem);
            right: 0;
            z-index: 50;
            display: none;
            flex-direction: column;
            width: 20rem;
            height: 16.5rem;
            box-sizing: border-box;
            padding: 0.85rem 0.9rem 0.75rem;
            background: #ffffff;
            border: 1px solid #d4d4d4;
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
        }
        .exp-filtros-popover.is-open,
        .exp-filtros-popover:not([hidden]) {
            display: flex;
        }
        .exp-filtros-popover[hidden] {
            display: none !important;
        }
        #popover-filtros-agenda {
            width: 22rem;
            height: 14rem;
        }
        .exp-filtros-search {
            position: relative;
            margin-top: auto;
            padding-top: 0.65rem;
        }
        .exp-filtros-search-icon {
            position: absolute;
            left: 0;
            top: calc(0.65rem + 1rem);
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            color: #111827;
            pointer-events: none;
            z-index: 1;
        }
        html.dark .exp-filtros-search-icon {
            color: #fafafa;
        }
        .exp-filtros-search-input {
            display: block;
            width: 1.35rem;
            max-width: 100%;
            height: 2rem;
            box-sizing: border-box;
            margin: 0;
            padding: 0 0 0 1.35rem;
            font-size: 0.8125rem;
            line-height: 1.25;
            color: #171717;
            caret-color: transparent;
            background: transparent;
            border: 0 !important;
            border-bottom: 1px solid transparent !important;
            border-radius: 0 !important;
            outline: none !important;
            box-shadow: none !important;
            appearance: none;
            -webkit-appearance: none;
            transition: width 0.32s ease, border-bottom-color 0.32s ease;
        }
        .exp-filtros-search-input::-webkit-search-cancel-button,
        .exp-filtros-search-input::-webkit-search-decoration,
        .exp-filtros-search-input::-webkit-search-results-button,
        .exp-filtros-search-input::-webkit-search-results-decoration {
            display: none;
            -webkit-appearance: none;
            appearance: none;
        }
        .exp-filtros-search-input::placeholder {
            color: #9ca3af;
            opacity: 0;
        }
        .exp-filtros-search:hover .exp-filtros-search-input,
        .exp-filtros-search:focus-within .exp-filtros-search-input,
        .exp-filtros-search:has(.exp-filtros-search-input:not(:placeholder-shown)) .exp-filtros-search-input {
            width: 100%;
            border-bottom-color: #e5e7eb !important;
        }
        .exp-filtros-search:hover .exp-filtros-search-input::placeholder,
        .exp-filtros-search:focus-within .exp-filtros-search-input::placeholder {
            opacity: 1;
        }
        .exp-filtros-search:focus-within .exp-filtros-search-input,
        .exp-filtros-search-input:not(:placeholder-shown) {
            caret-color: #171717;
        }
        html.dark .exp-filtros-search-input {
            color: #e5e5e5;
            background: transparent;
        }
        html.dark .exp-filtros-search:hover .exp-filtros-search-input,
        html.dark .exp-filtros-search:focus-within .exp-filtros-search-input,
        html.dark .exp-filtros-search:has(.exp-filtros-search-input:not(:placeholder-shown)) .exp-filtros-search-input {
            border-bottom-color: #404040 !important;
        }
        html.dark .exp-filtros-search:focus-within .exp-filtros-search-input,
        html.dark .exp-filtros-search-input:not(:placeholder-shown) {
            caret-color: #e5e5e5;
        }
        html.dark .exp-filtros-popover {
            background: #171717;
            border-color: #404040;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }
        .exp-filtros-sep {
            margin: 0.5rem 0 0.7rem;
            border: 0;
            border-top: 1px solid #E5E7EB;
        }
        html.dark .exp-filtros-sep {
            border-top-color: #404040;
        }
        #exp-filtros-generales,
        #exp-filtros-fases,
        #agenda-filtros-fechas {
            display: grid;
            grid-template-columns: 1fr 1fr;
            column-gap: 0.55rem;
            row-gap: 0.45rem;
        }
        #exp-filtros-fases .exp-filtros-row,
        #agenda-filtros-fechas .exp-filtros-row {
            gap: 0.4rem;
            width: 100%;
        }
        .exp-filtros-row {
            display: flex;
            align-items: center;
            gap: 0.1rem;
            width: max-content;
            max-width: 100%;
            min-width: 0;
            background: transparent;
            border: 0;
            padding: 0;
            margin: 0;
            text-align: left;
            font-size: 0.75rem;
            font-weight: 400;
            line-height: 1.2;
            color: #171717;
            cursor: pointer;
        }
        html.dark .exp-filtros-row {
            color: #fafafa;
        }
        .exp-filtros-row-main {
            flex: 0 1 auto;
            min-width: 0;
            background: transparent;
            border: 0;
            padding: 0;
            color: inherit;
            font: inherit;
            text-align: left;
            cursor: pointer;
        }
        .exp-filtros-sort-label {
            min-width: 0;
            white-space: nowrap;
        }
        .exp-filtros-flip {
            flex-shrink: 0;
            margin-left: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            color: #737373;
            cursor: pointer;
        }
        .exp-filtros-flip:hover {
            color: #000000;
            background: transparent;
        }
        html.dark .exp-filtros-flip {
            color: #a3a3a3;
        }
        html.dark .exp-filtros-flip:hover {
            color: #fafafa;
            background: transparent;
        }
        .exp-filtros-check {
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1.5px solid #a3a3a3;
            border-radius: 4px;
            background: #fff;
            color: #171717;
        }
        html.dark .exp-filtros-check {
            border-color: #737373;
            background: #171717;
            color: #fafafa;
        }
        .exp-filtros-check svg {
            display: none;
            width: 10px;
            height: 10px;
        }
        .exp-filtros-row.is-active .exp-filtros-check,
        .exp-filtros-check.is-on {
            border-color: #171717;
            background: #fff;
            color: #171717;
        }
        .exp-filtros-row.is-active .exp-filtros-check svg,
        .exp-filtros-check.is-on svg {
            display: block;
        }
        html.dark .exp-filtros-row.is-active .exp-filtros-check {
            border-color: #fafafa;
            background: #171717;
            color: #fafafa;
        }
        #lso-kanban-shell .lso-view-toggle-btn {
            height: 2rem;
            padding: 0 0.75rem;
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
        }
        .vercel-filter {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            height: 2rem;
            padding: 0 0.75rem;
            font-size: 0.8125rem;
            font-weight: 400;
            color: #000000;
            background: #ffffff;
            border: 1px solid #E5E7EB;
            border-radius: 24px;
            box-shadow: none;
        }
        /* Flecha del filtro de estado m?s cerca del texto */
        #filtro-estado-expedientes.vercel-filter,
        select#filtro-estado-expedientes {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            width: auto;
            min-width: 0;
            padding: 0 1.35rem 0 0.75rem !important;
            background-color: #ffffff;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23171717' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 1.75rem center;
            background-size: 0.65rem 0.4rem;
            cursor: pointer;
        }
        #filtro-estado-expedientes::-ms-expand { display: none; }
        html.dark #filtro-estado-expedientes.vercel-filter,
        html.dark select#filtro-estado-expedientes {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23fafafa' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        }
        .vercel-filter::placeholder {
            color: #9ca3af;
            opacity: 1;
        }
        .vercel-filter:focus {
            outline: none;
            border-color: #E5E7EB;
            box-shadow: none;
        }
        .vercel-list {
            background: #fff;
            border: 1px solid #E5E7EB;
            border-radius: 24px;
            overflow: hidden;
            box-shadow: none;
        }
        .vercel-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 1rem;
            align-items: center;
            padding: 0.875rem 1rem;
            border-bottom: 1px solid var(--app-border);
            cursor: pointer;
            transition: background-color 0.12s ease;
            background: #fff;
        }
        .vercel-row:last-child { border-bottom: none; }
        .vercel-row:hover { background: #FAFAFA; }
        .vercel-row.is-active { background: #F5F5F5; }
        .vercel-row-title {
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--app-text);
            line-height: 1.35;
            margin: 0;
        }
        .vercel-row-meta {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem 0.75rem;
            margin-top: 0.35rem;
            font-size: 0.75rem;
            color: var(--app-text-muted);
        }
        .vercel-status {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.75rem;
            color: var(--app-text-muted);
            white-space: nowrap;
        }
        .vercel-status-dot {
            width: 0.45rem;
            height: 0.45rem;
            border-radius: 50%;
            background: #16a34a;
            flex-shrink: 0;
        }
        .vercel-status-dot.is-idle { background: #737373; }
        .vercel-env-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.1rem 0.45rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: #fff !important;
            background: #000000;
            border-radius: 0;
            line-height: 1.4;
        }
        .vercel-hash {
            font-family: var(--font-mono);
            font-size: 0.75rem;
            color: var(--app-text-muted);
        }
        .vercel-row-right {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-shrink: 0;
            color: var(--app-text-muted);
            font-size: 0.75rem;
        }
        .vercel-nav-item {
            display: flex;
            align-items: center;
            gap: 0.625rem;
            width: 100%;
            padding: 0.5rem 0.7rem;
            border-radius: 0.5rem !important;
            font-size: 0.875rem;
            font-weight: 400;
            color: #71717A;
            background: transparent;
            border: none;
            text-align: left;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
            outline: 2px solid transparent;
            -webkit-tap-highlight-color: transparent;
            transition: background-color 0.12s ease, color 0.12s ease, transform 150ms cubic-bezier(0, 0, 0.2, 1);
        }
        .vercel-nav-item:focus,
        .vercel-nav-item:focus-visible,
        .vercel-nav-item:active {
            outline: none !important;
            outline-offset: 0 !important;
            box-shadow: none !important;
        }
        .vercel-nav-item:hover {
            background: rgba(9, 9, 11, 0.05);
            color: #09090B;
        }
        .vercel-nav-item.is-active {
            background: #E4E4E7;
            color: #09090B;
            font-weight: 500;
        }
        .vercel-nav-item i {
            width: 1rem;
            text-align: center;
            color: inherit;
            font-size: 0.85rem;
            opacity: 0.9;
        }
        .vercel-nav-item.is-active i {
            color: #09090B;
            opacity: 1;
        }
        .vercel-sidebar-search {
            width: 100%;
            height: 2rem;
            padding: 0 0.625rem 0 1.85rem;
            font-size: 0.8125rem;
            border: 1px solid #E5E7EB;
            border-radius: 0.5rem;
            background: #fff;
            color: #000000;
            box-shadow: none;
        }
        .vercel-sidebar-search::-webkit-search-cancel-button {
            -webkit-appearance: none;
            appearance: none;
            width: 0.7rem;
            height: 0.7rem;
            margin: 0 0.1rem 0 0.35rem;
            cursor: pointer;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='1.35' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
        }
        .vercel-sidebar-search::placeholder {
            color: #9ca3af;
            opacity: 1;
        }
        .vercel-sidebar-search:focus,
        .vercel-sidebar-search:focus-visible,
        #sidebar-historial #sidebar-search:focus,
        #sidebar-historial #sidebar-search:focus-visible {
            outline: none !important;
            border-color: #E5E7EB !important;
            box-shadow: none !important;
        }
        html.dark #sidebar-historial .vercel-sidebar-search:focus,
        html.dark #sidebar-historial .vercel-sidebar-search:focus-visible,
        html.dark #sidebar-historial #sidebar-search:focus,
        html.dark #sidebar-historial #sidebar-search:focus-visible {
            border-color: #404040 !important;
            box-shadow: none !important;
            outline: none !important;
        }
        html.liquid-glass #app-header {
            background-color: transparent !important;
        }
        html.dark.liquid-glass #app-header {
            background-color: transparent !important;
        }
        /* Fila: historial (in-flow en desktop) + dashboard */
        #app-workspace {
            display: flex;
            flex-direction: row;
            align-items: stretch;
            flex: 1 1 auto;
            width: 100%;
            min-height: 100vh;
            min-height: 100dvh;
            padding-top: 0;
            box-sizing: border-box;
            position: relative;
            z-index: 10;
        }
        #main-container {
            flex: 1 1 auto;
            min-width: 0;
            width: auto;
            max-width: 100%;
            padding-right: 0;
            box-sizing: border-box;
            z-index: 10;
            position: relative;
            /* Sin transition:all ? evita el ?aplastado? al abrir el chat */
            transition: none;
        }
        #view-cartera,
        #view-cartera .lg-name-frame,
        #dashboard-grid,
        #dashboard-grid > aside,
        #dashboard-grid > #panel-lexnet-agenda,
        #view-cartera .vercel-list,
        #view-cartera .vercel-row,
        #lista-expedientes {
            transition: none !important;
        }
        #view-cartera {
            width: 100%;
            max-width: 72rem;
            min-width: 0;
            box-sizing: border-box;
        }
        #view-cartera .lg-name-frame {
            max-width: 100%;
            box-sizing: border-box;
        }
        #txt-lbl-registro {
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        #lista-expedientes {
            transition: none;
        }
        /* Dashboard: lado a lado ? apilado al abrir chat o ambos paneles */
        #dashboard-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 1.5rem;
            align-items: start;
            width: 100%;
            min-width: 0;
        }
        /* T?tulos del dashboard: texto completo (sin ellipsis) */
        #dashboard-grid [data-i18n="lexnet_agenda_title"],
        #dashboard-grid [data-i18n="aperturar"],
        #dashboard-grid [data-i18n="dropzone_title"],
        #dashboard-grid [data-i18n="sub_aperturar"],
        #dashboard-grid [data-i18n="dropzone_sub"],
        #dashboard-grid [data-i18n="lexnet_agenda_desc"] {
            white-space: normal;
            overflow: visible;
            text-overflow: unset;
        }
        #panel-lexnet-agenda [data-i18n="lexnet_agenda_title"] {
            white-space: normal !important;
            overflow: visible !important;
            text-overflow: clip !important;
            max-width: none;
        }
        @media (min-width: 1024px) {
            #dashboard-grid {
                grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
            }
            #dashboard-grid > aside,
            #dashboard-grid > #panel-lexnet-agenda {
                grid-column: auto;
                min-width: 0;
                max-width: 100%;
            }
            #panel-lexnet-agenda {
                backface-visibility: hidden;
                -webkit-backface-visibility: hidden;
            }
            /* Chat abierto y/o historial+chat: una sola columna (sin animaci?n de apilado) */
            html.layout-dashboard-stack #dashboard-grid {
                grid-template-columns: minmax(0, 1fr);
            }
            html.layout-dashboard-stack #dashboard-grid > aside,
            html.layout-dashboard-stack #dashboard-grid > #panel-lexnet-agenda {
                grid-column: 1 / -1;
                animation: none !important;
            }
        }
        @media (prefers-reduced-motion: reduce) {
            #main-container,
            #view-cartera,
            #view-cartera .lg-name-frame,
            #dashboard-grid,
            #dashboard-grid > aside,
            #dashboard-grid > #panel-lexnet-agenda {
                transition: none !important;
            }
            html.layout-dashboard-stack #panel-lexnet-agenda,
            html.layout-dashboard-stack #dashboard-grid > aside {
                animation: none !important;
            }
        }
        #historial-backdrop {
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 35;
            transition: opacity var(--historial-duration) var(--historial-ease),
                        visibility var(--historial-duration) var(--historial-ease);
        }
        .toggle-historial-divider {
            transition: transform var(--historial-duration) var(--historial-ease);
            transform: translate3d(0, 0, 0);
        }
        #btn-toggle-historial.historial-panel-open .toggle-historial-divider,
        #btn-toggle-historial-panel.historial-panel-open .toggle-historial-divider {
            transform: translate3d(10px, 0, 0);
        }
        /* Fuera del panel: solo para reabrir cuando el historial est? cerrado */
        html.layout-historial-open #btn-toggle-historial,
        html.historial-closing #btn-toggle-historial,
        #btn-toggle-historial[hidden] {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
        html.layout-historial-open #app-header,
        html.historial-closing #app-header {
            padding-left: 1rem !important;
            padding-right: calc(var(--historial-width) + 1rem) !important;
            pointer-events: none;
        }
        html.layout-historial-open #app-header > * {
            pointer-events: auto;
        }
        html.layout-historial-open #sidebar-historial.historial-abierto,
        html.layout-historial-open #panel-historial.historial-abierto {
            z-index: 90 !important;
            pointer-events: auto !important;
            right: 0 !important;
            left: auto !important;
        }
        #btn-toggle-historial-panel {
            position: relative;
            z-index: 97 !important;
            pointer-events: auto !important;
            cursor: pointer;
        }
        @media (max-width: 767px) {
            html.layout-historial-open #app-header {
                padding-left: 1rem !important;
            }
        }
        #app-header {
            transition: padding-left var(--historial-duration) var(--historial-ease);
        }
        #btn-refresh-historial.historial-refresh-spinning .refresh-historial-icon {
            transform-box: fill-box;
            transform-origin: center;
            animation: historial-refresh-spin 0.6s ease-in-out;
        }
        #btn-descargar-historial.historial-download-hit .download-historial-arrow {
            transform-box: fill-box;
            transform-origin: center;
            animation: historial-download-hit 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
        }
        #btn-descargar-historial .download-historial-icon {
            overflow: visible;
        }
        /* Historial: overlay solo en m?vil; desde tablet empuja el layout (in-flow) */
        #sidebar-historial,
        #panel-historial {
            background-color: rgba(244, 241, 234, 0.72) !important;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            margin: 0;
            overflow: hidden;
            will-change: width, max-width, margin, background, border-color, box-shadow, backdrop-filter;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
        }
        html.dark #sidebar-historial,
        html.dark #panel-historial {
            background-color: rgba(17, 24, 39, 0.92) !important;
        }
        #sidebar-historial > div:first-child,
        #panel-historial > div:first-child {
            background-color: rgba(230, 226, 216, 0.92) !important;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        html.dark #sidebar-historial > div:first-child,
        html.dark #panel-historial > div:first-child {
            background-color: rgba(30, 41, 59, 0.92) !important;
        }
        #sidebar-historial:not(.historial-abierto) > *,
        #panel-historial:not(.historial-abierto) > * {
            min-width: 0 !important;
        }
        #sidebar-historial.historial-abierto > *,
        #panel-historial.historial-abierto > * {
            min-width: var(--historial-width);
            box-sizing: border-box;
        }
        /* M?vil: overlay fijo a pantalla completa desde arriba */
        @media (max-width: 767px) {
            #sidebar-historial,
            #panel-historial {
                position: fixed !important;
                top: 0 !important;
                bottom: 0;
                right: 0 !important;
                left: auto !important;
                z-index: 90;
                width: min(var(--historial-width), 92vw) !important;
                max-width: min(var(--historial-width), 92vw) !important;
                height: 100dvh !important;
                transform: translate3d(100%, 0, 0);
                pointer-events: none;
                visibility: hidden;
                transition: transform var(--historial-duration-close) var(--historial-ease-in),
                            visibility 0s linear var(--historial-duration-close),
                            border-color var(--historial-duration-close) var(--historial-ease-in),
                            box-shadow var(--historial-duration-close) var(--historial-ease-in),
                            background var(--lg-duration, 560ms) var(--lg-ease, cubic-bezier(0.22, 1, 0.36, 1)),
                            backdrop-filter var(--lg-duration, 560ms) var(--lg-ease, cubic-bezier(0.22, 1, 0.36, 1));
            }
            #sidebar-historial.historial-abierto,
            #panel-historial.historial-abierto {
                transform: translate3d(0, 0, 0);
                pointer-events: auto;
                visibility: visible;
                transition: transform var(--historial-duration) var(--historial-ease),
                            visibility 0s linear 0s,
                            border-color var(--historial-duration) var(--historial-ease),
                            box-shadow var(--historial-duration) var(--historial-ease);
            }
        }
        /* Tablet/desktop: drawer fijo a la DERECHA (no columna in-flow) */
        @media (min-width: 768px) {
            #sidebar-historial,
            #panel-historial {
                position: fixed !important;
                top: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                left: auto !important;
                z-index: 90 !important;
                height: 100dvh !important;
                width: var(--historial-width) !important;
                max-width: min(var(--historial-width), 92vw) !important;
                min-width: 0 !important;
                margin: 0 !important;
                opacity: 1;
                overflow: hidden !important;
                transform: translate3d(105%, 0, 0) !important;
                visibility: hidden !important;
                pointer-events: none;
                border-color: transparent !important;
                box-shadow: none !important;
                transition:
                    transform var(--historial-duration-close) var(--historial-ease-in),
                    visibility 0s linear var(--historial-duration-close),
                    border-color var(--historial-duration-close) var(--historial-ease-in),
                    box-shadow var(--historial-duration-close) var(--historial-ease-in) !important;
            }
            #sidebar-historial > *,
            #panel-historial > * {
                opacity: 1;
                transform: none;
            }
            #sidebar-historial.historial-abierto,
            #panel-historial.historial-abierto {
                width: var(--historial-width) !important;
                max-width: min(var(--historial-width), 92vw) !important;
                margin: 0 !important;
                height: 100dvh !important;
                max-height: none !important;
                opacity: 1;
                pointer-events: auto;
                visibility: visible !important;
                overflow: hidden !important;
                transform: translate3d(0, 0, 0) !important;
                border-radius: 0 !important;
                border-left: 1px solid rgba(0, 0, 0, 0.06) !important;
                border-right: none !important;
                box-shadow: none !important;
                transition:
                    transform var(--historial-duration) var(--historial-ease),
                    visibility 0s linear 0s,
                    border-color var(--historial-duration) var(--historial-ease),
                    box-shadow var(--historial-duration) var(--historial-ease) !important;
            }
            html.dark #sidebar-historial.historial-abierto,
            html.dark #panel-historial.historial-abierto {
                border-left-color: rgba(255, 255, 255, 0.08) !important;
            }
        }
        /* Chat: base com?n (posici?n/tama?o los definen las reglas layout-chat-* + media queries) */
        #chat-drawer {
            z-index: 45 !important;
            overflow: hidden !important;
            box-sizing: border-box !important;
        }
        #chat-drawer.chat-closed {
            pointer-events: none !important;
        }
        /* Ajustes: a sangre, sin padding del <main> (no solapa la sidebar) */
        html.vista-erp-ajustes #main-container,
        html.vista-erp-ajustes #main-container > main {
            padding: 0 !important;
            margin: 0 !important;
            background: var(--app-background) !important;
        }
        html.vista-erp-ajustes #main-container > main {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        /* Gana a #view-cartera.is-chat-workspace { display:flex !important } */
        html.vista-erp-ajustes #view-cartera {
            display: none !important;
        }
        #view-ajustes {
            width: 100%;
            max-width: none;
            min-height: 100%;
            height: 100%;
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        #view-ajustes.hidden {
            display: none !important;
        }
        html.vista-erp-ajustes #view-ajustes:not(.hidden) {
            display: flex !important;
        }
        #view-ajustes .settings-panel-shell {
            width: 100%;
            max-width: none;
            flex: 1 1 auto;
            min-height: 0;
            border: none !important;
            border-radius: 0 !important;
            background: transparent !important;
            box-shadow: none !important;
            transform: none;
            opacity: 1;
            margin: 0;
            padding: 0;
        }
        html.dark #view-ajustes .settings-panel-shell {
            background: transparent !important;
        }
        #view-ajustes #settings-workspace-panel {
            width: 100%;
            max-width: 80rem;
            box-sizing: border-box;
            margin: 0 auto;
            padding: 2rem 1.5rem 3.5rem;
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
        }
        #view-ajustes .settings-group {
            flex-direction: column;
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            gap: 1.5rem;
        }
        #view-ajustes .settings-group:not(.hidden) {
            display: flex;
        }
        #view-ajustes .settings-group.hidden,
        #view-ajustes .setting-content-pane.hidden {
            display: none !important;
        }
        #view-ajustes #view-ajustes-ia.settings-group {
            max-width: none;
            width: 100%;
        }
        #view-ajustes #view-ajustes-ia.settings-group > div:first-child {
            padding-bottom: 0;
        }
        #view-ajustes #view-ajustes-ia #form-api-keys-ia,
        #view-ajustes #view-ajustes-ia #chat-model-settings {
            margin-bottom: 0;
        }
        #view-ajustes .settings-group > div:first-child {
            padding: 0 0 0.25rem;
        }
        #view-ajustes .settings-group > div:first-child h4 {
            font-size: 1.5rem;
            font-weight: 600;
            color: #0f172a;
            letter-spacing: -0.025em;
        }
        #view-ajustes .settings-group > div:first-child p,
        #view-ajustes .settings-group > div:first-child span {
            color: #64748b;
        }
        #view-ajustes .settings-card {
            border-radius: 0.75rem !important;
            margin: 0;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
            background: #ffffff;
            padding: 1.5rem 2rem;
        }
        html.dark #view-ajustes .settings-card {
            background: #171717 !important;
            border: 1px solid #262626 !important;
            box-shadow: none !important;
        }
        #historial-backdrop.historial-backdrop-visible {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        /* Toggle Liquid Glass (p?ldora / iOS) */
        .liquid-glass-switch {
            position: relative;
            width: 2.75rem;
            height: 1.5rem;
            border-radius: 9999px !important;
            border: 1px solid var(--app-border-strong);
            background: var(--app-surface);
            transition: background 0.2s ease, border-color 0.2s ease;
            flex-shrink: 0;
        }
        .liquid-glass-switch::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 0.15rem;
            width: 1.2rem;
            height: 1.2rem;
            box-sizing: border-box;
            border-radius: 9999px !important;
            background: #fff;
            border: 1px solid var(--app-border);
            box-shadow: none;
            transform: translateY(-50%);
            transition: transform 0.2s ease;
        }
        input[type="checkbox"]:checked + .liquid-glass-switch,
        #toggle-liquid-glass:checked + .liquid-glass-switch {
            background: #22c55e;
            border-color: #16a34a;
        }
        input[type="checkbox"]:checked + .liquid-glass-switch::after,
        #toggle-liquid-glass:checked + .liquid-glass-switch::after {
            transform: translate(1.25rem, -50%);
        }
        html.dark .liquid-glass-switch { background: #475569; }
        html.dark input[type="checkbox"]:checked + .liquid-glass-switch,
        html.dark #toggle-liquid-glass:checked + .liquid-glass-switch {
            background: #22c55e;
            border-color: #16a34a;
        }
        html.dark input[type="checkbox"]:checked + .liquid-glass-switch::after,
        html.dark #toggle-liquid-glass:checked + .liquid-glass-switch::after { background: #fff; }
        @keyframes historial-refresh-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes historial-download-hit {
            0% { transform: translateY(0); }
            55% { transform: translateY(3.2px); }
            72% { transform: translateY(2.5px); }
            100% { transform: translateY(0); }
        }

        /* --- Banner de cookies (RGPD / AEPD) --- */
        #cookie-consent-banner {
            position: fixed;
            left: 1rem;
            right: 1rem;
            bottom: 1rem;
            z-index: 200;
            max-width: 42rem;
            margin: 0 auto;
            padding: 1.25rem 1.35rem;
            border-radius: var(--app-radius);
            border: 1px solid var(--app-border);
            background: #ffffff;
            color: #1a1a1a;
            box-shadow: none;
            transition: opacity 0.25s ease, transform 0.25s ease;
        }
        #cookie-consent-banner.cookie-banner-hidden {
            opacity: 0;
            pointer-events: none;
            transform: translateY(1rem);
        }
        html.dark #cookie-consent-banner {
            background: #ffffff;
            border-color: var(--app-border);
            box-shadow: none;
            color: #1a1a1a;
        }
        #cookie-consent-banner h3 {
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            color: #1a1a1a;
            margin: 0 0 0.4rem;
        }
        html.dark #cookie-consent-banner h3 { color: #1a1a1a; }
        #cookie-consent-banner p {
            font-size: 0.82rem;
            line-height: 1.45;
            color: #1a1a1a;
            margin: 0 0 1rem;
        }
        html.dark #cookie-consent-banner p { color: #1a1a1a; }
        .cookie-banner-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }
        .cookie-btn-accept {
            background: var(--primary-accent);
            color: #ffffff;
            border: none;
            border-radius: var(--app-radius);
            padding: 0.55rem 1rem;
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            cursor: pointer;
        }
        .cookie-btn-accept:hover { background: var(--app-primary-dark); }
        .cookie-btn-reject {
            background: var(--app-surface);
            color: #1a1a1a;
            border: 1px solid var(--app-border-strong);
            border-radius: var(--app-radius);
            padding: 0.55rem 1rem;
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            cursor: pointer;
        }
        html.dark .cookie-btn-reject {
            background: #f3f3f3;
            color: #1a1a1a;
            border-color: #c8c8c8;
        }
        .cookie-btn-reject:hover { background: #e8e8e8; }
        html.dark .cookie-btn-reject:hover { background: #e8e8e8; }
        .cookie-link-policy {
            font-size: 0.75rem;
            font-weight: 600;
            color: #5A4B41;
            text-decoration: underline;
            text-underline-offset: 2px;
            margin-left: auto;
            cursor: pointer;
            background: none;
            border: none;
            padding: 0.35rem 0.25rem;
        }
        html.dark .cookie-link-policy { color: #5A4B41; }
        #modal-politica-cookies,
        #modal-politica-privacidad,
        #modal-terminos-servicio,
        #modal-faq {
            z-index: 210;
        }

        /* Modal FAQ: adaptable claro/oscuro */
        #modal-faq .faq-modal-card {
            display: flex;
            flex-direction: column;
            max-height: min(85vh, 42rem);
            overflow: hidden;
            background: #ffffff;
            border: 1px solid #e5e5e5;
            color: #111827;
            box-shadow: none;
        }
        html.dark #modal-faq .faq-modal-card {
            background: #111827;
            border-color: #334155;
            color: #f8fafc;
            box-shadow: none;
        }
        #modal-faq .faq-modal-header {
            flex-shrink: 0;
        }
        #modal-faq .faq-modal-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            padding-right: 0.15rem;
        }
        #modal-faq .faq-item {
            border: 1px solid #e5e5e5;
            background: #fafafa;
            margin-bottom: 0.5rem;
        }
        #modal-faq .faq-item:last-child {
            margin-bottom: 0;
        }
        html.dark #modal-faq .faq-item {
            border-color: #334155;
            background: #0f172a;
        }
        #modal-faq .faq-item > summary {
            list-style: none;
            cursor: pointer;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.9rem 1rem;
            font-size: 0.875rem;
            font-weight: 600;
            color: #171717;
            user-select: none;
            transition: background-color 0.15s ease;
        }
        #modal-faq .faq-item > summary::-webkit-details-marker {
            display: none;
        }
        #modal-faq .faq-item > summary:hover {
            background: rgba(0, 0, 0, 0.03);
        }
        html.dark #modal-faq .faq-item > summary {
            color: #f8fafc;
        }
        html.dark #modal-faq .faq-item > summary:hover {
            background: rgba(255, 255, 255, 0.04);
        }
        #modal-faq .faq-item > summary .faq-chevron {
            flex-shrink: 0;
            width: 1rem;
            height: 1rem;
            margin-top: 0.15rem;
            transition: transform 0.2s ease;
            opacity: 0.65;
        }
        #modal-faq .faq-item[open] > summary .faq-chevron {
            transform: rotate(180deg);
        }
        #modal-faq .faq-answer {
            padding: 0 1rem 1rem;
            font-size: 0.8125rem;
            line-height: 1.6;
            color: #525252;
        }
        html.dark #modal-faq .faq-answer {
            color: #cbd5e1;
        }
        #modal-faq .faq-modal-eyebrow {
            color: #737373;
        }
        html.dark #modal-faq .faq-modal-eyebrow {
            color: #94a3b8;
        }
        #modal-faq .faq-modal-title {
            color: #171717;
        }
        html.dark #modal-faq .faq-modal-title {
            color: #f8fafc;
        }
        #modal-faq .faq-modal-desc {
            color: #737373;
        }
        html.dark #modal-faq .faq-modal-desc {
            color: #94a3b8;
        }
        /* Modales legales: fondo blanco opaco + scroll vertical usable */
        #modal-politica-cookies .cookie-policy-card,
        #modal-politica-privacidad .privacy-policy-card,
        #modal-terminos-servicio .privacy-policy-card,
        #modal-login > div {
            display: flex;
            flex-direction: column;
            background: #ffffff !important;
            background-image: none !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            overflow: hidden;
            color: #111827 !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        #modal-politica-cookies .cookie-policy-card,
        #modal-politica-privacidad .privacy-policy-card,
        #modal-terminos-servicio .privacy-policy-card {
            max-height: min(85vh, 42rem);
        }
        #modal-login > div,
        #modal-login .login-card {
            display: block;
            overflow: visible;
            width: 100%;
            max-width: 28rem;
            margin-inline: auto;
            padding: 1rem;
            box-sizing: border-box;
        }
        @media (min-width: 640px) {
            #modal-login .login-card {
                padding: 1.5rem;
            }
        }
        @media (min-width: 768px) {
            #modal-login .login-card {
                padding: 2rem;
            }
        }
        #modal-login #form-login input[type="text"],
        #modal-login #form-login input[type="password"],
        #modal-login #form-register input[type="text"],
        #modal-login #form-register input[type="email"],
        #modal-login #form-register input[type="password"] {
            width: 100%;
            box-sizing: border-box;
        }
        /* Evita el ?salto? de tama?o del autofill de Chrome (correo peque?o ? grande al hacer foco) */
        #modal-login #login-email,
        #modal-login #login-password,
        #modal-login #login-2fa-code,
        #modal-login #form-login input[type="text"],
        #modal-login #form-login input[type="password"],
        #modal-login #form-register input[type="text"],
        #modal-login #form-register input[type="email"],
        #modal-login #form-register input[type="password"],
        #modal-login .password-field-input {
            font-size: 0.875rem !important;
            line-height: 1.25 !important;
            font-weight: 400 !important;
            font-family: inherit !important;
            letter-spacing: normal !important;
            color: #111827 !important;
            -webkit-text-fill-color: #111827 !important;
            caret-color: #111827 !important;
            transform: none !important;
            zoom: 1 !important;
        }
        #modal-login #login-email:-webkit-autofill,
        #modal-login #login-email:-webkit-autofill:hover,
        #modal-login #login-email:-webkit-autofill:focus,
        #modal-login #login-email:-webkit-autofill:active,
        #modal-login #login-password:-webkit-autofill,
        #modal-login #login-password:-webkit-autofill:hover,
        #modal-login #login-password:-webkit-autofill:focus,
        #modal-login #login-password:-webkit-autofill:active,
        #modal-login #form-login input:-webkit-autofill,
        #modal-login #form-login input:-webkit-autofill:hover,
        #modal-login #form-login input:-webkit-autofill:focus,
        #modal-login #form-login input:-webkit-autofill:active,
        #modal-login #form-register input:-webkit-autofill,
        #modal-login #form-register input:-webkit-autofill:hover,
        #modal-login #form-register input:-webkit-autofill:focus,
        #modal-login #form-register input:-webkit-autofill:active,
        #modal-login .password-field-input:-webkit-autofill,
        #modal-login .password-field-input:-webkit-autofill:hover,
        #modal-login .password-field-input:-webkit-autofill:focus,
        #modal-login .password-field-input:-webkit-autofill:active {
            font-size: 0.875rem !important;
            line-height: 1.25 !important;
            font-weight: 400 !important;
            letter-spacing: normal !important;
            -webkit-text-fill-color: #111827 !important;
            color: #111827 !important;
            caret-color: #111827 !important;
            box-shadow: 0 0 0 1000px #ffffff inset !important;
            -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
            transition: background-color 99999s ease-out 0s !important;
            filter: none !important;
        }
        #modal-login #btn-login-submit,
        #modal-login #btn-register-submit,
        #modal-login #btn-recuperar-submit,
        #modal-login #btn-nueva-password-submit,
        #modal-login #btn-login-google,
        #modal-login #btn-register-google {
            min-height: 2.5rem;
            height: 2.5rem;
        }
        html.liquid-glass #modal-login > div,
        html.liquid-glass #modal-politica-cookies .cookie-policy-card,
        html.liquid-glass #modal-politica-privacidad .privacy-policy-card,
        html.liquid-glass #modal-terminos-servicio .privacy-policy-card,
        html.dark #modal-login > div,
        html.dark #modal-politica-cookies .cookie-policy-card,
        html.dark #modal-politica-privacidad .privacy-policy-card,
        html.dark #modal-terminos-servicio .privacy-policy-card {
            background: #ffffff !important;
            background-image: none !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            box-shadow: none !important;
            color: #111827 !important;
        }
        html.liquid-glass #modal-login > div::before,
        html.liquid-glass #modal-login > div::after,
        html.liquid-glass #modal-politica-cookies .cookie-policy-card::before,
        html.liquid-glass #modal-politica-cookies .cookie-policy-card::after,
        html.liquid-glass #modal-politica-privacidad .privacy-policy-card::before,
        html.liquid-glass #modal-politica-privacidad .privacy-policy-card::after,
        html.liquid-glass #modal-terminos-servicio .privacy-policy-card::before,
        html.liquid-glass #modal-terminos-servicio .privacy-policy-card::after {
            content: none !important;
            display: none !important;
        }
        #modal-politica-cookies .legal-modal-header,
        #modal-politica-privacidad .legal-modal-header,
        #modal-terminos-servicio .legal-modal-header {
            flex-shrink: 0;
        }
        #modal-politica-cookies .legal-modal-body,
        #modal-politica-privacidad .legal-modal-body,
        #modal-terminos-servicio .legal-modal-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            padding-right: 0.25rem;
        }
        #modal-politica-cookies .legal-modal-footer,
        #modal-politica-privacidad .legal-modal-footer,
        #modal-terminos-servicio .legal-modal-footer {
            flex-shrink: 0;
            margin-top: 1rem;
            padding-top: 0.75rem;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            background: #ffffff;
        }
        /* Login, registro y pol?ticas: texto negro s?lido, sin stroke/sombra */
        #modal-login,
        #modal-login *,
        #auth-view-login,
        #auth-view-register,
        #modal-politica-cookies,
        #modal-politica-cookies *,
        #modal-politica-privacidad,
        #modal-politica-privacidad *,
        #modal-terminos-servicio,
        #modal-terminos-servicio *,
        html.liquid-glass #modal-login,
        html.liquid-glass #modal-login *,
        html.liquid-glass #modal-politica-cookies,
        html.liquid-glass #modal-politica-cookies *,
        html.liquid-glass #modal-politica-privacidad,
        html.liquid-glass #modal-politica-privacidad *,
        html.liquid-glass #modal-terminos-servicio,
        html.liquid-glass #modal-terminos-servicio * {
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        #modal-login :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, div),
        #modal-politica-cookies :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, code, div, section),
        #modal-politica-privacidad :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, code, div, section),
        #modal-terminos-servicio :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, code, div, section),
        html.liquid-glass #modal-login :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, div),
        html.liquid-glass #modal-politica-cookies :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, code, div, section),
        html.liquid-glass #modal-politica-privacidad :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, code, div, section),
        html.liquid-glass #modal-terminos-servicio :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong, em, a, button, code, div, section) {
            color: #111827 !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
            opacity: 1 !important;
        }
        #modal-login .text-neutral-500,
        #modal-login .text-neutral-500,
        #modal-login .text-neutral-500,
        #modal-politica-cookies .text-neutral-500,
        #modal-politica-privacidad .text-neutral-500,
        #modal-terminos-servicio .text-neutral-500,
        #modal-politica-cookies .text-neutral-500,
        #modal-politica-privacidad .text-neutral-500,
        #modal-terminos-servicio .text-neutral-500,
        #modal-politica-cookies .legal-modal-body,
        #modal-politica-privacidad .legal-modal-body,
        #modal-terminos-servicio .legal-modal-body,
        html.liquid-glass #modal-login .text-neutral-500,
        html.liquid-glass #modal-login .text-neutral-500,
        html.liquid-glass #modal-login .text-neutral-500 {
            color: #374151 !important;
            text-shadow: none !important;
        }
        #modal-login #auth-switch-to-register,
        #modal-login #auth-switch-to-login,
        #modal-login [data-action="abrirTerminosServicio"],
        #modal-login [data-action="abrirPoliticaPrivacidad"],
        #modal-politica-cookies button.underline,
        #modal-politica-privacidad button.underline,
        #modal-terminos-servicio button.underline,
        #modal-politica-cookies .cookie-link-policy,
        #modal-politica-privacidad .cookie-link-policy,
        #modal-politica-cookies [class*="text-neutral-900"],
        #modal-politica-privacidad [class*="text-neutral-900"],
        #modal-terminos-servicio [class*="text-neutral-900"],
        html.liquid-glass #modal-login #auth-switch-to-register,
        html.liquid-glass #modal-login #auth-switch-to-login,
        html.liquid-glass #modal-login [data-action="abrirTerminosServicio"],
        html.liquid-glass #modal-login [data-action="abrirPoliticaPrivacidad"] {
            color: #766355 !important;
            text-shadow: none !important;
            filter: none !important;
        }
        #modal-login #btn-login-submit,
        #modal-login #btn-register-submit,
        #modal-login #btn-login-submit span,
        #modal-login #btn-register-submit span,
        #modal-login #btn-login-submit *,
        #modal-login #btn-register-submit *,
        html.liquid-glass #modal-login #btn-login-submit,
        html.liquid-glass #modal-login #btn-register-submit,
        html.liquid-glass #modal-login #btn-login-submit span,
        html.liquid-glass #modal-login #btn-register-submit span,
        html.liquid-glass #modal-login #btn-login-submit *,
        html.liquid-glass #modal-login #btn-register-submit * {
            color: #ffffff !important;
            text-shadow: none !important;
            filter: none !important;
        }
        #modal-login #login-error,
        #modal-login #register-error,
        html.liquid-glass #modal-login #login-error,
        html.liquid-glass #modal-login #register-error {
            color: #dc2626 !important;
            text-shadow: none !important;
        }
        #modal-politica-cookies .cookie-btn-accept,
        #modal-politica-privacidad .cookie-btn-accept,
        #modal-terminos-servicio .cookie-btn-accept,
        html.liquid-glass #modal-politica-cookies .cookie-btn-accept,
        html.liquid-glass #modal-politica-privacidad .cookie-btn-accept,
        html.liquid-glass #modal-terminos-servicio .cookie-btn-accept {
            color: #ffffff !important;
            text-shadow: none !important;
        }
        .privacy-policy-card h4 {
            font-size: 0.95rem;
            margin-bottom: 0.35rem;
        }
        .privacy-policy-card section + section {
            margin-top: 1.15rem;
            padding-top: 1.15rem;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
        }
        html.dark .privacy-policy-card section + section {
            border-top-color: rgba(0, 0, 0, 0.08);
        }
        #auth-switch-to-register,
        #auth-switch-to-login {
            color: #766355;
            font-weight: 600;
            text-decoration: underline;
            text-underline-offset: 2px;
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
        }
        #auth-switch-to-register:hover,
        #auth-switch-to-login:hover {
            opacity: 0.85;
        }

        /* --- Toasts: cola FIFO, centrados arriba --- */
        @keyframes toast-slide-in {
            from { opacity: 0; transform: translate3d(0, -0.75rem, 0) scale(0.98); }
            to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
        }
        @keyframes toast-slide-out {
            from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
            to { opacity: 0; transform: translate3d(0, -0.5rem, 0) scale(0.98); }
        }
        #app-header > .header-side-left {
            position: relative;
            z-index: 1;
        }
        /* header-side-right: position fixed (no relative ? ver bloque floating) */
        #toast-container {
            position: fixed;
            top: 1rem;
            /* Centrado en la zona de contenido (a la derecha del sidebar) */
            left: calc(var(--erp-sidebar-width, 16rem) + (100vw - var(--erp-sidebar-width, 16rem)) / 2);
            right: auto;
            bottom: auto;
            transform: translateX(-50%);
            margin: 0;
            z-index: 60;
            display: flex;
            justify-content: center;
            align-items: center;
            width: min(28rem, calc(100vw - var(--erp-sidebar-width, 16rem) - 2rem));
            max-width: min(28rem, calc(100vw - 2rem));
            pointer-events: none;
        }
        html.erp-nav-collapsed #toast-container {
            left: 50%;
            width: min(28rem, calc(100vw - 2rem));
        }
        @media (max-width: 768px) {
            #toast-container {
                left: 50%;
                width: min(28rem, calc(100vw - 2rem));
            }
        }
        .toast-item {
            animation: toast-slide-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            pointer-events: auto;
            width: 100%;
            max-width: 28rem;
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
            padding: 0.75rem 0.7rem 0.75rem 0.9rem;
            background: rgba(255, 255, 255, 0.96);
            color: #0a0a0a;
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: 1.25rem !important;
            box-shadow: none;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            font-size: 0.75rem;
            font-weight: 500;
            line-height: 1.35;
            overflow: hidden;
            box-sizing: border-box;
        }
        html.dark .toast-item {
            background: rgba(23, 23, 23, 0.96);
            color: #fafafa;
            border-color: rgba(255, 255, 255, 0.12);
            box-shadow: none;
            border-radius: 1.25rem !important;
            width: 1.15rem;
            height: 1.15rem;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-top: 0;
            color: #16a34a;
            background: rgba(22, 163, 74, 0.12);
            border-radius: 9999px !important;
        }
        .toast-item.toast-success .toast-icon { color: #16a34a; }
        .toast-item.toast-success {
            border-color: rgba(16, 185, 129, 0.45);
            box-shadow: none;
            background: linear-gradient(180deg, #ecfdf5 0%, #fff 55%);
        }
        .toast-item.toast-info .toast-icon { color: #2563eb; }
        .toast-item.toast-error .toast-icon { color: #dc2626; }
        .toast-item.toast-warning .toast-icon { color: #d97706; }
        html.dark .toast-item.toast-success .toast-icon { color: #4ade80; }
        html.dark .toast-item.toast-info .toast-icon { color: #60a5fa; }
        html.dark .toast-item.toast-error .toast-icon { color: #f87171; }
        html.dark .toast-item.toast-warning .toast-icon { color: #fbbf24; }
        .toast-item .toast-body { min-width: 0; flex: 1 1 auto; padding-right: 0.15rem; }
        .toast-item .toast-title { font-weight: 600; letter-spacing: -0.01em; font-size: 0.75rem; }
        .toast-item .toast-msg {
            overflow-wrap: anywhere;
            word-break: break-word;
            white-space: normal;
            max-height: 7.5rem;
            overflow-y: auto;
        }
        .toast-item .toast-close {
            flex-shrink: 0;
            width: 1.5rem;
            height: 1.5rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: inherit;
            opacity: 0.5;
            cursor: pointer;
            border-radius: 9999px;
            padding: 0;
            margin: 0;
            align-self: flex-start;
            margin-top: 0.05rem;
            transition: transform 150ms cubic-bezier(0, 0, 0.2, 1), opacity 150ms ease;
        }
        .toast-item .toast-close svg {
            display: block;
            width: 1.125rem;
            height: 1.125rem;
        }
        .toast-item .toast-close:hover { opacity: 0.9; transform: scale(0.86); }
        .toast-item.toast-leaving {
            animation: toast-slide-out 0.22s ease forwards;
        }
        @media (max-width: 768px) {
            #app-header {
                column-gap: 0.4rem;
            }
        }
        /* Skeleton loaders con shimmer */
        .skeleton-line,
        .skeleton-block {
            display: block;
            height: 0.75rem;
            border-radius: 0.375rem;
            background: linear-gradient(90deg, #ececec 0%, #f5f5f5 45%, #ececec 90%);
            background-size: 200% 100%;
            animation: skeleton-shimmer 1.4s ease-in-out infinite;
        }
        .skeleton-line.skeleton-lg,
        .skeleton-block.skeleton-lg { height: 1rem; }
        .skeleton-line.skeleton-sm { height: 0.5rem; width: 40%; }
        .skeleton-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 1rem;
            align-items: center;
            padding: 0.875rem 1rem;
            border-bottom: 1px solid var(--app-border);
        }
        html.dark .skeleton-line,
        html.dark .skeleton-block {
            background: linear-gradient(90deg, #262626 0%, #333 45%, #262626 90%);
            background-size: 200% 100%;
        }
        @keyframes skeleton-shimmer {
            0% { background-position: 100% 0; }
            100% { background-position: -100% 0; }
        }
        @keyframes skeleton-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.45; }
        }
        #btn-login-submit.is-loading,
        #btn-refresh-historial.is-loading {
            opacity: 0.85;
            cursor: wait;
            pointer-events: none;
        }
        #login-cold-start-hint {
            transition: opacity 0.25s ease;
        }
        #login-cold-start-hint.is-visible {
            display: block !important;
        }

        /* --- Paleta de comandos (Ctrl/Cmd + K) --- */
        #command-palette[aria-hidden="true"] {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        #command-palette[aria-hidden="false"] {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        #command-palette {
            transition: opacity 0.15s ease, visibility 0.15s ease;
        }
        #command-palette-panel {
            transform: scale(0.97) translateY(-0.35rem);
            transition: transform 0.15s ease;
        }
        #command-palette[aria-hidden="false"] #command-palette-panel {
            transform: scale(1) translateY(0);
        }
        .cmdk-item {
            transition: background-color 0.12s ease, border-color 0.12s ease;
        }
        .cmdk-item {
            border-radius: 0.5rem !important;
        }
        .cmdk-item[aria-selected="true"],
        .cmdk-item.cmdk-active {
            background-color: #f5f5f5;
            border-color: transparent;
        }
        html.dark .cmdk-item[aria-selected="true"],
        html.dark .cmdk-item.cmdk-active {
            background-color: #262626;
            border-color: transparent;
        }
        #command-palette-panel {
            border-radius: 24px !important;
            border: 1px solid #E5E7EB !important;
            box-shadow: none !important;
        }

        /* --- Dropzone LexNET --- */
        #dropzone-lexnet {
            transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
        }
        #dropzone-lexnet.is-dragover {
            border-color: #000000 !important;
            border-width: 2px !important;
            border-style: solid !important;
            background-color: rgba(0, 0, 0, 0.03) !important;
            transform: scale(1.005);
            box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
        }
        html.dark #dropzone-lexnet.is-dragover {
            background-color: rgba(255, 255, 255, 0.06) !important;
            border-color: #ffffff !important;
            box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
        }
        #dropzone-lexnet.is-dragover #dropzone-idle,
        #dropzone-lexnet.is-dragover #dropzone-processing,
        #dropzone-lexnet.is-dragover #dropzone-success {
            display: none !important;
        }
        #dropzone-lexnet.is-dragover #dropzone-dragover {
            display: flex !important;
        }
        #dropzone-dragover {
            display: none;
        }
        #dropzone-lexnet.is-processing {
            opacity: 0.85;
            pointer-events: none;
        }
        /* Export informe + vista previa */
        .ai-export-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            margin-top: 0.65rem;
            padding-top: 0.65rem;
            border-top: 1px solid var(--app-border);
        }
        .ai-export-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.3rem 0.55rem;
            font-size: 0.6875rem;
            font-weight: 500;
            color: var(--app-text-muted);
            background: transparent;
            border: 1px solid var(--app-border);
            border-radius: 9999px;
            cursor: pointer;
            transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
        }
        .ai-export-btn:hover {
            color: var(--app-text);
            background: var(--app-surface);
            border-color: var(--app-border-strong);
        }
        #doc-preview-drawer {
            position: fixed;
            inset: 0;
            z-index: 130;
            display: flex;
            justify-content: flex-end;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(4px);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s ease, visibility 0.2s ease;
        }
        #doc-preview-drawer.is-open {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        #doc-preview-panel {
            width: min(28rem, 100%);
            height: 100%;
            background: var(--app-card);
            border-left: 1px solid var(--app-border);
            transform: translateX(100%);
            transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            flex-direction: column;
        }
        #doc-preview-drawer.is-open #doc-preview-panel {
            transform: translateX(0);
        }

        /* --- RBAC: ocultar UI seg?n rol --- */
        [data-min-role].role-hidden,
        .role-hidden {
            display: none !important;
        }

        /* --- Bloqueo por inactividad (watchdog estricto) --- */
        #modal-session-lock {
            z-index: 200;
        }
        html.session-locked #app-shell,
        body.session-locked #app-shell,
        html.session-locked #erp-sidebar,
        body.session-locked #erp-sidebar {
            filter: blur(12px);
            -webkit-filter: blur(12px);
            pointer-events: none !important;
            user-select: none !important;
            -webkit-user-select: none !important;
        }
        html.session-locked #modal-session-lock,
        body.session-locked #modal-session-lock,
        html.session-locked #modal-session-lock.hidden,
        body.session-locked #modal-session-lock.hidden {
            display: flex !important;
            visibility: visible !important;
            opacity: 1 !important;
            filter: none !important;
            -webkit-filter: none !important;
            pointer-events: auto !important;
            z-index: 200 !important;
        }
        html.dark #modal-session-lock :where(h1, h2, h3, h4, p, label, span, small, strong),
        html.dark #modal-session-lock :where(i, svg),
        html.dark.liquid-glass #modal-session-lock :where(h1, h2, h3, h4, p, label, span, small, strong),
        html.dark.liquid-glass #modal-session-lock :where(i, svg) {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
        }
        html.dark #modal-session-lock input,
        html.dark.liquid-glass #modal-session-lock input {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
        }
        html.dark #modal-session-lock #btn-session-unlock,
        html.dark.liquid-glass #modal-session-lock #btn-session-unlock {
            background: #334155 !important;
            background-image: none !important;
            border: 1px solid #475569 !important;
            color: #f8fafc !important;
            -webkit-text-fill-color: #f8fafc !important;
            box-shadow: none !important;
        }
        html.dark #modal-session-lock #btn-session-unlock:hover,
        html.dark.liquid-glass #modal-session-lock #btn-session-unlock:hover {
            background: #475569 !important;
            border-color: #64748b !important;
        }
        html:not(.dark) #modal-session-lock #btn-session-unlock,
        html.liquid-glass:not(.dark) #modal-session-lock #btn-session-unlock {
            background: #111111 !important;
            background-image: none !important;
            border: 1px solid #111111 !important;
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            box-shadow: none !important;
        }
        html:not(.dark) #modal-session-lock #btn-session-unlock:hover,
        html.liquid-glass:not(.dark) #modal-session-lock #btn-session-unlock:hover {
            background: #262626 !important;
            border-color: #262626 !important;
        }

        /* --- Checkout de pago (integrado en Ajustes ? Facturaci?n) --- */
        #billing-checkout-panel .payment-shell,
        .payment-shell {
            background: #FAFAFA !important;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            border: 1px solid rgba(0, 0, 0, 0.06);
            box-shadow: none;
        }
        html.dark #billing-checkout-panel .payment-shell,
        html.dark .payment-shell {
            background: rgba(15, 23, 42, 0.85) !important;
            border-color: rgba(255, 255, 255, 0.12);
        }
        /* Liquid glass no debe sustituir el fondo marfil del checkout */
        html.liquid-glass #modal-pago.payment-shell,
        html.liquid-glass #billing-checkout-panel .payment-shell {
            background: #FAFAFA !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        html.dark.liquid-glass #billing-checkout-panel .payment-shell {
            background: rgba(15, 23, 42, 0.85) !important;
        }
        /* Facturaci?n / pago: texto negro s?lido (anula tinta blanca de liquid-glass) */
        html.liquid-glass #view-ajustes-billing :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small, li, a),
        html.liquid-glass #billing-plan-card :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        html.liquid-glass #billing-checkout-panel :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        html.liquid-glass #modal-pago.payment-shell :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        #view-ajustes-billing :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        #billing-plan-card :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        #billing-checkout-panel :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        #modal-pago.payment-shell :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small) {
            color: #111827 !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        html.liquid-glass #view-ajustes-billing :where(i, svg),
        html.liquid-glass #billing-plan-card :where(i, svg),
        html.liquid-glass #billing-checkout-panel :where(i, svg):not(.fa-paypal),
        #view-ajustes-billing :where(i, svg),
        #billing-plan-card :where(i, svg) {
            color: #4b5563 !important;
            filter: none !important;
            text-shadow: none !important;
        }
        html.liquid-glass #view-ajustes-billing .app-primary-text,
        html.liquid-glass #billing-plan-card .app-primary-text,
        #view-ajustes-billing .app-primary-text,
        #billing-plan-card .app-primary-text {
            color: var(--app-primary) !important;
        }
        html.liquid-glass #view-ajustes-billing .text-emerald-700,
        html.liquid-glass #billing-checkout-panel .text-emerald-700,
        #view-ajustes-billing .text-emerald-700,
        #billing-checkout-panel .text-emerald-700 {
            color: #047857 !important;
        }
        html.liquid-glass #view-ajustes-billing .text-emerald-800,
        #view-ajustes-billing .text-emerald-800 {
            color: #065f46 !important;
        }
        html.liquid-glass #view-ajustes-billing .text-neutral-500,
        html.liquid-glass #view-ajustes-billing .text-neutral-500,
        html.liquid-glass #view-ajustes-billing .text-neutral-500,
        html.liquid-glass #billing-checkout-panel .text-neutral-500,
        html.liquid-glass #billing-checkout-panel .text-neutral-500,
        html.liquid-glass #billing-checkout-panel .text-neutral-500,
        #view-ajustes-billing .text-neutral-500,
        #view-ajustes-billing .text-neutral-500,
        #view-ajustes-billing .text-neutral-500,
        #billing-checkout-panel .text-neutral-500,
        #billing-checkout-panel .text-neutral-500,
        #billing-checkout-panel .text-neutral-500 {
            color: #4b5563 !important;
        }
        /* Botones de pago: texto blanco sobre fondo primario */
        html.liquid-glass #view-ajustes-billing .app-primary-bg,
        html.liquid-glass #view-ajustes-billing .app-primary-bg :where(span, i),
        html.liquid-glass #btn-confirmar-pago,
        html.liquid-glass #btn-confirmar-pago :where(span, i),
        html.liquid-glass #btn-activar-premium,
        html.liquid-glass #btn-activar-premium :where(span, i),
        #btn-confirmar-pago,
        #btn-confirmar-pago :where(span, i),
        #btn-activar-premium,
        #btn-activar-premium :where(span, i) {
            color: #ffffff !important;
            text-shadow: none !important;
            filter: none !important;
        }
        html.dark #view-ajustes-billing :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        html.dark #billing-checkout-panel :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small),
        html.dark #modal-pago.payment-shell :where(h1, h2, h3, h4, h5, h6, p, span, label, strong, small) {
            color: #f3f4f6 !important;
        }
        .payment-method-tabs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0;
            padding: 0;
            border-radius: var(--app-radius);
            background: var(--app-surface);
            border: 1px solid var(--app-border);
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }
        html.dark .payment-method-tabs {
            background: rgba(30, 41, 59, 0.45);
            border-color: rgba(255, 255, 255, 0.1);
        }
        .payment-tab {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.2rem;
            text-align: left;
            padding: 0.75rem 0.85rem;
            border-radius: var(--app-radius);
            border: 1px solid transparent;
            background: transparent;
            color: var(--app-text-muted);
            transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
            cursor: pointer;
        }
        html.dark .payment-tab {
            color: #cbd5e1;
        }
        .payment-tab:hover {
            background: rgba(255, 255, 255, 0.55);
        }
        html.dark .payment-tab:hover {
            background: rgba(51, 65, 85, 0.55);
        }
        .payment-tab.is-active {
            background: var(--app-card);
            border-color: var(--primary-accent);
            box-shadow: inset 0 -2px 0 0 var(--primary-accent);
            color: var(--app-text);
        }
        html.dark .payment-tab.is-active {
            background: rgba(51, 65, 85, 0.85);
            border-color: var(--primary-accent);
            color: #f8fafc;
        }
        .payment-tab-title {
            font-size: 0.7rem;
            font-weight: 800;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .payment-tab-sub {
            font-size: 0.65rem;
            opacity: 0.75;
            line-height: 1.25;
        }
        .payment-brand-row {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            margin-top: 0.15rem;
            font-size: 1.15rem;
            opacity: 0.9;
        }
        #card-element,
        #paypal-button-container {
            min-height: 52px;
            border-radius: var(--app-radius);
            border: 1px solid var(--app-border);
            background: var(--app-card);
            padding: 0.85rem;
        }
        html.dark #card-element,
        html.dark #paypal-button-container {
            border-color: rgba(255, 255, 255, 0.12);
            background: rgba(30, 41, 59, 0.65);
        }
        #btn-confirmar-pago.is-loading {
            pointer-events: none;
            opacity: 0.85;
        }
        #btn-confirmar-pago .pay-spinner {
            display: none;
            width: 1rem;
            height: 1rem;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #fff;
            border-radius: 50%;
            animation: payment-spin 0.7s linear infinite;
        }
        #btn-confirmar-pago.is-loading .pay-spinner {
            display: inline-block;
        }
        #btn-confirmar-pago.is-loading .pay-label {
            opacity: 0.85;
        }
        @keyframes payment-spin {
            to { transform: rotate(360deg); }
        }

        /* === OVERRIDE FINAL: gana a liquid-glass #app-shell span { color:#000 } === */
        html #app-shell #txt-btn-aperturar-wrap,
        html #app-shell #txt-btn-aperturar-wrap i,
        html #app-shell #txt-btn-aperturar-wrap span,
        html #app-shell #txt-btn-aperturar,
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap,
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap *,
        html.liquid-glass #app-shell #txt-btn-aperturar,
        html.dark #app-shell #txt-btn-aperturar-wrap,
        html.dark #app-shell #txt-btn-aperturar-wrap *,
        html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap,
        html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap * {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            opacity: 1 !important;
            visibility: visible !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        html #app-shell #txt-btn-aperturar-wrap,
        html.liquid-glass #app-shell #txt-btn-aperturar-wrap {
            background-color: var(--app-primary) !important;
            border-color: var(--app-primary) !important;
        }
        html:not(.dark) #app-shell #filtro-expedientes,
        html:not(.dark) #app-shell #filtro-estado-expedientes,
        html.liquid-glass:not(.dark) #app-shell #filtro-expedientes,
        html.liquid-glass:not(.dark) #app-shell #filtro-estado-expedientes {
            color: #0a0a0a !important;
            background-color: #ffffff !important;
            -webkit-text-fill-color: #0a0a0a !important;
        }
        html:not(.dark) #app-shell #filtro-expedientes::placeholder,
        html.liquid-glass:not(.dark) #app-shell #filtro-expedientes::placeholder {
            color: #9ca3af !important;
            -webkit-text-fill-color: #9ca3af !important;
            opacity: 1 !important;
        }

        /* === MODO OSCURO: fondos en tonos distintos + texto blanco legible === */
        html.dark {
            color-scheme: dark;
            background-color: #0a0a0a !important;
        }
        html.dark body,
        html.dark #app-shell,
        html.dark #app-workspace,
        html.dark #main-container,
        html.dark #main-container > main {
            background-color: #0a0a0a !important;
            color: #fafafa !important;
        }
        html.dark #app-header:not(.app-header-floating) {
            background-color: #111111 !important;
            border-color: #2a2a2a !important;
        }
        html.dark #sidebar-historial,
        html.dark .sidebar-historial-block {
            background-color: #111111 !important;
            border-color: #2a2a2a !important;
        }
        html.dark #chat-drawer {
            background-color: #171717 !important;
            border-color: #2a2a2a !important;
        }
        html.dark .vercel-list,
        html.dark .vercel-row,
        html.dark #panel-lexnet-agenda,
        html.dark .dash-glass,
        html.dark .glass-card,
        html.dark .glass-panel {
            background-color: #171717 !important;
            border-color: #2a2a2a !important;
            color: #fafafa !important;
        }
        html.dark .vercel-row:hover { background-color: #1f1f1f !important; }
        html.dark .vercel-row.is-active { background-color: #262626 !important; }
        html.dark .vercel-filter,
        html.dark #filtro-expedientes,
        html.dark #filtro-estado-expedientes,
        html.dark #app-shell #filtro-expedientes,
        html.dark #app-shell #filtro-estado-expedientes {
            background-color: #1f1f1f !important;
            color: #fafafa !important;
            -webkit-text-fill-color: #fafafa !important;
            border-color: #404040 !important;
        }
        html.dark .vercel-filter::placeholder,
        html.dark #filtro-expedientes::placeholder,
        html.dark #app-shell #filtro-expedientes::placeholder {
            color: #737373 !important;
            -webkit-text-fill-color: #737373 !important;
        }
        html.dark #dropzone-lexnet {
            background-color: #171717 !important;
            border-color: #404040 !important;
            color: #fafafa !important;
        }
        html.dark .btn-secondary,
        html.dark .btn-marfil {
            background-color: #1f1f1f !important;
            color: #fafafa !important;
            border-color: #404040 !important;
        }
        html.dark .btn-secondary:hover,
        html.dark .btn-marfil:hover {
            background-color: #262626 !important;
        }
        html.dark .vercel-nav-item {
            color: #fafafa !important;
        }
        html.dark .vercel-nav-item:hover {
            background: #1f1f1f !important;
        }
        html.dark .vercel-nav-item.is-active {
            background: #E4E4E7 !important;
            color: #09090B !important;
            -webkit-text-fill-color: #09090B !important;
        }
        html.dark .vercel-nav-item.is-active i,
        html.dark .vercel-nav-item.is-active span {
            color: #09090B !important;
            -webkit-text-fill-color: #09090B !important;
        }
        html.dark .vercel-nav-item i,
        html.dark .vercel-hash,
        html.dark .vercel-row-right,
        html.dark .vercel-row-meta,
        html.dark .vercel-status {
            color: #a3a3a3 !important;
        }
        html.dark .vercel-row-title,
        html.dark .vercel-page-title,
        html.dark #txt-lbl-registro,
        html.dark #txt-lbl-historial,
        html.dark #txt-lbl-historial span,
        html.dark #app-branding-title,
        html.dark #app-logo-icon,
        html.dark .historial-heading,
        html.dark #app-shell :where(h1, h2, h3, h4, h5, h6, p, label, li, a, span, small, strong),
        html.dark #sidebar-historial :where(h1, h2, h3, h4, h5, h6, p, span, label, li, small, strong) {
            color: #fafafa !important;
            -webkit-text-fill-color: #fafafa !important;
            text-shadow: none !important;
            -webkit-text-stroke: 0 !important;
            filter: none !important;
        }
        html.dark #app-shell :where(.text-neutral-500, .text-slate-500, .text-slate-600, .text-slate-700, .text-gray-500, .text-neutral-700, .text-black, .text-neutral-900),
        html.dark #sidebar-historial :where(.text-neutral-500, .text-neutral-900, .text-black) {
            color: #a3a3a3 !important;
            -webkit-text-fill-color: #a3a3a3 !important;
        }
        html.dark #app-shell #txt-btn-aperturar-wrap,
        html.dark #app-shell #txt-btn-aperturar {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            background-color: #000000 !important;
        }
        html.dark #app-shell #txt-btn-aperturar-wrap * {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
            background: transparent !important;
            background-color: transparent !important;
        }
        html.dark #btn-chat-header i,
        html.dark #btn-lang-toggle .lang-text,
        html.dark #settings-toggle,
        html.dark #settings-toggle span,
        html.dark #settings-toggle svg,
        html.dark #user-session-badge i,
        html.dark #btn-toggle-historial svg,
        html.dark #btn-descargar-historial,
        html.dark #btn-descargar-historial svg,
        html.dark #btn-refresh-historial,
        html.dark #btn-refresh-historial svg {
            color: #fafafa !important;
            stroke: #fafafa !important;
        }
        html.dark #sidebar-historial .vercel-sidebar-search {
            background-color: #1f1f1f !important;
            color: #fafafa !important;
            border-color: #404040 !important;
        }
        html.dark #view-ajustes .settings-group-tab,
        html.dark #view-ajustes .settings-group-tab span {
            color: #ffffff !important;
        }
        html.dark #view-ajustes .settings-group-tab i,
        html.dark #view-ajustes .settings-group-tab svg,
        html.dark #view-ajustes .settings-group-tab svg * {
            color: #ffffff !important;
            stroke: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
        }
        html.dark #doc-preview-panel {
            background: #171717 !important;
            border-color: #2a2a2a !important;
            color: #fafafa !important;
        }
        html.dark #doc-preview-title { color: #fafafa !important; }
        html.dark #doc-preview-body { background: #0a0a0a !important; }
        html.dark #doc-preview-meta { color: #a3a3a3 !important; border-color: #2a2a2a !important; }

        /* --- Settings: tarjetas SaaS premium --- */
        #settings-workspace-panel {
            scroll-behavior: smooth;
        }
        .settings-card {
            border: 1px solid #e2e8f0;
            border-radius: 0.75rem !important;
            background: #ffffff;
            padding: 1.5rem 2rem;
            box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        }
        html.dark .settings-card {
            background: #171717 !important;
            border: 1px solid #262626 !important;
        }
        .settings-card-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: #0f172a;
            letter-spacing: -0.02em;
            line-height: 1.35;
        }
        html.dark .settings-card-title { color: #fafafa !important; -webkit-text-fill-color: #fafafa !important; }
        .settings-card-desc {
            font-size: 0.875rem;
            color: #64748b;
            font-weight: 400;
            margin-top: 0.25rem;
            margin-bottom: 1.5rem;
            line-height: 1.5;
        }
        html.dark .settings-card-desc,
        html.dark #view-ajustes .settings-card-desc,
        html.dark #view-ajustes .settings-meta-label {
            color: #a3a3a3 !important;
            -webkit-text-fill-color: #a3a3a3 !important;
        }
        html.dark #view-ajustes :where(h1, h2, h3, h4, h5, h6),
        html.dark #view-ajustes .settings-meta-value,
        html.dark #view-ajustes .settings-card-title {
            color: #fafafa !important;
            -webkit-text-fill-color: #fafafa !important;
        }
        html.dark #view-ajustes .settings-group > div:first-child :where(.text-neutral-700, .text-sm),
        html.dark #view-ajustes .settings-group > div:first-child span.text-xs {
            color: #a3a3a3 !important;
            -webkit-text-fill-color: #a3a3a3 !important;
        }
        html.dark #view-ajustes input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
        html.dark #view-ajustes select,
        html.dark #view-ajustes textarea {
            background: #0f0f0f !important;
            border-color: #404040 !important;
            color: #fafafa !important;
        }
        html.dark #view-ajustes input[readonly] {
            background: #1a1a1a !important;
            color: #d4d4d4 !important;
        }
        html.dark #view-ajustes .border-neutral-200,
        html.dark #view-ajustes .border-t.border-neutral-200 {
            border-color: #333333 !important;
        }
        html.dark #view-ajustes-apariencia label.border {
            border-color: #333333 !important;
            background: transparent;
        }
        html.dark #view-ajustes-apariencia label.border:hover {
            background: #1f1f1f !important;
        }
        html.dark #view-ajustes #inactivity-minutes-stepper,
        html.dark #view-ajustes #deadline-lead-stepper {
            background: #0f0f0f !important;
            border-color: #404040 !important;
            box-shadow: none !important;
            color: #fafafa !important;
        }
        html.dark #view-ajustes #inactivity-minutes-value,
        html.dark #view-ajustes #deadline-lead-value {
            color: #fafafa !important;
            -webkit-text-fill-color: #fafafa !important;
        }
        html.dark #view-ajustes #inactivity-minutes-stepper button,
        html.dark #view-ajustes #deadline-lead-stepper button {
            color: #a3a3a3 !important;
        }
        html.dark #view-ajustes #inactivity-minutes-stepper button:hover,
        html.dark #view-ajustes #deadline-lead-stepper button:hover {
            color: #fafafa !important;
            background: #262626 !important;
        }
        html.dark #view-ajustes #inactivity-minutes-stepper .border-l,
        html.dark #view-ajustes #deadline-lead-stepper .border-l,
        html.dark #view-ajustes #inactivity-minutes-stepper .border-gray-200,
        html.dark #view-ajustes #deadline-lead-stepper .border-gray-200 {
            border-color: #404040 !important;
        }
        .settings-profile-avatar {
            width: 3.5rem;
            height: 3.5rem;
            border-radius: 9999px !important;
            background: #0a0a0a;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 1rem;
            letter-spacing: 0.02em;
            flex-shrink: 0;
        }
        html.dark .settings-profile-avatar {
            background: #fafafa;
            color: #0a0a0a;
        }
        .settings-meta-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.85rem 1.25rem;
        }
        @media (max-width: 640px) {
            .settings-meta-grid { grid-template-columns: 1fr; }
        }
        .settings-meta-label {
            font-size: 0.6875rem;
            font-weight: 500;
            color: #737373;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .settings-meta-value {
            font-size: 0.875rem;
            font-weight: 500;
            color: #0a0a0a;
            margin-top: 0.15rem;
            word-break: break-word;
        }
        html.dark .settings-meta-value { color: #fafafa; }
        .settings-status-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            border: 1px solid #E5E7EB;
            border-radius: 1rem !important;
            background: #fff;
            padding: 1rem 1.15rem;
            cursor: pointer;
            text-align: left;
            width: 100%;
            transition: background-color 0.15s ease, border-color 0.15s ease;
        }
        .settings-status-card:hover { background: #FAFAFA; border-color: #D1D5DB; }
        html.dark .settings-status-card {
            background: #171717;
            border-color: #2a2a2a;
            color: #fafafa;
        }
        html.dark .settings-status-card:hover { background: #1f1f1f; }
        .settings-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.2rem 0.55rem;
            border-radius: 9999px !important;
            font-size: 0.6875rem;
            font-weight: 600;
            border: 1px solid transparent;
            white-space: nowrap;
        }
        .settings-badge.is-active {
            color: #15803d;
            background: rgba(22, 163, 74, 0.12);
            border-color: rgba(22, 163, 74, 0.25);
        }
        .settings-badge.is-setup {
            color: #525252;
            background: #F5F5F5;
            border-color: #E5E7EB;
        }
        html.dark .settings-badge.is-setup {
            color: #a3a3a3;
            background: #262626;
            border-color: #404040;
        }
        .settings-lang-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 6.5rem;
            padding: 0.5rem 1rem;
            border-radius: 9999px !important;
            border: 1px solid #E5E7EB;
            background: #fff;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #0a0a0a;
            cursor: pointer;
            transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        }
        .settings-lang-pill.is-active {
            background: #0a0a0a;
            border-color: #0a0a0a;
            color: #fff;
        }
        html.dark .settings-lang-pill {
            background: #171717;
            border-color: #404040;
            color: #fafafa;
        }
        html.dark .settings-lang-pill.is-active {
            background: #fafafa;
            border-color: #fafafa;
            color: #0a0a0a;
        }
        .settings-danger-card {
            border: 1px solid #fecaca !important;
            border-radius: 0.75rem !important;
            background: rgba(254, 242, 242, 0.5) !important;
            box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
        }
        html.dark .settings-danger-card {
            background: rgba(127, 29, 29, 0.18) !important;
            border-color: rgba(248, 113, 113, 0.35) !important;
        }
        .settings-danger-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-top: 0;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem !important;
            border: 1px solid transparent;
            background: #dc2626;
            color: #fff;
            font-size: 0.875rem;
            font-weight: 500;
            letter-spacing: 0;
            text-transform: none;
            width: auto;
            cursor: pointer;
            transition: background-color 0.15s ease;
        }
        .settings-danger-btn:hover {
            background: #b91c1c;
            color: #fff;
        }
        html.dark .settings-danger-btn {
            background: #dc2626;
            color: #fff;
            border-color: transparent;
        }
        html.dark .settings-danger-btn:hover {
            background: #b91c1c;
            color: #fff;
        }
        .settings-idle-option {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.7rem 0.85rem;
            border: 1px solid #E5E7EB;
            border-radius: 0.625rem !important;
            cursor: pointer;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #0a0a0a;
            background: #fff;
            transition: border-color 0.15s ease, background-color 0.15s ease;
        }
        .settings-idle-option:has(input:checked) {
            border-color: #0a0a0a;
            background: #FAFAFA;
        }
        html.dark .settings-idle-option {
            background: #171717;
            border-color: #2a2a2a;
            color: #fafafa;
        }
        html.dark .settings-idle-option:has(input:checked) {
            border-color: #fafafa;
            background: #1f1f1f;
        }

        /* Panel único por pestaña (Notificaciones / Seguridad) */
        .settings-unified-panel {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 0.75rem !important;
            box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            padding: 1.5rem 2rem;
        }
        html.dark .settings-unified-panel {
            background: #171717 !important;
            border-color: #333333 !important;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
        }
        .settings-unified-section + .settings-unified-section {
            border-top: 1px solid #f5f5f5;
            margin-top: 1.5rem;
            padding-top: 1.5rem;
        }
        html.dark .settings-unified-section + .settings-unified-section {
            border-top-color: #333333;
        }
        .settings-unified-panel .settings-status-card {
            background: #fafafa;
            border-radius: 0.75rem !important;
        }
        html.dark .settings-unified-panel .settings-status-card {
            background: #1a1a1a !important;
            border-color: #333333 !important;
        }
        html.dark .settings-unified-panel .settings-status-card:hover {
            background: #222222 !important;
            border-color: #404040 !important;
        }
        html.dark .settings-badge.is-setup {
            color: #e5e5e5 !important;
            background: #2a2a2a !important;
            border-color: #525252 !important;
        }
        .settings-unified-panel .settings-status-list {
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
        }

        /* --- Settings: medidores de l?mites de uso (estilo Gemini) --- */
        .usage-meter-card {
            border: 1px solid #E5E7EB;
            border-radius: 1rem !important;
            background: #f5f5f5;
            padding: 1.15rem 1.25rem;
        }
        html.dark .usage-meter-card {
            background: #1f1f1f;
            border-color: #2a2a2a;
        }
        .usage-progress {
            width: 100%;
            height: 0.55rem;
            border-radius: 9999px;
            background: #e5e5e5;
            overflow: hidden;
        }
        html.dark .usage-progress {
            background: #404040;
        }
        .usage-progress-fill {
            height: 100%;
            border-radius: 9999px;
            background: #0a0a0a;
            transition: width 0.35s ease;
        }
        html.dark .usage-progress-fill {
            background: #fafafa;
        }
        .settings-row-icon {
            width: 2rem;
            height: 2rem;
            border-radius: 0.5rem !important;
            border: 1px solid #E5E7EB;
            background: #FAFAFA;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #525252;
            font-size: 0.75rem;
            flex-shrink: 0;
        }
        html.dark .settings-row-icon {
            background: #262626;
            border-color: #404040;
            color: #d4d4d4;
        }

        /* Toggle visibilidad de contrase?a (login): tipograf?a fija, sin animaciones */
        .password-field {
            position: relative;
        }
        .password-field-input,
        .password-field-input[type="password"],
        .password-field-input[type="text"] {
            box-sizing: border-box !important;
            width: 100% !important;
            height: 3.25rem !important;
            min-height: 3.25rem !important;
            max-height: 3.25rem !important;
            margin: 0 !important;
            padding: 0.875rem 2.75rem 0.875rem 1rem !important;
            font-family: var(--font-sans) !important;
            font-size: 1rem !important;
            font-weight: 400 !important;
            font-style: normal !important;
            line-height: 1.5 !important;
            letter-spacing: 0 !important;
            word-spacing: 0 !important;
            text-indent: 0 !important;
            text-transform: none !important;
            font-variant: normal !important;
            font-feature-settings: normal !important;
            -webkit-text-security: none;
            border: 1px solid #e5e5e5 !important;
            border-radius: 0 !important;
            background-color: #ffffff !important;
            color: #171717 !important;
            -webkit-text-fill-color: #171717 !important;
            transition: none !important;
            animation: none !important;
            -webkit-transition: none !important;
            -moz-transition: none !important;
            -o-transition: none !important;
            caret-color: #171717;
        }
        .password-field-input:focus {
            outline: none !important;
            box-shadow: none !important;
            border-color: var(--app-border) !important;
            transition: none !important;
        }
        #register-password-hint {
            margin: 0 0 0.35rem;
            font-size: 0.75rem;
            line-height: 1.45;
            transition: none !important;
        }
        #modal-login #register-password-hint.is-invalid,
        #modal-login #register-password-hint.text-red-600,
        html.liquid-glass #modal-login #register-password-hint.is-invalid,
        html.liquid-glass #modal-login #register-password-hint.text-red-600 {
            color: #dc2626 !important;
        }
        #modal-login #register-password-hint.is-valid,
        #modal-login #register-password-hint.text-green-600,
        html.liquid-glass #modal-login #register-password-hint.is-valid,
        html.liquid-glass #modal-login #register-password-hint.text-green-600 {
            color: #16a34a !important;
        }
        #modal-login .password-mismatch-x.is-visible,
        html.liquid-glass #modal-login .password-mismatch-x.is-visible {
            color: #dc2626 !important;
        }
        #register-password-feedback {
            margin-top: 0.4rem;
            font-size: 0.8125rem;
            line-height: 1.4;
            color: #dc2626;
        }
        #register-password-feedback:empty,
        #register-password-feedback.is-hidden {
            display: none;
        }
        .password-field--confirm .password-field-input,
        .password-field--confirm .password-field-input[type="password"],
        .password-field--confirm .password-field-input[type="text"] {
            padding-right: 4.5rem !important;
        }
        .password-mismatch-x {
            position: absolute;
            top: 50%;
            right: 2.55rem;
            transform: translateY(-50%);
            display: none;
            align-items: center;
            justify-content: center;
            width: 1.25rem;
            height: 1.25rem;
            color: #dc2626;
            font-size: 1.05rem;
            font-weight: 700;
            line-height: 1;
            pointer-events: none;
            user-select: none;
        }
        .password-mismatch-x.is-visible {
            display: inline-flex;
        }
        .password-toggle-btn {
            position: absolute;
            top: 50%;
            right: 0.65rem;
            transform: translateY(-50%);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2rem;
            height: 2rem;
            padding: 0;
            border: none;
            background: transparent;
            color: #737373;
            cursor: pointer;
            border-radius: 0.35rem;
            transition: none !important;
        }
        .password-toggle-btn:hover {
            color: #171717;
            background: rgba(0, 0, 0, 0.04);
        }
        .password-toggle-btn .password-icon {
            width: 1.1rem;
            height: 1.1rem;
            display: block;
            transition: none !important;
        }
        .password-toggle-btn .password-icon-hide {
            display: none;
        }
        .password-toggle-btn.is-visible .password-icon-show {
            display: none;
        }
        .password-toggle-btn.is-visible .password-icon-hide {
            display: block;
        }
        html.dark .password-toggle-btn {
            color: #a3a3a3;
        }
        html.dark .password-toggle-btn:hover {
            color: #fafafa;
            background: rgba(255, 255, 255, 0.06);
        }

        /* Toasts: píldora corta; texto largo usa radio contenido */
        #toast-container .toast-item,
        html.dark #toast-container .toast-item,
        html.liquid-glass #toast-container .toast-item {
            border-radius: 1.25rem !important;
        }
        #toast-container .toast-item .toast-icon {
            border-radius: 9999px !important;
        }

        /* Fase 2 ERP: badges de estado y alertas de plazos */
        .erp-estado-badge,
        #detalle-estado-badge,
        #detalle-fecha {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            background-color: #ffffff !important;
            color: #0F172A !important;
            border: 1px solid #E2E8F0 !important;
            font-size: 0.75rem !important;
            font-weight: 500 !important;
            letter-spacing: 0 !important;
            text-transform: none !important;
            padding: 0.5rem 0.875rem !important;
            border-radius: 0.5rem !important;
            box-shadow: none !important;
            white-space: nowrap;
        }
        .erp-alerta-badge {
            display: inline-flex;
            align-items: center;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.2rem 0.5rem;
            border: 1px solid #e5e7eb;
            white-space: nowrap;
        }
        .erp-alerta-badge[data-nivel="ok"] {
            border-color: #bbf7d0;
            background: #f0fdf4;
            color: #166534;
        }
        .erp-alerta-badge[data-nivel="proximo"] {
            border-color: #fde68a;
            background: #fffbeb;
            color: #92400e;
        }
        .erp-alerta-badge[data-nivel="urgente"] {
            border-color: #fdba74;
            background: #fff7ed;
            color: #9a3412;
        }
        .erp-alerta-badge[data-nivel="vencido"] {
            border-color: #fecaca;
            background: #fef2f2;
            color: #991b1b;
        }
        .erp-doc-row,
        .erp-plazo-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            background: #fff;
        }
        .erp-doc-row:hover,
        .erp-plazo-row:hover {
            background: #fafafa;
        }

        /* Fase 3 ? Copiloto IA */
        .erp-doc-row {
            flex-wrap: wrap;
        }
        .erp-resumen-ia {
            width: 100%;
            margin-top: 0.5rem;
            border: 1px solid #e5e7eb;
            background: #f9fafb;
            padding: 0.75rem 1rem;
        }
        .erp-resumen-ia summary {
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
            color: #171717;
            list-style: none;
        }
        .erp-resumen-ia summary::-webkit-details-marker { display: none; }
        .erp-resumen-ia[open] summary { margin-bottom: 0.5rem; }
        .erp-resumen-ia pre {
            white-space: pre-wrap;
            word-break: break-word;
            font-family: inherit;
            font-size: 0.8rem;
            line-height: 1.45;
            color: #262626;
            margin: 0;
        }
        .erp-copiloto-tabs {
            display: flex;
            gap: 0.25rem;
            border-bottom: 1px solid #e5e7eb;
            margin-bottom: 1rem;
        }
        .erp-copiloto-tab {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.5rem 0.85rem;
            border: 1px solid transparent;
            border-bottom: none;
            background: transparent;
            color: #525252;
            cursor: pointer;
        }
        .erp-copiloto-tab.is-active {
            color: #0a0a0a;
            background: #fff;
            border-color: #e5e7eb;
            border-bottom-color: #fff;
            margin-bottom: -1px;
        }
        #escrito-borrador-output {
            min-height: 14rem;
            max-height: 22rem;
            overflow-y: auto;
            white-space: pre-wrap;
            font-size: 0.85rem;
            line-height: 1.5;
            border: 1px solid #e5e7eb;
            background: #fafafa;
            padding: 1rem;
        }
        .erp-search-hint-row {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            margin-top: 0.25rem;
        }
        #lso-kanban-shell.is-lista-view .erp-search-hint-row {
            visibility: hidden;
            pointer-events: none;
        }
        .lso-casos-row-trash {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.65rem;
            height: 1.65rem;
            padding: 0;
            border: none;
            border-radius: 0.4rem;
            background: transparent;
            color: #dc2626;
            cursor: pointer;
        }
        .lso-casos-row-trash svg,
        .lso-casos-row-trash:hover svg,
        html.dark .lso-casos-row-trash svg,
        html.dark .lso-casos-row-trash:hover svg {
            color: #dc2626 !important;
            stroke: #dc2626 !important;
        }
        .lso-casos-row-trash:hover {
            color: #dc2626;
            background: transparent;
        }
        html.dark .lso-casos-row-trash { color: #dc2626; }
        html.dark .lso-casos-row-trash:hover {
            color: #dc2626;
            background: transparent;
        }
        .lso-deudores-table .lso-deudores-row td:last-child {
            text-align: right;
            width: 2.5rem;
        }
        .erp-search-hint {
            font-size: 0.875rem;
            color: #737373;
            margin-top: 0;
        }
        .lso-casos-trash {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.65rem;
            height: 1.65rem;
            padding: 0;
            border: 1px solid transparent;
            border-radius: 0.4rem;
            background: transparent;
            color: #dc2626;
            cursor: default;
            flex-shrink: 0;
            transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
        }
        #lso-casos-trash,
        #lso-casos-trash:hover,
        #lso-casos-trash.is-drop-target,
        html.dark #lso-casos-trash,
        html.dark #lso-casos-trash:hover,
        html.dark #lso-casos-trash.is-drop-target,
        #lso-casos-trash svg,
        #lso-casos-trash svg path,
        #lso-casos-trash:hover svg,
        #lso-casos-trash:hover svg path,
        html.dark #lso-casos-trash svg path,
        .lso-casos-row-trash svg path,
        .lso-casos-row-trash:hover svg path,
        html.dark .lso-casos-row-trash svg path {
            color: #dc2626 !important;
            stroke: #dc2626 !important;
        }
        .lso-casos-trash:hover,
        .lso-casos-trash.is-drop-target {
            color: #dc2626;
            background: #fef2f2;
            border-color: #fecaca;
        }
        .lso-casos-trash.is-drop-target {
            transform: scale(1.08);
            outline: 2px dashed #b91c1c;
            outline-offset: 1px;
        }
        html.dark .lso-casos-trash { color: #dc2626; }
        html.dark .lso-casos-trash:hover,
        html.dark .lso-casos-trash.is-drop-target {
            color: #dc2626;
            background: #450a0a;
            border-color: #7f1d1d;
        }

        /* Fase 4 ? Facturaci?n */
        .erp-metricas {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.75rem;
        }
        @media (max-width: 640px) {
            .erp-metricas { grid-template-columns: 1fr; }
        }
        .erp-metrica {
            border: 1px solid #e5e7eb;
            background: #fff;
            padding: 0.9rem 1rem;
        }
        .erp-metrica .lbl {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #737373;
        }
        .erp-metrica .val {
            font-size: 1.35rem;
            font-weight: 700;
            margin-top: 0.25rem;
            color: #0a0a0a;
        }
        /* Facturación: paneles blancos en modo oscuro (como métricas) */
        html.dark #panel-erp-facturacion > section,
        html.dark #panel-erp-facturacion > section.bg-white,
        html.dark #panel-erp-facturacion > section.dark\:bg-gray-900,
        html.dark #panel-erp-facturacion > section.dark\:bg-gray-950 {
            background-color: #ffffff !important;
            border-color: #e5e5e5 !important;
            color: #0a0a0a !important;
            box-shadow: none !important;
        }
        html.dark #panel-erp-facturacion > section :where(h3, h4, p, li, strong, span),
        html.dark #app-shell #panel-erp-facturacion > section :where(h3, h4, p, li, strong, span) {
            color: #0a0a0a !important;
            -webkit-text-fill-color: #0a0a0a !important;
        }
        html.dark #panel-erp-facturacion .factura-estado-badge[data-estado="cobrada"],
        html.dark #panel-erp-facturacion .factura-estado-badge[data-estado="Pagada"],
        html.dark #panel-erp-facturacion .factura-estado-badge[data-estado="pendiente"],
        html.dark #panel-erp-facturacion .factura-estado-badge[data-estado="Pendiente"] {
            color: #3f3f46 !important;
            -webkit-text-fill-color: #3f3f46 !important;
            background-color: transparent !important;
            border-color: #e4e4e7 !important;
        }
        html.dark #panel-erp-facturacion .text-muted-foreground,
        html.dark #panel-erp-facturacion .text-neutral-400 {
            color: #737373 !important;
            -webkit-text-fill-color: #737373 !important;
        }
        html.dark #metrica-cobrado,
        html.dark #metrica-pendiente,
        html.dark #metrica-total-facturado {
            color: #18181b !important;
            -webkit-text-fill-color: #18181b !important;
        }
        html.dark #sheet-nueva-factura aside {
            background-color: #ffffff !important;
            border-color: #e5e5e5 !important;
        }
        html.dark #sheet-nueva-factura input:not([type="checkbox"]):not([type="radio"]),
        html.dark #sheet-nueva-factura select,
        html.dark #sheet-nueva-factura #factura-iva-preview {
            background-color: #ffffff !important;
            border-color: #e5e5e5 !important;
            color: #0a0a0a !important;
            -webkit-text-fill-color: #0a0a0a !important;
        }
        html.dark #panel-erp-facturacion > section :where(label),
        html.dark #app-shell #panel-erp-facturacion > section :where(label),
        html.dark #panel-erp-facturacion > section .text-neutral-700,
        html.dark #app-shell #panel-erp-facturacion > section .text-neutral-700 {
            color: #404040 !important;
            -webkit-text-fill-color: #404040 !important;
        }
        html.dark #panel-erp-facturacion input:not([type="checkbox"]):not([type="radio"]),
        html.dark #panel-erp-facturacion select,
        html.dark.liquid-glass #panel-erp-facturacion input:not([type="checkbox"]):not([type="radio"]),
        html.dark.liquid-glass #panel-erp-facturacion select {
            background-color: #ffffff !important;
            border-color: #e5e5e5 !important;
            color: #0a0a0a !important;
            -webkit-text-fill-color: #0a0a0a !important;
        }
        html.dark #panel-erp-facturacion #factura-iva-preview,
        html.dark #panel-erp-facturacion .bg-neutral-50 {
            background-color: #fafafa !important;
            border-color: #e5e5e5 !important;
            color: #0a0a0a !important;
            -webkit-text-fill-color: #0a0a0a !important;
        }
        html.dark #panel-erp-facturacion #lista-facturas-global {
            border-color: #e5e5e5 !important;
            background-color: #ffffff !important;
        }
        html.dark #panel-erp-facturacion #lista-facturas-global td,
        html.dark #panel-erp-facturacion #lista-facturas-global th {
            color: #0a0a0a !important;
            -webkit-text-fill-color: #0a0a0a !important;
        }
        html.dark #panel-erp-facturacion thead th {
            color: #737373 !important;
            -webkit-text-fill-color: #737373 !important;
        }
        html.dark #panel-erp-facturacion #lista-facturas-global .text-neutral-500,
        html.dark #panel-erp-facturacion #lista-facturas-global .text-neutral-700 {
            color: #737373 !important;
            -webkit-text-fill-color: #737373 !important;
        }
        .erp-nav-pill {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.4rem 0.85rem;
            border: 1px solid #e5e7eb;
            background: #fff;
            color: #525252;
            cursor: pointer;
        }
        .erp-nav-pill.is-active {
            background: #0a0a0a;
            border-color: #0a0a0a;
            color: #fff;
        }
        .erp-factura-estado[data-estado="Pagada"],
        .erp-factura-estado[data-estado="cobrada"] {
            color: #166534;
            font-weight: 600;
        }
        .erp-factura-estado[data-estado="Pendiente"],
        .erp-factura-estado[data-estado="pendiente"] {
            color: #9a3412;
            font-weight: 600;
        }
        .erp-factura-estado[data-estado="borrador"] {
            color: #525252;
            font-weight: 600;
        }
        .erp-factura-table-head,
        .erp-factura-row.has-exp {
            display: grid;
            grid-template-columns: 1.2fr 1fr 1.2fr 0.8fr 0.7fr 0.7fr auto;
            gap: 0.5rem;
            align-items: center;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .erp-factura-row.no-exp {
            display: grid;
            grid-template-columns: 1.4fr 1fr 0.8fr 0.7fr 0.7fr auto;
            gap: 0.5rem;
            align-items: center;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .erp-factura-table-head {
            background: #fafafa;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #737373;
            border-bottom: 1px solid #e5e7eb;
        }
        .erp-factura-label {
            display: block;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            color: #a3a3a3;
            margin-bottom: 0.15rem;
        }
        .erp-factura-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.4rem;
            white-space: nowrap;
        }
        .erp-factura-delete {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.75rem;
            height: 1.75rem;
            color: #dc2626;
            background: transparent;
            border: none;
            border-radius: 0.375rem;
            cursor: pointer;
        }
        .erp-factura-delete:hover {
            background: transparent;
            color: #b91c1c;
        }
        @media (max-width: 640px) {
            .erp-factura-row.has-exp,
            .erp-factura-row.no-exp {
                grid-template-columns: 1fr;
                gap: 0.35rem;
            }
        }
        #suscripcion-estado-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.3rem 0.6rem;
            border: 1px solid #bbf7d0;
            background: #f0fdf4;
            color: #166534;
        }
        #suscripcion-estado-badge.is-inactive {
            border-color: #e5e7eb;
            background: #f9fafb;
            color: #525252;
        }

/* ==========================================================================
   Gemini-style chat + historial actions (2026 redesign)
   ========================================================================== */
/* Branding de cabecera: siempre oculto (logo/nombre fuera del chrome) */
#app-branding-mark,
#app-branding-mark #app-logo-img,
#app-branding-mark #app-branding-title,
#app-branding-mark #app-logo-icon {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.vercel-status-dot {
  border-radius: 50% !important;
}

#chat-drawer.gemini-chat {
  display: flex !important;
  flex-direction: column !important;
  background: var(--app-surface, #fff) !important;
  border-left: none !important;
  min-height: 0 !important;
}

#chat-drawer.gemini-chat .gemini-chat-toolbar {
  border: none !important;
  border-bottom: none !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 2.5rem;
}

.gemini-dim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--app-text-muted, #737373);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.gemini-dim-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--app-text, #171717);
}
html.dark .gemini-dim-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
}
.gemini-dim-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.gemini-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 1.25rem 1.25rem;
  background: transparent !important;
  min-height: 0;
}

.gemini-msg {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 100%;
}
.gemini-msg-assistant { align-items: flex-start; }
.gemini-msg-user { align-items: flex-end; }
.gemini-msg-welcome {
  align-self: center;
  align-items: center;
  text-align: center;
  width: min(100%, 36rem);
  margin: 3.5rem auto 1.5rem;
  padding: 0 1rem;
}
.gemini-msg-welcome .gemini-msg-label {
  margin-left: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase !important;
  color: var(--app-text-muted, #737373);
}
.gemini-bubble-welcome {
  background: transparent !important;
  color: var(--app-text, #171717);
  max-width: 100% !important;
  padding: 0.75rem 0.25rem !important;
  border-radius: 0 !important;
  font-size: 1.05rem;
  line-height: 1.55;
  text-align: center;
}
html.dark .gemini-bubble-welcome {
  color: #f5f5f5;
}
.gemini-msg-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--app-text-muted, #737373);
  margin-left: 0.65rem;
  letter-spacing: 0.02em;
  text-transform: none !important;
}

.gemini-bubble {
  border: none !important;
  box-shadow: none !important;
  word-break: break-word;
}
.gemini-bubble-assistant {
  background: transparent;
  color: #1e293b;
}
.gemini-bubble-user {
  background: #f1f5f9;
  color: #0f172a;
}
.gemini-bubble-error {
  background: #fef2f2;
  color: #b91c1c;
  border-bottom-left-radius: 0.45rem;
}
html.dark .gemini-bubble-assistant {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
}
html.dark .gemini-bubble-user {
  background: #e5e5e5;
  color: #111;
}

.gemini-composer-wrap {
  background: transparent !important;
  border: none !important;
}

.gemini-composer {
  display: flex;
  flex-direction: column;
  border-radius: 9999px !important;
  border: 1px solid #E5E7EB !important;
  background: #ffffff !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: box-shadow 160ms ease, background 160ms ease;
}
.gemini-composer:focus-within {
  background: #ffffff !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: none !important;
}
html.dark .gemini-composer {
  background: #2a2a2a !important;
  border: 1px solid #262626 !important;
  box-shadow: none !important;
}
html.dark .gemini-composer:focus-within {
  background: #303030 !important;
}

.gemini-composer-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.45rem 0.4rem 0.4rem;
}
.gemini-composer-input,
#chat-input.gemini-composer-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.65rem 0.5rem;
  color: var(--app-text, #171717);
  -webkit-appearance: none;
  appearance: none;
}
.gemini-composer-input:focus,
#chat-input.gemini-composer-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.gemini-composer-input::placeholder {
  color: #9ca3af;
}
.gemini-composer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  flex-shrink: 0;
}
.gemini-composer-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
}
html.dark .gemini-composer-icon-btn {
  color: #d4d4d4;
}
html.dark .gemini-composer-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.gemini-send-btn,
#btn-enviar-chat.gemini-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #111111 !important;
  box-shadow: none !important;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
}
.gemini-send-btn:hover,
#btn-enviar-chat.gemini-send-btn:hover {
  background: #f8f8f8 !important;
}
.gemini-send-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 0;
  will-change: transform, opacity;
}
.gemini-send-btn svg,
#btn-enviar-chat.gemini-send-btn svg,
.gemini-send-icon {
  width: 18px;
  height: 18px;
  fill: #111111 !important;
  stroke: none !important;
  color: #111111 !important;
  transform: rotate(-90deg);
  transform-origin: center;
  display: block;
}
/* L?neas de viento (solo visibles en despegue) */
.gemini-send-icon-wrap::before,
.gemini-send-icon-wrap::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 7px;
  border-radius: 1px;
  background: linear-gradient(
    to bottom,
    rgba(120, 120, 120, 0) 0%,
    rgba(140, 140, 140, 0.55) 45%,
    rgba(120, 120, 120, 0) 100%
  );
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -40%);
  z-index: 0;
}
.gemini-send-icon-wrap::before {
  margin-left: -5px;
  height: 8px;
  box-shadow: 5px 2px 0 -0.5px rgba(140, 140, 140, 0.35);
}
.gemini-send-icon-wrap::after {
  margin-left: 5px;
  height: 6px;
}
.gemini-send-icon-wrap .gemini-send-icon {
  position: relative;
  z-index: 1;
}
.gemini-send-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.gemini-send-btn.is-sending,
.gemini-send-btn.is-sending:disabled {
  opacity: 1 !important;
  pointer-events: none;
}
.gemini-send-btn.is-sending .gemini-send-icon-wrap {
  animation: fly-out-in 750ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gemini-send-btn.is-sending .gemini-send-icon-wrap::before,
.gemini-send-btn.is-sending .gemini-send-icon-wrap::after {
  animation: send-speed-lines 280ms ease-out both;
}
.gemini-send-btn.is-sending .gemini-send-icon-wrap::after {
  animation-delay: 30ms;
}
@keyframes fly-out-in {
  /* Fase 1 ? despegue */
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
  }
  38% {
    transform: translateY(-150%) scale(0.9);
    opacity: 0.2;
    animation-timing-function: step-end;
  }
  /* Fase 2 ? reset invisible abajo */
  39% {
    transform: translateY(150%) scale(0.92);
    opacity: 0;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
  /* Fase 3 ? aterrizaje */
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
@keyframes send-speed-lines {
  0% {
    opacity: 0;
    transform: translate(-50%, -70%) scaleY(0.4);
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 90%) scaleY(1.15);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gemini-send-btn.is-sending .gemini-send-icon-wrap,
  .gemini-send-btn.is-sending .gemini-send-icon-wrap::before,
  .gemini-send-btn.is-sending .gemini-send-icon-wrap::after {
    animation: none !important;
  }
}
html.dark .gemini-send-btn,
html.dark #btn-enviar-chat.gemini-send-btn {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
html.dark .gemini-send-btn svg,
html.dark #btn-enviar-chat.gemini-send-btn svg {
  fill: #111111 !important;
  stroke: none !important;
  color: #111111 !important;
}

/* Maximize: full-height flex column, children stretch correctly */
html.layout-chat-max #chat-drawer.gemini-chat:not(.chat-closed) {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100dvh - var(--app-header-height)) !important;
  max-height: calc(100dvh - var(--app-header-height)) !important;
}
html.layout-chat-max #chat-drawer.gemini-chat > .gemini-chat-toolbar,
html.layout-chat-max #chat-drawer.gemini-chat > .gemini-composer-wrap {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex-shrink: 0 !important;
}
html.layout-chat-max #chat-drawer.gemini-chat > .gemini-chat-messages,
html.layout-chat-max #chat-drawer.gemini-chat > #chat-messages {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
@media (min-width: 768px) {
  html.layout-chat-max #chat-drawer.gemini-chat > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex-shrink: unset;
  }
  html.layout-chat-min #chat-drawer.gemini-chat:not(.chat-closed) {
    display: flex !important;
    flex-direction: column !important;
    border: none !important;
    border-left: none !important;
  }
  /* Mantener ancho final del panel (no 100% del padre animado ? evita reflujo del texto) */
  html.layout-chat-min #chat-drawer.gemini-chat > *,
  html.layout-chat-min #chat-drawer.gemini-chat:not(.chat-closed) > *,
  #chat-drawer.gemini-chat.chat-closed > * {
    width: var(--chat-content-lock, max(18rem, 37.5vw)) !important;
    min-width: var(--chat-content-lock, max(18rem, 37.5vw)) !important;
    max-width: var(--chat-content-lock, max(18rem, 37.5vw)) !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
  html.layout-chat-min #chat-drawer.gemini-chat:not(.chat-closed) > .gemini-chat-messages,
  html.layout-chat-min #chat-drawer.gemini-chat:not(.chat-closed) > #chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
}

/* Historial estilo Gemini: t?tulo limpio + men? ? + scroll */
.normas-ia-scroll {
  max-height: 310px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
#modal-normas-ia.hidden,
#modal-preguntas-ia.hidden,
#modal-anadir-direccion-cliente.hidden,
#modal-confirmar-borrado-norma.hidden,
#modal-confirmar-borrado-pregunta.hidden,
#modal-confirmar-borrado-direccion.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
#modal-normas-ia:not(.hidden),
#modal-preguntas-ia:not(.hidden),
#modal-anadir-direccion-cliente:not(.hidden),
#modal-confirmar-borrado-norma:not(.hidden),
#modal-confirmar-borrado-pregunta:not(.hidden),
#modal-confirmar-borrado-direccion:not(.hidden) {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
  z-index: 110 !important;
}
#modal-confirmar-borrado-norma:not(.hidden),
#modal-confirmar-borrado-pregunta:not(.hidden),
#modal-confirmar-borrado-direccion:not(.hidden) {
  z-index: 120 !important;
}
#modal-confirmar-borrado-direccion:not(.hidden) {
  z-index: 200 !important;
}
.btn-borrar-dir {
  color: #dc2626;
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 0;
}
.btn-borrar-dir:hover {
  color: #dc2626;
}
.normas-ia-scroll::-webkit-scrollbar {
  width: 6px;
}
.normas-ia-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.normas-ia-scroll::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 9999px;
}
.normas-ia-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

.historial-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c5cdd8 transparent;
}
.historial-scroll::-webkit-scrollbar {
  width: 11px;
}
.historial-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.historial-scroll::-webkit-scrollbar-thumb {
  background-color: #c5cdd8;
  border-radius: 9999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.historial-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #aeb8c6;
  border: 3px solid transparent;
  background-clip: padding-box;
}
html.dark .historial-scroll {
  scrollbar-color: #525252 transparent;
}
html.dark .historial-scroll::-webkit-scrollbar-thumb {
  background-color: #525252;
}
html.dark .historial-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #737373;
}
.historial-list {
  padding-right: 0.15rem;
}
#lista-historial-sidebar > li.is-filtered-out,
#lista-historial-sidebar > li.hidden {
  display: none !important;
}
#sidebar-historial .historial-search-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
#sidebar-historial .historial-search-wrap .vercel-sidebar-search {
  width: 2.1rem;
  max-width: 100%;
  border: none !important;
  border-bottom: 1px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  transition: width 0.32s ease, border-bottom-color 0.32s ease !important;
}
#sidebar-historial .historial-search-wrap .vercel-sidebar-search::placeholder {
  color: #9ca3af;
  opacity: 0;
  transition: opacity 0.32s ease;
}
#sidebar-historial .historial-search-wrap:hover .vercel-sidebar-search::placeholder,
#sidebar-historial .historial-search-wrap:focus-within .vercel-sidebar-search::placeholder {
  opacity: 1;
}
#sidebar-historial .historial-search-wrap:hover .vercel-sidebar-search,
#sidebar-historial .historial-search-wrap:focus-within .vercel-sidebar-search,
#sidebar-historial .historial-search-wrap:has(.vercel-sidebar-search:not(:placeholder-shown)) .vercel-sidebar-search {
  width: 100%;
  border-bottom-color: #E5E7EB !important;
}
html.dark #sidebar-historial .historial-search-wrap .vercel-sidebar-search {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html.dark #sidebar-historial .historial-search-wrap:hover .vercel-sidebar-search,
html.dark #sidebar-historial .historial-search-wrap:focus-within .vercel-sidebar-search,
html.dark #sidebar-historial .historial-search-wrap:has(.vercel-sidebar-search:not(:placeholder-shown)) .vercel-sidebar-search {
  width: 100%;
  border-bottom-color: #404040 !important;
}
.historial-nuevo-chat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #111827;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.32s ease;
}
.historial-nuevo-chat span {
  position: absolute;
  left: 2.15rem;
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.historial-nuevo-chat:hover span,
.historial-nuevo-chat:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
}
.historial-nuevo-chat:hover {
  background: #f3f4f6;
}
html.dark .historial-nuevo-chat {
  color: #fafafa;
}
html.dark .historial-nuevo-chat:hover {
  background: #262626;
}
.historial-nuevo-chat-divider {
  height: 0;
  margin: 0.35rem 0.15rem 0;
  border: none;
  border-top: 1px solid #E4E4E7;
}
html.dark .historial-nuevo-chat-divider {
  border-top-color: #404040;
}
.historial-chat-item.vercel-nav-item,
.historial-chat-item {
  position: relative;
  align-items: center !important;
  min-height: 2.75rem;
  padding: 0.7rem 0.75rem 0.7rem 0.45rem !important;
  gap: 0.45rem !important;
  border-radius: 0.85rem !important;
  flex-direction: row !important;
  background: transparent !important;
  font-weight: 400 !important;
  border: 1px solid #d4d4d4 !important;
}
html.dark .historial-chat-item.vercel-nav-item,
html.dark .historial-chat-item {
  border-color: #525252 !important;
}
#lista-historial-sidebar .historial-chat-item.vercel-nav-item:hover {
  background: rgba(9, 9, 11, 0.04) !important;
}
#lista-historial-sidebar .historial-chat-item.vercel-nav-item.is-active {
  background: rgba(9, 9, 11, 0.04) !important;
  font-weight: 500 !important;
}
html.dark #lista-historial-sidebar .historial-chat-item.vercel-nav-item:hover,
html.dark #lista-historial-sidebar .historial-chat-item.vercel-nav-item.is-active {
  background: rgba(255, 255, 255, 0.06) !important;
}
.historial-item-main {
  min-width: 0;
  flex: 1;
  padding: 0.1rem 0;
  cursor: pointer;
  text-align: left;
}
.historial-item-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
}
.historial-rename-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  width: 100%;
}
.historial-rename-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.historial-rename-btn-cancel:hover {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}
.historial-rename-btn-save:hover {
  color: #15803d;
  background: rgba(21, 128, 61, 0.08);
}
html.dark .historial-rename-btn-cancel:hover {
  color: #fca5a5;
}
html.dark .historial-rename-btn-save:hover {
  color: #86efac;
}
.historial-rename-input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 0 1px;
  border: none;
  border-bottom: 1px solid #9ca3af;
  border-radius: 0;
  background: transparent;
  color: var(--app-text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
}
.historial-rename-input:focus {
  outline: none;
  border-bottom-color: var(--app-text, #404040);
}
.historial-rename-row .historial-rename-input {
  flex: 1;
  min-width: 0;
  width: auto;
}
.historial-chat-item.is-renaming .historial-item-main {
  cursor: text;
}
.historial-chat-item.is-active .historial-item-title {
  font-weight: 500;
}
.historial-item-actions {
  position: relative;
  flex-shrink: 0;
  order: 0;
}
.historial-item-main {
  order: 1;
}
.historial-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--app-text-muted, #737373);
  opacity: 1;
  cursor: pointer;
  transition: opacity 120ms ease, background 120ms ease;
}
.vercel-nav-item:hover .historial-more-btn,
.vercel-nav-item.is-active .historial-more-btn,
.historial-more-btn[aria-expanded="true"] {
  opacity: 1;
}
.historial-more-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--app-text, #111);
}
.historial-context-menu {
  position: fixed;
  z-index: 12000;
  min-width: 13.5rem;
  padding: 0.4rem;
  border-radius: 0.85rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
}
html.dark .historial-context-menu {
  background: #171717;
  border-color: rgba(255, 255, 255, 0.1);
}
.historial-context-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--app-text, #171717);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.historial-context-menu button svg {
  flex-shrink: 0;
  opacity: 0.85;
}
.historial-context-menu button:hover {
  background: rgba(0, 0, 0, 0.05);
}
html.dark .historial-context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.gemini-rename-overlay {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(32, 33, 36, 0.32);
}
.gemini-rename-overlay.hidden {
  display: none !important;
}
.gemini-rename-panel {
  width: 100%;
  max-width: 26rem;
  padding: 1.5rem 1.5rem 1.15rem;
  border-radius: 1.75rem;
  background: #fff;
  box-shadow: none;
}
.gemini-rename-title {
  margin: 0 0 1.15rem;
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #1f1f1f;
  line-height: 1.3;
}
.gemini-rename-input {
  display: block;
  width: 100%;
  height: 3.5rem;
  padding: 0 0.9rem;
  border: 1px solid #1f1f1f;
  border-radius: 4px;
  background: #fff;
  color: #1f1f1f;
  font-size: 1rem;
  outline: none;
  box-shadow: none;
}
.gemini-rename-input:focus {
  border-width: 1px;
}
.gemini-rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.35rem;
}
.gemini-rename-btn {
  border: none;
  border-radius: 9999px;
  padding: 0.62rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}
.gemini-rename-btn-cancel {
  background: #e3e3e3;
  color: #1f1f1f;
}
.gemini-rename-btn-cancel:hover {
  background: #d6d6d6;
}
.gemini-rename-btn-ok {
  background: #c2c2c2;
  color: #f1f1f1;
}
.gemini-rename-btn-ok.is-ready {
  background: #e3e3e3;
  color: #1f1f1f;
}
.gemini-rename-btn-ok.is-ready:hover {
  background: #d6d6d6;
}
.gemini-rename-btn-ok:disabled {
  cursor: default;
  opacity: 1;
}
html.dark .gemini-rename-panel {
  background: #2d2e30;
}
html.dark .gemini-rename-title {
  color: #e3e3e3;
}
html.dark .gemini-rename-input {
  background: transparent;
  border-color: #e3e3e3;
  color: #e3e3e3;
}
html.dark .gemini-rename-btn-cancel,
html.dark .gemini-rename-btn-ok.is-ready {
  background: #444746;
  color: #e3e3e3;
}
html.dark .gemini-rename-btn-ok {
  background: #3c4043;
  color: #9aa0a6;
}

.historial-context-menu button.is-danger {
  color: #dc2626;
}
.historial-item-pinned .historial-item-title {
  font-weight: 500;
}

/* Historial blanco persistente */
html.historial-white #sidebar-historial,
#sidebar-historial.historial-panel {
  background: #ffffff !important;
}
html.dark.historial-white #sidebar-historial,
html.dark #sidebar-historial.historial-panel {
  background: #0a0a0a !important;
}
html.liquid-glass.historial-white #sidebar-historial {
  background: rgba(255, 255, 255, 0.92) !important;
}
html.dark.liquid-glass.historial-white #sidebar-historial {
  background: rgba(17, 17, 17, 0.92) !important;
}

/* Composer ?nico Gemini: limpio, p?ldora, sin anillo negro en el input */
#chat-drawer.gemini-chat .gemini-composer-wrap {
  border-top: none !important;
  background: transparent !important;
}
#chat-drawer.gemini-chat #chat-composer.gemini-composer,
html.liquid-glass #chat-drawer.gemini-chat #chat-composer.gemini-composer {
  border-radius: 9999px !important;
  border: none !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.dark #chat-drawer.gemini-chat #chat-composer.gemini-composer,
html.dark.liquid-glass #chat-drawer.gemini-chat #chat-composer.gemini-composer {
  background: #2a2a2a !important;
  border: none !important;
}
#chat-drawer.gemini-chat #chat-input,
#chat-drawer.gemini-chat .gemini-composer-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}
#chat-drawer.gemini-chat #btn-enviar-chat.gemini-send-btn,
html.liquid-glass #chat-drawer.gemini-chat #btn-enviar-chat.gemini-send-btn {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  overflow: hidden !important;
  position: relative !important;
}
#chat-drawer.gemini-chat #btn-enviar-chat.gemini-send-btn svg,
html.liquid-glass #chat-drawer.gemini-chat #btn-enviar-chat.gemini-send-btn svg,
html.liquid-glass:not(.dark) #chat-drawer #btn-enviar-chat svg {
  color: #111111 !important;
  fill: #111111 !important;
  stroke: none !important;
}
html.liquid-glass:not(.dark) #chat-drawer #btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg),
html.liquid-glass #chat-drawer #btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg),
html.liquid-glass:not(.dark) #chat-drawer #btn-chat-send #icon-chat-send:not(.hidden) path {
  color: #1F1F1F !important;
  stroke: #1F1F1F !important;
  fill: none !important;
  opacity: 1 !important;
}
html.dark.liquid-glass #chat-drawer #btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg):not(#icon-chat-send) {
  color: #a3a3a3 !important;
  stroke: #a3a3a3 !important;
  fill: none !important;
}
html.liquid-glass #chat-drawer #btn-chat-send #icon-chat-send.hidden,
html.liquid-glass #chat-drawer #btn-chat-send #icon-chat-stop.hidden,
html.liquid-glass #chat-drawer #btn-chat-send svg.hidden {
  display: none !important;
}
html.liquid-glass #chat-drawer #btn-chat-send #icon-chat-stop:not(.hidden),
html.liquid-glass #chat-drawer #btn-chat-send #icon-chat-stop:not(.hidden) rect {
  display: block !important;
  fill: #525252 !important;
  stroke: none !important;
}
html.dark.liquid-glass #chat-drawer #btn-chat-send #icon-chat-stop:not(.hidden),
html.dark.liquid-glass #chat-drawer #btn-chat-send #icon-chat-stop:not(.hidden) rect {
  display: block !important;
  fill: #a3a3a3 !important;
  stroke: none !important;
}
#chat-drawer.gemini-chat .gemini-chat-toolbar {
  border-bottom: none !important;
  box-shadow: none !important;
}
.chat-active-title {
  min-width: 0;
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-text, #171717);
  opacity: 0.9;
  transition: opacity 220ms ease, transform 220ms ease;
}
.chat-active-title.chat-title-flash,
.historial-item-title.historial-title-flash {
  animation: historial-title-in 420ms ease;
}
@keyframes historial-title-in {
  from { opacity: 0.35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ?? Esc?ner de conflictos de inter?s ?? */
.conflicto-semaforo {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid #e5e5e5;
  background: #fafafa;
}
.conflicto-semaforo-dot {
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.2rem;
  border-radius: 9999px;
  flex-shrink: 0;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.conflicto-semaforo[data-risk="AMARILLO"] .conflicto-semaforo-dot {
  background: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}
.conflicto-semaforo[data-risk="ROJO"] .conflicto-semaforo-dot {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}
.conflicto-semaforo[data-risk="VERDE"] {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}
.conflicto-semaforo[data-risk="AMARILLO"] {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.07);
}
.conflicto-semaforo[data-risk="ROJO"] {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}
.conflicto-match-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.conflicto-match-row[data-risk="ROJO"] {
  border-color: rgba(220, 38, 38, 0.28);
}
.conflicto-match-row[data-risk="AMARILLO"] {
  border-color: rgba(234, 179, 8, 0.35);
}
.conflicto-match-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border: 1px solid currentColor;
  color: #737373;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.conflicto-match-row[data-risk="ROJO"] .conflicto-match-badge {
  color: #dc2626;
}
.conflicto-match-row[data-risk="AMARILLO"] .conflicto-match-badge {
  color: #a16207;
}
.conflicto-scan-pulse {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 2px solid #e5e5e5;
  border-top-color: #171717;
  animation: conflicto-spin 0.7s linear infinite;
}
@keyframes conflicto-spin {
  to { transform: rotate(360deg); }
}
html.liquid-glass #modal-conflicto-interes > div {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

/* ?? Tracker de horas facturables (p?ldora en header) ?? */
.time-tracker-widget {
  position: relative;
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 0;
  height: 2.25rem;
  max-width: 5.75rem;
  padding: 0 0.15rem 0 0.2rem;
  background: transparent;
  border: 1px solid #e5e5e5;
  border-radius: 9999px;
  box-shadow: none;
  font-family: inherit;
  overflow: hidden;
  transition: max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.15s ease,
    border-color 0.15s ease,
    padding 0.22s ease;
}
html.auth-session .time-tracker-widget {
  display: inline-flex;
}
.time-tracker-widget:hover,
.time-tracker-widget:focus-within,
.time-tracker-widget.is-expanded {
  max-width: 14rem;
  padding-right: 0.3rem;
  background: #fafafa;
  border-color: #d4d4d4;
}
.time-tracker-widget.is-running {
  border-color: #171717;
}
.time-tracker-widget.is-running .time-tracker-icon {
  color: #171717;
  animation: time-tracker-pulse 1.6s ease-in-out infinite;
}
.time-tracker-widget.is-paused {
  border-color: #a3a3a3;
}
@keyframes time-tracker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.time-tracker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  padding: 0 0.55rem;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #171717;
  white-space: nowrap;
  border-radius: 9999px;
}
.time-tracker-toggle:hover {
  background: transparent;
}
.time-tracker-icon {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
  color: #525252;
  flex-shrink: 0;
}
.time-tracker-icon {
  overflow: visible;
}
.time-tracker-hand {
  transform-box: view-box;
  transform-origin: center;
}
.time-tracker-widget:hover .time-tracker-hand-hour,
.time-tracker-widget:focus-within .time-tracker-hand-hour,
.time-tracker-widget.is-expanded .time-tracker-hand-hour {
  animation: time-tracker-spin 1.6s linear infinite;
}
.time-tracker-widget:hover .time-tracker-hand-minute,
.time-tracker-widget:focus-within .time-tracker-hand-minute,
.time-tracker-widget.is-expanded .time-tracker-hand-minute {
  animation: time-tracker-spin 0.65s linear infinite;
}
@keyframes time-tracker-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.time-tracker-display {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #171717;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.time-tracker-status {
  display: none !important;
}
.time-tracker-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding-right: 0;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.time-tracker-widget:hover .time-tracker-actions,
.time-tracker-widget:focus-within .time-tracker-actions,
.time-tracker-widget.is-expanded .time-tracker-actions {
  opacity: 1;
  max-width: 6.5rem;
  padding-right: 0.15rem;
  pointer-events: auto;
}
.time-tracker-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e5e5;
  border-radius: 9999px;
  background: #fff;
  color: #171717;
  cursor: pointer;
  font-size: 0.55rem;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.time-tracker-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #d4d4d4;
}
.time-tracker-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.time-tracker-btn-stop {
  color: #dc2626;
}
.time-tracker-media-icon {
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  flex-shrink: 0;
}
.time-tracker-media-icon.hidden,
.time-tracker-media-icon[hidden] {
  display: none !important;
}
html.liquid-glass .time-tracker-widget {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}
html.liquid-glass .time-tracker-widget:hover,
html.liquid-glass .time-tracker-widget:focus-within,
html.liquid-glass .time-tracker-widget.is-expanded {
  background: rgba(255, 255, 255, 0.82);
}
html.dark .time-tracker-widget {
  border-color: #2a2a2a;
  background: transparent;
}
html.dark .time-tracker-widget:hover,
html.dark .time-tracker-widget:focus-within,
html.dark .time-tracker-widget.is-expanded {
  background: #1a1a1a;
  border-color: #404040;
}
html.dark .time-tracker-widget.is-running {
  border-color: #fafafa;
}
html.dark .time-tracker-toggle,
html.dark .time-tracker-display,
html.dark .time-tracker-btn {
  color: #fafafa;
}
html.dark .time-tracker-icon {
  color: #a3a3a3;
}
html.dark .time-tracker-btn {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .time-tracker-btn:hover:not(:disabled) {
  background: #262626;
  border-color: #404040;
}
html.dark .time-tracker-btn-stop {
  color: #f87171;
}
@media (max-width: 640px) {
  .time-tracker-widget {
    max-width: 5.25rem;
  }
  .time-tracker-display {
    font-size: 0.6875rem;
  }
}

/* ?? Men? ? gestor documental / firma ?? */
.erp-doc-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 13.5rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  box-shadow: none;
  padding: 0.25rem;
}
.erp-doc-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #171717;
  background: transparent;
  border: none;
  cursor: pointer;
}
.erp-doc-menu-item:hover {
  background: #f5f5f5;
}
.erp-doc-row .relative {
  position: relative;
}

/* ?? Detalle: pesta?as Documentos / Comunicaciones / Notas ?? */
.detalle-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0;
}
.detalle-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #737373;
  cursor: pointer;
}
.detalle-tab:hover {
  color: #171717;
}
.ficha-exp-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
.ficha-exp-slot {
  min-width: 0;
}
@media (min-width: 640px) {
  .ficha-exp-row {
    flex-direction: row;
    align-items: center;
  }
  .ficha-exp-slot {
    flex: 1 1 0;
    text-align: center;
  }
  .ficha-exp-slot:first-child {
    text-align: left;
  }
}
#view-detalle-cliente .detalle-tab-panel .btn-secondary:not(.w-8),
#view-detalle-cliente .detalle-accion {
  border-radius: 999px !important;
  padding: 0.45rem 1.05rem !important;
  font-size: 0.8125rem !important;
  line-height: 1.2 !important;
  font-weight: 500 !important;
  min-height: 0 !important;
  transition: transform 150ms cubic-bezier(0, 0, 0.2, 1), background-color 0.15s ease, border-color 0.15s ease !important;
}
#view-detalle-cliente .detalle-tab-panel .btn-primary:not(.w-8):hover,
#view-detalle-cliente .detalle-tab-panel .btn-secondary:not(.w-8):hover,
#view-detalle-cliente .detalle-accion:hover {
  transform: translateY(2px) scale(0.98) !important;
}
.detalle-tab.is-active {
  color: #0a0a0a;
  border-bottom-color: #0a0a0a;
}
.detalle-tab-panel.hidden,
.detalle-tab-panel[hidden],
#form-detalle-plazo-rapido[hidden],
#detalle-lista-plazos[hidden],
#btn-anadir-plazo-detalle.hidden {
  display: none !important;
}

/* Timeline conversacional de emails */
.com-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 28rem;
  overflow-y: auto;
  padding: 0.25rem 0.15rem 0.5rem;
}
.com-bubble {
  max-width: min(100%, 36rem);
  padding: 0.85rem 1rem;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.com-bubble.is-in {
  align-self: flex-start;
  border-left: 3px solid #171717;
  background: #fafafa;
}
.com-bubble.is-out {
  align-self: flex-end;
  border-right: 3px solid #525252;
  background: #f5f5f5;
}
.com-bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: #737373;
  margin-bottom: 0.35rem;
}
.com-bubble-from {
  font-weight: 600;
  color: #404040;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.com-bubble-subject {
  font-size: 0.875rem;
  font-weight: 650;
  color: #171717;
  margin: 0 0 0.35rem;
}
.com-bubble-body {
  font-size: 0.8125rem;
  color: #404040;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
}
.com-bubble-to {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  color: #a3a3a3;
}

/* Nuevo cliente — teléfono compuesto (misma caja que el resto de inputs) */
.cliente-phone-compose {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.35rem;
  border-radius: 0.5rem !important;
  box-shadow: none !important;
}
.cliente-phone-compose:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border-color: var(--app-border) !important;
}
html.dark .cliente-phone-compose:focus-within {
  border-color: #404040 !important;
}
#nuevo-cliente-prefijo.cliente-phone-prefix,
#nuevo-cliente-telefono.cliente-phone-number,
.cliente-phone-prefix,
.cliente-phone-number {
  border: none !important;
  border-color: transparent !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}
#nuevo-cliente-prefijo.cliente-phone-prefix:focus,
#nuevo-cliente-telefono.cliente-phone-number:focus,
#nuevo-cliente-prefijo.cliente-phone-prefix:focus-visible,
#nuevo-cliente-telefono.cliente-phone-number:focus-visible,
.cliente-phone-prefix:focus,
.cliente-phone-number:focus {
  outline: none !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.cliente-phone-prefix {
  padding: 0;
  padding-right: 0.25rem;
  font-size: 0.875rem;
  max-width: 7.5rem;
  color: #171717;
  border-radius: 0 !important;
  flex-shrink: 0;
}
.cliente-phone-mask-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.cliente-phone-mask,
.cliente-phone-number {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  letter-spacing: 0.04em;
}
.cliente-phone-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
}
.cliente-phone-ghost {
  color: #9ca3af !important;
  -webkit-text-fill-color: #9ca3af !important;
  font-weight: 400;
}
.cliente-phone-digit,
.cliente-phone-sep {
  color: #171717 !important;
  -webkit-text-fill-color: #171717 !important;
}
.cliente-phone-number {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  caret-color: #171717;
  background: transparent !important;
  background-color: transparent !important;
}
.cliente-phone-number::selection,
.cliente-phone-number::-moz-selection {
  background: transparent !important;
  color: transparent !important;
}
#nuevo-cliente-telefono.cliente-phone-number:-webkit-autofill,
#nuevo-cliente-telefono.cliente-phone-number:-webkit-autofill:hover,
#nuevo-cliente-telefono.cliente-phone-number:-webkit-autofill:focus {
  -webkit-text-fill-color: transparent !important;
  caret-color: #171717;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-out;
}
@keyframes cliente-autofill { from { opacity: 1; } to { opacity: 1; } }
#form-nuevo-cliente input:not(.cliente-phone-number):-webkit-autofill,
#form-nuevo-cliente input:not(.cliente-phone-number):-webkit-autofill:hover,
#form-nuevo-cliente input:not(.cliente-phone-number):-webkit-autofill:focus {
  -webkit-text-fill-color: #171717 !important;
  caret-color: #171717;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  background-color: #ffffff !important;
  transition: background-color 99999s ease-out;
  animation-name: cliente-autofill;
  animation-duration: 0.01s;
}
#form-nuevo-cliente input.is-completo:not(.is-invalid),
#form-nuevo-cliente input.is-completo:not(.is-invalid):focus,
#form-nuevo-cliente input.is-completo:not(.is-invalid):focus-visible,
#form-nuevo-cliente .cliente-phone-compose.is-completo {
  border-color: #16a34a !important;
}
#form-nuevo-cliente .cliente-phone-compose.is-incompleto {
  border-color: #dc2626 !important;
}
html.dark #form-nuevo-cliente input:not(.cliente-phone-number):-webkit-autofill,
html.dark #form-nuevo-cliente input:not(.cliente-phone-number):-webkit-autofill:hover,
html.dark #form-nuevo-cliente input:not(.cliente-phone-number):-webkit-autofill:focus {
  -webkit-text-fill-color: #fafafa !important;
  caret-color: #fafafa;
  box-shadow: 0 0 0 1000px #171717 inset !important;
  background-color: #171717 !important;
}
html.dark #form-nuevo-cliente input.is-completo:not(.is-invalid),
html.dark #form-nuevo-cliente input.is-completo:not(.is-invalid):focus,
html.dark #form-nuevo-cliente .cliente-phone-compose.is-completo {
  border-color: #4ade80 !important;
}
html.dark #form-nuevo-cliente .cliente-phone-compose.is-incompleto {
  border-color: #f87171 !important;
}
#form-nuevo-cliente .cliente-phone-compose:focus-within {
  border-color: var(--app-border) !important;
}
html.dark #form-nuevo-cliente .cliente-phone-compose:focus-within {
  border-color: #404040 !important;
}
html.dark .cliente-phone-prefix {
  color: #fafafa;
}
html.dark .cliente-phone-digit,
html.dark .cliente-phone-sep {
  color: #fafafa;
}
html.dark .cliente-phone-ghost {
  color: #737373;
  -webkit-text-fill-color: #737373;
}
html.dark .cliente-phone-number {
  caret-color: #fafafa;
  -webkit-text-fill-color: transparent;
}
#form-nuevo-cliente #nuevo-cliente-nif.is-completo:not(.is-invalid):focus,
#form-nuevo-cliente #nuevo-cliente-nif.is-completo:not(.is-invalid):focus-visible {
  border-color: var(--app-border) !important;
}
html.dark #form-nuevo-cliente #nuevo-cliente-nif.is-completo:not(.is-invalid):focus,
html.dark #form-nuevo-cliente #nuevo-cliente-nif.is-completo:not(.is-invalid):focus-visible {
  border-color: #404040 !important;
}
#nuevo-cliente-nif.is-invalid,
#nuevo-cliente-nif.is-invalid:focus,
#nuevo-cliente-nif.is-invalid:focus-visible {
  border-color: #dc2626 !important;
}

/* Google-style custom select (casilla que se expande en bloque único) */
.g-select {
  position: relative;
  width: 100%;
  z-index: 1;
}
.g-select.is-open {
  z-index: 80;
}
.g-select.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.g-select.g-select-compact {
  width: auto;
  min-width: 9.5rem;
  max-width: 100%;
}
.g-select.g-select-inline {
  width: auto;
  min-width: 8rem;
  max-width: 12rem;
  align-self: center;
  overflow: visible;
}
.g-select.g-select-dense {
  width: 100%;
}
.g-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: none !important;
  background-image: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
.g-select-panel {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 24px;
  background: #fff;
  overflow: visible;
  box-shadow: none;
  transition: box-shadow 0.15s ease;
}
.g-select.is-open .g-select-panel {
  border: none;
  box-shadow: none;
  overflow: visible;
}
.g-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #171717;
  text-align: left;
  cursor: pointer;
  outline: none;
}
.g-select.is-open .g-select-trigger {
  border-radius: 0.75rem;
}
.g-select-trigger:focus-visible {
  outline: none;
}
.g-select:not(.is-open) .g-select-panel:focus-within {
  border: none;
  box-shadow: none;
}
.g-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-select-chevron {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  color: #6b7280;
  transition: transform 0.15s ease;
  display: inline-flex;
  transform: rotate(-90deg);
}
.g-select-chevron svg {
  width: 11px;
  height: 11px;
  display: block;
}
.g-select.g-select-pegado,
.g-select.g-select-pegado .g-select-panel {
  width: max-content;
  max-width: 100%;
}
.g-select.g-select-pegado .g-select-trigger {
  width: auto;
  justify-content: flex-start;
  gap: 0.35rem;
  padding-right: 0.15rem;
}
.g-select.g-select-pegado .g-select-value {
  flex: 0 1 auto;
}
.g-select.g-select-pegado .g-select-list {
  width: max-content;
  min-width: max(100%, 14rem);
}
.g-select.g-select-pegado .g-select-option {
  white-space: nowrap;
}
.detalle-ficha-etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: auto;
  cursor: pointer;
}
.g-select.is-open .g-select-chevron,
.detalle-ficha-etiqueta.is-open .g-select-chevron {
  transform: rotate(0deg);
}
.g-select.g-select-sin-flecha .g-select-trigger {
  width: auto;
  max-width: 100%;
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 0;
}
.g-select-list {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 60;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  border: none;
  border-radius: 24px;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}
.g-select.is-open .g-select-list {
  display: block;
  max-height: 16rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.g-select-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.g-select.g-select-compact .g-select-trigger {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}
.g-select.g-select-compact .g-select-option {
  padding: 0.9rem 1.1rem;
  font-size: 0.8125rem;
}
.g-select.g-select-dense .g-select-trigger {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.g-select.g-select-dense .g-select-option {
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
}
.g-select.g-select-inline .g-select-panel {
  border: none;
  background: transparent;
}
.g-select.g-select-inline.is-open .g-select-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}
.g-select.g-select-inline .g-select-list {
  top: calc(100% - 0.2rem);
  min-width: max(100%, 16.5rem);
  width: max-content;
  max-width: 22rem;
}
.g-select-option {
  padding: 0.9rem 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #111;
  cursor: pointer;
  user-select: none;
  background: #fff;
}
.g-select-option:hover,
.g-select-option.is-active {
  background: #fafafa;
}
.calc-bancaria-actions-dash {
  position: relative;
  z-index: 2;
}
.calc-bancaria-exp-list {
  display: block;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  width: auto;
  max-height: 16rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  border: 1px solid #E5E7EB;
  border-radius: 24px;
  background: #fff;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-canvas="calculadora-bancaria"],
[data-canvas="calculadora-bancaria"] .calc-bancaria-grid,
[data-canvas="calculadora-bancaria"] .calc-bancaria-col,
[data-canvas="calculadora-bancaria"] .calc-bancaria-col-dash,
[data-canvas="calculadora-bancaria"] .calc-bancaria-resultados {
  overflow: visible;
}
.calc-bancaria-exp-list .g-select-option {
  display: block;
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  font: inherit;
  text-align: left;
}
.g-select-option[aria-selected="true"] {
  background: #f4f5f7;
  font-weight: 500;
}
.g-select-option[aria-selected="true"]:hover,
.g-select-option[aria-selected="true"].is-active {
  background: #f4f5f7;
}
.g-select-option[aria-disabled="true"] {
  color: #a3a3a3;
  cursor: default;
  pointer-events: none;
}
.g-select:has(#tpl-caso-select) .g-select-option[data-value=""] {
  border-bottom: 1px solid #111827;
}
html.dark .g-select-panel {
  background: #0a0a0a;
  border: none;
}
html.dark .g-select.is-open .g-select-panel {
  border: none;
  box-shadow: none;
}
html.dark .g-select-trigger,
html.dark .g-select-option {
  color: #fafafa;
}
html.dark .g-select-chevron {
  color: #a3a3a3;
}
html.dark .g-select:not(.is-open) .g-select-panel:focus-within {
  border: none;
}
html.dark .g-select-list {
  background: #171717;
  box-shadow: none;
}
html.dark .g-select-option {
  background: #171717;
}
html.dark .g-select-option:hover,
html.dark .g-select-option.is-active {
  background: #262626;
}
html.dark .g-select-option[aria-selected="true"],
html.dark .g-select-option[aria-selected="true"]:hover,
html.dark .g-select-option[aria-selected="true"].is-active {
  background: #262626;
}
html.dark .g-select:has(#tpl-caso-select) .g-select-option[data-value=""] {
  border-bottom-color: #fafafa;
}
html.dark .g-select.g-select-inline.is-open .g-select-panel {
  background: transparent;
  border: none;
  box-shadow: none;
}
html.dark .g-select.g-select-inline .g-select-list {
  background: #171717;
  border: none;
  box-shadow: none;
}

/* Selects de alta: misma caja que los inputs del modal */
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-panel,
#modal-nuevo-caso-lso .g-select-panel,
#modal-nuevo-expediente .g-select-panel,
#modal-invitar-miembro .g-select-panel,
#modal-nuevo-cliente .g-select-panel {
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #fff;
}
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select.is-open .g-select-panel,
#modal-nuevo-caso-lso .g-select.is-open .g-select-panel,
#modal-nuevo-expediente .g-select.is-open .g-select-panel,
#modal-invitar-miembro .g-select.is-open .g-select-panel,
#modal-nuevo-cliente .g-select.is-open .g-select-panel,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-panel:focus-within,
#modal-nuevo-caso-lso .g-select-panel:focus-within,
#modal-nuevo-expediente .g-select-panel:focus-within,
#modal-invitar-miembro .g-select-panel:focus-within,
#modal-nuevo-cliente .g-select-panel:focus-within,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) input:focus,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) input:focus-visible,
#modal-nuevo-caso-lso input:focus,
#modal-nuevo-caso-lso input:focus-visible,
#modal-nuevo-expediente input:focus,
#modal-nuevo-expediente input:focus-visible,
#modal-invitar-miembro input:focus,
#modal-invitar-miembro input:focus-visible,
#modal-nuevo-cliente input:focus,
#modal-nuevo-cliente input:focus-visible,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-trigger:focus,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-trigger:focus-visible,
#modal-nuevo-caso-lso .g-select-trigger:focus,
#modal-nuevo-caso-lso .g-select-trigger:focus-visible,
#modal-nuevo-expediente .g-select-trigger:focus,
#modal-nuevo-expediente .g-select-trigger:focus-visible,
#modal-invitar-miembro .g-select-trigger:focus,
#modal-invitar-miembro .g-select-trigger:focus-visible,
#modal-nuevo-cliente .g-select-trigger:focus,
#modal-nuevo-cliente .g-select-trigger:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: #e5e5e5 !important;
}
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-trigger,
#modal-nuevo-caso-lso .g-select-trigger,
#modal-nuevo-expediente .g-select-trigger,
#modal-invitar-miembro .g-select-trigger,
#modal-nuevo-cliente .g-select-trigger {
  min-height: 2.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  letter-spacing: 0;
  color: #171717;
}
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-value,
#modal-nuevo-caso-lso .g-select-value,
#modal-nuevo-expediente .g-select-value,
#modal-invitar-miembro .g-select-value,
#modal-nuevo-cliente .g-select-value {
  font-size: 0.875rem;
  font-weight: 400;
}
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-chevron,
#modal-nuevo-caso-lso .g-select-chevron,
#modal-nuevo-expediente .g-select-chevron,
#modal-invitar-miembro .g-select-chevron,
#modal-nuevo-cliente .g-select-chevron {
  width: 11px;
  height: 11px;
  color: #737373;
  transform: rotate(-90deg);
}
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-chevron svg,
#modal-nuevo-caso-lso .g-select-chevron svg,
#modal-nuevo-expediente .g-select-chevron svg,
#modal-invitar-miembro .g-select-chevron svg,
#modal-nuevo-cliente .g-select-chevron svg {
  width: 11px;
  height: 11px;
}
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select.is-open .g-select-chevron,
#modal-nuevo-caso-lso .g-select.is-open .g-select-chevron,
#modal-nuevo-expediente .g-select.is-open .g-select-chevron,
#modal-invitar-miembro .g-select.is-open .g-select-chevron,
#modal-nuevo-cliente .g-select.is-open .g-select-chevron {
  transform: rotate(0deg);
}
#modal-nuevo-caso-lso .g-select-list,
#modal-nuevo-expediente .g-select-list,
#modal-invitar-miembro .g-select-list,
#modal-nuevo-cliente .g-select-list,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-list {
  border: 1px solid #E5E7EB;
  border-radius: 24px;
  background: #fff !important;
  box-shadow: none !important;
  padding: 0.45rem;
  overflow: hidden;
}
#modal-nuevo-caso-lso .g-select-option,
#modal-nuevo-expediente .g-select-option,
#modal-invitar-miembro .g-select-option,
#modal-nuevo-cliente .g-select-option,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-option {
  border-radius: 1.15rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #171717;
  background: transparent !important;
}
#modal-nuevo-caso-lso .g-select-option[aria-selected="true"],
#modal-nuevo-expediente .g-select-option[aria-selected="true"],
#modal-invitar-miembro .g-select-option[aria-selected="true"],
#modal-nuevo-cliente .g-select-option[aria-selected="true"],
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-option[aria-selected="true"] {
  font-weight: 500;
  background: transparent !important;
}
#modal-nuevo-caso-lso .g-select-option:hover,
#modal-nuevo-expediente .g-select-option:hover,
#modal-invitar-miembro .g-select-option:hover,
#modal-nuevo-cliente .g-select-option:hover,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-option:hover {
  background: transparent !important;
}
#modal-nuevo-caso-lso .g-select-option.is-active,
#modal-nuevo-expediente .g-select-option.is-active,
#modal-invitar-miembro .g-select-option.is-active,
#modal-nuevo-cliente .g-select-option.is-active,
:is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-option.is-active {
  background: #f4f4f5 !important;
  font-weight: 400;
}
#view-detalle-cliente .g-select-list,
#detalle-cliente-select-list,
#detalle-estado-select-list,
#lso-fase-select-list,
#lso-slideover-caso .g-select-list,
#view-expediente-lso .g-select-list {
  z-index: 50;
  border: 1px solid rgb(226 232 240 / 0.9) !important;
  border-radius: 1rem !important;
  background: #fff !important;
  box-shadow: 0 20px 25px -5px rgb(15 23 42 / 0.12), 0 8px 10px -6px rgb(15 23 42 / 0.08) !important;
  padding: 0.375rem !important;
  overflow: hidden;
}
#view-detalle-cliente .g-select-option,
#detalle-cliente-select-list .g-select-option,
#detalle-estado-select-list .g-select-option,
#lso-fase-select-list .g-select-option,
#lso-slideover-caso .g-select-option,
#view-expediente-lso .g-select-option {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #1e293b;
  background: transparent !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
#view-detalle-cliente .g-select-option[aria-selected="true"],
#detalle-cliente-select-list .g-select-option[aria-selected="true"],
#detalle-estado-select-list .g-select-option[aria-selected="true"],
#lso-fase-select-list .g-select-option[aria-selected="true"],
#lso-slideover-caso .g-select-option[aria-selected="true"],
#view-expediente-lso .g-select-option[aria-selected="true"] {
  font-weight: 500;
  background: transparent !important;
}
#view-detalle-cliente .g-select-option:hover,
#detalle-cliente-select-list .g-select-option:hover,
#detalle-estado-select-list .g-select-option:hover,
#lso-fase-select-list .g-select-option:hover,
#lso-slideover-caso .g-select-option:hover,
#view-expediente-lso .g-select-option:hover,
#view-detalle-cliente .g-select-option.is-active,
#detalle-cliente-select-list .g-select-option.is-active,
#detalle-estado-select-list .g-select-option.is-active,
#lso-fase-select-list .g-select-option.is-active,
#lso-slideover-caso .g-select-option.is-active,
#view-expediente-lso .g-select-option.is-active {
  background: #f8fafc !important;
  font-weight: 400;
}
#nuevo-caso-bancario-cuantia,
#nuevo-caso-deuda {
  -moz-appearance: textfield;
  appearance: textfield;
}
#nuevo-caso-bancario-cuantia::-webkit-inner-spin-button,
#nuevo-caso-bancario-cuantia::-webkit-outer-spin-button,
#nuevo-caso-deuda::-webkit-inner-spin-button,
#nuevo-caso-deuda::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0;
  display: none;
}
html.dark :is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-panel,
html.dark #modal-nuevo-caso-lso .g-select-panel,
html.dark #modal-nuevo-expediente .g-select-panel,
html.dark #modal-invitar-miembro .g-select-panel,
html.dark #modal-nuevo-cliente .g-select-panel,
html.dark :is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-list,
html.dark #modal-nuevo-caso-lso .g-select-list,
html.dark #modal-nuevo-expediente .g-select-list,
html.dark #modal-invitar-miembro .g-select-list,
html.dark #modal-nuevo-cliente .g-select-list {
  background: #0a0a0a;
  border-color: #404040;
}
html.dark :is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-trigger,
html.dark #modal-nuevo-caso-lso .g-select-trigger,
html.dark #modal-nuevo-expediente .g-select-trigger,
html.dark #modal-invitar-miembro .g-select-trigger,
html.dark #modal-nuevo-cliente .g-select-trigger,
html.dark :is(#modal-nuevo-caso-extranjeria, #modal-nuevo-caso-bancario) .g-select-value,
html.dark #modal-nuevo-caso-lso .g-select-value,
html.dark #modal-nuevo-expediente .g-select-value,
html.dark #modal-invitar-miembro .g-select-value,
html.dark #modal-nuevo-cliente .g-select-value {
  color: #fafafa;
}

.cliente-verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #166534;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  padding: 0.15rem 0.45rem;
}
.cliente-verify-badge.is-inline {
  margin-left: 0.35rem;
  vertical-align: middle;
}
.cliente-verify-badge.hidden {
  display: none;
}

/* ============================================================
   LAYOUT SIDEBAR (estilo Vercel)
   Columna fija de navegaci?n + ?rea principal fluida.
   ============================================================ */
:root {
  --erp-sidebar-width: 16rem;
  --lexia-elev-ink: 32 33 36;
  --lexia-elev-x: 0px;
  --lexia-elev-y: 1px;
  --lexia-elev-blur: 6px;
  --lexia-elev-soft: 8px;
  --lexia-elev-fade-blur: 12px;
  --lexia-elev-spread: 0px;
  --lexia-elev-shadow: none;
  --lexia-elev-shadow-active: none;
  --app-shadow-google: none;
  --app-shadow-google-active: none;
}
html.dark {
  --lexia-elev-ink: 0 0 0;
  --lexia-elev-shadow: none;
  --lexia-elev-shadow-active: none;
  --app-shadow-google: none;
  --app-shadow-google-active: none;
}
.shadow-google,
.shadow-google-active {
  box-shadow: none !important;
}

.erp-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  pointer-events: auto;
  display: none;
  flex-direction: column;
  width: var(--erp-sidebar-width);
  box-sizing: border-box;
  background: #F1F5F9;
  border-right: 1px solid #E2E8F0;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
html.auth-session .erp-sidebar {
  display: flex;
  pointer-events: auto;
}
.erp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--app-header-height);
  padding: 0 0.9rem;
  border-bottom: none;
  flex-shrink: 0;
}
.erp-sidebar-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.erp-sidebar-header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.erp-sidebar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.erp-sidebar-brand {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #0F172A;
  white-space: nowrap;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s ease;
}
.erp-sidebar-brand:hover {
  transform: translateY(-2px);
}
.erp-sidebar-close {
  display: none;
  margin-left: auto;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #525252;
  border-radius: 0.5rem;
  cursor: pointer;
}
.erp-sidebar-close:hover {
  background: #f5f5f5;
}
.erp-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.erp-sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.erp-sidebar-nav-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.erp-sidebar-nav-stack::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.erp-sidebar-nav-stack.hidden {
  display: none !important;
}
.erp-niche-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #0a0a0a;
  text-align: center;
  flex-shrink: 0;
}
.erp-niche-selector-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #c4c4c8;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  transition: color 0.15s ease;
}
.erp-niche-selector-arrow:hover,
.erp-niche-selector-arrow:focus-visible {
  background: transparent;
  color: #71717a;
  outline: none;
}
.erp-niche-selector-label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  min-width: 0;
  flex: 1 1 auto;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-wrap: balance;
  white-space: normal;
  color: #0a0a0a;
}
.erp-niche-selector-label.is-switching {
  animation: erp-nicho-swap 0.22s ease;
}
@keyframes erp-nicho-swap {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.erp-niche-selector-chevron {
  display: none;
}
html.dark .erp-niche-selector {
  background: transparent;
  color: #fafafa;
}
html.dark .erp-niche-selector-arrow {
  color: #52525b;
}
html.dark .erp-niche-selector-arrow:hover,
html.dark .erp-niche-selector-arrow:focus-visible {
  background: transparent;
  color: #a1a1aa;
}
html.dark .erp-niche-selector-chevron {
  color: #a3a3a3;
}
html.vista-erp-ajustes #btn-selector-nicho,
html.vista-erp-ajustes .erp-niche-switcher {
  display: none !important;
}
html.vista-erp-plantillas #btn-selector-nicho,
html.vista-erp-plantillas .erp-niche-switcher {
  display: none !important;
}
html.vista-erp-ajustes #nav-principal {
  display: none !important;
}
html.vista-erp-ajustes #nav-ajustes {
  display: flex !important;
}
html.vista-erp-plantillas #nav-principal {
  display: none !important;
}
html.vista-erp-plantillas #nav-plantillas {
  display: flex !important;
}
#nav-ajustes-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0.2rem 0.75rem;
}
#view-ajustes #settings-local-nav,
.settings-local-nav {
  display: none !important;
}
.erp-settings-back {
  font-weight: 600 !important;
  color: #0a0a0a !important;
  margin-bottom: 0.25rem;
}
.erp-settings-back-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.75rem;
  min-height: 2.45rem;
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.011em;
  color: #0a0a0a;
}
.erp-settings-back-row > span {
  pointer-events: none;
  user-select: none;
  color: #0a0a0a;
}
.erp-settings-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #D1D5DB;
  cursor: pointer;
  line-height: 0;
  transition: color 0.15s ease;
}
.erp-settings-back-btn:hover,
.erp-settings-back-btn:active,
.erp-settings-back-btn:focus {
  background: transparent;
  color: #4B5563;
}
.erp-settings-back-btn .nav-item-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  color: inherit;
}
#nav-plantillas .erp-sidebar-tpl-list {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding-top: 0.35rem;
  padding-bottom: 0.65rem;
}
#nav-plantillas,
#nav-plantillas .erp-sidebar-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#nav-plantillas::-webkit-scrollbar,
#nav-plantillas .erp-sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
html.vista-erp-ajustes .erp-sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
}
html.dark.vista-erp-ajustes .erp-sidebar {
  background: #0a0a0a !important;
  border-right-color: #262626 !important;
}
#nav-ajustes .settings-group-tab {
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  font-weight: 400;
  border-radius: 0.5rem !important;
  color: #475569;
}
#nav-ajustes .settings-group-tab:hover {
  background: #f8fafc !important;
  color: #1e293b !important;
}
#nav-ajustes .settings-group-tab[aria-selected="true"],
#nav-ajustes .settings-group-tab.is-active {
  border: none !important;
  border-left: none !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  border-radius: 0.5rem !important;
}
html.dark #nav-ajustes .settings-group-tab[aria-selected="true"],
html.dark #nav-ajustes .settings-group-tab.is-active {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
  -webkit-text-fill-color: #93c5fd !important;
}
html.dark #nav-ajustes .settings-group-tab[aria-selected="true"] span,
html.dark #nav-ajustes .settings-group-tab.is-active span,
html.dark #nav-ajustes .settings-group-tab[aria-selected="true"] i,
html.dark #nav-ajustes .settings-group-tab.is-active i,
html.dark #nav-ajustes .settings-group-tab[aria-selected="true"] svg,
html.dark #nav-ajustes .settings-group-tab.is-active svg {
  color: #93c5fd !important;
  -webkit-text-fill-color: #93c5fd !important;
  stroke: #93c5fd !important;
}
.erp-sidebar-label {
  margin: 0.7rem 0 0.3rem 0.65rem;
  font-size: 0.75rem; /* text-xs */
  font-weight: 500; /* font-medium */
  letter-spacing: 0.08em; /* tracking-wider */
  text-transform: uppercase;
  color: #9CA3AF; /* gray-400 */
  line-height: 1.25;
}
.erp-sidebar-label:first-child {
  margin-top: 0.1rem;
}
.erp-sidebar .vercel-nav-item {
  color: #6B7280;
  padding: 0.58rem 0.75rem;
  border-radius: 0.625rem !important;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.011em;
  gap: 0.7rem;
  min-height: 2.45rem;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  outline: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 300ms cubic-bezier(0.23, 1, 0.32, 1), color 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.erp-sidebar .vercel-nav-item:active {
  transform: translateX(0.25rem);
}
.erp-sidebar .vercel-nav-item:focus,
.erp-sidebar .vercel-nav-item:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}
.erp-sidebar .outline-none {
  outline: none;
}
.erp-sidebar .focus\:outline-none:focus {
  outline: none;
}
.erp-sidebar .focus-visible\:outline-none:focus-visible {
  outline: none;
}
.erp-sidebar .focus-visible\:ring-0:focus-visible {
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  box-shadow: none;
}
.erp-sidebar .focus-visible\:ring-offset-0:focus-visible {
  --tw-ring-offset-width: 0px;
}
.erp-sidebar .vercel-nav-item i,
.erp-sidebar .vercel-nav-item .nav-item-icon {
  color: #9CA3AF; /* gray-400 icons inactivos */
  opacity: 1;
}
.erp-sidebar .vercel-nav-item:hover {
  color: #18181b;
  background: rgb(244 244 245 / 0.8);
  transform: translateX(0.25rem);
}
.erp-sidebar .vercel-nav-item.is-active:hover {
  background: #EDEEF1;
  transform: translateX(0.25rem);
}
.erp-sidebar .vercel-nav-item:hover i,
.erp-sidebar .vercel-nav-item:hover .nav-item-icon {
  color: #0F172A;
}
.erp-sidebar .vercel-nav-item.is-active {
  color: #0F172A;
  background: #FFFFFF;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  box-shadow: none;
}
.erp-sidebar .vercel-nav-item.is-active i,
.erp-sidebar .vercel-nav-item.is-active .nav-item-icon {
  color: #0F172A;
}
.vercel-nav-item .nav-item-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  display: block;
  overflow: visible;
  transform-box: fill-box;
  transition: transform 300ms ease-out;
}
.erp-sidebar .vercel-nav-item i {
  width: 1.25rem;
  font-size: 1.05rem;
  text-align: center;
}

.erp-sidebar .vercel-nav-item .nav-item-icon {
  overflow: visible;
  shape-rendering: geometricPrecision;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.erp-sidebar .vercel-nav-item:hover .nav-item-icon {
  transform: translateY(-1px);
}
#nav-erp-expedientes:hover .nav-item-icon,
#nav-erp-agenda:hover .nav-item-icon,
#nav-erp-lexnet:hover .nav-item-icon,
#nav-erp-test-insolvencia:hover .nav-item-icon,
#nav-erp-calculadora-bancaria:hover .nav-item-icon,
#nav-erp-plantillas:hover .nav-item-icon,
#nav-erp-facturacion:hover .nav-item-icon,
#nav-erp-dashboard:hover .nav-item-icon,
#nav-erp-clientes:hover .nav-item-icon,
#nav-erp-buscador-boe:hover .nav-item-icon,
#nav-erp-email .nav-item-icon {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#nav-erp-email:hover .nav-item-icon {
  transform: translateY(-1px);
}
#nav-erp-email {
  overflow: visible;
}
#nav-erp-email .nav-icon-mail {
  overflow: visible;
}
#nav-erp-email .mail-flap {
  transform-box: view-box;
  transform-origin: 12px 7px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#nav-erp-email:hover .mail-flap {
  transform: translateY(-3px) scaleY(-1);
  transition: transform 1.25s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}
#nav-erp-email .mail-letter-face {
  fill: #ffffff;
  stroke: currentColor;
}
html.dark #nav-erp-email .mail-letter-face {
  fill: #18181b;
}
#nav-erp-email .mail-letter {
  transform-box: view-box;
  transform-origin: 12px 4px;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.35s ease;
}
#nav-erp-email:hover .mail-letter {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease 1.55s, transform 1s cubic-bezier(0.22, 1, 0.36, 1) 1.55s;
}
#nav-erp-email .mail-pocket {
  opacity: 0;
  transition: opacity 0.2s ease;
}
#nav-erp-email:hover .mail-pocket {
  opacity: 1;
  transition: opacity 0.4s ease 0.45s;
}
.nav-icon-folder .folder-sheet {
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}
#nav-erp-expedientes:hover .folder-sheet {
  opacity: 1;
}

#nav-erp-lexnet .nav-icon-inbox {
  overflow: hidden;
}
#nav-erp-lexnet .inbox-letter {
  transform-box: view-box;
  transform-origin: 12px 4px;
  transform: translate(22px, -20px) rotate(42deg);
  opacity: 1;
  pointer-events: none;
  transition: transform 0.2s ease;
}
#nav-erp-lexnet:hover .inbox-letter {
  transform: translate(1.4px, 8.4px) rotate(28deg);
  transition: transform 0.7s cubic-bezier(0.22, 0.55, 0.25, 1);
}
#nav-erp-lexnet .inbox-letter-face {
  fill: #ffffff;
  fill-opacity: 1;
  stroke: currentColor;
}
#nav-erp-lexnet.is-active .inbox-letter-face {
  fill: #ffffff;
}
html.dark #nav-erp-lexnet .inbox-letter-face,
html.dark #nav-erp-lexnet:hover .inbox-letter-face,
html.dark #nav-erp-lexnet.is-active .inbox-letter-face {
  fill: #18181b;
  fill-opacity: 1;
}

#nav-erp-test-insolvencia .scale-tilt {
  transform-box: view-box;
  transform-origin: 12px 5px;
  transform: rotate(0deg);
  transition: transform 0.7s cubic-bezier(0.22, 1.12, 0.36, 1);
}
#nav-erp-test-insolvencia:hover .scale-tilt {
  animation: scale-tilt-cycle 1.4s cubic-bezier(0.22, 1.12, 0.36, 1) 1 forwards;
}

#nav-erp-calculadora-bancaria .calc-key {
  fill: currentColor;
  fill-opacity: 1;
  transform-box: fill-box;
  transform-origin: center;
}
#nav-erp-calculadora-bancaria .calc-key-enter {
  fill: none;
}
#nav-erp-calculadora-bancaria:hover .calc-key-1 { animation: calc-key-press 0.22s ease 0s 1; }
#nav-erp-calculadora-bancaria:hover .calc-key-2 { animation: calc-key-press 0.22s ease 0.16s 1; }
#nav-erp-calculadora-bancaria:hover .calc-key-4 { animation: calc-key-press 0.22s ease 0.32s 1; }
#nav-erp-calculadora-bancaria:hover .calc-key-5 { animation: calc-key-press 0.22s ease 0.48s 1; }
#nav-erp-calculadora-bancaria:hover .calc-key-enter { animation: calc-enter-press 0.34s ease 0.68s 1; }
@keyframes calc-key-press {
  0%, 100% { transform: scale(1); fill-opacity: 1; }
  45% { transform: scale(0.55); fill-opacity: 1; }
}
@keyframes calc-enter-press {
  0%, 100% { transform: scale(1); fill: none; }
  40%, 70% { transform: scale(0.82); fill: currentColor; }
}

#nav-erp-plantillas .fan-sheet {
  transform-box: view-box;
  transform-origin: 12px 21px;
  transform: rotate(0deg);
  transition: transform 0.42s cubic-bezier(0.22, 1.15, 0.36, 1);
}
#nav-erp-plantillas .fan-sheet-face {
  fill: #ffffff;
  fill-opacity: 1;
  stroke: currentColor;
}
#nav-erp-plantillas.is-active .fan-sheet-face {
  fill: #ffffff;
}
html.dark #nav-erp-plantillas .fan-sheet-face,
html.dark #nav-erp-plantillas.is-active .fan-sheet-face {
  fill: #18181b;
}
#nav-erp-plantillas:hover .fan-sheet-3 {
  transform: rotate(-16deg);
  transition-delay: 0s;
}
#nav-erp-plantillas:hover .fan-sheet-2 {
  transform: rotate(-8deg);
  transition-delay: 0.04s;
}
#nav-erp-plantillas:hover .fan-sheet-1 {
  transform: rotate(5deg);
  transition-delay: 0.08s;
}

#nav-erp-dashboard .dash-tl,
#nav-erp-dashboard .dash-tr,
#nav-erp-dashboard .dash-bl,
#nav-erp-dashboard .dash-br {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.42s cubic-bezier(0.22, 1.15, 0.36, 1);
}
#nav-erp-dashboard:hover .dash-tl,
#nav-erp-dashboard:hover .dash-bl {
  transform: translateX(11px);
}
#nav-erp-dashboard:hover .dash-tr,
#nav-erp-dashboard:hover .dash-br {
  transform: translateX(-11px);
}

#nav-erp-buscador-boe .nav-icon-search {
  overflow: visible;
}
#nav-erp-buscador-boe:hover .nav-item-icon {
  transform: none;
  animation: boe-search-scan 1s ease-in-out 1 forwards;
}
#nav-erp-buscador-boe .boe-lens {
  transform: none;
  animation: none;
}
@keyframes boe-search-scan {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

#nav-erp-alarmas .nav-icon-alarm {
  overflow: visible;
}
#nav-erp-alarmas .alarm-hand-hour,
#nav-erp-alarmas .alarm-hand-minute {
  transform-box: view-box;
  transform-origin: 12px 13px;
}
#nav-erp-alarmas:hover .alarm-hand-minute {
  animation: alarm-hand-minute-spin 1.2s linear infinite;
}
#nav-erp-alarmas:hover .alarm-hand-hour {
  animation: alarm-hand-hour-spin 7.2s linear infinite;
}
@keyframes alarm-hand-minute-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes alarm-hand-hour-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#nav-erp-clientes .nav-icon-users {
  overflow: visible;
}
#nav-erp-clientes .user-front-head,
#nav-erp-clientes .user-front-body,
#nav-erp-clientes .user-back-head,
#nav-erp-clientes .user-back-body {
  fill: #ffffff;
  stroke: currentColor;
}
html.dark #nav-erp-clientes .user-front-head,
html.dark #nav-erp-clientes .user-front-body,
html.dark #nav-erp-clientes .user-back-head,
html.dark #nav-erp-clientes .user-back-body {
  fill: #18181b;
}
#nav-erp-clientes.is-active .user-front-head,
#nav-erp-clientes.is-active .user-front-body,
#nav-erp-clientes.is-active .user-back-head,
#nav-erp-clientes.is-active .user-back-body {
  fill: #ffffff;
}
html.dark #nav-erp-clientes.is-active .user-front-head,
html.dark #nav-erp-clientes.is-active .user-front-body,
html.dark #nav-erp-clientes.is-active .user-back-head,
html.dark #nav-erp-clientes.is-active .user-back-body {
  fill: #e4e4e7;
}
#nav-erp-clientes .user-back {
  transform-box: view-box;
  transform-origin: 16px 12px;
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.22, 1.15, 0.36, 1);
}
#nav-erp-clientes:hover .user-back {
  transform: translateX(7px);
}

#nav-erp-facturacion {
  overflow: visible;
}
#nav-erp-facturacion .nav-icon-pos {
  overflow: visible;
}
#nav-erp-facturacion .pos-ticket {
  transform-box: view-box;
  transform-origin: 12px 7.4px;
  pointer-events: none;
  animation: none;
}
#nav-erp-facturacion .pos-ticket-fly {
  transform: translate(0, 0) rotate(0deg) scaleY(1);
  transition: transform 0.35s ease;
}
#nav-erp-facturacion .pos-ticket-next {
  transform: scaleY(0);
  opacity: 0;
}
#nav-erp-facturacion:hover .pos-ticket-fly {
  transition: none;
  animation: pos-ticket-print 1.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
#nav-erp-facturacion:hover .pos-ticket-next {
  animation: pos-ticket-next 1.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes pos-ticket-print {
  0% { transform: translate(0, 0) rotate(0deg) scaleY(1); }
  26% { transform: translate(0, 0) rotate(0deg) scaleY(1.55); }
  36% { transform: translate(4px, -4px) rotate(-14deg) scaleY(1.55); }
  50% { transform: translate(16px, 8px) rotate(18deg) scaleY(1.55); }
  64% { transform: translate(28px, 20px) rotate(-12deg) scaleY(1.55); }
  80% { transform: translate(40px, 36px) rotate(8deg) scaleY(1.55); }
  100% { transform: translate(48px, 52px) rotate(3deg) scaleY(1.55); }
}
@keyframes pos-ticket-next {
  0%, 34% { transform: scaleY(0); opacity: 0; }
  36% { transform: scaleY(0.2); opacity: 1; }
  58% { transform: scaleY(1.55); opacity: 1; }
  100% { transform: scaleY(1.55); opacity: 1; }
}
#nav-erp-facturacion .pos-ticket-face {
  fill: #ffffff;
  fill-opacity: 1;
  stroke: currentColor;
  stroke-width: 1.15;
}
#nav-erp-facturacion .pos-ticket-lines {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
}
#nav-erp-facturacion .pos-body {
  fill: #ffffff;
  fill-opacity: 1;
  stroke: currentColor;
}
#nav-erp-facturacion.is-active .pos-ticket-face,
#nav-erp-facturacion.is-active .pos-body {
  fill: #ffffff;
}
html.dark #nav-erp-facturacion .pos-ticket-face,
html.dark #nav-erp-facturacion.is-active .pos-ticket-face {
  fill: #ffffff;
}
html.dark #nav-erp-facturacion .pos-body,
html.dark #nav-erp-facturacion.is-active .pos-body {
  fill: #18181b;
}
@keyframes scale-tilt-cycle {
  0% { transform: rotate(0deg); }
  32% { transform: rotate(7deg); }
  50% { transform: rotate(7deg); }
  100% { transform: rotate(0deg); }
}

#nav-erp-agenda .nav-icon-calendar {
  shape-rendering: geometricPrecision;
}
#nav-erp-agenda .cal-num {
  stroke: none !important;
  fill: currentColor !important;
  pointer-events: none;
  text-rendering: geometricPrecision;
}
#nav-erp-agenda .cal-leaf {
  transform-box: view-box;
  transform-origin: 12px 10.2px;
  transform: translateY(0) rotate(0deg) scaleY(1);
  opacity: 1;
  transition: transform 0.7s cubic-bezier(0.22, 0.55, 0.25, 1), opacity 0.22s ease;
}
#nav-erp-agenda:hover .cal-leaf {
  transform: translateY(-8px) rotate(-68deg) scaleY(0.42);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.22, 0.55, 0.25, 1), opacity 0.4s ease 0.55s;
}
#nav-erp-agenda .cal-leaf-face {
  fill: #F1F5F9;
  stroke: none !important;
}
#nav-erp-agenda:hover .cal-leaf-face {
  fill: #f3f4f6;
}
#nav-erp-agenda.is-active .cal-leaf-face {
  fill: #E4E4E7;
}
#nav-erp-agenda.is-active:hover .cal-leaf-face {
  fill: #EDEEF1;
}
html.dark #nav-erp-agenda .cal-leaf-face {
  fill: #0a0a0a;
}
html.dark #nav-erp-agenda:hover .cal-leaf-face {
  fill: #1f1f1f;
}
html.dark #nav-erp-agenda.is-active .cal-leaf-face {
  fill: #E4E4E7;
}
html.dark #nav-erp-agenda.is-active:hover .cal-leaf-face {
  fill: #EDEEF1;
}
.nav-icon-folder .folder-front {
  fill: #f4f4f5;
  stroke: none !important;
}
#nav-erp-expedientes:hover .folder-front {
  fill: #f4f4f5;
}
#nav-erp-expedientes.is-active .folder-front {
  fill: #ffffff;
}
html.dark .erp-sidebar .vercel-nav-item .nav-icon-folder .folder-front,
html:not(.dark) .erp-sidebar .vercel-nav-item .nav-icon-folder .folder-front {
  stroke: none !important;
}
html.dark .nav-icon-folder .folder-front {
  fill: #18181b;
}
html.dark #nav-erp-expedientes:hover .folder-front {
  fill: #1f1f1f;
}
html.dark #nav-erp-expedientes.is-active .folder-front {
  fill: #e4e4e7;
}

.nav-hop-word {
  display: inline-block;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-ai-main.group:hover .nav-hop-word {
  transform: translateY(-1px);
}
#nav-erp-chat .nav-ai-glyph {
  overflow: visible;
  transform-style: preserve-3d;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: unset;
  color: inherit;
  filter: none !important;
}
#nav-erp-chat .ai-3d {
  display: inline-grid;
  transform-origin: center center;
  transform-style: preserve-3d;
}
#nav-erp-chat .ai-3d-layer {
  grid-area: 1 / 1;
  transform: translateZ(0);
  opacity: 0;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: transform 0.28s ease, opacity 0.18s ease;
}
#nav-erp-chat .ai-3d-layer:last-child {
  opacity: 1;
}
#nav-erp-chat:hover .ai-3d-layer {
  opacity: 1;
  transform: translateZ(calc(var(--z) * -0.28px));
}
#nav-erp-chat .nav-chat-ch {
  display: inline-block;
}
#nav-erp-chat {
  perspective: 120px;
}
#nav-erp-chat:hover .ai-3d {
  animation: nav-ai-spin-up 1.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
#nav-erp-chat:hover .nav-chat-ch {
  animation: nav-asistente-up 0.52s cubic-bezier(0.22, 1.15, 0.36, 1) both;
  animation-delay: calc(0.07s + var(--i) * 0.048s);
}
@keyframes nav-ai-spin-up {
  0% { transform: translateY(0) rotateY(0deg); }
  14% { transform: translateY(-3px) rotateY(42deg); }
  30% { transform: translateY(0) rotateY(100deg); }
  100% { transform: translateY(0) rotateY(360deg); }
}
@keyframes nav-asistente-up {
  0% { transform: translateY(0); }
  38% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .erp-sidebar .vercel-nav-item,
  .erp-sidebar .vercel-nav-item:hover,
  .erp-sidebar .vercel-nav-item:active,
  .erp-sidebar .vercel-nav-item.is-active:hover,
  .erp-sidebar .group:hover .nav-item-icon,
  .erp-sidebar .group:hover .nav-ai-glyph,
  .erp-sidebar .group:hover .ai-3d,
  .erp-sidebar .group:hover .nav-chat-label,
  .erp-sidebar .group:hover .nav-chat-ch,
  .erp-sidebar .group:hover .folder-sheet,
  .erp-sidebar .group:hover .cal-leaf,
  .erp-sidebar .group:hover .inbox-letter,
  .erp-sidebar .group:hover .scale-tilt,
  .erp-sidebar .group:hover .calc-key,
  .erp-sidebar .group:hover .fan-sheet,
  .erp-sidebar .group:hover .pos-ticket,
  .erp-sidebar .group:hover .pos-ticket-next,
  .erp-sidebar .group:hover .dash-tl,
  .erp-sidebar .group:hover .dash-tr,
  .erp-sidebar .group:hover .dash-bl,
  .erp-sidebar .group:hover .dash-br,
  .erp-sidebar .group:hover .user-back,
  .erp-sidebar .group:hover .boe-lens {
    animation: none !important;
    filter: none !important;
    transform: none !important;
  }
}
/* Ajustes: microinteracción de bolitas en el icono de sliders */
#nav-erp-ajustes .icon-ajustes-sliders .bolita-1,
#nav-erp-ajustes .icon-ajustes-sliders .bolita-2,
#nav-erp-ajustes .icon-ajustes-sliders .bolita-3,
.sidebar-link .bolita-1,
.sidebar-link .bolita-2,
.sidebar-link .bolita-3 {
  fill: currentColor !important;
  stroke: none !important;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.38s cubic-bezier(0.22, 1.15, 0.36, 1);
}

.sidebar-link:hover .bolita-1,
.sidebar-link.is-active .bolita-1,
#nav-erp-ajustes:hover .bolita-1,
#nav-erp-ajustes.is-active .bolita-1,
#nav-erp-ajustes[aria-expanded="true"] .bolita-1 {
  transform: translateX(7.5px);
}

.sidebar-link:hover .bolita-2,
.sidebar-link.is-active .bolita-2,
#nav-erp-ajustes:hover .bolita-2,
#nav-erp-ajustes.is-active .bolita-2,
#nav-erp-ajustes[aria-expanded="true"] .bolita-2 {
  transform: translateX(-7.5px);
}

.sidebar-link:hover .bolita-3,
.sidebar-link.is-active .bolita-3,
#nav-erp-ajustes:hover .bolita-3,
#nav-erp-ajustes.is-active .bolita-3,
#nav-erp-ajustes[aria-expanded="true"] .bolita-3 {
  transform: translateX(8.5px);
}
/* Bloque de administraci?n: justo debajo del resto del men? */
.erp-sidebar-group-admin {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  margin-left: 0.15rem;
  margin-right: 0.15rem;
  border-top: 1px solid #E4E4E7;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.erp-sidebar-group-admin .erp-sidebar-label {
  margin-top: 0.45rem;
}
.erp-sidebar-footer {
  padding: 0;
  border-top: none;
  flex-shrink: 0;
  min-height: 0;
  position: relative;
  z-index: 40;
  overflow: visible;
}

/* Vistas de m?dulo a?n sin contenido */
.erp-view-placeholder {
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
}
.erp-view-placeholder i {
  font-size: 1.25rem;
  color: #a3a3a3;
}
.erp-view-placeholder h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0a0a0a;
}
.erp-view-placeholder p {
  margin: 0;
  font-size: 0.8125rem;
  color: #8f8f8f;
}
html.dark .erp-view-placeholder {
  background: #111111 !important;
  border-color: #2a2a2a !important;
}
html.dark .erp-view-placeholder h3 {
  color: #fafafa !important;
}
html.dark .erp-view-placeholder p {
  color: #a3a3a3 !important;
}

/* ============================================================
   Bandeja LexNET: zona de carga + tabla de triaje
   ============================================================ */
.lexnet-bandeja-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 2.5rem 1.5rem;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.lexnet-bandeja-dropzone-trace {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  overflow: visible;
  pointer-events: none;
}
.lexnet-bandeja-dropzone-trace-base,
.lexnet-bandeja-dropzone-trace-dash {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  stroke-linecap: butt;
  vector-effect: non-scaling-stroke;
}
.lexnet-bandeja-dropzone-trace-base {
  stroke: #d4d4d4;
}
.lexnet-bandeja-dropzone-trace-dash {
  stroke: #0a0a0a;
}
.lexnet-bandeja-dropzone-trace-reveal {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.4s steps(64, end);
}
.lexnet-bandeja-dropzone:hover,
.lexnet-bandeja-dropzone:focus-visible {
  background: #fafafa;
  outline: none;
}
.lexnet-bandeja-dropzone:hover .lexnet-bandeja-dropzone-trace-reveal,
.lexnet-bandeja-dropzone:focus-visible .lexnet-bandeja-dropzone-trace-reveal,
.lexnet-bandeja-dropzone.is-dragover .lexnet-bandeja-dropzone-trace-reveal {
  stroke-dashoffset: 0;
}
.lexnet-bandeja-dropzone.is-dragover {
  background: #f5f5f5;
}
.lexnet-bandeja-dropzone.is-dragover .lexnet-bandeja-dropzone-trace-reveal {
  transition: none;
}
.lexnet-bandeja-dropzone-trace {
  z-index: 0;
}
.lexnet-bandeja-dropzone-icon,
.lexnet-bandeja-dropzone-title,
.lexnet-bandeja-dropzone-sub {
  position: relative;
  z-index: 1;
}
.lexnet-bandeja-dropzone i,
.lexnet-bandeja-dropzone-icon {
  font-size: 1.5rem;
  color: #737373;
}
html.dark .lexnet-bandeja-dropzone-icon {
  color: #a3a3a3 !important;
}
.lexnet-bandeja-dropzone-title {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0a;
}
.lexnet-bandeja-dropzone-sub {
  margin: 0;
  font-size: 0.75rem;
  color: #8f8f8f;
}

.lexnet-bandeja-card {
  background: #ffffff;
  border: 1px solid rgba(229, 229, 229, 0.8);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: none;
}
.lexnet-bandeja-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(229, 229, 229, 0.8);
}
.lexnet-bandeja-card-head h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #171717;
}
.lexnet-bandeja-card-head p {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: #404040;
}
.lexnet-bandeja-contador {
  font-size: 0.75rem;
  font-weight: 500;
  color: #737373;
  white-space: nowrap;
}
.lexnet-bandeja-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.lexnet-bandeja-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.lexnet-bandeja-table thead th {
  padding: 0.6rem 1.25rem;
  background: #fafafa;
  border-bottom: 1px solid #eaeaea;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8f8f8f;
  text-align: left;
  white-space: nowrap;
}
.lexnet-bandeja-table tbody td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  color: #0a0a0a;
  vertical-align: middle;
}
.lexnet-bandeja-table tbody tr:last-child td {
  border-bottom: none;
}
.lexnet-bandeja-vacio {
  padding: 2.5rem 1.25rem !important;
  text-align: center;
  color: #8f8f8f !important;
}
.lexnet-estado {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #404040;
  white-space: nowrap;
}
.lexnet-estado-punto {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.lexnet-estado-pendiente .lexnet-estado-punto {
  background: #f5a623;
}
.lexnet-estado-escaneando .lexnet-estado-punto {
  background: #f5a623;
  animation: lexnet-pulse 1s ease-in-out infinite;
}
.lexnet-estado-procesado .lexnet-estado-punto {
  background: #10b981;
}
@keyframes lexnet-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.lexnet-bandeja-archivo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-weight: 500;
}
.lexnet-bandeja-archivo i {
  color: #737373;
}
.lexnet-bandeja-archivo-peso {
  font-size: 0.6875rem;
  color: #8f8f8f;
  font-weight: 400;
}
.lexnet-ocr-dato {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
}
.lexnet-ocr-dato dt {
  font-size: 0.75rem;
  color: #8f8f8f;
}
.lexnet-ocr-dato dd {
  margin: 0;
  font-weight: 600;
  color: #0a0a0a;
  text-align: right;
}

html.dark .lexnet-bandeja-dropzone {
  background: #111111 !important;
  border-color: transparent !important;
}
html.dark .lexnet-bandeja-dropzone-trace-base {
  stroke: #3a3a3a;
}
html.dark .lexnet-bandeja-dropzone-trace-dash {
  stroke: #fafafa;
}
html.dark .lexnet-bandeja-dropzone:hover,
html.dark .lexnet-bandeja-dropzone.is-dragover {
  background: #171717 !important;
}
html.dark .lexnet-bandeja-dropzone-title {
  color: #fafafa !important;
}
html.dark .lexnet-bandeja-card {
  background: #111111 !important;
  border-color: #2a2a2a !important;
}
html.dark .lexnet-bandeja-card-head {
  border-color: #2a2a2a !important;
}
html.dark .lexnet-bandeja-card-head h3 {
  color: #fafafa !important;
}
html.dark .lexnet-bandeja-table thead th {
  background: #171717 !important;
  border-color: #2a2a2a !important;
}
html.dark .lexnet-bandeja-table tbody td {
  border-color: #222222 !important;
  color: #fafafa !important;
}
html.dark .lexnet-estado {
  color: #d4d4d4 !important;
}
html.dark .lexnet-ocr-dato dd {
  color: #fafafa !important;
}

#erp-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
html.erp-sidebar-open #erp-sidebar-backdrop {
  display: block;
  pointer-events: auto;
}
/* Off-canvas abierto: por encima de cualquier panel del ?rea principal */
html.erp-sidebar-open .erp-sidebar {
  z-index: 95;
}

/* Desplazamiento del workspace y del header para dejar hueco al sidebar */
html.auth-session #app-workspace {
  padding-left: var(--erp-sidebar-width);
}
html.auth-session #app-header.app-header-floating,
html.auth-session.layout-historial-open #app-header.app-header-floating {
  padding: 0 !important;
  padding-left: 0 !important;
}

/* Header transparente: solo contenedor de controles globales flotantes */
#app-header.app-header-floating,
html.dark #app-header.app-header-floating,
html.liquid-glass #app-header.app-header-floating,
html.dark.liquid-glass #app-header.app-header-floating {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
  z-index: 80 !important;
}
#app-header.app-header-floating::before,
#app-header.app-header-floating::after {
  content: none !important;
  display: none !important;
}
#app-header.app-header-floating > * {
  pointer-events: auto;
}

/* Controles flotantes: contenedor transparente, botones individuales con cristal */
#app-header .header-side-right,
#app-header .header-floating-controls {
  position: fixed !important;
  top: 0.75rem !important;
  right: 1rem !important;
  left: auto !important;
  z-index: 50 !important;
  overflow: visible !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  isolation: auto !important;
}
html.dark #app-header .header-side-right,
html.dark #app-header .header-floating-controls,
html.liquid-glass #app-header .header-side-right {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Cada control: liquid glass grisáceo */
#app-header .header-side-right #btn-chat-header,
#app-header .header-side-right #btn-lang-toggle,
#app-header .header-side-right .time-tracker-widget {
  background: rgba(245,246,248,0.80) !important;
  background-image: none !important;
  backdrop-filter: blur(18px) saturate(180%) brightness(1.05) !important;
  -webkit-backdrop-filter: blur(18px) saturate(180%) brightness(1.05) !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(255,255,255,0.70) !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
/* Theme toggle: círculo sólido; la animación de sol/luna sale del recorte */
#app-header .header-side-right #theme-toggle.theme-toggle-btn {
  background: rgba(245,246,248,0.80) !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 9999px !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  color: #eab308 !important;
}
html.dark #app-header .header-side-right #btn-chat-header,
html.dark #app-header .header-side-right #btn-lang-toggle,
html.dark #app-header .header-side-right .time-tracker-widget,
html.dark #app-header .header-side-right #theme-toggle.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(72px) saturate(150%) brightness(1.06) !important;
  -webkit-backdrop-filter: blur(72px) saturate(150%) brightness(1.06) !important;
  box-shadow:
    inset 0  2px 0   rgba(255, 255, 255, 0.40),
    inset 0 -1.5px 0 rgba(255, 255, 255, 0.12),
    inset  2px 0 0   rgba(255, 255, 255, 0.24),
    inset -1.5px 0 0 rgba(255, 255, 255, 0.08) !important;
}

#app-header .header-side-right #btn-modo-concentracion.header-concentrate-btn,
html.dark #app-header .header-side-right #btn-modo-concentracion.header-concentrate-btn,
#app-header .header-side-right #btn-modo-concentracion.header-concentrate-btn:hover,
html.dark #app-header .header-side-right #btn-modo-concentracion.header-concentrate-btn:hover {
  width: 2.25rem !important;
  height: 2.25rem !important;
  min-width: 2.25rem !important;
  min-height: 2.25rem !important;
  max-width: 2.25rem !important;
  max-height: 2.25rem !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease,
              right 0.82s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.82s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  border-radius: 9999px !important;
  container-type: normal;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Contenido a altura completa: sin reserva de header */
#app-workspace {
  padding-top: 0 !important;
}
#main-container,
#main-container > main {
  min-height: 100vh;
  min-height: 100dvh;
}

/* T?tulos alineados con la l?nea superior (misma altura que los controles flotantes) */
#view-cartera,
#view-detalle-cliente,
#view-ficha-cliente {
  padding-top: 0.75rem !important;
  box-sizing: border-box;
}
#btn-guardar-edicion-cliente {
  border-radius: 9999px !important;
}
.ficha-icon-btn,
.ficha-trash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
}
.ficha-icon-btn {
  flex-direction: column;
  gap: 0.28rem;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  color: #334155;
}
.ficha-icon-btn-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: inherit;
}
.ficha-icon-btn:hover .ficha-icon-btn-circle {
  background: #f8fafc;
  color: #0f172a;
}
.ficha-icon-btn-label {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  color: #64748b;
}
.ficha-icon-btn:hover .ficha-icon-btn-label {
  color: #334155;
}
.ficha-icon-btn i {
  font-size: 0.7rem;
}
.ficha-trash-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b91c1c;
  align-self: flex-start;
}
.ficha-trash-btn:hover {
  color: #991b1b;
}
.ficha-trash-btn svg {
  display: block;
}
html.dark .ficha-icon-btn-circle {
  background: #171717;
  border-color: #404040;
  color: #e5e5e5;
}
html.dark .ficha-icon-btn:hover .ficha-icon-btn-circle {
  background: #262626;
  color: #fafafa;
}
#view-ajustes #settings-workspace-panel {
  scroll-padding-top: 0.75rem;
}
#view-ajustes .settings-group {
  padding-top: 0.75rem !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}
#view-ajustes .settings-group > div:first-child {
  padding: 0 1rem 0.75rem 1rem !important;
}

/* La hamburguesa solo aparece cuando el sidebar se colapsa */
#btn-abrir-erp-sidebar {
  display: none !important;
}
#btn-abrir-erp-sidebar svg.erp-nav-toggle-icon,
#btn-toggle-erp-nav svg.erp-nav-toggle-icon,
#btn-cerrar-erp-sidebar svg.erp-nav-toggle-icon,
#btn-abrir-erp-sidebar svg,
#btn-toggle-erp-nav svg,
#btn-cerrar-erp-sidebar svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block !important;
  flex-shrink: 0 !important;
  color: #0a0a0a !important;
  stroke: #0a0a0a !important;
  fill: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  overflow: visible !important;
}
#btn-abrir-erp-sidebar svg :is(line, path, rect, polyline, circle),
#btn-toggle-erp-nav svg :is(line, path, rect, polyline, circle),
#btn-cerrar-erp-sidebar svg :is(line, path, rect, polyline, circle) {
  stroke: #0a0a0a !important;
  fill: none !important;
  stroke-width: 2 !important;
  opacity: 1 !important;
}
html.dark #btn-abrir-erp-sidebar svg,
html.dark #btn-toggle-erp-nav svg,
html.dark #btn-cerrar-erp-sidebar svg,
html.dark #btn-abrir-erp-sidebar svg :is(line, path, rect, polyline, circle),
html.dark #btn-toggle-erp-nav svg :is(line, path, rect, polyline, circle),
html.dark #btn-cerrar-erp-sidebar svg :is(line, path, rect, polyline, circle) {
  color: #fafafa !important;
  stroke: #fafafa !important;
  fill: none !important;
}

/* Hover: las 3 rayas del menú se separan un poco */
#btn-abrir-erp-sidebar svg.erp-nav-toggle-icon line,
#btn-toggle-erp-nav svg.erp-nav-toggle-icon line {
  transition: transform 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}
#btn-abrir-erp-sidebar:hover svg.erp-nav-toggle-icon line:nth-child(1),
#btn-toggle-erp-nav:hover svg.erp-nav-toggle-icon line:nth-child(1) {
  transform: translateY(-2.5px);
}
#btn-abrir-erp-sidebar:hover svg.erp-nav-toggle-icon line:nth-child(3),
#btn-toggle-erp-nav:hover svg.erp-nav-toggle-icon line:nth-child(3) {
  transform: translateY(2.5px);
}

@media (max-width: 767px) {
  html.auth-session #app-workspace {
    padding-left: 0;
    padding-top: var(--app-header-height, 3.75rem);
  }
  html.auth-session #app-header.app-header-floating,
  html.auth-session.layout-historial-open #app-header.app-header-floating {
    padding: 0 0.75rem !important;
    padding-left: 0.75rem !important;
  }
  .erp-sidebar {
    position: fixed !important;
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 50 !important;
  }
  html.erp-sidebar-open .erp-sidebar,
  html.auth-session.erp-nav-collapsed.erp-sidebar-open .erp-sidebar {
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }
  .erp-sidebar-close {
    display: inline-flex;
  }
  html.auth-session #btn-abrir-erp-sidebar {
    display: inline-flex !important;
  }
  #btn-toggle-erp-nav {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  html.auth-session #app-workspace {
    padding-left: 0;
  }
  .erp-sidebar {
    position: fixed !important;
    transform: translateX(-100%) !important;
    z-index: 50 !important;
  }
  html.erp-sidebar-open .erp-sidebar,
  html.auth-session.erp-nav-collapsed.erp-sidebar-open .erp-sidebar {
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }
  html.auth-session #btn-abrir-erp-sidebar {
    display: inline-flex !important;
  }
  .erp-sidebar-close {
    display: inline-flex !important;
  }
  #btn-toggle-erp-nav {
    display: none !important;
  }
  html.erp-sidebar-open #erp-sidebar-backdrop {
    display: block;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

html.dark .erp-sidebar {
  background: #0a0a0a !important;
  border-right-color: #2a2a2a !important;
}
html.dark .erp-sidebar-header {
  border-color: #2a2a2a !important;
}
html.dark .erp-sidebar-footer {
  border-top: none !important;
  border-color: transparent !important;
}
html.dark .erp-sidebar-brand {
  color: #fafafa !important;
}
html.dark .erp-sidebar .vercel-nav-item {
  color: #a3a3a3 !important;
}
html.dark .erp-sidebar .vercel-nav-item:hover {
  color: #fafafa !important;
  background: #1f1f1f !important;
  transform: translateX(0.25rem);
}
html.dark .erp-sidebar .vercel-nav-item.is-active:hover,
html.dark #erp-sidebar .vercel-nav-item.is-active:hover,
html.dark #app-shell #erp-sidebar .vercel-nav-item.is-active:hover {
  color: #09090B !important;
  background: #EDEEF1 !important;
}
html.dark .erp-sidebar .vercel-nav-item:active {
  transform: translateX(0.25rem);
}
html.dark #erp-sidebar .vercel-nav-item.is-active,
html.dark #app-shell #erp-sidebar .vercel-nav-item.is-active {
  color: #09090B !important;
  -webkit-text-fill-color: #09090B !important;
  background: #E4E4E7 !important;
  font-weight: 600 !important;
}
html.dark #erp-sidebar .vercel-nav-item.is-active span,
html.dark #erp-sidebar .vercel-nav-item.is-active i,
html.dark #erp-sidebar .vercel-nav-item.is-active .nav-item-icon,
html.dark #erp-sidebar .vercel-nav-item.is-active svg:not(.nav-ai-glyph),
html.dark #app-shell #erp-sidebar .vercel-nav-item.is-active span,
html.dark #app-shell #erp-sidebar .vercel-nav-item.is-active i,
html.dark #app-shell #erp-sidebar .vercel-nav-item.is-active .nav-item-icon,
html.dark #app-shell #erp-sidebar .vercel-nav-item.is-active svg:not(.nav-ai-glyph) {
  color: #09090B !important;
  -webkit-text-fill-color: #09090B !important;
  stroke: #09090B !important;
}
html.dark #erp-sidebar .vercel-nav-item.is-active svg:not(.nav-ai-glyph) :is(path, line, circle, rect, polyline, polygon, ellipse) {
  stroke: #09090B !important;
}
html.dark #erp-sidebar .vercel-nav-item.is-active svg:not(.nav-ai-glyph) :is(circle[fill], path[fill]:not([fill="none"])) {
  fill: #09090B !important;
}
html.dark .erp-sidebar .vercel-nav-item i,
html.dark .erp-sidebar .vercel-nav-item .nav-item-icon,
html.dark .erp-sidebar .vercel-nav-item svg:not(.nav-ai-glyph) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  stroke: currentColor !important;
}
html.dark .erp-sidebar .vercel-nav-item svg:not(.nav-ai-glyph) :is(path, line, circle, rect, polyline, polygon, ellipse) {
  stroke: #ffffff !important;
}
html.dark .erp-sidebar .vercel-nav-item svg:not(.nav-ai-glyph) :is(circle[fill], path[fill]:not([fill="none"])) {
  fill: #ffffff !important;
}
html.dark .erp-sidebar .vercel-nav-item:hover i,
html.dark .erp-sidebar .vercel-nav-item:hover .nav-item-icon,
html.dark .erp-sidebar .vercel-nav-item:hover svg:not(.nav-ai-glyph) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html.dark #erp-sidebar .vercel-nav-item.is-active i,
html.dark #erp-sidebar .vercel-nav-item.is-active .nav-item-icon,
html.dark #erp-sidebar .vercel-nav-item.is-active svg:not(.nav-ai-glyph) {
  color: #09090B !important;
  -webkit-text-fill-color: #09090B !important;
}

/* ============================================================
   DASHBOARD / OVERVIEW ? m?tricas LSO
   ============================================================ */
.dash-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1.5rem;
}
.dash-metric-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.dash-metric-card:hover {
  border-color: #CBD5E1;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}
.dash-metric-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dash-metric-title {
  margin: 0;
  font-size: 0.875rem; /* text-sm */
  font-weight: 500;
  color: #64748B; /* slate-500 */
  letter-spacing: -0.01em;
  line-height: 1.35;
  min-height: calc(0.875rem * 1.35 * 2);
}
.dash-metric-card-head i {
  font-size: 0.75rem;
  color: #A1A1AA;
}
.dash-metric-value-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 0;
  min-height: 1.875rem;
}
.dash-metric-value {
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #0F172A;
  font-variant-numeric: lining-nums tabular-nums;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 1280px) {
  .dash-metric-value {
    font-size: 1.875rem;
  }
}
.dash-metric-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #A1A1AA;
  letter-spacing: -0.01em;
  line-height: 1.4;
  min-height: calc(0.8125rem * 1.4 * 2);
}
.dash-metric-card.is-urgent .dash-metric-value {
  color: #b45309;
}
html.dark .dash-metric-card {
  background: #111111 !important;
  border-color: #2a2a2a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
html.dark .dash-metric-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.28);
}
html.dark .dash-metric-value {
  color: #fafafa !important;
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", var(--font-sans) !important;
  letter-spacing: 0.01em !important;
}
html.dark .dash-metric-title,
html.dark .dash-metric-hint {
  color: #a3a3a3 !important;
}

/* ============================================================
   LSO KANBAN + CHECKLIST + BADGES
   ============================================================ */
.lso-section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.015em;
}
.lso-section-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: #6B7280;
  line-height: 1.4;
}

.lso-badge {
  display: inline-flex;
  align-items: center;
  height: 1.15rem;
  padding: 0 0.4rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.lso-badge-debt {
  background: #f3f4f6;
  color: #111827;
}
.lso-badge-count {
  background: #f3f4f6;
  color: #6B7280;
  min-width: 1.15rem;
  justify-content: center;
}
.lso-badge-count.is-on {
  background: #dcfce7;
  color: #166534;
}
.lso-badge-success {
  background: #dcfce7;
  color: #166534;
}
.lso-badge-warning {
  background: #fef9c3;
  color: #854d0e;
}

.lso-kanban-board {
  display: flex;
  flex: 1 1 auto;
  gap: 0.75rem;
  overflow-x: auto;
  height: 100%;
  min-height: 20rem;
  max-height: calc(100vh - 18rem);
  padding: 0.15rem 0.1rem 0.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lso-kanban-board::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.lso-kanban-scroll {
  position: relative;
  height: 22px;
  margin-top: 0.35rem !important;
}
.lso-kanban-scroll[hidden] {
  display: none !important;
}
.lso-kanban-board.is-scrollbar-drag {
  scroll-snap-type: none !important;
}
.lso-kanban-board.is-scrollbar-drag .lso-kanban-column {
  scroll-snap-align: none !important;
}
.lso-kanban-scroll-thumb {
  position: absolute;
  top: 0;
  left: 50%;
  height: 28px;
  width: 4.25rem;
  background: none;
  transform: translateX(-50%);
  cursor: pointer;
  touch-action: none;
}
.lso-kanban-scroll-thumb::before {
  content: "";
  position: absolute;
  left: 0;
  right: 11px;
  top: 50%;
  height: 7px;
  border-radius: 999px;
  background: #3f3f46;
  transform: translateY(-50%);
}
.lso-kanban-scroll-thumb.is-dragging {
  cursor: pointer;
}
.lso-kanban-scroll-plane {
  position: absolute;
  right: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  color: #3f3f46;
  transform: translate(calc(100% - 2px), -50%) rotate(90deg);
  pointer-events: none;
}
.lso-kanban-board.hidden,
.lso-kanban-board[hidden] {
  display: none !important;
}
.lso-kanban-board.is-fase-filtrada .lso-kanban-column {
  flex: 1 1 auto;
  max-width: 28rem;
}
.lso-kanban-column {
  flex: 1 0 16.5rem;
  min-width: 16.5rem;
  scroll-snap-align: start;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  display: flex;
  flex-direction: column;
  min-height: 12rem;
  max-height: 100%;
  height: auto;
}
.lso-kanban-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem 0.45rem;
  border-bottom: 1px solid #eef0f2;
}
.lso-kanban-column-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.lso-kanban-column-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lso-kanban-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  padding: 0.7rem 2.15rem 0.65rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  text-align: left;
}
.lso-kanban-card:hover {
  border-color: #d1d5db;
  box-shadow: none;
  transform: translateY(-1px);
}
.lso-kanban-card:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}
.lso-kanban-card-top,
.lso-kanban-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}
.lso-kanban-card-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.lso-kanban-card-deuda {
  margin: 0.28rem 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: #111827;
  line-height: 1.3;
  transition: none;
}
.lso-kanban-card-trash {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #b91c1c;
}
.lso-kanban-card-trash svg {
  display: block;
  stroke: currentColor;
}
.lso-kanban-card-trash:hover {
  transform: translateY(-50%) scale(0.86);
}
.lso-kanban-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.5rem;
}
.lso-kanban-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  line-height: 1.3;
}
.lso-kanban-chip.is-warn,
.lso-kanban-chip.is-due {
  background: #fff7ed;
  color: #c2410c;
}
.lso-kanban-chip.is-ok {
  background: #ecfdf5;
  color: #047857;
}
.lso-kanban-chip.is-demo {
  background: #f5f3ff;
  color: #6d28d9;
}
.lso-kanban-chip.is-overdue {
  background: #fef2f2;
  color: #b91c1c;
}
.bancario-kanban-entidad {
  margin: 0.28rem 0 0.35rem;
  font-size: 0.6875rem;
  color: #4b5563;
  line-height: 1.3;
}
.bancario-kanban-producto {
  display: inline-flex;
  max-width: 100%;
  font-size: 0.625rem;
  font-weight: 600;
}
.lso-kanban-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: #6B7280;
  margin-bottom: 0.2rem;
}
.lso-progress-track {
  height: 0.28rem;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
}
.lso-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: #111827;
  transition: width 0.25s ease;
}

.lso-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.65rem 0.5rem;
  gap: 0.25rem;
  min-height: 5rem;
}
.lso-empty-icon {
  color: #e5e7eb;
  margin-bottom: 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
}
.lso-empty-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
}
.lso-empty-sub {
  margin: 0;
  font-size: 0.625rem;
  color: #6B7280;
  max-width: 10rem;
}
.lso-empty-cta {
  margin-top: 0.65rem;
  appearance: none;
  border: none;
  background: #111827;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
}
.lso-empty-cta:hover { background: #000; }

.lso-checklist-panel {
  box-shadow: none;
}
.lso-checklist-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.lso-checklist-chevron {
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.lso-checklist-panel.is-collapsed .lso-checklist-chevron {
  transform: rotate(-90deg);
}
.lso-checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #f3f4f6;
}
.lso-checklist-panel.is-collapsed .lso-checklist-list {
  display: none;
}
.lso-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.35rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid #f3f4f6;
}
.lso-check-row:last-child { border-bottom: none; }
.lso-check-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.lso-check-row > .lso-ghost-btn,
.lso-check-actions {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
}
.lso-check-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.lso-check-actions .lso-ghost-btn {
  white-space: nowrap;
}
.lso-check-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}
.lso-check-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.lso-check-status.is-pending { color: #9CA3AF; }
.lso-check-status.is-processing { color: #6B7280; }
.lso-check-status.is-validated,
.lso-check-status.is-ok { color: #166534; }
.lso-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  border: 2px solid #d1d5db;
  border-top-color: #9ca3af;
  animation: lso-spin 0.8s linear infinite;
}
@keyframes lso-spin {
  to { transform: rotate(360deg); }
}
.lso-ghost-btn {
  appearance: none;
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 9999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lso-ghost-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
.lso-ocr-preview {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  max-height: 16rem;
  overflow: auto;
}
.lso-ocr-preview.hidden,
.lso-ocr-preview[hidden] {
  display: none !important;
}
.lso-ocr-campo {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.75rem;
  padding: 0.2rem 0;
}
.lso-ocr-campo dt {
  color: #6b7280;
  font-weight: 600;
}
.lso-ocr-campo dd {
  margin: 0;
  color: #111827;
  word-break: break-word;
}
.lso-ocr-texto {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #374151;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html.dark .lso-kanban-column {
  background: #0f0f0f;
  border-color: #2a2a2a;
}
html.dark .lso-kanban-card,
html.dark .lso-checklist-panel {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .lso-kanban-column-title {
  color: #a3a3a3;
}
html.dark .lso-kanban-card-title,
html.dark .lso-check-label,
html.dark .lso-section-title,
html.dark .lso-empty-title {
  color: #fafafa;
}
html.dark .lso-kanban-card-deuda,
html.dark .lso-section-sub,
html.dark .lso-empty-sub,
html.dark .lso-kanban-progress-meta {
  color: #a3a3a3;
}
html.dark .lso-kanban-chip.is-warn,
html.dark .lso-kanban-chip.is-due {
  background: #431407;
  color: #fdba74;
}
html.dark .lso-kanban-chip.is-ok {
  background: #064e3b;
  color: #6ee7b7;
}
html.dark .lso-kanban-chip.is-overdue {
  background: #7f1d1d;
  color: #fecaca;
}
html.dark .lso-progress-track { background: #2a2a2a; }
html.dark .lso-progress-fill { background: #fafafa; }
html.dark .lso-badge-debt,
html.dark .lso-badge-count {
  background: #262626;
  color: #e5e5e5;
}
html.dark .lso-badge-count.is-on {
  background: #14532d;
  color: #bbf7d0;
}
html.dark .lso-ghost-btn {
  border-color: #404040;
  color: #e5e5e5;
}
html.dark .lso-ghost-btn:hover { background: #262626; }
html.dark .lso-empty-cta { background: #fafafa; color: #111; }

/* ?? Deudores table ?? */
.lso-deudores-table-wrap {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: none;
}
.lso-deudores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.lso-deudores-table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6B7280;
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
}
.lso-deudores-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: middle;
}
.lso-deudores-table tbody tr:last-child td { border-bottom: none; }
.lso-deudores-row { cursor: default; transition: background 0.12s ease; }
.lso-deudores-row[data-action]:hover { background: #f9fafb; cursor: pointer; }
.lso-deudores-name {
  font-weight: 600;
  color: #111827;
}
.lso-deudores-loading td {
  text-align: center;
  padding: 2.5rem 1rem !important;
  color: #6B7280;
}
.lso-deudores-table td.lso-deudores-empty {
  width: auto;
  max-width: none;
  text-align: center;
  vertical-align: middle;
  padding: 4rem 1rem;
  color: #6B7280;
}
.lso-clientes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  padding: 3rem 1rem;
}
.lso-clientes-empty-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #f3f4f6;
  color: #9ca3af;
  flex-shrink: 0;
}
.lso-clientes-empty-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.lso-clientes-empty-title {
  margin: 0 0 0.25rem;
  max-width: none;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #111827;
}
.lso-clientes-empty-sub {
  margin: 0 0 1.25rem;
  max-width: 28rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.625;
  color: #6b7280;
}
.lso-deudores-empty .lso-empty-cta {
  margin-top: 0;
}
html.dark .lso-clientes-empty-icon {
  background: #262626;
  color: #737373;
}
html.dark .lso-clientes-empty-title { color: #fafafa; }
html.dark .lso-clientes-empty-sub { color: #a3a3a3; }
html.dark .lso-deudores-table-wrap {
  background: #171717;
  border: none;
}
html.dark .lso-deudores-table thead th {
  background: #111;
  color: #a3a3a3;
  border-color: #2a2a2a;
}
html.dark .lso-deudores-table tbody td {
  border-color: #2a2a2a;
  color: #d4d4d4;
}
html.dark .lso-deudores-name { color: #fafafa; }
html.dark .lso-deudores-row[data-action]:hover { background: #1f1f1f; }

/* ?? Slide-over Motor Documental ?? */
.lso-slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.lso-slideover-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.lso-slideover {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 100vw);
  background: #ffffff;
  z-index: 95;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.lso-slideover.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.lso-slideover.hidden:not(.is-open) {
  display: none !important;
}
.lso-slideover.is-open {
  display: flex !important;
}
.lso-slideover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.25rem 1.15rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.lso-slideover-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9CA3AF;
  line-height: 1.2;
}
.lso-slideover-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}
.lso-slideover-meta {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  color: #6B7280;
}
.lso-slideover-close {
  width: 2rem;
  height: 2rem;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.lso-slideover-close:hover { background: transparent; color: #0a0a0a; }
.lso-slideover-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: #c4c4c4 transparent;
}
.lso-slideover-body::-webkit-scrollbar {
  width: 4px;
}
.lso-slideover-body::-webkit-scrollbar-track {
  background: transparent;
}
.lso-slideover-body::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 999px;
}
.lso-ia-extract-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fafafa;
}
.lso-ia-extract-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #374151;
}
.lso-ia-extract-toggle input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #111827;
  cursor: pointer;
}
.lso-ia-extract-toggle input:checked {
  accent-color: #111827;
}
.lso-ia-extract-panel.is-ia-on {
  border-color: #111827;
  background: #f5f5f5;
}
.lso-ia-extract-panel.is-ia-on .lso-ia-extract-badge {
  border-color: #111827;
}
.lso-ia-extract-badge {
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.lso-ia-extract-badge.is-empty {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}
#slideover-checklist-lso {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}

/* DnD Kanban */
.lso-kanban-card { cursor: pointer; }
.lso-kanban-card.is-kanban-lift {
  position: fixed;
  z-index: 90;
  margin: 0;
  opacity: 1;
  cursor: grabbing;
  pointer-events: none;
  box-shadow: none;
  transform: none !important;
  transition: none;
  will-change: left, top;
}
.lso-kanban-card.is-kanban-lift .lso-kanban-card-deuda,
.lso-kanban-card.is-kanban-settling .lso-kanban-card-deuda {
  color: #111827;
  transition: none;
}
.lso-kanban-card.is-kanban-settling {
  transition: left 0.32s cubic-bezier(0.22, 1, 0.36, 1), top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.lso-kanban-drag-slot {
  flex-shrink: 0;
  visibility: hidden;
  pointer-events: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}
.lso-kanban-board.is-kanban-dragging,
.lso-kanban-board.is-kanban-dragging * {
  cursor: grabbing !important;
}
.lso-kanban-board.is-kanban-dragging .lso-kanban-card:hover {
  transform: none;
  box-shadow: none;
}
html.dark .lso-slideover {
  background: #111;
  box-shadow: none;
}
html.dark .lso-slideover-header { border-color: #2a2a2a; }
html.dark .lso-ia-extract-panel {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .lso-ia-extract-toggle { color: #d4d4d4; }
html.dark .lso-ia-extract-badge {
  color: #fafafa;
  background: #111;
  border-color: #2a2a2a;
}
html.dark .lso-ia-extract-badge.is-empty {
  color: #fca5a5;
  border-color: #7f1d1d;
  background: #1c0b0b;
}
html.dark .lso-slideover-title { color: #fafafa; }
html.dark .lso-slideover-close {
  background: transparent;
  border: none;
  color: #e5e5e5;
}
html.dark #slideover-checklist-lso {
  background: #171717;
  border-color: #2a2a2a;
}

/* ?? Slide-over: resumen del caso ?? */
.lso-check-file {
  margin: 0.25rem 0 0;
  font-size: 0.6875rem;
  color: #6B7280;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.dark .lso-check-file { color: #a3a3a3; }

.lso-resumen {
  margin-bottom: 1rem;
}
.lso-resumen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: start;
}
.lso-resumen-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
}
.lso-resumen-item:has(#lso-fase-select) {
  position: relative;
  z-index: 3;
  overflow: visible;
}
#lso-fase-select {
  scrollbar-width: thin;
  scrollbar-color: #c4c4c4 transparent;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 1.65rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.25 2.5 8.25 6 4.25 9.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.45rem center !important;
  background-size: 0.7rem !important;
}
#lso-fase-select::-ms-expand {
  display: none;
}
#lso-fase-select::-webkit-scrollbar {
  width: 4px;
}
#lso-fase-select::-webkit-scrollbar-track {
  background: transparent;
}
#lso-fase-select::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 999px;
}
#lso-fase-select[size] {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  height: auto;
  max-height: 9.5rem;
  overflow-y: auto;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.25 6 8.25 9.5 4.25'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.45rem 0.7rem !important;
  background-size: 0.7rem !important;
  box-shadow: none;
}
#lso-fase-select option:checked {
  background-color: #f3f8ff;
  background-image: linear-gradient(#f3f8ff, #f3f8ff);
  color: #111827;
}
#lso-fase-select option:hover {
  background-color: #f8fbff;
  background-image: linear-gradient(#f8fbff, #f8fbff);
}
.lso-resumen-label {
  margin: 0;
  font-size: 0.6875rem;
  color: #6B7280;
}
.lso-resumen-value {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}
.lso-kanban-progress {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.3rem;
}
.lso-kanban-progress-value {
  font-size: 0.625rem;
  font-weight: 600;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
}
html.dark .lso-resumen-item { background: #171717; border-color: #2a2a2a; }
html.dark .lso-resumen-label,
html.dark .lso-kanban-progress-value { color: #a3a3a3; }
html.dark .lso-resumen-value { color: #fafafa; }
html.dark #lso-fase-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a3a3a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.25 2.5 8.25 6 4.25 9.5'/%3E%3C/svg%3E") !important;
}
html.dark #lso-fase-select[size] {
  background-color: #171717;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a3a3a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.25 6 8.25 9.5 4.25'/%3E%3C/svg%3E") !important;
}

/* ?? Bandeja LexNET ?? */
.lexnet-ocr-btn {
  appearance: none;
  border: none;
  background: #111827;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
}
.lexnet-ocr-btn:hover { background: #000; }
.lexnet-ocr-btn:disabled { opacity: 0.55; cursor: default; }
.lexnet-ia-extract-panel { margin: 0; }
.lexnet-bandeja-acciones {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}
.lexnet-bandeja-borrar {
  appearance: none;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lexnet-bandeja-borrar:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}
html.dark .lexnet-bandeja-borrar {
  background: #171717;
  border-color: #2a2a2a;
  color: #dc2626;
}
html.dark .lexnet-bandeja-borrar:hover {
  color: #fca5a5;
  border-color: #7f1d1d;
  background: #1c0b0b;
}
.lexnet-pendiente-dato {
  font-size: 0.75rem;
  color: #9CA3AF;
  font-style: italic;
}
.lexnet-celda-juzgado { display: flex; flex-direction: column; gap: 0.15rem; }
.lexnet-venc-dias {
  margin-left: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6B7280;
}
.lexnet-venc-dias.is-urgent { color: #B45309; }
html.dark .lexnet-ocr-btn { background: #fafafa; color: #111; }
html.dark .lexnet-pendiente-dato { color: #737373; }

/* ?? Plantillas: biblioteca + editor ?? */
.tpl-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: min(70vh, 44rem);
}

/* Selector de caso LSO del editor de plantillas */
.tpl-caso-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0.2rem 0.35rem 0.2rem 0.7rem;
  background: #fff;
  overflow: visible;
}
.tpl-caso-selector-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #404040;
}
.tpl-caso-select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: #111827;
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.3rem 0.2rem;
}
html.dark .tpl-caso-selector { background: #171717; border-color: #2a2a2a; }
html.dark .tpl-caso-select { color: #fafafa; }

/* Barra lateral contextual: biblioteca de plantillas guardadas */
.erp-sidebar-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-right: 0.35rem;
}
.erp-sidebar-label-row .erp-sidebar-label { margin-bottom: 0; }
#nav-plantillas .erp-sidebar-label-row {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
#nav-plantillas-base + .erp-sidebar-label-row {
  margin-top: 0.85rem;
}
.tpl-section-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  flex-shrink: 0;
}
.tpl-section-eye svg { display: block; }
.tpl-section-eye .tpl-section-eye-shut { display: none; }
.tpl-section-eye.is-off .tpl-section-eye-open { display: none; }
.tpl-section-eye.is-off .tpl-section-eye-shut { display: block; }
.erp-sidebar-tpl-list.is-section-hidden { display: none; }
html:not(.dark) #nav-plantillas .erp-sidebar-label-row .erp-sidebar-label,
html.liquid-glass:not(.dark) #nav-plantillas .erp-sidebar-label-row .erp-sidebar-label {
  margin-bottom: 0 !important;
}
.erp-sidebar-tpl-list {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  overflow-y: auto;
  max-height: calc(100vh - 16rem);
  padding-bottom: 0.35rem;
}
.erp-sidebar-tpl-empty {
  padding: 0.5rem 0.75rem 0;
  color: #a1a1aa;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
}
.erp-sidebar-tpl-empty svg {
  color: #a1a1aa;
  width: 0.875rem;
  height: 0.875rem;
  stroke-width: 1.5;
}
html.dark .erp-sidebar-tpl-empty {
  color: #a1a1aa;
}
html.dark .erp-sidebar-tpl-empty svg {
  color: #a1a1aa;
}
.erp-sidebar-tpl-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border-radius: 0.5rem;
  cursor: grab;
  touch-action: none;
  position: relative;
  background: transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.erp-sidebar-tpl-row:hover { background: #f5f5f5; }
.erp-sidebar-tpl-row.is-active,
.erp-sidebar-tpl-row.is-active:hover {
  background: #fff;
  transform: translateY(-4px);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 10px 24px rgba(15, 23, 42, 0.12);
  z-index: 2;
}
.erp-sidebar-tpl-list.is-reordering {
  user-select: none;
}
.erp-sidebar-tpl-ord {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  margin-left: 0.35rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.erp-sidebar-tpl-ord:active { cursor: grabbing; }
.erp-sidebar-tpl-num {
  display: block;
  width: 1.45rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.erp-sidebar-tpl-slot {
  flex: 0 0 auto;
  border-radius: 0.5rem;
  pointer-events: none;
}
.erp-sidebar-tpl-row.is-dragging {
  position: fixed;
  z-index: 80;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  transform: none;
  transition: none;
  filter: none;
}
.erp-sidebar-tpl-row.is-dragging.is-returning {
  transition: left 0.16s ease, top 0.16s ease;
}
.erp-sidebar-tpl-row.is-press:not(.is-active) {
  animation: erp-tpl-press 0.22s ease;
}
.erp-sidebar-tpl-row.is-active.is-press {
  animation: erp-tpl-press-active 0.22s ease;
}
#nav-principal .erp-nav-group-body.is-reordering {
  user-select: none;
}
#nav-principal .erp-nav-group-body > .vercel-nav-item,
#nav-principal .erp-nav-group-body > .nav-ai-group,
#nav-principal .erp-nav-group-body > .vercel-nav-item:hover,
#nav-principal .erp-nav-group-body > .nav-ai-group:hover,
#nav-principal .erp-nav-group-body > .vercel-nav-item:active,
#nav-principal .erp-nav-group-body > .nav-ai-group:active,
#erp-sidebar a.vercel-nav-item,
#erp-sidebar a.vercel-nav-item:hover,
#erp-sidebar a.vercel-nav-item:active,
#erp-sidebar a.vercel-nav-item * {
  cursor: pointer !important;
  touch-action: pan-y;
}
.erp-sidebar-nav-slot {
  flex: 0 0 auto;
  border-radius: 0.5rem;
  pointer-events: none;
}
#nav-principal a.vercel-nav-item {
  -webkit-user-drag: none;
  user-drag: none;
}
.vercel-nav-item.is-dragging,
.nav-ai-group.is-dragging {
  position: fixed !important;
  z-index: 80;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  transform: none !important;
  transition: none;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  font-weight: 600;
  box-shadow: none;
  filter: none;
}
.vercel-nav-item.is-dragging i,
.vercel-nav-item.is-dragging .nav-item-icon,
.nav-ai-group.is-dragging .vercel-nav-item,
.nav-ai-group.is-dragging i,
.nav-ai-group.is-dragging .nav-item-icon {
  color: #0F172A;
}
.nav-ai-group.is-dragging .vercel-nav-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  font-weight: 600;
}
#nav-principal .vercel-nav-item.is-dragging.is-returning,
#nav-principal .nav-ai-group.is-dragging.is-returning {
  transition: left 0.16s ease, top 0.16s ease;
}
#nav-principal .erp-nav-group-body.is-reordering .vercel-nav-item,
#nav-principal .erp-nav-group-body.is-reordering .nav-ai-group {
  transition: none;
  transform: none;
}
#nav-principal .vercel-nav-item.is-press,
#nav-principal .nav-ai-group.is-press,
#nav-principal .vercel-nav-item.is-press:hover,
#nav-principal .nav-ai-group.is-press:hover,
#erp-sidebar .vercel-nav-item.is-press,
#erp-sidebar .vercel-nav-item.is-press:hover,
#erp-sidebar .nav-ai-group.is-press,
#nav-principal .vercel-nav-item.is-active.is-press,
#nav-principal .nav-ai-group.is-press:has(.vercel-nav-item.is-active),
#nav-principal .vercel-nav-item.is-active.is-press:hover,
#erp-sidebar .vercel-nav-item.is-active.is-press,
#erp-sidebar .vercel-nav-item.is-active.is-press:hover,
#erp-sidebar .nav-ai-group.is-press:has(.vercel-nav-item.is-active) {
  animation: erp-nav-drop-press 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  transition: none !important;
}
@keyframes erp-nav-drop-press {
  0% { transform: translateY(-5px) scale(1); }
  38% { transform: translateY(2px) scale(0.975); }
  68% { transform: translateY(-1.5px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes erp-tpl-press {
  0% { transform: scale(1); }
  40% { transform: translateY(2px) scale(0.97); }
  100% { transform: scale(1); }
}
@keyframes erp-tpl-press-active {
  0% { transform: translateY(-4px) scale(1); }
  40% { transform: translateY(1px) scale(0.97); }
  100% { transform: translateY(-4px) scale(1); }
}
.erp-sidebar-tpl-item {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  text-align: left;
  background: transparent;
  border: none;
  cursor: grab;
  padding: 0.58rem 0.55rem 0.58rem 0.2rem;
}
.erp-sidebar-tpl-row.is-dragging,
.erp-sidebar-tpl-list.is-reordering .erp-sidebar-tpl-row,
.erp-sidebar-tpl-list.is-reordering .erp-sidebar-tpl-item {
  cursor: grabbing;
}
.erp-sidebar-tpl-name {
  font-size: 0.9375rem;
  font-weight: 300;
  letter-spacing: -0.011em;
  color: #6B7280;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
.erp-sidebar-tpl-paren {
  white-space: nowrap;
}
.erp-sidebar-tpl-row:hover .erp-sidebar-tpl-name {
  color: #0a0a0a;
}
.erp-sidebar-tpl-row.is-active .erp-sidebar-tpl-name {
  color: #6B7280;
}
.erp-sidebar-tpl-meta {
  display: none;
}
.erp-sidebar-tpl-del {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 0.4rem;
  color: #dc2626;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  touch-action: auto;
}
.erp-sidebar-tpl-del:hover { background: #fee2e2; color: #b91c1c; }
html.dark .erp-sidebar-tpl-row:hover { background: #1c1c1c; }
html.dark .erp-sidebar-tpl-row.is-active,
html.dark .erp-sidebar-tpl-row.is-active:hover {
  background: #18181b;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.32),
    0 1px 8px 0 rgba(0, 0, 0, 0.22);
}
html.dark .erp-sidebar-tpl-row.is-active .erp-sidebar-tpl-name { color: #fafafa; }
html.dark .erp-sidebar-tpl-name { color: #fafafa; }
html.dark .erp-sidebar-tpl-num { color: #71717a; }
.tpl-sidebar,
.tpl-editor {
  background: #fff;
  border: none;
  border-radius: 24px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tpl-editor {
  overflow: visible;
}
.lexia-elev-panel,
.tpl-sidebar,
.tpl-editor,
#panel-slot-herramienta-nicho [data-canvas],
.equipo-card,
.lso-deudores-table-wrap,
#panel-erp-facturacion > section,
.g-select-list,
.DropdownMenuContent,
.erp-user-menu,
.erp-doc-menu,
.historial-context-menu,
.lso-exp-escritos-menu,
.lso-ctx-menu,
.TooltipContent,
#chat-capacity-popover,
.login-card,
.cookie-policy-card,
.privacy-policy-card,
.faq-modal-card,
.dash-glass,
.glass-card,
.glass-panel,
.lg-name-frame,
.settings-panel-shell,
.settings-card,
.settings-unified-panel,
.payment-shell,
.toast-item,
.vercel-list,
.gemini-composer,
.gemini-rename-panel,
.erp-overflow-menu,
.erp-niche-listbox,
#command-palette-panel,
#chat-composer,
#chat-drawer,
#sidebar-historial,
#panel-historial,
#dropdown-adjuntos,
#modal-confirmacion > div,
#modal-camara > div,
#modal-lexnet > div,
#modal-session-lock > div,
#modal-login > div {
  container-type: inline-size;
  --lexia-elev-x: 0px;
  --lexia-elev-y: 1px;
  --lexia-elev-blur: 6px;
  --lexia-elev-soft: 8px;
  --lexia-elev-fade-blur: 12px;
  --lexia-elev-spread: 0px;
  border: 1px solid #E5E7EB;
  border-radius: 24px;
  box-shadow: none;
}
.lexia-elev-panel,
.g-select-list,
.DropdownMenuContent,
.erp-user-menu,
.erp-doc-menu,
.historial-context-menu,
.lso-exp-escritos-menu,
.lso-ctx-menu,
.TooltipContent,
#chat-capacity-popover,
#dropdown-adjuntos,
.erp-overflow-menu,
.erp-niche-listbox,
.gemini-rename-panel {
  box-shadow: none;
}
#chat-drawer,
#sidebar-historial,
#panel-historial {
  border-radius: 0;
  border: none;
  box-shadow: none;
}
#chat-composer {
  border-radius: 9999px;
}
#panel-slot-herramienta-nicho [data-canvas] {
  border: 1px solid #E5E7EB;
}

html.dark .g-select-list,
html.dark .DropdownMenuContent,
html.dark .erp-user-menu,
html.dark .erp-doc-menu,
html.dark .historial-context-menu,
html.dark .lso-exp-escritos-menu,
html.dark .lso-ctx-menu,
html.dark .TooltipContent,
html.dark #chat-capacity-popover,
html.dark .tpl-sidebar,
html.dark .tpl-editor,
html.dark .lexia-elev-panel,
html.dark #panel-slot-herramienta-nicho [data-canvas],
html.dark .lexnet-bandeja-card,
html.dark .agenda-cal-card,
html.dark .agenda-side-card,
html.dark .equipo-card,
html.dark .lso-deudores-table-wrap,
html.dark #panel-erp-facturacion > section,
html.dark .login-card,
html.dark .cookie-policy-card,
html.dark .privacy-policy-card,
html.dark .faq-modal-card,
html.dark .dash-glass,
html.dark .glass-card,
html.dark .glass-panel,
html.dark .lg-name-frame,
html.dark .settings-card,
html.dark .settings-unified-panel,
html.dark .payment-shell,
html.dark .toast-item,
html.dark .vercel-list {
  --lexia-elev-ink: 0 0 0;
  box-shadow: none;
}
html.dark #panel-slot-herramienta-nicho [data-canvas] {
  background: #111111 !important;
  border-color: #2a2a2a;
}
#cartera-page-heading {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  min-width: 0;
  flex: 1 1 auto;
}
#cartera-page-heading[hidden] {
  display: none !important;
}
.cartera-page-heading-text {
  min-width: 0;
  flex: 0 1 auto;
}
#tpl-ia-extract-panel.hidden,
#tpl-ia-extract-panel[hidden] {
  display: none !important;
}
#tpl-ia-extract-panel.tpl-ia-extract-panel {
  flex: 0 0 20rem;
  width: 20rem;
  max-width: 20rem;
  margin-left: 0;
  align-self: center;
}
@media (min-width: 640px) {
  #cartera-page-header {
    position: relative;
    align-items: flex-start;
  }
  #cartera-acciones-exp:not(.hidden),
  #cartera-acciones-clientes:not(.hidden),
  #cartera-acciones-facturacion:not(.hidden) {
    padding-top: 2.5rem;
  }
  #cartera-page-header:has(#tpl-ia-extract-panel:not([hidden])) {
    min-height: 7rem;
  }
  #tpl-ia-extract-panel.tpl-ia-extract-panel:not(.hidden):not([hidden]) {
    position: absolute;
    left: 50%;
    top: -0.4rem;
    transform: translateX(-50%);
    z-index: 2;
  }
}
#cartera-acciones-exp,
#cartera-acciones-clientes,
#cartera-acciones-facturacion {
  align-items: center;
}
#cartera-acciones-exp > button,
#cartera-acciones-clientes > button,
.cartera-accion-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 2.25rem !important;
  min-height: 2.25rem !important;
  max-height: 2.25rem !important;
  padding: 0 1rem !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  white-space: nowrap;
  gap: 0.375rem;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  border-radius: 9999px !important;
  vertical-align: middle;
}
#cartera-acciones-exp > button i,
#cartera-acciones-clientes > button i,
.cartera-accion-btn i {
  font-size: 0.625rem !important;
  line-height: 1 !important;
  width: 0.75rem;
  text-align: center;
  flex-shrink: 0;
}
.vercel-filters > .btn-secondary,
.vercel-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 2rem !important;
  min-height: 2rem !important;
  padding: 0 0.875rem !important;
  line-height: 1 !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  border-radius: 0.5rem !important;
  box-sizing: border-box !important;
  white-space: nowrap;
  align-self: center;
}
.tpl-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.tpl-sidebar-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #404040;
}
.tpl-icon-btn {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.45rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.tpl-icon-btn:hover { background: #f9fafb; }
.tpl-lista {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.tpl-lista-vacia {
  padding: 1.25rem 1rem;
  font-size: 0.75rem;
  color: #6B7280;
  text-align: center;
}
.tpl-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.tpl-item:hover { background: #f9fafb; }
.tpl-item.is-active { background: #f3f4f6; }
.tpl-item-nombre {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}
.tpl-item-desc {
  font-size: 0.6875rem;
  color: #6B7280;
}
.tpl-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e4e4e7;
  flex-wrap: nowrap;
}
.tpl-editor-title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(46%, 28rem);
}
.tpl-nav-title {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, max-content) 1.25rem;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 0.4rem;
  row-gap: 0.12rem;
  width: max-content;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}
.tpl-nav-title > .tpl-nav-name {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 0;
  min-width: 100%;
  max-width: none;
  justify-self: stretch;
}
.tpl-nav-title > #tpl-prev { grid-column: 1; grid-row: 2; align-self: start; justify-self: start; margin-top: 0.1rem; }
.tpl-nav-title > .tpl-editor-meta {
  grid-column: 2;
  grid-row: 2;
  width: max-content;
  max-width: min(36rem, 70vw);
}
.tpl-nav-title > #tpl-next { grid-column: 3; grid-row: 2; align-self: start; justify-self: end; margin-top: 0.1rem; }
.tpl-nav-title > input,
.tpl-nav-title > label,
.tpl-nav-title > select,
.tpl-nav-title .g-select,
.tpl-editor-title .g-select,
#tpl-select,
#tpl-select-trigger,
#tpl-select-list { display: none !important; }
.tpl-nav-title > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 0.2rem;
  background: transparent;
  color: #D1D5DB;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.tpl-nav-title > button:hover:not(:disabled) {
  background: transparent;
  color: #4B5563;
  opacity: 1;
}
.tpl-nav-title > button:disabled {
  opacity: 0.28;
  cursor: default;
}
.tpl-nav-name {
  margin: 0;
  min-width: 0;
  max-width: min(28rem, 100%);
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  text-align: left;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-nombre-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  padding: 0;
  text-overflow: ellipsis;
}
.tpl-editor-meta {
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
  color: #0a0a0a;
}
html.dark .tpl-nav-title {
  background: transparent;
  border: none;
}
html.dark .tpl-nav-title > button {
  background: transparent;
  color: #A1A1AA;
}
html.dark .tpl-nav-title > button:hover:not(:disabled) {
  background: transparent;
  color: #E4E4E7;
  opacity: 1;
}
html.dark .tpl-nav-name,
html.dark .tpl-editor-meta,
html.dark .erp-sidebar-tpl-name,
html.dark .erp-sidebar-tpl-meta { color: #fafafa; }
.tpl-editor-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: stretch;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0;
  position: relative;
  z-index: 5;
}
.tpl-editor-actions-end {
  grid-column: 2;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: 0;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.tpl-editor-actions-end[hidden] {
  display: none !important;
}
.tpl-editor-actions-end.is-visible {
  opacity: 1;
  transform: none;
}
.tpl-editor-actions > button,
.tpl-editor-actions .DropdownMenuTrigger,
.tpl-editor-actions .TooltipTrigger {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  align-self: center;
  height: auto !important;
  min-height: 0;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 150ms cubic-bezier(0, 0, 0.2, 1);
}
.tpl-editor-actions .btn-ghost {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #71717a !important;
}
.tpl-editor-actions .btn-ghost:hover {
  background: #f4f4f5 !important;
  color: #18181b !important;
  transform: scale(0.98);
}
.tpl-editor-actions .btn-ghost:active {
  transform: scale(0.96);
}
html.dark .tpl-editor-actions .btn-ghost {
  color: #a1a1aa !important;
}
html.dark .tpl-editor-actions .btn-ghost:hover {
  background: #27272a !important;
  color: #fafafa !important;
}
.tpl-editor-actions .DropdownMenu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
}
.tpl-editor-actions .DropdownMenuContent {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 40;
  min-width: 17.5rem;
  padding: 0.7rem 0.15rem;
  overflow: hidden;
  border-radius: 1.25rem;
  border: none;
  background: #fff;
  box-shadow: none;
}
#tpl-ia-menu.DropdownMenuContent {
  min-width: 0;
  width: max-content;
  padding: 0.3rem;
  border-radius: 0.9rem;
}
#tpl-ia-menu .DropdownMenuItem {
  width: auto;
  white-space: nowrap;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
}
#tpl-export-menu .DropdownMenuItem {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem;
  padding: 0.7rem 1.25rem;
  background: transparent;
}
#tpl-export-menu .btn-export-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  max-width: none;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: #111;
  white-space: normal;
}
#tpl-export-menu .btn-export-ext {
  font-weight: 400;
}
#tpl-export-menu .btn-export-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #8a8a8a;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.05rem;
}
#tpl-export-menu .DropdownMenuItem:disabled .btn-export-hint {
  display: none;
}
html.dark #tpl-export-menu .btn-export-hint {
  color: #a1a1aa;
}
.tpl-editor-actions .DropdownMenuItem {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  border-radius: 0;
  padding: 0.95rem 1.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.tpl-editor-actions .DropdownMenuItem:hover:not(:disabled) {
  background: #f7f7f8;
}
.tpl-editor-actions .DropdownMenuItem:active:not(:disabled) {
  background: #f7f7f8;
}
#tpl-export-menu .DropdownMenuItem:hover:not(:disabled),
#tpl-export-menu .DropdownMenuItem:active:not(:disabled) {
  background: transparent;
}
.tpl-editor-actions .DropdownMenuItem.hidden {
  display: none;
}
.tpl-editor-actions .DropdownMenuItem:disabled {
  opacity: 0.55;
  cursor: default;
}
html.dark .tpl-editor-actions .DropdownMenuContent {
  background: #171717;
  border: none;
  box-shadow: none;
}
html.dark .tpl-editor-actions .DropdownMenuItem {
  background: #171717;
  color: #fafafa;
}
html.dark .tpl-editor-actions .DropdownMenuItem:hover:not(:disabled) {
  background: #27272a;
}
html.dark .tpl-editor-actions .DropdownMenuTrigger.bg-transparent {
  border-color: #3f3f46;
  color: #fafafa;
}
.tpl-editor-actions .DropdownMenuTrigger {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#btn-exportar-plantilla {
  background: #18181b;
  color: #fff;
}
#btn-exportar-plantilla .tpl-export-chevron {
  transition: transform 0.15s ease;
  transform: rotate(-90deg);
}
#btn-exportar-plantilla[aria-expanded="true"] .tpl-export-chevron {
  transform: rotate(0deg);
}
#btn-exportar-plantilla:hover:not(:disabled) {
  background: #27272a;
}
#btn-exportar-plantilla:disabled {
  opacity: 0.6;
  cursor: default;
}
html.liquid-glass:not(.dark) #app-shell #btn-exportar-plantilla,
html.liquid-glass:not(.dark) #app-shell #btn-exportar-plantilla * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.tpl-editor-head,
.tpl-editor-actions {
  overflow: visible;
}
.TooltipProvider {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.Tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.TooltipTrigger {
  gap: 0.5rem;
}
.TooltipTrigger svg {
  margin-left: 0.15rem;
  flex-shrink: 0;
}
.TooltipContent {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  z-index: 50;
  width: max-content;
  max-width: 17.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: #ffffff !important;
  color: #0a0a0a !important;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  border: 1px solid #e5e7eb;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  white-space: normal;
  text-align: left;
}
.Tooltip:hover .TooltipContent,
.Tooltip:focus-within .TooltipContent {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.Tooltip:last-child .TooltipContent {
  left: auto;
  right: 0;
  transform: translateY(0.25rem);
}
.Tooltip:last-child:hover .TooltipContent,
.Tooltip:last-child:focus-within .TooltipContent {
  transform: translateY(0);
}
.tpl-help-icon {
  display: none;
  width: 0.875rem;
  height: 0.875rem;
  margin-left: 0.375rem;
  opacity: 0.6;
  flex-shrink: 0;
}
html.help-mode-active .tpl-help-icon {
  display: inline-block;
}
html:not(.help-mode-active) .tpl-editor-actions .Tooltip:hover .TooltipContent,
html:not(.help-mode-active) .tpl-editor-actions .Tooltip:focus-within .TooltipContent {
  opacity: 0 !important;
  visibility: hidden !important;
}
.tpl-editor-actions .tpl-caso-selector {
  grid-column: 1;
  justify-self: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  z-index: 6;
}
.tpl-editor-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 24rem;
}
.tpl-highlight,
.tpl-textarea {
  min-height: 24rem;
  width: 100%;
  border: none;
  outline: none;
  padding: 1.5rem clamp(1rem, 6%, 3.5rem);
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
  font-size: 0.9375rem;
  line-height: 1.7;
  letter-spacing: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  tab-size: 4;
  box-sizing: border-box;
}
.tpl-highlight {
  display: none !important;
}
.tpl-textarea {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  resize: none;
  overflow: auto;
  color: #1f2937;
  caret-color: #18181b;
  background: #fff;
  -webkit-text-fill-color: #1f2937;
  scrollbar-width: none;
  padding-bottom: 8.5rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 8rem), rgba(0, 0, 0, 0.35) calc(100% - 3.25rem), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 8rem), rgba(0, 0, 0, 0.35) calc(100% - 3.25rem), transparent 100%);
}
.tpl-textarea.is-scroll-end {
  -webkit-mask-image: none;
  mask-image: none;
}
.tpl-editor,
.tpl-editor-body,
.tpl-textarea,
#tpl-contenido {
  scrollbar-width: none;
}
.tpl-editor::-webkit-scrollbar,
.tpl-editor-body::-webkit-scrollbar,
.tpl-textarea::-webkit-scrollbar,
#tpl-contenido::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.tpl-textarea::selection {
  background: rgba(24, 24, 27, 0.14);
  color: inherit;
}
html.dark .tpl-sidebar,
html.dark .tpl-editor { background: #111; border: none; box-shadow: none; }
html.dark .tpl-sidebar-head,
html.dark .tpl-editor-head,
html.dark .tpl-editor-actions { border-color: #2a2a2a; }
html.dark .tpl-item:hover,
html.dark .tpl-item.is-active { background: #1c1c1c; }
html.dark .tpl-item-nombre,
html.dark .tpl-nombre-input { color: #fafafa; }
html.dark .tpl-icon-btn { background: #171717; border-color: #404040; color: #e5e5e5; }
html.dark .tpl-textarea,
html.dark.liquid-glass .tpl-textarea,
html.dark #tpl-contenido.tpl-textarea,
html.dark.liquid-glass #tpl-contenido.tpl-textarea {
  background: #111 !important;
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
  caret-color: #fafafa !important;
}

/* ?? Agenda procesal ?? */
.agenda-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1000px) {
  .agenda-workspace { grid-template-columns: minmax(0, 1fr); }
}
.agenda-cal-card,
.agenda-side-card,
.lexnet-bandeja-card {
  container-type: normal;
  contain: none;
}
.agenda-cal-card,
.agenda-side-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
}
.agenda-side-card {
  overflow: visible;
}
.agenda-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.agenda-cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.agenda-cal-titulo {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  min-width: 9rem;
}
.agenda-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #c4c4c8;
  cursor: pointer;
  transition: color 0.15s ease;
}
.agenda-nav-btn:hover,
.agenda-nav-btn:focus-visible {
  background: transparent;
  color: #71717a;
  outline: none;
}
.agenda-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0.5rem 0.75rem 0;
  gap: 0.35rem;
}
.agenda-cal-weekdays span {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  text-align: center;
}
.agenda-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.5rem 0.75rem 0.9rem;
}
.agenda-cal-cell {
  min-height: 4.25rem;
  border: 1px solid #f1f2f4;
  border-radius: 0.5rem;
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}
.agenda-cal-cell.is-muted { background: #fafafa; border-color: #f5f5f5; }
.agenda-cal-cell.has-events { border-color: #e5e7eb; }
.agenda-cal-cell.is-today {
  border-color: #111827;
  box-shadow: inset 0 0 0 1px #111827;
}
.agenda-cal-cell.is-past {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.agenda-cal-cell.is-past .agenda-cal-num { color: #9ca3af; }
.agenda-cal-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  font-variant-numeric: tabular-nums;
}
.agenda-cal-cell.is-today .agenda-cal-num { color: #111827; }
.agenda-cal-dots { display: flex; gap: 0.2rem; }
.agenda-cal-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #111827;
}
.agenda-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.agenda-side-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  flex: 1 1 auto;
  min-width: 0;
}
.agenda-side-rango-dd {
  position: relative;
  flex: 0 0 auto;
  z-index: 50;
}
.agenda-side-rango {
  margin: 0;
  padding: 0.28rem 1.6rem 0.28rem 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.agenda-side-rango:hover {
  background-color: #f9fafb;
}
.agenda-side-rango:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 1px;
}
.agenda-side-lista {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: min(60vh, 30rem);
  overflow-y: auto;
}
.agenda-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.65rem;
  border-radius: 0.55rem;
}
.agenda-side-item + .agenda-side-item { border-top: 1px solid #f1f2f4; }
.agenda-side-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.agenda-side-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.agenda-side-del:hover,
.agenda-side-del:focus-visible {
  color: #f87171;
  background: #fef2f2;
  outline: none;
}
.agenda-side-item-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}
.agenda-side-item-meta {
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  color: #6B7280;
}
.agenda-side-vacio {
  padding: 2rem 1rem;
  text-align: center;
}
html.dark .agenda-cal-card,
html.dark .agenda-side-card { background: #111; border-color: #2a2a2a; }
html.dark .agenda-cal-head,
html.dark .agenda-side-head { border-color: #2a2a2a; }
html.dark .agenda-cal-titulo,
html.dark .agenda-side-title,
html.dark .agenda-side-item-title { color: #fafafa; }
html.dark .agenda-side-rango {
  color: #e5e5e5;
  background-color: #171717;
  border-color: #404040;
}
html.dark .agenda-side-rango:hover { background-color: #262626; }
html.dark .agenda-nav-btn { background: transparent; border: none; color: #52525b; }
html.dark .agenda-nav-btn:hover,
html.dark .agenda-nav-btn:focus-visible { background: transparent; color: #a1a1aa; }
html.dark .agenda-cal-cell { background: #141414; border-color: #232323; }
html.dark .agenda-cal-cell.is-muted { background: #101010; border-color: #1a1a1a; }
html.dark .agenda-cal-cell.is-today { border-color: #fafafa; box-shadow: inset 0 0 0 1px #fafafa; }
html.dark .agenda-cal-cell.is-past .agenda-cal-num { color: #737373; }
html.dark .agenda-cal-num { color: #d4d4d4; }
html.dark .agenda-cal-dot { background: #fafafa; }
html.dark .agenda-side-item-meta { color: #a3a3a3; }
html.dark .agenda-side-del { color: #dc2626; }
html.dark .agenda-side-del:hover,
html.dark .agenda-side-del:focus-visible {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

/* ?? Equipo ?? */
.equipo-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
}
.equipo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.equipo-card-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}
.equipo-chat-ajustes {
  margin-bottom: 1rem;
}
.equipo-chat-ajustes-body {
  padding: 0.9rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.equipo-chat-ajustes-body p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #52525b;
}
.equipo-chat-ajustes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.equipo-card-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #6B7280;
}
.equipo-table-wrap { overflow-x: auto; }
.equipo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.equipo-table thead th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6B7280;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  white-space: nowrap;
}
.equipo-table tbody td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid #f1f2f4;
  color: #374151;
  vertical-align: middle;
}
.equipo-table tbody tr:last-child td { border-bottom: none; }
.equipo-nombre { font-weight: 600; color: #111827; }
.equipo-email { color: #6B7280; }
.equipo-pendiente { color: #9CA3AF; font-style: italic; }
.equipo-online { color: #047857; font-weight: 600; }
.equipo-offline { color: #9CA3AF; }
.equipo-acceso { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.equipo-compartir {
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.equipo-compartir:disabled { opacity: 0.4; cursor: not-allowed; }
#equipo-pantalla {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: min(28rem, calc(100vw - 2rem));
  background: #0f172a;
  color: #fff;
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}
#equipo-pantalla[hidden] { display: none; }
#equipo-pantalla video { display: block; width: 100%; max-height: 16rem; background: #000; }
#equipo-pantalla button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-size: 0.78rem;
}
html.dark .equipo-card { background: #111; border-color: #2a2a2a; }
html.dark .equipo-card-head { border-color: #2a2a2a; }
html.dark .equipo-card-title,
html.dark .equipo-nombre { color: #fafafa; }
html.dark .equipo-table thead th { background: #171717; border-color: #2a2a2a; color: #a3a3a3; }
html.dark .equipo-table tbody td { border-color: #232323; color: #d4d4d4; }

/* ============================================================
   TOAST DE ACCI?N REVERSIBLE ? esquina inferior derecha
   ============================================================ */
#undo-toast-container {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 12050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}
.undo-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(24rem, calc(100vw - 2.5rem));
  padding: 0.7rem 0.75rem 0.7rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  color: #0a0a0a;
  animation: undoToastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.undo-toast.is-leaving {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.undo-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #dcfce7;
  color: #166534;
}
.undo-toast-text {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
}
.undo-toast-action {
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 9999px;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}
.undo-toast-action:hover { background: rgba(15, 23, 42, 0.06); }
.undo-toast-close {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #6B7280;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.undo-toast-close:hover { background: rgba(15, 23, 42, 0.06); }
@keyframes undoToastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
html.dark .undo-toast {
  background: rgba(23, 23, 23, 0.86);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fafafa;
  box-shadow: none;
}
html.dark .undo-toast-icon { background: #14351f; color: #86efac; }
html.dark .undo-toast-action { border-color: rgba(255, 255, 255, 0.16); }
html.dark .undo-toast-action:hover { background: rgba(255, 255, 255, 0.08); }
html.dark .undo-toast-close:hover { background: rgba(255, 255, 255, 0.08); }
@media (prefers-reduced-motion: reduce) {
  .undo-toast { animation: none; }
}

/* ============================================================
   NAVEGACI?N ? ?tem del asistente IA
   ============================================================ */
.nav-ai-glyph {
  width: 1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
#nav-erp-chat:hover .nav-ai-glyph,
#nav-erp-chat.is-active .nav-ai-glyph,
.nav-ai-group:has(#nav-erp-chat.is-active) .nav-ai-glyph {
  filter: saturate(1.25) brightness(1.05);
}
.nav-ai-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav-ai-group .nav-ai-row {
  width: 100%;
}
.nav-ai-group #submenu-ai {
  list-style: none;
  margin: 0.15rem 0 0.25rem;
  padding-left: 1rem;
}
.nav-ai-group #submenu-ai.hidden,
.nav-ai-group #submenu-ai[hidden] {
  display: none !important;
}
.nav-ai-group.is-open #submenu-ai:not(.hidden) {
  display: block !important;
}
.nav-ai-group #submenu-ai .vercel-nav-item {
  font-size: 0.8125rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}
.nav-ai-group #icon-submenu-ai.rotate-90,
.nav-ai-group.is-open #icon-submenu-ai {
  transform: rotate(90deg);
}
.nav-ai-chevron-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
  position: relative;
}
html.liquid-glass #app-shell .nav-ai-glyph,
html.liquid-glass #erp-sidebar .nav-ai-glyph,
html:not(.dark) #app-shell .nav-ai-glyph,
html:not(.dark) #erp-sidebar .nav-ai-glyph {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}
html.dark .nav-ai-glyph,
html.dark #app-shell .nav-ai-glyph,
html.dark #erp-sidebar .nav-ai-glyph {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 45%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
}

/* ============================================================
   DIRECTORIO DE CLIENTES ? badges de nicho
   ============================================================ */
.lso-badge-nicho-lso { background: #ede9fe; color: #5b21b6; }
.lso-badge-nicho-bancario { background: #dbeafe; color: #1e40af; }
.lso-badge-nicho-extranjeria { background: #ffedd5; color: #9a3412; }
.lso-badge-nicho-b2b { background: #e0f2fe; color: #075985; }
html.dark .lso-badge-nicho-lso { background: #2e1065; color: #ddd6fe; }
html.dark .lso-badge-nicho-bancario { background: #172554; color: #bfdbfe; }
html.dark .lso-badge-nicho-extranjeria { background: #431407; color: #fed7aa; }
html.dark .lso-badge-nicho-b2b { background: #082f49; color: #bae6fd; }


/* ============================================================
   CHAT IA — vista principal full-width (#view-chat) Gemini
   ============================================================ */
#view-cartera.is-chat-workspace,
html.vista-erp-chat #view-cartera {
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html.vista-erp-chat #view-cartera > :not([hidden]) ~ :not([hidden]),
#view-cartera.is-chat-workspace > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}
html.vista-erp-chat #view-cartera > #view-chat,
#view-cartera.is-chat-workspace > #view-chat {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
html.vista-erp-chat #view-cartera > :not(#view-chat),
#view-cartera.is-chat-workspace > :not(#view-chat) {
  display: none !important;
}

/* Chat a sangre: sin padding del <main> (evita marco / doble pantalla) */
html.vista-erp-chat #main-container,
html.vista-erp-chat #main-container > main {
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background-color: var(--app-background) !important;
  background-image: none !important;
  overflow: hidden !important;
}
html.vista-erp-chat #main-container > main {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#view-chat,
html.vista-erp-chat #view-cartera,
#view-cartera:has(#view-chat:not(.hidden)) {
  max-width: none !important;
  width: 100% !important;
}
#view-chat {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background-color: #ffffff !important;
}
#view-chat.hidden { display: none !important; }

#chat-trial-banner.chat-trial-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  width: 100%;
  flex: 0 0 auto;
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  color: var(--app-text);
  background: color-mix(in srgb, var(--app-text) 4%, var(--app-background));
  border-bottom: 1px solid var(--app-border);
  z-index: 20;
}
#chat-trial-banner.chat-trial-banner[hidden],
#chat-trial-banner.chat-trial-banner.hidden {
  display: none !important;
}
html.vista-erp-chat #view-chat #chat-drawer.gemini-chat > #chat-incognito-chrome,
#view-chat #chat-drawer > #chat-incognito-chrome {
  position: absolute !important;
  top: 14px !important;
  left: 18px !important;
  right: 18px !important;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex-shrink: 0 !important;
  pointer-events: none;
}
html.auth-session.erp-nav-collapsed.vista-erp-chat #view-chat #chat-drawer.gemini-chat > #chat-incognito-chrome,
html.auth-session.erp-nav-collapsed #view-chat #chat-drawer > #chat-incognito-chrome {
  left: 4.25rem !important;
}
html.chat-incognito.vista-erp-chat #btn-toggle-historial,
html.chat-incognito.vista-erp-chat #btn-toggle-historial:not([hidden]):not(.hidden) {
  display: none !important;
}
#btn-chat-incognito.chat-incognito-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: #18181b;
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
}
.chat-incognito-lock {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 200ms ease-in-out;
}
#btn-chat-incognito.chat-incognito-toggle:active .chat-incognito-lock {
  transform: scale(0.92);
}
.chat-incognito-lock-open,
.chat-incognito-lock-closed {
  position: absolute;
  inset: 0;
  display: flex;
  transition: opacity 300ms ease-in-out, transform 300ms ease-in-out;
}
.chat-incognito-lock svg {
  width: 18px;
  height: 18px;
}
#view-chat #btn-chat-incognito .chat-incognito-lock-open {
  opacity: 1 !important;
  transform: scale(1) !important;
}
#view-chat #btn-chat-incognito .chat-incognito-lock-closed {
  opacity: 0 !important;
  transform: scale(0.75) !important;
}
#view-chat.chat-incognito #btn-chat-incognito .chat-incognito-lock-open {
  opacity: 0 !important;
  transform: scale(0.75) !important;
}
#view-chat.chat-incognito #btn-chat-incognito .chat-incognito-lock-closed {
  opacity: 1 !important;
  transform: scale(1) !important;
}
#chat-incognito-label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #18181b;
}
#chat-incognito-label[hidden],
#chat-incognito-hero[hidden],
#chat-incognito-note[hidden] {
  display: none !important;
}
#view-chat.chat-incognito #chat-incognito-label {
  display: inline !important;
}
#chat-incognito-hero {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 0 1.35rem;
}
#view-chat.chat-incognito #chat-drawer.chat-mode-empty #chat-incognito-hero {
  display: flex !important;
}
#view-chat.chat-incognito #chat-drawer.chat-mode-empty .chat-greeting-copy {
  display: none !important;
}
#view-chat.chat-incognito #chat-drawer.chat-mode-empty {
  padding-top: 22vh !important;
}
.chat-incognito-hero-title {
  margin: 0;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #18181b;
}
#chat-incognito-note.chat-incognito-note {
  display: none;
  max-width: 34rem;
  margin: 0.85rem auto 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #a1a1aa;
}
#view-chat.chat-incognito #chat-drawer.chat-mode-empty #chat-incognito-note {
  display: block !important;
}
html.dark #btn-chat-incognito.chat-incognito-toggle,
html.dark #chat-incognito-label,
html.dark .chat-incognito-hero-title {
  color: #fafafa;
}
#chat-trial-banner.chat-trial-banner.is-expired {
  color: #991b1b;
  background: #fef2f2;
  border-bottom-color: #fecaca;
}
#chat-trial-banner-label {
  font-weight: 500;
}
#chat-trial-banner-cta.chat-trial-banner-cta {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
#chat-trial-banner-cta.chat-trial-banner-cta:hover {
  opacity: 0.75;
}
html.dark #chat-trial-banner.chat-trial-banner {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.dark #chat-trial-banner.chat-trial-banner.is-expired {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border-bottom-color: rgba(248, 113, 113, 0.35);
}
#view-chat #chat-drawer.chat-mode-empty #chat-trial-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

html.vista-erp-chat #view-chat #chat-drawer,
html.vista-erp-chat #view-chat #chat-drawer.gemini-chat,
html.vista-erp-chat #view-chat #chat-drawer.view-chat-shell,
#view-chat #chat-drawer,
#view-chat #chat-drawer.gemini-chat {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  transform: none !important;
  visibility: visible !important;
  pointer-events: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 1 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
  opacity: 1 !important;
  transition: none !important;
  background-color: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.dark #view-chat #chat-drawer,
html.dark #view-chat #chat-drawer.gemini-chat {
  background-color: var(--app-background) !important;
  background-image: none !important;
}

/* Liquid Glass no debe encapsular el lienzo del chat como tarjeta flotante */
html.vista-erp-chat.liquid-glass #view-chat #chat-drawer,
html.vista-erp-chat.liquid-glass #view-chat #chat-drawer.gemini-chat,
html.vista-erp-chat.liquid-glass #view-chat #chat-drawer.view-chat-shell {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: #ffffff !important;
  background-image: none !important;
}
html.vista-erp-chat.liquid-glass #view-chat #chat-drawer::before,
html.vista-erp-chat.liquid-glass #view-chat #chat-drawer::after {
  content: none !important;
  display: none !important;
}

/* Estado vacío: bloque a altura de ojos (título + input + chips) */
html.vista-erp-chat #view-chat #chat-drawer.chat-mode-empty,
html.vista-erp-chat #view-chat #chat-drawer.gemini-chat.chat-mode-empty,
html.vista-erp-chat #view-chat #chat-drawer.view-chat-shell.chat-mode-empty,
#view-chat #chat-drawer.chat-mode-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 100% !important;
  min-height: 100% !important;
  gap: 0 !important;
  padding: 28vh 0 0 !important;
}
#view-chat #chat-drawer.chat-mode-empty #chat-empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 42rem !important;
  flex: 0 0 auto !important;
  order: 1;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
#view-chat #chat-drawer.chat-mode-empty #chat-messages-container {
  display: none !important;
}
#view-chat #chat-drawer.chat-mode-empty #chat-composer-wrap {
  position: sticky !important;
  bottom: 0 !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: 48rem !important;
  margin: 0 auto 0 !important;
  padding: 1rem !important;
  background: transparent !important;
  border-top: none !important;
  flex: 0 0 auto !important;
  order: 2;
  z-index: 2 !important;
}

#view-chat,
#view-chat #chat-drawer,
#view-chat .chat-greeting-title,
#view-chat .chat-greeting-subtitle,
#view-chat #chat-input,
#view-chat .chat-suggestion-chip {
  font-family: var(--font-sans) !important;
}

#view-chat .chat-greeting-title {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.025em !important;
  text-transform: none !important;
  color: #18181b !important;
  margin-bottom: 0.5rem !important;
}
#view-chat .chat-greeting-subtitle {
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #71717a !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.625 !important;
}
html.dark #view-chat .chat-greeting-title {
  color: #f3f4f6 !important;
}
html.dark #view-chat .chat-greeting-subtitle {
  color: #9ca3af !important;
}
#view-chat .chat-greeting-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.22s ease;
}
#view-chat .chat-greeting-copy:hover {
  transform: translateY(-3px);
}

#view-chat .chat-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2.5rem;
}
#dropdown-chat-plus #chat-suggestion-chips,
#dropdown-chat-plus .chat-suggestion-chips {
  display: flex !important;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.25rem;
  justify-content: stretch;
  margin-top: 0;
}
#dropdown-chat-plus .chat-preguntas-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 12.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}
#dropdown-chat-plus .chat-preguntas-scroll::-webkit-scrollbar {
  width: 6px;
}
#dropdown-chat-plus .chat-preguntas-scroll::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 999px;
}
#view-chat #chat-drawer.chat-mode-active .chat-suggestion-chips {
  display: none !important;
}
#view-chat #chat-drawer.chat-mode-active #dropdown-chat-plus .chat-suggestion-chips {
  display: flex !important;
}
#modal-preguntas-ia .pregunta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#modal-preguntas-ia .pregunta-row .chat-plus-starter,
#modal-preguntas-ia .pregunta-row .chat-starter {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
}
#modal-preguntas-ia .btn-borrar-pregunta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
}
#modal-preguntas-ia .btn-facilitar-posicion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  color: #2563eb;
  transition: color 140ms ease;
}
#modal-preguntas-ia .btn-facilitar-posicion:hover {
  color: #1d4ed8;
}
#modal-preguntas-ia .btn-facilitar-posicion.is-pinned {
  color: #16a34a;
}
#modal-preguntas-ia .btn-facilitar-posicion.is-pinned:hover {
  color: #15803d;
}
#modal-preguntas-ia .btn-facilitar-posicion.is-limit {
  color: #9ca3af;
}
#chat-composer-under-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}
#chat-composer-pregunta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  width: 100%;
  max-width: 42rem;
  margin: 0.65rem auto 0;
  min-width: 0;
}
#chat-composer-pregunta-pills:empty {
  display: none;
}
.chat-composer-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  max-width: 100%;
  padding: 0.22rem 0.28rem 0.22rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  transition: background 140ms ease, border-color 140ms ease;
}
.chat-composer-pill-wrap:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.chat-composer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.18rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
}
.chat-composer-pill:hover {
  color: #111827;
}
.chat-composer-pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.05rem;
  color: #9ca3af;
  border-radius: 9999px;
  flex-shrink: 0;
}
.chat-composer-pill-x:hover {
  color: #111827;
  background: #e5e7eb;
}
#view-chat .chat-suggestion-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
#view-chat .chat-suggestion-chip:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}
html.dark #view-chat .chat-suggestion-chip {
  background: #111827;
  border-color: #374151;
  color: #d1d5db;
}
html.dark #view-chat .chat-suggestion-chip:hover {
  background: #1f2937;
  border-color: #4b5563;
  color: #f9fafb;
}

/* Conversación activa: mensajes + composer abajo */
#view-chat #chat-drawer.chat-mode-active {
  align-items: stretch !important;
  justify-content: flex-start !important;
}
#view-chat #chat-drawer.chat-mode-active #chat-empty-state {
  display: none !important;
}
#view-chat #chat-drawer.chat-mode-active #chat-messages-container {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  height: auto !important;
  overflow-y: auto !important;
  padding: 2rem 1rem !important;
  padding-bottom: 2rem !important;
  order: 1;
}
#view-chat #chat-drawer.chat-mode-active #chat-composer-wrap {
  position: sticky !important;
  bottom: 0 !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 1rem 1rem max(1rem, env(keyboard-inset-height, 0px)) !important;
  background: rgb(255 255 255 / 0.8) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-top: 1px solid #f1f5f9 !important;
  flex: 0 0 auto !important;
  z-index: 5 !important;
  order: 2;
}
#view-chat #chat-composer-wrap > .relative {
  max-width: 42rem !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: visible !important;
}

#view-chat #chat-messages,
#view-chat .gemini-chat-messages {
  display: flex !important;
  flex-direction: column !important;
  gap: 2rem !important;
  min-height: 0 !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 48rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  background: transparent !important;
  padding: 0 !important;
}

#view-chat .chat-legal-composer,
#view-chat #chat-composer.chat-legal-composer,
#view-chat .chat-gemini-pill,
#view-chat #chat-composer.chat-gemini-pill {
  background: #ffffff !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 1.75rem !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 3.5rem !important;
  max-height: none !important;
  max-width: 42rem !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: visible !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 2rem !important;
  padding-right: 2rem !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
}
#view-chat #chat-composer.chat-legal-composer > .flex {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  align-items: center !important;
  flex: 1 1 auto !important;
}
#view-chat #chat-composer.chat-legal-composer.is-multiline {
  align-items: flex-end !important;
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
  border-radius: 1.5rem !important;
}
#view-chat #chat-composer.chat-legal-composer.is-multiline > .flex {
  align-items: flex-end !important;
}
#view-chat #chat-composer.chat-legal-composer:has(#attachment-preview-container:not(.hidden)),
#view-chat #chat-composer.chat-gemini-pill:has(#attachment-preview-container:not(.hidden)) {
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  border-radius: 1.75rem !important;
  padding: 0.85rem 1.15rem 0.6rem !important;
  gap: 0.35rem !important;
}
#view-chat #chat-composer:has(#attachment-preview-container:not(.hidden)) > #attachment-preview-container {
  order: -1;
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 0 0.15rem !important;
  overflow: visible;
}
#view-chat #chat-composer:has(#attachment-preview-container:not(.hidden)) > .flex {
  width: 100% !important;
  align-items: center !important;
}
#view-chat #chat-plus-wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  line-height: 0 !important;
}
#view-chat #btn-chat-plus {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  line-height: 0 !important;
  height: 1.125rem;
  width: 1.125rem;
  color: #1f1f1f !important;
}
#view-chat #btn-chat-plus svg {
  display: block !important;
  margin: 0 !important;
  transform-origin: 50% 50%;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
#view-chat #btn-chat-plus[aria-expanded="true"] svg {
  transform: rotate(45deg);
}
html.dark #view-chat .chat-legal-composer,
html.dark #view-chat #chat-composer.chat-legal-composer,
html.dark #view-chat .chat-gemini-pill,
html.dark #view-chat #chat-composer.chat-gemini-pill {
  background: #111827 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
#view-chat #chat-input {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
  resize: none !important;
  min-height: 1.5rem;
  max-height: 12rem;
  line-height: 1.45;
  padding: 0.1rem 0;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  color: #27272a !important;
  field-sizing: content;
}
#view-chat #chat-input:focus,
#view-chat #chat-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
}

.chat-context-meter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  pointer-events: none;
}
.chat-context-meter svg {
  transform-origin: 50% 50%;
  transform-box: fill-box;
  transform: rotate(0.01deg);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
#btn-capacity-usage[aria-expanded="true"] .chat-context-meter svg {
  transform: rotate(360.01deg);
}
.chat-context-meter-tick {
  fill: #737373;
  stroke: none;
}
html.dark .chat-context-meter-tick {
  fill: #a3a3a3;
}
#chat-capacity-wrap {
  position: relative;
  z-index: 50;
  overflow: visible;
}
#btn-capacity-usage {
  pointer-events: auto;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
#chat-composer.has-capacity-popover,
html.liquid-glass #chat-composer.has-capacity-popover {
  overflow: visible !important;
}
.w-64 { width: 16rem; }
.h-1\.5 { height: 0.375rem; }
.h-2 { height: 0.5rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.min-w-\[280px\] { min-width: 280px; }
.min-w-\[290px\] { min-width: 290px; }
.p-3\.5 { padding: 0.875rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mb-3\.5 { margin-bottom: 0.875rem; }
.ml-2\.5 { margin-left: 0.625rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.bg-gray-200\/80 { background-color: rgb(229 231 235 / 0.8); }
.shadow-md { box-shadow: none; }
.bg-gray-500 { background-color: #6b7280; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-emerald-600 { background-color: #059669; }
.bg-amber-600 { background-color: #d97706; }
.bg-fuchsia-700 { background-color: #a21caf; }
.bg-blue-400 { background-color: #60a5fa; }
.bg-blue-600 { background-color: #2563eb; }
.bg-orange-600 { background-color: #ea580c; }
.bg-purple-500 { background-color: #a855f7; }
#cap-bar-master > div {
  min-width: 0 !important;
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
}
.rounded-sm { border-radius: 0.125rem; }
.whitespace-nowrap { white-space: nowrap; }
.ml-auto { margin-left: auto; }
.overflow-hidden { overflow: hidden; }
#chat-capacity-popover {
  min-width: 290px;
}
.text-\[13px\] { font-size: 13px; line-height: 1.25rem; }
.rounded-\[2px\] { border-radius: 2px; }
html:not(.dark) #chat-capacity-popover .text-gray-600 {
  color: #4b5563 !important;
}
html:not(.dark) #chat-capacity-popover .text-gray-500 {
  color: #6b7280 !important;
}
html:not(.dark) #chat-capacity-popover .text-gray-400 {
  color: #9ca3af !important;
}
.chat-context-meter-track {
  stroke: #d4d4d4;
}
html.dark .chat-context-meter-track {
  stroke: #404040;
}
.chat-context-meter-arc {
  stroke: #737373;
  transition: stroke-dashoffset 180ms ease, stroke 180ms ease;
}
.chat-context-meter.is-warn .chat-context-meter-arc {
  stroke: #d97706;
}
.chat-context-meter.is-crit .chat-context-meter-arc {
  stroke: #dc2626;
}
#btn-chat-send,
#view-chat #btn-chat-send {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  width: 1rem;
  height: 1rem;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #a1a1aa !important;
  -webkit-text-fill-color: #a1a1aa !important;
  box-shadow: none !important;
  cursor: pointer !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: transform 0.15s ease, color 0.15s ease;
}
#btn-chat-send:hover,
#view-chat #btn-chat-send:hover {
  background: transparent !important;
  cursor: pointer !important;
  color: #52525b !important;
  -webkit-text-fill-color: #52525b !important;
}
#btn-chat-send:active,
#view-chat #btn-chat-send:active {
  transform: scale(0.95);
}
#btn-chat-send[aria-disabled="true"],
#view-chat #btn-chat-send[aria-disabled="true"],
#btn-chat-send:disabled,
#view-chat #btn-chat-send:disabled {
  cursor: pointer !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none;
}
#btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg),
#view-chat #btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg),
#btn-chat-send #icon-chat-send:not(.hidden),
#view-chat #btn-chat-send #icon-chat-send:not(.hidden),
#btn-chat-send #icon-chat-send:not(.hidden) path,
#view-chat #btn-chat-send #icon-chat-send:not(.hidden) path {
  display: block !important;
  margin: 0 auto;
  color: currentColor !important;
  stroke: currentColor !important;
  fill: none !important;
  flex-shrink: 0;
  pointer-events: none;
  opacity: 1 !important;
  filter: none !important;
  width: 1rem;
  height: 1rem;
}
#btn-chat-send #icon-chat-send:not(.hidden),
#view-chat #btn-chat-send #icon-chat-send:not(.hidden),
#btn-chat-send #icon-chat-send:not(.hidden) path,
#view-chat #btn-chat-send #icon-chat-send:not(.hidden) path {
  stroke-width: 2.5;
}
#btn-chat-send #icon-chat-send-bg,
#view-chat #btn-chat-send #icon-chat-send-bg {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 0;
  width: 1.5rem;
  height: 1.5rem;
  transform: scale(1.25);
  overflow: visible;
  display: block !important;
  pointer-events: none;
  fill: none !important;
  stroke: #C2E7FF !important;
  color: #C2E7FF !important;
  opacity: 0 !important;
  filter: none !important;
  transition: opacity 0.2s ease;
}
#btn-chat-send #icon-chat-send-bg path,
#view-chat #btn-chat-send #icon-chat-send-bg path {
  fill: none !important;
  stroke: #C2E7FF !important;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#btn-chat-send:hover #icon-chat-send-bg,
#view-chat #btn-chat-send:hover #icon-chat-send-bg {
  opacity: 0 !important;
}
#btn-chat-send:has(#icon-chat-send.hidden) #icon-chat-send-bg,
#view-chat #btn-chat-send:has(#icon-chat-send.hidden) #icon-chat-send-bg {
  opacity: 0 !important;
}
#btn-chat-send #icon-chat-send.hidden,
#view-chat #btn-chat-send #icon-chat-send.hidden,
#btn-chat-send #icon-chat-stop.hidden,
#view-chat #btn-chat-send #icon-chat-stop.hidden,
#btn-chat-send svg.hidden,
#view-chat #btn-chat-send svg.hidden {
  display: none !important;
}
#btn-chat-send #icon-chat-stop:not(.hidden),
#view-chat #btn-chat-send #icon-chat-stop:not(.hidden),
#btn-chat-send #icon-chat-stop:not(.hidden) rect,
#view-chat #btn-chat-send #icon-chat-stop:not(.hidden) rect {
  display: block !important;
  fill: #525252 !important;
  stroke: none !important;
  color: #525252 !important;
}
html.dark #btn-chat-send,
html.dark #view-chat #btn-chat-send {
  background: transparent !important;
  border-color: #737373 !important;
  color: #a3a3a3 !important;
  -webkit-text-fill-color: #a3a3a3 !important;
  opacity: 1 !important;
  cursor: pointer !important;
}
html.dark #btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg):not(#icon-chat-send),
html.dark #view-chat #btn-chat-send svg:not(.hidden):not(#icon-chat-send-bg):not(#icon-chat-send) {
  color: #a3a3a3 !important;
  stroke: #a3a3a3 !important;
  fill: none !important;
  opacity: 1 !important;
}
html.dark #btn-chat-send #icon-chat-send:not(.hidden),
html.dark #view-chat #btn-chat-send #icon-chat-send:not(.hidden),
html.dark #btn-chat-send #icon-chat-send:not(.hidden) path,
html.dark #view-chat #btn-chat-send #icon-chat-send:not(.hidden) path {
  color: #1F1F1F !important;
  stroke: #1F1F1F !important;
  fill: none !important;
  opacity: 1 !important;
}
#btn-chat-send.has-draft,
#view-chat #btn-chat-send.has-draft,
#btn-chat-send.has-draft:hover,
#view-chat #btn-chat-send.has-draft:hover {
  color: #2563eb !important;
  -webkit-text-fill-color: #2563eb !important;
}
#btn-chat-send.has-draft #icon-chat-send:not(.hidden),
#view-chat #btn-chat-send.has-draft #icon-chat-send:not(.hidden),
#btn-chat-send.has-draft #icon-chat-send:not(.hidden) path,
#view-chat #btn-chat-send.has-draft #icon-chat-send:not(.hidden) path,
html.dark #btn-chat-send.has-draft #icon-chat-send:not(.hidden),
html.dark #view-chat #btn-chat-send.has-draft #icon-chat-send:not(.hidden),
html.dark #btn-chat-send.has-draft #icon-chat-send:not(.hidden) path,
html.dark #view-chat #btn-chat-send.has-draft #icon-chat-send:not(.hidden) path,
html.liquid-glass #chat-drawer #btn-chat-send.has-draft #icon-chat-send:not(.hidden),
html.liquid-glass #chat-drawer #btn-chat-send.has-draft #icon-chat-send:not(.hidden) path,
html.liquid-glass:not(.dark) #chat-drawer #btn-chat-send.has-draft svg:not(.hidden):not(#icon-chat-send-bg),
html.liquid-glass:not(.dark) #chat-drawer #btn-chat-send.has-draft #icon-chat-send:not(.hidden) path,
html.dark.liquid-glass #chat-drawer #btn-chat-send.has-draft #icon-chat-send:not(.hidden),
html.dark.liquid-glass #chat-drawer #btn-chat-send.has-draft #icon-chat-send:not(.hidden) path {
  color: #2563eb !important;
  stroke: #2563eb !important;
}
html.dark #btn-chat-send #icon-chat-send-bg,
html.dark #view-chat #btn-chat-send #icon-chat-send-bg,
html.dark #btn-chat-send #icon-chat-send-bg path,
html.dark #view-chat #btn-chat-send #icon-chat-send-bg path {
  fill: none !important;
  stroke: #C2E7FF !important;
  color: #C2E7FF !important;
}
html.dark #btn-chat-send #icon-chat-stop:not(.hidden),
html.dark #view-chat #btn-chat-send #icon-chat-stop:not(.hidden),
html.dark #btn-chat-send #icon-chat-stop:not(.hidden) rect,
html.dark #view-chat #btn-chat-send #icon-chat-stop:not(.hidden) rect {
  display: block !important;
  fill: #a3a3a3 !important;
  stroke: none !important;
  color: #a3a3a3 !important;
}
#btn-enviar-chat.chat-send-legal,
#view-chat #btn-enviar-chat.chat-send-legal,
#view-chat #btn-enviar-chat {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 9999px !important;
  background: #111111 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}
#btn-enviar-chat.chat-send-legal:hover:not(:disabled),
#view-chat #btn-enviar-chat:hover:not(:disabled) {
  opacity: 0.88;
  transform: scale(1.05);
  background: #000000 !important;
  filter: none;
  border-color: transparent !important;
}
#btn-enviar-chat.chat-send-legal:active:not(:disabled),
#view-chat #btn-enviar-chat:active:not(:disabled) {
  opacity: 0.75;
  transform: scale(0.96);
}
#btn-enviar-chat.chat-send-legal:disabled,
#view-chat #btn-enviar-chat:disabled {
  background: #d1d5db !important;
  color: #9ca3af !important;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
#btn-enviar-chat.chat-send-legal svg,
#btn-enviar-chat.chat-send-legal .chat-send-icon,
#view-chat #btn-enviar-chat svg,
#view-chat #btn-enviar-chat.chat-send-legal svg {
  width: 16px;
  height: 16px;
  display: block !important;
  color: currentColor !important;
  stroke: currentColor !important;
  fill: none !important;
  flex-shrink: 0;
  pointer-events: none;
  transform: translate(-0.5px, 0.5px);
}
html.dark #btn-enviar-chat.chat-send-legal,
html.dark #view-chat #btn-enviar-chat.chat-send-legal,
html.dark #view-chat #btn-enviar-chat {
  background: #fafafa !important;
  color: #111111 !important;
  border: none !important;
}
html.dark #btn-enviar-chat.chat-send-legal:hover:not(:disabled),
html.dark #view-chat #btn-enviar-chat:hover:not(:disabled) {
  background: #ffffff !important;
  opacity: 0.92;
}
html.dark #btn-enviar-chat.chat-send-legal:disabled,
html.dark #view-chat #btn-enviar-chat:disabled {
  background: #404040 !important;
  color: #737373 !important;
}
html.dark #view-chat #btn-enviar-chat svg,
html.dark #view-chat #btn-enviar-chat.chat-send-legal svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

/* Burbujas Gemini */
#view-chat .gemini-msg-user {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
  width: 100% !important;
}
#view-chat .gemini-msg-assistant {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
}
#view-chat .gemini-bubble-user {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-size: 0.875rem !important;
  border-radius: 1rem !important;
  padding: 0.75rem 1rem !important;
  max-width: 75% !important;
  border: none !important;
  box-shadow: none !important;
  line-height: 1.625 !important;
}
html.dark #view-chat .gemini-bubble-user {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}
#view-chat .gemini-bubble-assistant {
  width: 100% !important;
  max-width: 100% !important;
  background: transparent !important;
  color: #1e293b !important;
  font-size: 0.875rem !important;
  border-radius: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  line-height: 1.625 !important;
}
html.dark #view-chat .gemini-bubble-assistant {
  background: transparent !important;
  color: #e2e8f0 !important;
}
#view-chat .ai-action-bar {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-top: 0.75rem !important;
  padding-top: 0.5rem !important;
  color: #94a3b8 !important;
}
#view-chat .gemini-bubble-error {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border-radius: 1rem !important;
  padding: 0.75rem 1.25rem !important;
  max-width: min(100%, 32rem);
  border: none !important;
  box-shadow: none !important;
}
html.dark #view-chat .gemini-bubble-error {
  background: rgba(127, 29, 29, 0.35) !important;
  color: #fca5a5 !important;
}
#view-chat .gemini-msg-label {
  display: none !important;
}

#view-chat .gemini-msg-user .user-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  margin-top: 0.35rem;
  min-height: 1.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  color: #9ca3af;
}
#view-chat .gemini-msg-user:hover .user-action-bar,
#view-chat .gemini-msg-user:focus-within .user-action-bar,
#view-chat .gemini-msg-user.is-editing .user-action-bar {
  opacity: 1;
  pointer-events: auto;
}
#view-chat .gemini-msg-user .user-edit-actions {
  display: none;
}
#view-chat .gemini-msg-user.is-editing .user-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
}
#view-chat .gemini-msg-user.is-editing [data-action="copiarConsultaUsuario"],
#view-chat .gemini-msg-user.is-editing [data-action="editarConsultaUsuario"] {
  display: none !important;
}
#view-chat .gemini-msg-user.is-editing .user-action-bar {
  margin-top: 0.5rem;
  min-height: auto;
}
#view-chat .user-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 80ms ease;
}
#view-chat .user-edit-btn:active {
  transform: translateY(1px) scale(0.97);
}
#view-chat .user-edit-btn-cancel {
  background: transparent;
  border: none;
  color: #6b7280;
  padding: 0.4rem 0.55rem;
  border-radius: 0.375rem;
}
#view-chat .user-edit-btn-cancel:hover {
  color: #111827;
  background: rgba(0, 0, 0, 0.04);
}
#view-chat .user-edit-btn-submit {
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 9999px;
  padding: 0.45rem 0.95rem;
}
#view-chat .user-edit-btn-submit:hover {
  background: #262626;
  border-color: #262626;
}
html.dark #view-chat .user-edit-btn-cancel {
  color: #9ca3af;
}
html.dark #view-chat .user-edit-btn-cancel:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.06);
}
html.dark #view-chat .user-edit-btn-submit {
  background: #f3f4f6;
  color: #111827;
  border-color: #f3f4f6;
}
html.dark #view-chat .user-edit-btn-submit:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
}
#view-chat .user-edit-input {
  align-self: flex-end;
  width: min(100%, 32rem);
  min-height: 2.75rem;
  resize: vertical;
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  font-size: 0.9375rem;
  line-height: 1.55;
  outline: none;
}
html.dark #view-chat .user-edit-input {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #374151;
}

#view-chat .ai-action-bar .ai-action-btn,
#view-chat .user-action-bar .ai-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  line-height: 1;
  color: #9ca3af;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, transform 80ms ease;
}
#view-chat .ai-action-bar .ai-action-btn:has(.ai-fb-count) {
  width: auto;
  min-width: 1.85rem;
  padding: 0 0.35rem;
  gap: 0.2rem;
}
#view-chat .ai-action-bar .ai-fb-count {
  font-size: 0.62rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: inherit;
  pointer-events: none;
}
#view-chat .ai-action-bar .ai-action-btn:active,
#view-chat .user-action-bar .ai-action-btn:active {
  transform: translateY(1px) scale(0.92);
}
#view-chat .ai-action-bar .ai-action-btn:hover,
#view-chat .user-action-bar .ai-action-btn:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.04);
}
html.dark #view-chat .ai-action-bar .ai-action-btn:hover,
html.dark #view-chat .user-action-bar .ai-action-btn:hover {
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.06);
}
#view-chat .ai-action-bar .ai-action-btn.is-copied,
#view-chat .user-action-bar .ai-action-btn.is-copied,
#view-chat .ai-action-bar .ai-action-btn.is-saved {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}
#view-chat .ai-action-bar .ai-action-btn.is-active {
  color: #111827;
  background: rgba(0, 0, 0, 0.06);
}
html.dark #view-chat .ai-action-bar .ai-action-btn.is-active {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.08);
}
#view-chat .ai-action-bar .ai-action-btn.is-active[data-arg="up"] {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}
#view-chat .ai-action-bar .ai-action-btn.is-active[data-arg="down"] {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}
html.dark #view-chat .ai-action-bar .ai-action-btn.is-copied,
html.dark #view-chat .user-action-bar .ai-action-btn.is-copied,
html.dark #view-chat .ai-action-bar .ai-action-btn.is-saved,
html.dark #view-chat .ai-action-bar .ai-action-btn.is-active[data-arg="up"] {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}
html.dark #view-chat .ai-action-bar .ai-action-btn.is-active[data-arg="down"] {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

#view-chat .ai-action-bar .ai-action-btn.ai-star-btn {
  color: #94a3b8;
}
#view-chat .ai-action-bar .ai-action-btn.ai-star-btn:hover {
  color: #f59e0b;
  background: #f1f5f9;
}
#view-chat .ai-action-bar .ai-action-btn.ai-star-btn.is-starred,
#view-chat .ai-action-bar .ai-action-btn.ai-star-btn.is-starred:hover {
  color: #f59e0b;
  background: #fffbeb;
  transform: scale(1.05);
}
#view-chat .ai-action-bar .ai-action-btn.ai-star-btn.is-starred svg {
  fill: #fbbf24;
  stroke: #f59e0b;
}
html.dark #view-chat .ai-action-bar .ai-action-btn.ai-star-btn:hover {
  background: rgba(245, 158, 11, 0.12);
}
html.dark #view-chat .ai-action-bar .ai-action-btn.ai-star-btn.is-starred,
html.dark #view-chat .ai-action-bar .ai-action-btn.ai-star-btn.is-starred:hover {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
}

#view-chat #chat-drawer > #chat-marcadores-nav {
  position: absolute !important;
  right: 0.5rem !important;
  left: auto !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  z-index: 30 !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
}
#view-chat #chat-drawer > #chat-marcadores-nav[hidden] {
  display: none !important;
}
@media (min-width: 640px) {
  #view-chat #chat-drawer > #chat-marcadores-nav {
    right: 1rem !important;
  }
}
.chat-marcador-pill {
  width: auto;
  height: auto;
  border-radius: 9999px;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  color: #b45309;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  transition: transform 150ms ease, background 150ms ease;
}
.chat-marcador-pill:hover {
  background: #fffbeb;
  transform: scale(1.05);
}
.chat-marcador-pill svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: #f59e0b;
  fill: #fbbf24;
  transition: transform 150ms ease;
}
.chat-marcador-pill:hover svg {
  transform: scale(1.1);
}
.chat-marcador-pill span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #b45309;
  letter-spacing: 0.025em;
  line-height: 1;
}
#view-chat .gemini-msg.chat-marcador-flash {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.8);
  background: rgba(255, 251, 235, 0.3);
  border-radius: 1rem;
  transition: box-shadow 1s ease, background 1s ease;
}

#view-chat .ai-feedback-wrap {
  width: 100%;
}
#view-chat .ai-dislike-reason {
  margin-top: 0.7rem;
  padding: 0.75rem 0.8rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#view-chat .ai-dislike-reason.hidden {
  display: none;
}
#view-chat .ai-dislike-reason-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}
#view-chat .ai-dislike-reason-input {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  background: #fff;
  color: #111827;
  outline: none;
}
#view-chat .ai-dislike-reason-input:focus {
  border-color: #e5e7eb;
}
#view-chat .ai-dislike-reason-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
}
html.dark #view-chat .ai-dislike-reason {
  background: #171717;
  border-color: #374151;
}
html.dark #view-chat .ai-dislike-reason-title {
  color: #f3f4f6;
}
html.dark #view-chat .ai-dislike-reason-input {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #374151;
}

.dev-feedback-ia-list {
  padding: 0.25rem 0;
}
.dev-feedback-ia-empty {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}
.dev-feedback-ia-item {
  position: relative;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.dev-feedback-ia-meta-end {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.dev-feedback-ia-delete,
.dev-feedback-ia-delete:hover,
.dev-feedback-ia-delete:focus,
.dev-feedback-ia-delete:focus-visible,
.dev-feedback-ia-delete:active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  color: #b91c1c;
  cursor: pointer;
}
.dev-feedback-ia-delete svg,
.dev-feedback-ia-delete:hover svg,
.dev-feedback-ia-delete svg path {
  display: block;
  color: #b91c1c;
  stroke: #b91c1c;
}
.dev-feedback-ia-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.dev-feedback-ia-item:first-child {
  padding-top: 0;
}
.dev-feedback-ia-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}
.dev-feedback-ia-comment {
  margin: 0;
  font-size: 0.875rem;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}
.dev-feedback-ia-preview {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}
html.dark .dev-feedback-ia-empty,
html.dark .dev-feedback-ia-meta,
html.dark .dev-feedback-ia-preview {
  color: #9ca3af;
}
html.dark .dev-feedback-ia-item {
  border-bottom-color: #374151;
}
html.dark .dev-feedback-ia-comment {
  color: #f3f4f6;
}
.dev-feedback-ia-tags {
  display: inline-flex;
  margin: 0 0 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #f4f4f5;
  color: #18181b;
  font-size: 0.75rem;
  font-weight: 600;
}
.dev-feedback-ia-context {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dev-feedback-ia-label {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #71717a;
}
.dev-feedback-ia-block {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #3f3f46;
  white-space: pre-wrap;
  word-break: break-word;
}
html.dark .dev-feedback-ia-tags {
  background: #27272a;
  color: #fafafa;
}
html.dark .dev-feedback-ia-block {
  background: #18181b;
  border-color: #3f3f46;
  color: #e4e4e7;
}
.ia-fb-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ia-fb-modal.hidden {
  display: none;
}
.ia-fb-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
}
.ia-fb-dialog {
  position: relative;
  z-index: 1;
  width: min(32rem, 100%);
  max-height: min(90vh, 40rem);
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}
.ia-fb-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #52525b;
  cursor: pointer;
}
.ia-fb-close:hover {
  background: #f4f4f5;
}
.ia-fb-title {
  margin: 0 2rem 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #18181b;
}
.ia-fb-sub {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #71717a;
}
.ia-fb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ia-fb-chip {
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #18181b;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
}
.ia-fb-chip:hover {
  background: #fafafa;
}
.ia-fb-chip.is-selected {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
}
.ia-fb-extra {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.9rem;
}
.ia-fb-extra.hidden {
  display: none;
}
.ia-fb-input {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  border: 1px solid #e4e4e7;
  border-radius: 0.85rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #18181b;
  background: #fff;
  outline: none;
}
.ia-fb-input:focus {
  border-color: #a1a1aa;
}
.ia-fb-submit {
  align-self: flex-end;
  border: 0;
  border-radius: 999px;
  background: var(--app-primary);
  color: #fff;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.ia-fb-submit:disabled {
  opacity: 0.55;
  cursor: default;
}
html.dark .ia-fb-dialog {
  background: #18181b;
  border-color: #3f3f46;
}
html.dark .ia-fb-title {
  color: #fafafa;
}
html.dark .ia-fb-sub,
html.dark .ia-fb-close {
  color: #a1a1aa;
}
html.dark .ia-fb-close:hover {
  background: #27272a;
}
html.dark .ia-fb-chip {
  background: #18181b;
  border-color: #3f3f46;
  color: #fafafa;
}
html.dark .ia-fb-chip.is-selected {
  background: #fafafa;
  border-color: #fafafa;
  color: #18181b;
}
html.dark .ia-fb-input {
  background: #09090b;
  border-color: #3f3f46;
  color: #fafafa;
}
html.dark .ia-fb-submit {
  background: #fafafa;
  color: #18181b;
}

/* Modelo del chat — vive en Ajustes › Integración IA (sin popover en composer) */
#view-chat #btn-model-selector {
  max-width: 9.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #52525b;
}
#view-chat #btn-model-selector-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#btn-model-selector .chat-model-chevron {
  transition: transform 0.15s ease;
  transform: rotate(0deg);
  color: inherit;
  stroke: currentColor;
}
#btn-model-selector .chat-model-chevron path {
  stroke: currentColor;
}
html.dark #btn-model-selector .chat-model-chevron,
html.dark #btn-model-selector .chat-model-chevron path,
.dark #btn-model-selector .chat-model-chevron,
.dark #btn-model-selector .chat-model-chevron path {
  color: #ffffff !important;
  stroke: #ffffff !important;
}
#btn-model-selector[aria-expanded="true"] .chat-model-chevron {
  transform: rotate(-90deg);
}
html.dark #icon-submenu-ai,
html.dark .nav-ai-chevron-btn svg,
.dark #icon-submenu-ai,
.dark .nav-ai-chevron-btn svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}
#chat-model-settings .ia-choice-card {
  min-height: 100%;
}
#chat-model-settings > div + div {
  margin-top: 1rem !important;
  padding-top: 0;
}

/* Cursor de streaming sutil en burbuja IA */
.chat-stream-cursor {
  display: inline-block;
  width: 0.45em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: currentColor;
  opacity: 0.35;
  border-radius: 1px;
  animation: chat-stream-blink 1.05s steps(1, end) infinite;
}
@keyframes chat-stream-blink {
  0%, 45% { opacity: 0.4; }
  50%, 100% { opacity: 0; }
}
.chat-stream-cursor--pulse {
  animation: chat-stream-pulse 1.1s ease-in-out infinite;
}
@keyframes chat-stream-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.95; }
}
.gemini-bubble-streaming .ai-message-body:empty::before,
.gemini-bubble-streaming .ai-message-body:has(> .chat-stream-cursor:only-child)::before {
  content: none;
}

/* Skeleton “pensando” — burbuja horizontal con líneas de texto */
#view-chat .gemini-bubble-thinking,
.gemini-bubble-thinking {
  width: auto !important;
  max-width: min(40rem, 92%) !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.chat-thought-block {
  border-left: 2px solid rgb(228 228 231 / 0.6);
  padding: 0.25rem 0 0.25rem 0.75rem;
  margin: 0.75rem 0;
}
.chat-thought-text {
  margin: 0;
  font-size: 13px;
  color: #71717a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.625;
  opacity: 0.8;
  white-space: pre-wrap;
}
.chat-thought-accordion > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: #a1a1aa;
  user-select: none;
  display: flex;
  align-items: center;
}
.chat-thought-accordion > summary::-webkit-details-marker {
  display: none;
}
.chat-thought-accordion--live {
  width: min(22rem, 100%);
  margin: 0;
  padding: 0.7rem 0.9rem 0.45rem;
  border-radius: 0.85rem;
  background: rgb(244 244 245 / 0.9);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.6) inset;
}
html.dark .chat-thought-accordion--live {
  background: rgb(39 39 42 / 0.55);
  box-shadow: none;
}
.chat-thought-pulse {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.45rem;
  border-radius: 9999px;
  background: #71717a;
  animation: chat-thought-pulse 1.1s ease-in-out infinite;
}
.chat-thought-status {
  margin: 0 0 0.35rem;
}
.chat-thinking-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.35rem 0 0.15rem;
}
.chat-thinking-bars > div {
  height: 0.45rem;
  max-width: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #e4e4e7 0%, #fafafa 45%, #e4e4e7 100%);
  background-size: 200% 100%;
  animation: chat-thinking-shimmer 1.15s ease-in-out infinite;
}
.chat-thinking-bars > div:nth-child(1) { width: 100%; }
.chat-thinking-bars > div:nth-child(2) { width: 84%; animation-delay: 0.12s; }
.chat-thinking-bars > div:nth-child(3) { width: 62%; animation-delay: 0.24s; }
html.dark .chat-thinking-bars > div {
  background: linear-gradient(90deg, #3f3f46 0%, #52525b 45%, #3f3f46 100%);
  background-size: 200% 100%;
}
@keyframes chat-thought-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes chat-thinking-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
html.dark .chat-thought-block {
  border-left-color: rgb(63 63 70 / 0.7);
}
html.dark .chat-thought-text {
  color: #a1a1aa;
}
.gemini-bubble-thinking .ai-message-body {
  width: 100%;
}
.chat-thinking-skeleton {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  opacity: 1;
  transition: opacity 0.24s ease, transform 0.24s ease;
  will-change: opacity, transform;
}
.chat-thinking-skeleton--out {
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
}
.chat-thinking-card {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.4rem;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #a1a1aa;
  background: transparent;
  box-shadow: none;
}
html.dark .chat-thinking-card {
  color: #a1a1aa;
  background: transparent;
  box-shadow: none;
}
.ia-scale-svg {
  display: block;
  overflow: visible;
}
.ia-scale-arm {
  transform-box: view-box;
  transform-origin: 50% 22%;
  animation: ia-scale-tilt 1.7s ease-in-out infinite;
}
.ia-scale-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  margin-bottom: 0.08rem;
}
.ia-scale-dots i {
  width: 0.26rem;
  height: 0.26rem;
  border-radius: 9999px;
  background: currentColor;
  animation: ia-scale-dot 1.2s ease-in-out infinite;
}
.ia-scale-dots i:nth-child(2) { animation-delay: 0.16s; }
.ia-scale-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes ia-scale-tilt {
  0%, 100% { transform: rotate(-16deg); }
  50% { transform: rotate(16deg); }
}
@keyframes ia-scale-dot {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-thought-pulse,
  .chat-thinking-bars > div,
  .ia-scale-arm,
  .ia-scale-dots i {
    animation: none;
  }
  .chat-thinking-skeleton {
    animation: none;
    transition: opacity 0.15s ease;
  }
}
#chat-model-settings > div:has(> [aria-label="Modelo del chat"]) > p:first-child {
  margin-bottom: 0.5rem !important;
}
#chat-model-settings .ia-choice-card.is-selected {
  border-color: #22c55e !important;
  background: #fff !important;
  box-shadow: none !important;
}
#chat-model-settings .ia-choice-card.is-selected .ia-choice-icon {
  background: #eff6ff !important;
  color: inherit !important;
  box-shadow: none;
  ring: none;
}
#chat-model-settings .ia-choice-card.is-selected .ia-choice-icon svg {
  color: inherit !important;
  stroke: currentColor;
}
#chat-model-settings .ia-choice-card.is-selected .model-popover-check {
  display: none !important;
}
html.dark #chat-model-settings .ia-choice-card.is-selected {
  border-color: #22c55e !important;
  background: transparent !important;
  box-shadow: none !important;
}
html.dark #chat-model-settings .ia-choice-card.is-selected .ia-choice-icon {
  background: rgba(59, 130, 246, 0.15) !important;
  color: inherit !important;
}
html.dark #chat-model-settings .ia-choice-card.is-selected .ia-choice-icon svg {
  color: inherit !important;
}
html.dark #chat-model-settings .ia-choice-card.is-selected .model-popover-check {
  display: none !important;
}
#chat-model-settings .ia-choice-card .text-gray-500 {
  font-weight: 400;
}
#chat-model-settings .model-popover-check {
  display: none !important;
}

#ai-model-dropdown {
  overflow: visible;
}
#ai-model-dropdown-menu.ai-dd-shell {
  box-sizing: border-box;
  position: relative;
  width: 9.5rem;
  min-width: 9.5rem;
  max-width: 9.5rem;
  height: auto;
  max-height: none;
  overflow: visible !important;
  border: 1px solid #E5E7EB;
  border-radius: 24px;
  box-shadow: none;
}
#ai-dd-accordion {
  position: relative;
  padding: 0;
  width: 100%;
  min-width: 0;
}
#ai-dd-accordion [data-ai-accordion] {
  position: relative;
}
#ai-dd-accordion .ai-dd-acc-title {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border: none;
  background: transparent;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
#ai-dd-accordion .ai-dd-acc-title span {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}
html.dark #ai-dd-accordion .ai-dd-acc-title {
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
}
#ai-dd-accordion [data-ai-accordion]:first-child .ai-dd-acc-title {
  border-radius: 23px 23px 0 0;
}
#ai-dd-accordion [data-ai-accordion]:last-child .ai-dd-acc-title {
  border-radius: 0 0 23px 23px;
}
#ai-dd-accordion .ai-dd-acc-title:hover,
#ai-dd-accordion [data-ai-accordion]:hover > .ai-dd-acc-title {
  background: #f3f4f6;
}
#ai-dd-accordion [data-ai-accordion].is-open > .ai-dd-acc-title,
#ai-dd-accordion [data-ai-accordion].is-open > .ai-dd-acc-title:hover {
  background: #d1d5db;
}
#ai-dd-accordion [data-ai-accordion].is-open > [data-ai-accordion-panel] {
  display: block;
}
html.dark #ai-dd-accordion .ai-dd-acc-title:hover,
html.dark #ai-dd-accordion [data-ai-accordion]:hover > .ai-dd-acc-title {
  background: #262626;
}
html.dark #ai-dd-accordion [data-ai-accordion].is-open > .ai-dd-acc-title,
html.dark #ai-dd-accordion [data-ai-accordion].is-open > .ai-dd-acc-title:hover {
  background: #404040;
}
#ai-dd-accordion [data-ai-accordion-panel],
body > [data-ai-accordion-panel] {
  display: none;
  position: fixed;
  top: 50%;
  left: auto;
  right: auto;
  z-index: 10060;
  box-sizing: border-box;
  width: 17.35rem;
  min-width: 14.85rem;
  max-width: min(18.85rem, calc(100vw - 1.5rem));
  height: auto;
  max-height: none;
  align-self: flex-start;
  padding: 0 0 0 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}
html.dark #ai-dd-accordion [data-ai-accordion-panel],
html.dark body > [data-ai-accordion-panel] {
  border-color: transparent;
  background: transparent;
}
#ai-dd-accordion [data-ai-accordion].flyout-left [data-ai-accordion-panel] {
  left: auto;
  right: 100%;
  padding: 0 0.5rem 0 0;
}
#ai-dd-accordion [data-ai-accordion-panel] > div,
body > [data-ai-accordion-panel] > div {
  min-width: 0;
  height: auto;
  padding: 0.25rem 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(22rem, calc(100vh - 7rem));
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}
html.dark #ai-dd-accordion [data-ai-accordion-panel] > div,
html.dark body > [data-ai-accordion-panel] > div {
  border-color: #404040;
  background: #171717;
}
#ai-dd-accordion .ai-dd-item,
body > [data-ai-accordion-panel] .ai-dd-item,
.ai-vendor-flyout .ai-dd-item {
  max-width: 100%;
  min-width: 0;
  height: auto;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.ai-vendor-flyout {
  display: none;
  box-sizing: border-box;
  width: max-content;
  min-width: 8.25rem;
  max-width: 10rem;
  padding: 0.25rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: none;
}
.ai-vendor-flyout[hidden] {
  display: none !important;
}
html.dark .ai-vendor-flyout {
  border-color: #404040;
  background: #171717;
}
#ai-dd-model-list .ai-vendor-name:hover,
#ai-dd-model-list .ai-vendor.is-open > .ai-vendor-name,
#ai-dd-model-list .ai-vendor.is-open > .ai-vendor-name:hover {
  background: #f3f4f6;
}
html.dark #ai-dd-model-list .ai-vendor-name:hover,
html.dark #ai-dd-model-list .ai-vendor.is-open > .ai-vendor-name,
html.dark #ai-dd-model-list .ai-vendor.is-open > .ai-vendor-name:hover {
  background: #262626;
}
#ai-dd-view-main {
  width: 100%;
  height: auto;
}
#ai-dd-view-models {
  width: 100%;
  min-height: 16rem;
  height: min(22rem, calc(100vh - 24px));
}
#ai-dd-view-models.hidden,
#ai-dd-view-main.hidden {
  display: none !important;
}
#ai-dd-view-models:not(.hidden) {
  display: flex;
}
#ai-dd-model-search.ai-dd-search {
  box-shadow: none;
}
.ai-dd-model-search-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 0.15rem;
}
.ai-dd-model-search-wrap .ai-dd-search {
  display: block;
  width: 2.1rem;
  max-width: 100%;
  height: 2rem;
  margin: 0;
  padding: 0 0.35rem 0 1.35rem;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-size: 0.8125rem;
  line-height: 1.25;
  outline: none;
  box-shadow: none;
  transition: width 0.32s ease, border-bottom-color 0.32s ease;
}
.ai-dd-model-search-wrap .ai-dd-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.ai-dd-model-search-wrap .ai-dd-search::placeholder {
  color: #9ca3af;
  opacity: 0;
  transition: opacity 0.32s ease;
}
.ai-dd-model-search-wrap:hover .ai-dd-search::placeholder,
.ai-dd-model-search-wrap:focus-within .ai-dd-search::placeholder {
  opacity: 1;
}
.ai-dd-model-search-wrap:hover .ai-dd-search,
.ai-dd-model-search-wrap:focus-within .ai-dd-search,
.ai-dd-model-search-wrap:has(.ai-dd-search:not(:placeholder-shown)) .ai-dd-search {
  width: 100%;
  border-bottom-color: #e5e7eb;
}
html.dark .ai-dd-model-search-wrap .ai-dd-search {
  color: #e5e5e5;
  background: transparent;
  border-bottom-color: transparent;
}
html.dark .ai-dd-model-search-wrap:hover .ai-dd-search,
html.dark .ai-dd-model-search-wrap:focus-within .ai-dd-search,
html.dark .ai-dd-model-search-wrap:has(.ai-dd-search:not(:placeholder-shown)) .ai-dd-search {
  width: 100%;
  border-bottom-color: #404040;
}

/* Chips de adjuntos dentro del composer */
#view-chat .chat-attach-preview {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.5rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.35rem;
}
#view-chat .chat-attach-preview.has-gemini-thumbs {
  border-bottom: none;
  margin-bottom: 0.1rem;
}
#view-chat .chat-attach-preview.hidden {
  display: none !important;
}
#view-chat .chat-attach-thumb {
  position: relative;
  width: 5.25rem;
  height: 5.25rem;
  flex-shrink: 0;
}
#view-chat .chat-attach-thumb-open {
  display: block;
  width: 5.25rem;
  height: 5.25rem;
  padding: 0;
  border: none;
  border-radius: 1.15rem;
  overflow: hidden;
  background: #f3f4f6;
  cursor: zoom-in;
}
html.dark #view-chat .chat-attach-thumb-open {
  background: #1f2937;
  border-color: #374151;
}
#view-chat .chat-attach-thumb-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#view-chat .chat-attach-thumb-remove {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f1f1f;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}
#view-chat .chat-attach-thumb-remove:hover,
html.dark #view-chat .chat-attach-thumb-remove,
html.dark #view-chat .chat-attach-thumb-remove:hover {
  background: rgba(255, 255, 255, 0.94);
  color: #1f1f1f;
  border: none;
}
.chat-annotate-modal {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.chat-annotate-modal.hidden {
  display: none !important;
}
.chat-annotate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.chat-annotate-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(1120px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
}
.chat-annotate-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  background: #fff;
  color: #111827;
}
html.dark .chat-annotate-toolbar {
  background: #171717;
  color: #fafafa;
}
.chat-annotate-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
}
.chat-annotate-hint {
  margin: 0;
  flex: 1;
  font-size: 0.75rem;
  color: #525252;
}
.chat-annotate-actions {
  display: flex;
  gap: 0.5rem;
}
.chat-annotate-actions-group {
  display: flex;
  gap: 0.5rem;
}
.chat-annotate-actions-group.hidden {
  display: none !important;
}
.chat-annotate-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #111827;
  cursor: pointer;
  box-shadow: none;
}
.chat-annotate-close:hover {
  background: transparent;
  color: #000;
}
html.dark .chat-annotate-close {
  background: transparent;
  border: none;
  color: #fafafa;
}
html.dark .chat-annotate-close:hover {
  background: transparent;
  color: #fff;
}
#chat-annotate-btn-brush[aria-pressed="true"] {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
html.dark #chat-annotate-btn-brush[aria-pressed="true"] {
  background: #fafafa;
  color: #171717;
  border-color: #fafafa;
}
#chat-annotate-canvas.is-brush {
  cursor: crosshair;
}
#chat-annotate-canvas:not(.is-brush) {
  cursor: default;
}
.chat-annotate-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(72vh, calc(100vh - 8.5rem));
  min-height: min(72vh, calc(100vh - 8.5rem));
  max-height: min(72vh, calc(100vh - 8.5rem));
  background: #111;
  border-radius: 0.35rem;
  overflow: hidden;
}
#chat-annotate-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background: #111;
  cursor: crosshair;
  touch-action: none;
  border-radius: 0.35rem;
  box-shadow: none;
}
#view-chat .chat-attach-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 5rem;
  height: 6rem;
  flex-shrink: 0;
  padding: 0.75rem;
  border: none;
  border-radius: 1rem;
  background: rgba(229, 231, 235, 0.7);
  color: #1f2937;
  cursor: default;
  overflow: hidden;
  transition: background-color 0.15s ease;
}
#view-chat .chat-attach-chip:hover {
  background: rgba(209, 213, 219, 0.7);
}
html.dark #view-chat .chat-attach-chip {
  background: rgba(64, 64, 64, 0.7);
  border: none;
  color: #e5e7eb;
}
html.dark #view-chat .chat-attach-chip:hover {
  background: rgba(82, 82, 82, 0.75);
}
#view-chat .chat-attach-chip-ext {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
html.dark #view-chat .chat-attach-chip-ext {
  color: #9ca3af;
}
#view-chat .chat-attach-chip-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: none;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: #1f2937;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
html.dark #view-chat .chat-attach-chip-name {
  color: #f3f4f6;
}
#view-chat .chat-attach-chip-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.25rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #9ca3af;
  line-height: 1;
  cursor: pointer;
}
#view-chat .chat-attach-chip-remove:hover {
  background: transparent;
  color: #4b5563;
}
html.dark #view-chat .chat-attach-chip-remove {
  color: #9ca3af;
}
html.dark #view-chat .chat-attach-chip-remove:hover {
  color: #e5e7eb;
}

.chat-composer-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 1.75rem;
}
.chat-voice-wave-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.38s ease, visibility 0s linear 0.38s;
}
.chat-voice-wave-canvas {
  display: block;
  width: 100%;
  height: 2.35rem;
}
#chat-composer.is-voice-recording .chat-voice-wave-slot {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.38s ease, visibility 0s linear 0s;
}
#view-chat #chat-composer.chat-legal-composer {
  position: relative;
}
html.liquid-glass #view-chat #chat-composer > #chat-live-transcript,
#view-chat #chat-composer > #chat-live-transcript {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.75rem);
  z-index: 60;
  width: auto;
  height: 2.75rem;
}
.chat-live-transcript {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.75rem);
  z-index: 60;
  box-sizing: border-box;
  width: auto;
  height: 2.75rem;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 0.75rem;
  color: #18181b;
  background: #fff;
  border: 1px solid #E5E7EB;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms;
}
.chat-live-transcript.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 0s;
}
#view-chat #chat-drawer.chat-mode-empty:has(#chat-composer.is-voice-recording) #chat-empty-state {
  margin-bottom: 3.75rem;
}
.chat-live-transcript-text {
  margin: 0;
  height: 100%;
  overflow: auto;
  font-size: 0.875rem;
  line-height: 1.45;
  font-weight: 450;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
#chat-live-transcript-placeholder {
  color: #a1a1aa;
}
#chat-live-transcript-placeholder[hidden] {
  display: none;
}
#chat-live-transcript-interim {
  color: #71717a;
}
#chat-composer.is-voice-recording #chat-input {
  opacity: 0;
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#chat-input {
  transition: opacity 0.28s ease, transform 0.22s ease;
}
#chat-input:hover {
  transform: translateY(-2px);
}
#chat-composer.is-voice-recording .chat-model-chip,
#chat-composer.is-voice-recording #chat-capacity-wrap,
#chat-composer.is-voice-recording .chat-context-meter {
  opacity: 0;
  width: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, width 0.28s ease;
}

/* Micrófono: reposo / grabando */
#view-chat #btn-mic.chat-mic-btn {
  position: relative;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
  cursor: pointer;
}
#view-chat #btn-mic.is-recording,
#btn-mic.is-recording {
  flex: 0 0 48px !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  aspect-ratio: 1 / 1 !important;
  align-self: center !important;
  padding: 0 !important;
  line-height: 0 !important;
  box-sizing: border-box !important;
  overflow: visible;
  background: transparent !important;
  color: #27272a !important;
}
#view-chat #btn-mic.is-recording .mic-stop-wrap,
#btn-mic.is-recording .mic-stop-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  aspect-ratio: 1 / 1;
  pointer-events: none;
}
#view-chat #btn-mic.is-recording #mic-radial-eq,
#btn-mic.is-recording #mic-radial-eq {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  color: #a1a1aa;
  pointer-events: none;
  overflow: visible;
}
#view-chat #btn-mic.is-recording #mic-radial-eq line,
#btn-mic.is-recording #mic-radial-eq line {
  stroke-width: 1;
  stroke-linecap: round;
}
#view-chat #btn-mic.is-recording .mic-stop-btn {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  background: #e4e4e7;
  transition: background-color 150ms ease;
}
#view-chat #btn-mic.is-recording:hover .mic-stop-btn {
  background: #d4d4d8;
}
#view-chat #btn-mic.is-recording .mic-stop-square {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 2px;
  background: #27272a;
}
#btn-mic.is-transcribing {
  width: 1rem;
  height: 1rem;
  opacity: 1;
}
.mic-transcribe-spin {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid #e4e4e7;
  border-top-color: #18181b;
  border-radius: 9999px;
  animation: mic-transcribe-spin 0.7s linear infinite;
}
@keyframes mic-transcribe-spin {
  to { transform: rotate(360deg); }
}

html.vista-erp-chat #main-container {
  visibility: visible !important;
  pointer-events: auto !important;
  padding-right: 0 !important;
  display: flex !important;
  opacity: 1 !important;
}
html.vista-erp-chat.layout-chat-max #main-container,
html.vista-erp-chat.layout-chat-open #main-container {
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
  opacity: 1 !important;
}

/* Evitar lock de ancho del chat lateral legacy dentro de la vista Chat */
html.vista-erp-chat #view-chat #chat-drawer.gemini-chat > *,
html.vista-erp-chat #view-chat #chat-drawer.gemini-chat.chat-closed > * {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex-shrink: unset !important;
  box-sizing: border-box !important;
}
html.vista-erp-chat #view-chat #chat-drawer.chat-mode-empty > #chat-empty-state,
html.vista-erp-chat #view-chat #chat-drawer.chat-mode-empty > #chat-composer-wrap {
  max-width: 48rem !important;
}

/* ============================================================
   HISTORIAL — drawer DERECHO (override final, máxima especificidad)
   ============================================================ */
html.vista-erp-chat #sidebar-historial,
html.vista-erp-chat #sidebar-historial.historial-drawer-right,
html.layout-chat-max #sidebar-historial,
html.layout-chat-open #sidebar-historial,
html.vista-erp-chat.layout-chat-max #sidebar-historial,
html.vista-erp-chat.layout-historial-open #sidebar-historial,
html.layout-chat-max.layout-historial-open #sidebar-historial,
#sidebar-historial.historial-drawer-right,
#sidebar-historial,
#sidebar-historial.hidden {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;
  z-index: 95 !important;
  width: min(var(--historial-width, 20rem), 92vw) !important;
  min-width: min(var(--historial-width, 20rem), 92vw) !important;
  max-width: min(var(--historial-width, 20rem), 92vw) !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 1px solid transparent !important;
  overflow: hidden !important;
  transform: translate3d(100%, 0, 0) !important;
  pointer-events: none !important;
  visibility: hidden !important;
  box-shadow: none !important;
  will-change: transform;
  transition:
    transform var(--historial-duration-close, 0.42s) var(--historial-ease-in, cubic-bezier(0.32, 0, 0.67, 0)),
    box-shadow var(--historial-duration-close, 0.42s) var(--historial-ease-in, cubic-bezier(0.32, 0, 0.67, 0)),
    border-color var(--historial-duration-close, 0.42s) var(--historial-ease-in, cubic-bezier(0.32, 0, 0.67, 0)),
    visibility 0s linear var(--historial-duration-close, 0.42s) !important;
}
html.vista-erp-chat #sidebar-historial.historial-abierto,
html.vista-erp-chat.layout-historial-open #sidebar-historial.historial-abierto,
html.layout-chat-max.layout-historial-open #sidebar-historial.historial-abierto,
html.vista-erp-chat.layout-chat-max.layout-historial-open #sidebar-historial.historial-abierto,
#sidebar-historial.historial-abierto {
  right: 0 !important;
  left: auto !important;
  width: min(var(--historial-width, 20rem), 92vw) !important;
  min-width: min(var(--historial-width, 20rem), 92vw) !important;
  max-width: min(var(--historial-width, 20rem), 92vw) !important;
  border-left: 1px solid #e5e7eb !important;
  overflow: hidden !important;
  transform: translate3d(0, 0, 0) !important;
  pointer-events: auto !important;
  visibility: visible !important;
  transition:
    transform var(--historial-duration, 0.42s) var(--historial-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow var(--historial-duration, 0.42s) var(--historial-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color var(--historial-duration, 0.42s) var(--historial-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    visibility 0s linear 0s !important;
  box-shadow: none !important;
}
html:not(.vista-erp-chat) #sidebar-historial,
html:not(.vista-erp-chat) #sidebar-historial.historial-abierto {
  transform: translate3d(100%, 0, 0) !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
html:not(.vista-erp-chat) #btn-toggle-historial {
  display: none !important;
}
html.vista-erp-chat #btn-toggle-historial:not([hidden]):not(.hidden) {
  display: inline-flex !important;
  position: fixed !important;
  top: calc(0.75rem + 2.25rem + 0.5rem) !important;
  left: auto !important;
  right: 1rem !important;
  margin: 0 !important;
  z-index: 51 !important;
}
#historial-backdrop.historial-backdrop-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 85 !important;
}

/* Chat ERP: sin velo gris — el drawer ya cubre; el overlay solo estorbaba */
html.vista-erp-chat #historial-backdrop,
html.vista-erp-chat #historial-backdrop.historial-backdrop-visible {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  background: transparent !important;
}

/* Historial por encima del header flotante (evita que el ojo tape cerrar/descargar) */
html.vista-erp-chat.layout-historial-open #sidebar-historial.historial-abierto,
html.layout-historial-open #sidebar-historial.historial-abierto,
html.historial-closing #sidebar-historial {
  z-index: 110 !important;
}
html.vista-erp-chat.layout-historial-open #app-header.app-header-floating,
html.layout-historial-open #app-header.app-header-floating,
html.historial-closing #app-header.app-header-floating {
  z-index: 80 !important;
}

/* Controles flotantes: fuera del panel historial; ojo oculto mientras el panel está abierto */
html.vista-erp-chat.layout-historial-open #app-header .header-side-right,
html.vista-erp-chat.layout-historial-open #app-header .header-floating-controls,
html.vista-erp-chat.historial-closing #app-header .header-side-right,
html.vista-erp-chat.historial-closing #app-header .header-floating-controls {
  right: calc(var(--historial-width, 20rem) + 0.75rem) !important;
}
html.layout-historial-open #btn-modo-concentracion,
html.vista-erp-chat.layout-historial-open #btn-modo-concentracion,
html.historial-closing #btn-modo-concentracion {
  display: inline-flex !important;
}

/* Botones del panel historial: iconos planos sin círculo */
#sidebar-historial .historial-panel-header button:not(#btn-toggle-historial-panel),
#sidebar-historial #btn-descargar-historial,
#sidebar-historial #btn-refresh-historial {
  color: #525252 !important; /* neutral-600 */
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}
#sidebar-historial .historial-panel-header button:not(#btn-toggle-historial-panel):hover,
#sidebar-historial #btn-descargar-historial:hover,
#sidebar-historial #btn-refresh-historial:hover {
  background: transparent !important;
  color: #171717 !important; /* neutral-900 */
}
#sidebar-historial .historial-panel-header button svg,
#sidebar-historial .historial-panel-header button i,
#sidebar-historial #btn-descargar-historial svg,
#sidebar-historial #btn-descargar-historial i,
#sidebar-historial #btn-refresh-historial svg,
#sidebar-historial #btn-refresh-historial i,
#sidebar-historial #btn-toggle-historial-panel svg,
#sidebar-historial #btn-toggle-historial-panel i {
  color: inherit !important;
  opacity: 1 !important;
  filter: none !important;
}
#sidebar-historial .historial-panel-header button svg,
#sidebar-historial #btn-descargar-historial svg,
#sidebar-historial #btn-refresh-historial svg,
#sidebar-historial #btn-toggle-historial-panel svg {
  stroke: currentColor !important;
  fill: none !important;
}
html.dark #sidebar-historial .historial-panel-header button:not([aria-label*="Cerrar"]),
html.dark #sidebar-historial #btn-descargar-historial,
html.dark #sidebar-historial #btn-refresh-historial {
  color: #d4d4d4 !important; /* neutral-300 */
  background: transparent !important;
  border: none !important;
}
html.dark #sidebar-historial .historial-panel-header button:not([aria-label*="Cerrar"]):hover,
html.dark #sidebar-historial #btn-descargar-historial:hover,
html.dark #sidebar-historial #btn-refresh-historial:hover {
  color: #ffffff !important;
  background: transparent !important;
}
#sidebar-historial .historial-title-close {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
}
#sidebar-historial .historial-title-close #txt-lbl-historial {
  display: inline-block;
  transform: translateX(0);
  transition: transform 0.22s ease;
}
#sidebar-historial .historial-title-close #btn-toggle-historial-panel {
  position: absolute !important;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #525252;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  cursor: pointer;
}
#sidebar-historial .historial-title-close:hover #txt-lbl-historial,
#sidebar-historial .historial-title-close:focus-within #txt-lbl-historial {
  transform: translateX(1.65rem);
}
#sidebar-historial .historial-title-close:hover #btn-toggle-historial-panel,
#sidebar-historial .historial-title-close:focus-within #btn-toggle-historial-panel {
  opacity: 1 !important;
  pointer-events: auto !important;
}
#sidebar-historial .historial-title-close #btn-toggle-historial-panel:hover {
  color: #171717;
}
html.dark #sidebar-historial .historial-title-close #btn-toggle-historial-panel {
  color: #d4d4d4;
}
html.dark #sidebar-historial .historial-title-close #btn-toggle-historial-panel:hover {
  color: #ffffff;
}
html.dark #sidebar-historial .historial-panel-header button svg,
html.dark #sidebar-historial .historial-panel-header button i,
html.dark #sidebar-historial #btn-descargar-historial svg,
html.dark #sidebar-historial #btn-descargar-historial i,
html.dark #sidebar-historial #btn-refresh-historial svg,
html.dark #sidebar-historial #btn-refresh-historial i,
html.dark #sidebar-historial #btn-toggle-historial-panel svg,
html.dark #sidebar-historial #btn-toggle-historial-panel i {
  color: inherit !important;
}
html.dark #sidebar-historial .historial-panel-header button svg,
html.dark #sidebar-historial #btn-descargar-historial svg,
html.dark #sidebar-historial #btn-refresh-historial svg,
html.dark #sidebar-historial #btn-toggle-historial-panel svg {
  stroke: currentColor !important;
}

html.dark #sidebar-historial.historial-drawer-right,
html.dark.vista-erp-chat #sidebar-historial {
  border-left-color: #2a2a2a !important;
}

/* ============================================================
   COLAPSAR MEN? PRINCIPAL IZQUIERDO
   ============================================================ */
html.auth-session.erp-nav-collapsed #app-workspace {
  padding-left: 0 !important;
}
html.auth-session.erp-nav-collapsed.vista-erp-ajustes #view-ajustes,
html.auth-session.erp-nav-collapsed.vista-erp-ajustes #view-ajustes .settings-panel-shell {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0;
  box-sizing: border-box;
}
html.vista-erp-ajustes #ajustes-container {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
html.vista-erp-ajustes #view-ajustes,
html.vista-erp-ajustes #view-ajustes .settings-panel-shell {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
html.vista-erp-ajustes #view-ajustes #settings-workspace-panel {
  flex: 1 1 0 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
@media (min-width: 1024px) {
  html.auth-session.erp-nav-collapsed .erp-sidebar {
    transform: translateX(-100%) !important;
    pointer-events: none;
  }
  html.auth-session.erp-nav-collapsed #btn-abrir-erp-sidebar,
  html.auth-session.erp-nav-collapsed #btn-abrir-erp-sidebar.is-nav-reopen {
    display: inline-flex !important;
  }
}
html.auth-session.erp-nav-collapsed #btn-abrir-erp-sidebar,
html.auth-session.erp-nav-collapsed #btn-abrir-erp-sidebar.is-nav-reopen {
  display: none;
}
@media (max-width: 1023px) {
  html.auth-session.erp-nav-collapsed #btn-abrir-erp-sidebar {
    display: inline-flex !important;
  }
}
.ojo-drag-handle {
  display: inline-flex;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  cursor: pointer;
}
.ojo-drag-handle.is-dragging,
#header-utility-controls.is-dragging {
  position: relative;
  z-index: 120;
}
.settings-ojo-preview {
  pointer-events: none;
  user-select: none;
  cursor: default;
}
.settings-ojo-preview .ojo-slash {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
}
.settings-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.settings-reset-btn:hover {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.settings-reset-arrow {
  display: block;
  flex-shrink: 0;
  transform-origin: 50% 50%;
}
.settings-reset-arrow.is-spinning {
  animation: settings-reset-spin 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes settings-reset-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.header-concentrate-btn {
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: #9ca3af;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease !important;
}
.header-concentrate-btn:hover {
  background: transparent !important;
  color: #374151;
  transform: scale(1.15);
}
.header-concentrate-btn .icon-ojo {
  overflow: visible;
}
.header-concentrate-btn .ojo-slash {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
  transition: stroke-dashoffset 0.4s ease-out;
}
.header-concentrate-btn .ojo-pupila {
  transform-origin: 12px 12px;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
html.modo-concentracion .header-concentrate-btn .ojo-slash {
  stroke-dashoffset: 0;
}
html.modo-concentracion .header-concentrate-btn .ojo-pupila {
  opacity: 0.35;
  transform: scale(0.72);
}
#header-utility-controls {
  overflow: hidden;
  interpolate-size: allow-keywords;
  width: max-content;
  max-width: 28rem;
  white-space: nowrap;
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: left center;
  pointer-events: auto;
  visibility: visible;
  clip-path: inset(-32px -24px -32px -24px);
  transition:
    width 0.4s ease-out,
    max-width 0.4s ease-out,
    opacity 0.4s ease-out,
    gap 0.4s ease-out,
    visibility 0s linear 0s;
}
#header-utility-controls > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
#header-utility-controls > *:nth-child(1) { transition-delay: 0s; }
#header-utility-controls > *:nth-child(2) { transition-delay: 0s; }
#header-utility-controls > *:nth-child(3) { transition-delay: 0s; }
html.modo-concentracion #header-utility-controls {
  width: 0 !important;
  max-width: 0 !important;
  opacity: 1 !important;
  gap: 0 !important;
  overflow: hidden;
  filter: none;
  transform: translate3d(0, 0, 0);
  clip-path: none;
  visibility: hidden;
  pointer-events: none !important;
  transition:
    width 0.4s ease-out,
    max-width 0.4s ease-out,
    gap 0.4s ease-out,
    visibility 0s linear 0.4s;
}
html.modo-concentracion #header-utility-controls > * {
  opacity: 0;
  transform: translateX(3px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out !important;
}
html.modo-concentracion #header-utility-controls > *:nth-child(1) { transition-delay: 0s; }
html.modo-concentracion #header-utility-controls > *:nth-child(2) { transition-delay: 0s; }
html.modo-concentracion #header-utility-controls > *:nth-child(3) { transition-delay: 0s; }
#app-header .header-sun-slot {
  position: relative !important;
  width: 2.25rem !important;
  height: 2.25rem !important;
  flex-shrink: 0;
  overflow: visible !important;
}
html.modo-concentracion #app-header .header-floating-controls {
  min-width: 2.25rem;
  min-height: 2.25rem;
}
/* Ojo: icono desnudo, en flujo, sin superponerse */
#btn-modo-concentracion {
  position: relative !important;
  z-index: 1 !important;
}

/* Pastilla ojo — icono desnudo sin fondo */
html #app-header .header-side-right #btn-modo-concentracion.header-concentrate-btn {
  background: transparent !important;
  border: none !important;
  display: inline-flex !important;
  color: #9ca3af !important;
  box-shadow: none !important;
}

html.modo-concentracion #btn-modo-concentracion {
  position: relative !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 1 !important;
  animation: none;
}

@keyframes eye-sweep-right {
  from { transform: translateX(-210px) translateY(-50%); }
  to   { transform: translateX(0)      translateY(-50%); }
}

@keyframes eye-sweep-left {
  from { transform: translateX(0)      translateY(-50%); }
  to   { transform: translateX(-210px) translateY(-50%); }
}

/* === CIERRE: ojo barre de derecha a izquierda (easing espejo del opening) === */
html.modo-concentracion.modo-concentracion-closing #btn-modo-concentracion {
  animation: none;
}

/* Clipea el ojo solo durante la animación */
html.modo-concentracion .header-floating-controls > .flex {
  overflow: visible;
}

/* Historial derecho: reservar espacio a la derecha del header */
html.layout-historial-open #app-header,
html.vista-erp-chat.layout-historial-open #app-header.app-header-floating {
  padding-left: 1rem !important;
  padding-right: calc(var(--historial-width, 20rem) + 1rem) !important;
  pointer-events: none;
}
html.vista-erp-chat.layout-historial-open #app-header > * {
  pointer-events: auto;
}
html.vista-erp-chat.layout-historial-open #app-workspace {
  padding-left: var(--erp-sidebar-width);
}
html.vista-erp-chat.erp-nav-collapsed.layout-historial-open #app-workspace {
  padding-left: 0 !important;
}

html.dark .erp-sidebar-footer {
  border-top: none !important;
}

/* ============================================================
   Z-INDEX SCALE (Fase 2)
   30 nav · 40 drawers · 50 modals · 60 toasts · 70 security
   ============================================================ */
.z-30 { z-index: 30 !important; }
.z-40 { z-index: 40 !important; }
.z-50 { z-index: 50 !important; }
.z-60 { z-index: 60 !important; }
.z-70 { z-index: 70 !important; }

#app-header {
  z-index: 30 !important;
}
#erp-sidebar,
.erp-sidebar {
  z-index: 50 !important;
  pointer-events: auto !important;
}
#erp-sidebar-backdrop {
  z-index: 40 !important;
}
#sidebar-historial,
#historial-backdrop {
  z-index: 40 !important;
}
#lso-slideover-caso,
.lso-slideover,
#lso-slideover-backdrop,
.lso-slideover-backdrop {
  z-index: 90 !important;
}
#modal-lexnet-ocr,
#modal-normas-ia,
#modal-preguntas-ia,
#modal-anadir-direccion-cliente {
  z-index: 110 !important;
}
#modal-confirmar-borrado-norma,
#modal-confirmar-borrado-pregunta,
#modal-confirmar-borrado-direccion {
  z-index: 120 !important;
}
#modal-confirmar-borrado-direccion {
  z-index: 200 !important;
}
#command-palette,
#modal-camara,
#modal-confirmacion,
#modal-nuevo-expediente,
#modal-nuevo-cliente,
#modal-nuevo-caso-lso,
#modal-invitar-miembro,
#modal-conflicto-interes,
#modal-time-stop,
#modal-nuevo-plazo,
#modal-creditos-agotados,
#modal-lexnet,
#modal-firma-documento,
#modal-ver-firma,
#doc-preview-drawer {
  z-index: 50 !important;
}
#toast-container,
#undo-toast-container {
  z-index: 60 !important;
}
#modal-session-lock,
#modal-politica-cookies,
#modal-politica-privacidad,
#modal-terminos-servicio,
#modal-faq,
#cookie-consent-banner,
#view-auth {
  z-index: 70 !important;
}

/* Skeleton loaders (sin CDN Tailwind) */
@keyframes eternity-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.animate-pulse {
  animation: eternity-pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.skeleton-bone {
  background-color: #e5e5e5;
}
html.dark .skeleton-bone {
  background-color: #262626;
}
.h-4 { height: 1rem; }
.h-7 { height: 1.75rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }
.w-5\/6 { width: 83.3333%; }
.w-3\/4 { width: 75%; }
.w-2\/3 { width: 66.6667%; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.3333%; }
.w-\[80\%\] { width: 80%; }
.max-w-\[80\%\] { max-width: 80%; }
.mb-2 { margin-bottom: 0.5rem; }
.p-4 { padding: 1rem; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.rounded { border-radius: 0.25rem; }
.rounded-full { border-radius: 9999px; }
.inline-block { display: inline-block; }
.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.duration-200 { transition-duration: 200ms; }
.hover\:translate-x-2:hover { transform: translateX(0.5rem); }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* ============================================================
   Momentic polish — contraste sidebar/main (override final)
   ============================================================ */
html:not(.dark) .erp-sidebar {
  background: #F1F5F9 !important;
  border-right: 1px solid #E2E8F0 !important;
}
html:not(.dark) #main-container,
html:not(.dark) #main-container > main,
html:not(.dark) #app-workspace {
  background: var(--app-background) !important;
}

/* Categorías DESPACHO / ADMINISTRACIÓN — sutiles (gana a liquid-glass) */
html:not(.dark) .erp-sidebar .erp-sidebar-label,
html.liquid-glass:not(.dark) .erp-sidebar .erp-sidebar-label,
html.liquid-glass:not(.dark) #erp-sidebar .erp-sidebar-label {
  color: #9CA3AF !important; /* gray-400 */
  font-size: 0.75rem !important; /* text-xs */
  font-weight: 500 !important;
  letter-spacing: 0.08em !important; /* tracking-wider */
  text-transform: uppercase !important;
  line-height: 1.25 !important;
}
html:not(.dark) #nav-plantillas .erp-sidebar-label,
html.liquid-glass:not(.dark) #nav-plantillas .erp-sidebar-label {
  color: #a1a1aa !important; /* zinc-400 */
  font-size: 11px !important;
  font-weight: 500 !important;
  margin-bottom: 0.5rem !important;
}

/* Densidad compacta + iconos grises */
html:not(.dark) .erp-sidebar .erp-sidebar-nav {
  gap: 0.2rem !important;
}
html:not(.dark) .erp-sidebar .vercel-nav-item {
  color: #6B7280 !important;
  padding: 0.58rem 0.75rem !important;
  font-size: 0.9375rem !important;
  min-height: 2.45rem;
}
html:not(.dark) .erp-sidebar .vercel-nav-item i,
html:not(.dark) .erp-sidebar .vercel-nav-item .nav-item-icon,
html.liquid-glass:not(.dark) .erp-sidebar .vercel-nav-item i,
html.liquid-glass:not(.dark) .erp-sidebar .vercel-nav-item .nav-item-icon {
  color: #9CA3AF !important;
}
html:not(.dark) .erp-sidebar .vercel-nav-item:hover {
  color: #18181b !important;
  background: rgb(244 244 245 / 0.8) !important;
  transform: translateX(0.25rem);
}
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active:hover {
  background: #EDEEF1 !important;
  transform: translateX(0.25rem);
}
html:not(.dark) .erp-sidebar .vercel-nav-item:active {
  transform: translateX(0.25rem);
}
html:not(.dark) .erp-sidebar .vercel-nav-item:hover i,
html:not(.dark) .erp-sidebar .vercel-nav-item:hover .nav-item-icon,
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active,
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active i,
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active .nav-item-icon,
html.liquid-glass:not(.dark) .erp-sidebar .vercel-nav-item:hover i,
html.liquid-glass:not(.dark) .erp-sidebar .vercel-nav-item.is-active,
html.liquid-glass:not(.dark) .erp-sidebar .vercel-nav-item.is-active i,
html.liquid-glass:not(.dark) .erp-sidebar .vercel-nav-item.is-active .nav-item-icon {
  color: var(--app-primary) !important;
}
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active {
  background: #E4E4E7 !important;
  font-weight: 500 !important;
}

/* Subtítulo Inicio */
html:not(.dark) #txt-lbl-registro-desc,
html.liquid-glass:not(.dark) #txt-lbl-registro-desc {
  color: #64748B !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  margin-top: 0.35rem !important;
}

/* Títulos de métricas más pequeños; el número manda */
html:not(.dark) .dash-metric-title,
html.liquid-glass:not(.dark) .dash-metric-title {
  font-size: 0.875rem !important; /* text-sm */
  font-weight: 500 !important;
  color: #64748B !important;
}
html:not(.dark) .dash-metric-value,
html.liquid-glass:not(.dark) .dash-metric-value {
  color: #0F172A !important;
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", var(--font-sans) !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
}
@media (min-width: 1280px) {
  html:not(.dark) .dash-metric-value,
  html.liquid-glass:not(.dark) .dash-metric-value {
    font-size: 1.875rem !important;
  }
}
html:not(.dark) .dash-metric-hint,
html.liquid-glass:not(.dark) .dash-metric-hint {
  color: #64748B !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
}

html:not(.dark) .dash-metric-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}
html:not(.dark) .dash-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}
html:not(.dark) .dash-glass,
html:not(.dark) .glass-card,
html:not(.dark) .glass-panel,
html:not(.dark) .settings-card {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 24px !important;
  box-shadow: none !important;
}
html:not(.dark) #view-ajustes .settings-card,
html:not(.dark) #view-ajustes .settings-unified-panel {
  background: #FFFFFF !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}
html:not(.dark) #view-cartera {
  max-width: 72rem;
}
html:not(.dark) #cartera-page-heading {
  margin-bottom: 0.25rem;
}

/* Anillo/borde negro de foco (UA Windows + Tailwind ring) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
select,
textarea {
  outline: none !important;
  outline-offset: 0 !important;
  -webkit-tap-highlight-color: transparent;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]) {
  -webkit-appearance: none;
  appearance: none;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: inner-spin-button;
  appearance: auto;
  opacity: 1;
}
#factura-importe,
#detalle-factura-importe,
#acreedor-lso-importe,
#nuevo-caso-deuda {
  -moz-appearance: textfield;
  appearance: textfield;
}
#factura-importe::-webkit-inner-spin-button,
#factura-importe::-webkit-outer-spin-button,
#detalle-factura-importe::-webkit-inner-spin-button,
#detalle-factura-importe::-webkit-outer-spin-button,
#acreedor-lso-importe::-webkit-inner-spin-button,
#acreedor-lso-importe::-webkit-outer-spin-button,
#nuevo-caso-deuda::-webkit-inner-spin-button,
#nuevo-caso-deuda::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
  margin: 0;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):is(:focus, :focus-visible):not(#filtro-clientes),
select:is(:focus, :focus-visible),
textarea:is(:focus, :focus-visible) {
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  --tw-ring-offset-width: 0px !important;
  --tw-ring-offset-color: transparent !important;
  --tw-ring-color: transparent !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-shadow: 0 0 #0000 !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not(.is-completo):not(.is-invalid):is(:focus, :focus-visible):not(.border-red-500):not(#filtro-clientes),
select:is(:focus, :focus-visible):not(.border-red-500),
textarea:is(:focus, :focus-visible):not(.border-red-500) {
  border-color: var(--app-border) !important;
}
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not(.is-completo):not(.is-invalid):is(:focus, :focus-visible):not(.border-red-500):not(#filtro-clientes),
html.dark select:is(:focus, :focus-visible):not(.border-red-500),
html.dark textarea:is(:focus, :focus-visible):not(.border-red-500) {
  border-color: #404040 !important;
}

#view-deudores #filtro-clientes,
#view-deudores #filtro-clientes:hover,
#view-deudores #filtro-clientes:focus,
#view-deudores #filtro-clientes:focus-visible {
  border: 1px solid #E5E7EB !important;
  outline: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
  border-radius: 9999px !important;
  background-color: #ffffff !important;
  box-shadow: none !important;
}
html.dark #view-deudores #filtro-clientes,
html.dark #view-deudores #filtro-clientes:focus,
html.dark #view-deudores #filtro-clientes:focus-visible {
  background-color: #171717 !important;
  border: 1px solid #262626 !important;
  box-shadow: none !important;
}
#view-deudores .lso-deudores-table-wrap {
  border: 1px solid #E5E7EB !important;
  background: #ffffff !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.chat-action-card {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}
html.dark .chat-action-card {
  background: #171717;
  border-color: #404040;
}
.chat-action-card-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}
.chat-action-card-title {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}
html.dark .chat-action-card-title { color: #f3f4f6; }
.chat-action-card-status {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
}
.chat-action-card.is-resolved .chat-action-card-status { color: #047857; }
html.dark .chat-action-card.is-resolved .chat-action-card-status { color: #6ee7b7; }
.chat-action-card-dl {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.4rem;
}
.chat-action-card-dl > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.chat-action-card-dl dt {
  color: #6b7280;
  font-weight: 500;
}
.chat-action-card-dl dd {
  margin: 0;
  color: #111827;
  word-break: break-word;
}
html.dark .chat-action-card-dl dd { color: #e5e7eb; }
.chat-action-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.chat-action-card-btn {
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.chat-action-card-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.chat-action-card-btn-cancel {
  background: #fff;
  border-color: #e5e7eb;
  color: #374151;
}
html.dark .chat-action-card-btn-cancel {
  background: #262626;
  border-color: #404040;
  color: #e5e7eb;
}
.chat-action-card-btn-confirm {
  background: #111827;
  color: #fff;
}
html.dark .chat-action-card-btn-confirm {
  background: #f3f4f6;
  color: #111827;
}


/* Calculadora financiera — revolving / préstamos usurarios */
.calc-bancaria-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem !important;
  align-items: stretch;
}
@media (min-width: 768px) {
  .calc-bancaria-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  }
}
.calc-bancaria-col-dash {
  overflow: visible; min-height: 0;
  display: flex;
}
.calc-bancaria-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.calc-bancaria-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(228, 228, 231, 0.8);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0 0.75rem;
}
.calc-bancaria-input-wrap:focus-within {
  border-color: #a1a1aa;
}
.calc-bancaria-adorn {
  color: #a1a1aa;
  font-size: 0.875rem;
  flex-shrink: 0;
  line-height: 1;
}
.calc-bancaria-input {
  text-align: left;
  font-variant-numeric: tabular-nums;
  width: 100%;
  min-width: 0;
  font-size: 1rem !important; font-weight: 300; letter-spacing: 0.02em; flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.calc-bancaria-actions {
  margin-top: 0.35rem !important;
  padding-top: 0.85rem !important;
  border-top: 1px solid #f4f4f5;
  gap: 0.35rem !important;
}
.calc-bancaria-cta {
  width: 100% !important;
  margin-top: 0;
  padding: 0.55rem 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  border-radius: 0.5rem !important;
}
.calc-bancaria-limpiar {
  width: 100%;
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 0.5rem;
  background: transparent;
  color: #71717a;
  border: 1px solid transparent;
  cursor: pointer;
}
.calc-bancaria-limpiar:hover {
  background: transparent;
  color: #27272a;
  border-color: #e4e4e7;
}
html.dark .calc-bancaria-limpiar {
  color: #a1a1aa;
  border-color: transparent;
}
html.dark .calc-bancaria-limpiar:hover {
  background: transparent;
  color: #f4f4f5;
  border-color: #3f3f46;
}
.calc-bancaria-empty {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem !important;
  border: 1px solid rgba(228, 228, 231, 0.6);
  border-radius: 0.75rem;
  background: rgba(250, 250, 250, 0.5);
  box-shadow: none;
}
.calc-bancaria-empty-icon {
  color: #d4d4d8;
  margin-bottom: 0.5rem;
}
.calc-bancaria-empty-text {
  max-width: 18rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: #71717a;
  letter-spacing: -0.01em;
}
.calc-bancaria-resultados {
  overflow: visible; width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.calc-bancaria-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}
.calc-bancaria-card-label {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}
.calc-bancaria-card-value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #171717;
}
.calc-bancaria-card-banco .calc-bancaria-card-value {
  color: #dc2626;
}
.calc-bancaria-card-legal .calc-bancaria-card-value {
  color: #525252;
}
.calc-bancaria-card-reclamar {
  background: rgba(236,253,245,0.5);
  border-color: #a7f3d0;
  box-shadow: none;
}
.calc-bancaria-card-reclamar .calc-bancaria-card-label {
  color: #064e3b;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.calc-bancaria-card-reclamar .calc-bancaria-card-value {
  color: #022c22;
}
.calc-bancaria-vincular-cta {
  width: 100% !important;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem !important;
  font-size: 0.8125rem !important;
  border: 1px solid #e5e7eb !important;
  color: #4b5563 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.calc-bancaria-vincular-cta:hover {
  background: #f9fafb !important;
  color: #111827 !important;
}
.calc-bancaria-vincular {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 0 0.15rem;
}
.calc-bancaria-vincular-btn {
  width: 100% !important;
}
html.dark .calc-bancaria-empty {
  background: #171717;
  border-color: #404040;
}
html.dark .calc-bancaria-empty-icon { color: #525252; }
html.dark .calc-bancaria-empty-text { color: #a3a3a3; }
html.dark .calc-bancaria-card {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .calc-bancaria-card-label { color: #a3a3a3; }
html.dark .calc-bancaria-card-legal .calc-bancaria-card-value { color: #d4d4d4; }
html.dark .calc-bancaria-card-reclamar {
  background: #052e1a;
  border-color: #065f46;
}
html.dark .calc-bancaria-card-reclamar .calc-bancaria-card-label { color: #6ee7b7; }
html.dark .calc-bancaria-card-reclamar .calc-bancaria-card-value { color: #34d399; }
html.dark .calc-bancaria-field label { color: #d4d4d4; }
html.dark .calc-bancaria-input-wrap {
  background: #171717;
  border-color: #404040;
}
html.dark .calc-bancaria-input { color: #f5f5f5; }

[data-canvas="calculadora-bancaria"] {
  padding: 0.85rem 1rem !important;
  min-height: 0 !important;
}
html.auth-session #panel-slot-herramienta-nicho:has(#view-calculadora-bancaria:not(.hidden)),
html.auth-session #panel-slot-herramienta-nicho [data-canvas="calculadora-bancaria"],
#panel-slot-herramienta-nicho:has(#view-calculadora-bancaria:not(.hidden)),
#view-calculadora-bancaria,
[data-canvas="calculadora-bancaria"] {
  overflow: visible !important;
  position: relative;
  z-index: 5;
}
#view-calculadora-bancaria {
  padding-top: 5rem;
}
#view-calculadora-bancaria.hidden { display: none !important; }
.calc-bancaria-field label {
  margin-bottom: 0.3rem !important;
}

/* Test de Insolvencia — diagnóstico LSO */
.test-insolvencia-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .test-insolvencia-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.test-insolvencia-col-dash {
  min-height: 22rem;
  display: flex;
}
.test-insolvencia-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.test-insolvencia-form input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.test-insolvencia-form input[type="number"]::-webkit-inner-spin-button,
.test-insolvencia-form input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
  margin: 0;
}
.test-insolvencia-seccion {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.test-insolvencia-seccion-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #737373;
}
.test-insolvencia-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #f0f0f0;
  border-radius: 0.75rem;
  background: #fafafa;
  cursor: pointer;
  overflow: visible;
}
.test-insolvencia-toggle-text {
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 500;
  color: #171717;
  letter-spacing: -0.01em;
}
.test-insolvencia-toggle .liquid-glass-switch {
  margin-top: 0.1rem;
}
.test-insolvencia-cta {
  width: 100% !important;
  margin-top: 0.15rem;
  padding: 0.85rem 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  border-radius: 9999px !important;
}
.test-insolvencia-empty {
  width: 100%;
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.9rem;
  padding: 1.5rem 1rem;
  border: 1px dashed #e5e5e5;
  border-radius: 0.75rem;
  background: #fafafa;
}
.test-insolvencia-empty-icon {
  color: #d4d4d4;
}
.test-insolvencia-empty-text {
  max-width: 17rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #a3a3a3;
  letter-spacing: -0.01em;
}
.test-insolvencia-resultados {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.test-insolvencia-alert {
  border-radius: 0.85rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid transparent;
}
.test-insolvencia-alert-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.test-insolvencia-alert-rojo {
  background: #fef2f2;
  border-color: #fecaca;
}
.test-insolvencia-alert-rojo .test-insolvencia-alert-text {
  color: #b91c1c;
}
.test-insolvencia-alert-verde {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.test-insolvencia-alert-verde .test-insolvencia-alert-text {
  color: #047857;
}
.test-insolvencia-alert-naranja {
  background: #fff7ed;
  border-color: #fed7aa;
}
.test-insolvencia-alert-naranja .test-insolvencia-alert-text {
  color: #c2410c;
}
.test-insolvencia-alert-con_masa {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.test-insolvencia-alert-con_masa .test-insolvencia-alert-text {
  color: #1d4ed8;
}
.test-insolvencia-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.test-insolvencia-card {
  border: 1px solid #f0f0f0;
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background: #fafafa;
}
.test-insolvencia-card-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #737373;
}
.test-insolvencia-card-value {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #171717;
}
.test-insolvencia-card-activo .test-insolvencia-card-value {
  color: #059669;
}
.test-insolvencia-card-pasivo .test-insolvencia-card-value {
  color: #dc2626;
}
.test-insolvencia-adjuntar {
  width: 100% !important;
  margin-top: 0.2rem;
  padding: 0.8rem 1rem !important;
  font-size: 0.8125rem !important;
  border-radius: 9999px !important;
}
html.dark .test-insolvencia-seccion-title { color: #a3a3a3; }
html.dark .test-insolvencia-toggle {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .test-insolvencia-toggle-text { color: #e5e5e5; }
html.dark .test-insolvencia-field label { color: #d4d4d4; }
html.dark .test-insolvencia-empty {
  background: #171717;
  border-color: #404040;
}
html.dark .test-insolvencia-empty-icon { color: #525252; }
html.dark .test-insolvencia-empty-text { color: #a3a3a3; }
html.dark .test-insolvencia-card {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .test-insolvencia-card-label { color: #a3a3a3; }
html.dark .test-insolvencia-alert-rojo {
  background: #450a0a;
  border-color: #7f1d1d;
}
html.dark .test-insolvencia-alert-rojo .test-insolvencia-alert-text { color: #fca5a5; }
html.dark .test-insolvencia-alert-verde {
  background: #052e1a;
  border-color: #065f46;
}
html.dark .test-insolvencia-alert-verde .test-insolvencia-alert-text { color: #6ee7b7; }
html.dark .test-insolvencia-alert-naranja {
  background: #431407;
  border-color: #9a3412;
}
html.dark .test-insolvencia-alert-naranja .test-insolvencia-alert-text { color: #fdba74; }
html.dark .test-insolvencia-alert-con_masa {
  background: #172554;
  border-color: #1e3a8a;
}
html.dark .test-insolvencia-alert-con_masa .test-insolvencia-alert-text { color: #93c5fd; }

/* Buscador BOE — extranjería / nacionalidad */
.boe-canvas {
  padding: 1.25rem 1.35rem !important;
}
.boe-panel {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.boe-search {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.boe-search-head {
  position: relative;
  padding-top: 0.15rem;
}
.boe-tokens-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.boe-tokens-coin { font-size: 0.85rem; line-height: 1; }
.boe-tokens-count {
  font-variant-numeric: tabular-nums;
}
.boe-search-field {
  position: relative;
  margin-top: 0;
}
.boe-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: #a3a3a3;
  pointer-events: none;
}
.boe-search-input {
  width: 100%;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 9999px;
  padding: 0.42rem 2.15rem 0.42rem 2.15rem;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
  color: #171717;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.boe-search-input:focus {
  border-color: #a3a3a3;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}
.boe-search-input::placeholder { color: #a3a3a3; }
.boe-search-input::-webkit-search-cancel-button,
.boe-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.boe-search-clear {
  display: none;
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #171717;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.boe-search-field:has(.boe-search-input:not(:placeholder-shown)) .boe-search-clear {
  display: inline-flex;
}
.boe-search-clear svg {
  transition: transform 0.15s ease;
}
.boe-search-clear:hover svg {
  transform: scale(0.72);
}
html.dark .boe-search-clear { color: #fafafa; }
.boe-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1rem;
}
.boe-filtro-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #737373;
  letter-spacing: 0.02em;
}
.boe-select {
  min-width: 10.5rem;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 9999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: #171717;
  outline: none;
}
.boe-select:focus { border-color: #a3a3a3; }
.boe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.boe-chip {
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #404040;
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.boe-chip:hover { border-color: #d4d4d4; background: #fafafa; }
.boe-chip.is-active {
  background: #171717;
  border-color: #171717;
  color: #fff;
}
.boe-cta {
  margin-left: auto;
  margin-right: 1.35rem;
  padding: 0.48rem 1.05rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 9999px !important;
  line-height: 1.2 !important;
}
.boe-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #a3a3a3;
  letter-spacing: -0.01em;
}
.boe-error,
.boe-banner {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
html.dark .boe-banner,
html.dark .boe-error {
  background: #2a2118;
  color: #fdba74;
  border-color: #7c4a1e;
}
.boe-empty {
  min-height: 16rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.55rem;
  padding: 2rem 1rem;
  border: 1px dashed #e5e5e5;
  border-radius: 0.9rem;
  background: #fafafa;
}
.boe-empty-icon { color: #d4d4d4; }
.boe-empty-title {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #262626;
  letter-spacing: -0.02em;
}
.boe-empty-text {
  margin: 0;
  max-width: 26rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #a3a3a3;
}
.boe-suggests {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.boe-suggest {
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #525252;
  border-radius: 9999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}
.boe-suggest:hover { border-color: #d4d4d4; color: #171717; }
.boe-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.boe-card {
  border: 1px solid #f0f0f0;
  border-radius: 0.9rem;
  padding: 1.05rem 1.15rem 1.1rem;
  background: #fff;
}
.boe-card-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #171717;
  line-height: 1.35;
}
.boe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}
.boe-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  background: #f5f5f5;
  color: #525252;
  letter-spacing: 0.01em;
}
.boe-tag-id {
  background: #eff6ff;
  color: #1d4ed8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
}
.boe-card-excerpt {
  margin: 0 0 0.95rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #525252;
}
.boe-card-full {
  white-space: pre-wrap;
  max-height: 16rem;
  overflow: auto;
}
.boe-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.boe-picker {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f0f0f0;
}
.boe-picker-btn { width: fit-content; }
.boe-skeleton { pointer-events: none; }
.boe-sk-title {
  height: 0.95rem;
  width: 72%;
  border-radius: 0.35rem;
  margin-bottom: 0.75rem;
}
.boe-sk-badge {
  height: 1.05rem;
  width: 5.5rem;
  border-radius: 9999px;
}
.boe-sk-line {
  height: 0.65rem;
  width: 100%;
  border-radius: 0.3rem;
  margin-top: 0.45rem;
}
.boe-sk-line-short { width: 64%; }
@media (max-width: 720px) {
  .boe-cta { margin-left: 0; width: 100% !important; }
  .boe-tokens-badge { position: static; margin-bottom: 0.65rem; }
  .boe-search-field { margin-top: 0; }
}
html.dark .boe-search-input,
html.dark .boe-select,
html.dark .boe-chip,
html.dark .boe-suggest,
html.dark .boe-card {
  background: #171717;
  border-color: #2a2a2a;
  color: #e5e5e5;
}
html.dark .boe-search-input:focus,
html.dark .boe-select:focus { border-color: #525252; }
html.dark .boe-chip.is-active {
  background: #fafafa;
  border-color: #fafafa;
  color: #171717;
}
html.dark .boe-empty {
  background: #171717;
  border-color: #404040;
}
html.dark .boe-empty-icon { color: #525252; }
html.dark .boe-empty-title { color: #e5e5e5; }
html.dark .boe-card-title { color: #f5f5f5; }
html.dark .boe-card-excerpt { color: #a3a3a3; }
html.dark .boe-tag { background: #262626; color: #d4d4d4; }
html.dark .boe-tag-id { background: #1e3a5f; color: #93c5fd; }
html.dark .boe-picker { border-top-color: #2a2a2a; }
html.dark .boe-filtro-label { color: #a3a3a3; }
html.dark .boe-hint { color: #737373; }

.dash-first-win {
  border: 1px dashed #d4d4d4;
  background: #fafafa;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dash-first-win[hidden],
.dash-plazos-semana[hidden] { display: none !important; }
.dash-first-win h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.dash-first-win p {
  margin: 0 0 0.65rem;
  color: #525252;
  font-size: 0.9rem;
  max-width: 36rem;
}
.dash-first-win-drop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  cursor: pointer;
  border: 1px solid #e5e5e5;
  background: #fff;
  padding: 0.85rem 1rem;
  width: fit-content;
  min-width: 12rem;
}
.dash-first-win-drop.is-drag {
  border-color: #171717;
  background: #f5f5f5;
}
.dash-first-win-drop span {
  font-size: 0.875rem;
  font-weight: 600;
}
.dash-first-win-drop small {
  color: #737373;
  font-size: 0.75rem;
}
.dash-plazos-semana {
  position: relative;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  padding: 16px 24px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.dash-plazos-semana:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  z-index: 3;
}
.dash-plazos-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.dash-plazos-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}
.dash-plazos-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}
.dash-cmdk-hint {
  background: none;
  border: 0;
  padding: 0;
  color: #737373;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: right;
}
.dash-cmdk-hint:hover { color: #171717; }
.dash-plazos-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dash-plazos-item {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.875rem;
  padding: 0.35rem 0;
  border-top: 1px solid #f0f0f0;
  cursor: pointer;
}
.dash-plazos-item:first-child { border-top: 0; }
.dash-plazos-fecha {
  color: #737373;
  min-width: 6.5rem;
  font-variant-numeric: tabular-nums;
}
.dash-plazos-empty {
  color: #737373;
  font-size: 0.85rem;
}
.dash-reloj-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.15rem;
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.dash-reloj-header[hidden],
.dash-reloj-header.hidden { display: none !important; }
#view-cartera:has(#panel-erp-dashboard:not(.hidden)) #dash-reloj-header {
  display: flex !important;
  visibility: visible !important;
}
.dash-reloj-alarmas-valor {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #171717;
}
.dash-reloj-alarmas-valor.is-empty {
  display: block;
  color: #737373;
  font-weight: 400;
}
.dash-reloj-alarma-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.12rem 0.55rem;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  background: #FAFAFA;
  color: #111827;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}
.dash-reloj-alarma-pill em {
  font-style: normal;
  font-weight: 500;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dash-alarmas-card .dash-reloj-alarmas-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.dash-reloj-fecha {
  color: #6B7280;
  font-size: 0.875rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.dash-reloj-hora {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #111827;
}
.dash-reloj-hora,
.dash-reloj-fecha {
  display: inline-block;
  transform-origin: right center;
  transition: transform 0.22s ease;
  cursor: pointer;
}
.dash-reloj-hora:hover {
  transform: scale(1.16);
}
.dash-reloj-fecha:hover {
  transform: scale(1.16);
}
html:not(.dark) #app-shell #dash-reloj-fecha,
html.liquid-glass:not(.dark) #app-shell #dash-reloj-fecha {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
}
html:not(.dark) #app-shell #dash-reloj-hora,
html.liquid-glass:not(.dark) #app-shell #dash-reloj-hora {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
}
.chat-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 38rem;
}
.chat-starter {
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #171717;
  font-size: 0.8rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  border-radius: 999px;
}
.chat-starter:hover { border-color: #171717; }
.chat-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.chat-source-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border: 1px solid #d4d4d4;
  background: #fafafa;
  color: #171717;
  text-decoration: none;
}
a.chat-source-chip:hover { border-color: #171717; }
.chat-source-missing {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}
html.dark .dash-first-win,
html.dark .dash-first-win-drop,
html.dark .dash-plazos-semana,
html.dark .chat-starter,
html.dark .chat-source-chip {
  background: #171717;
  border-color: #2a2a2a;
  color: #e5e5e5;
}
html.dark .dash-first-win p,
html.dark .dash-plazos-empty,
html.dark .dash-plazos-fecha,
html.dark .dash-cmdk-hint,
html.dark .chat-source-missing { color: #a3a3a3; }
html.dark .dash-plazos-item { border-top-color: #262626; }
html.dark .dash-reloj-fecha,
html.dark .dash-reloj-alarmas-valor.is-empty { color: #a3a3a3; }
html.dark .dash-reloj-hora { color: #fafafa; }
html.dark .dash-reloj-alarma-pill {
  background: #111;
  border-color: #2a2a2a;
  color: #fafafa;
}
html.dark .dash-reloj-alarma-pill em { color: #a3a3a3; }
html.dark .dash-plazos-semana {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
html.dark .dash-plazos-semana:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.28);
}
html.dark .dash-cmdk-hint:hover,
html.dark .chat-starter:hover { color: #fafafa; }

/* Expediente Inteligente (detalle LSO) */
#view-cartera.is-expediente-open #cartera-page-header { display: none; }
.lso-exp {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 72rem;
  margin: 0 auto;
  padding-bottom: 5.5rem;
  height: auto;
  min-height: min-content;
  overflow: visible;
}
.lso-exp.hidden,
.lso-exp[hidden] {
  display: none !important;
}
.lso-exp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.lso-exp-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #525252;
  background: transparent;
  border: 0;
  padding: 0.35rem 0;
  cursor: pointer;
}
.lso-exp-back:hover { color: #111827; }
.lso-exp-cta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}
.lso-exp-credits {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
}
.lso-exp-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lso-exp-generate:disabled { opacity: 0.72; cursor: wait; }
html:not(.dark) .lso-exp-generate,
html:not(.dark) .lso-exp-generate span,
html:not(.dark) .lso-exp-generate svg,
html:not(.dark) #lso-exp-btn-generar,
html:not(.dark) #lso-exp-btn-generar span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.lso-exp-generate.is-loading span {
  animation: lso-exp-pulse 1.15s ease-in-out infinite;
}
@keyframes lso-exp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.lso-exp-audit-card { margin-top: 0; }
.lso-exp-context { display: flex; flex-direction: column; gap: 1.25rem; }
.lso-exp-panels {
  background: #f8fafc;
  padding: 1.5rem 0 0;
  border-radius: 0.75rem;
}
.lso-exp-panel.hidden,
.lso-exp-panel[hidden] {
  display: none !important;
}
.lso-exp-epi-card {
  max-width: none;
  margin-inline: 0;
}

/* Calculadora EPI — plan de pagos en expediente LSO */
.epi-card {
  margin-top: 0;
  background: #fff;
  border-color: #e2e8f0;
}
.epi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.25rem 1.75rem;
  align-items: stretch;
}
.epi-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.epi-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.epi-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}
.epi-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.epi-input-wrap input[type="number"] {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  padding: 0.7rem 2.15rem 0.7rem 0.85rem;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  border-radius: 0.65rem;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.epi-input-wrap input[type="number"]::-webkit-inner-spin-button,
.epi-input-wrap input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.epi-input-wrap input[type="number"]:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.epi-suffix {
  position: absolute;
  right: 0.8rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: #64748b;
  pointer-events: none;
}
.epi-plazo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.epi-plazo-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.65rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  line-height: 1.25;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.epi-plazo-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.epi-plazo-opt:hover { background: #fff; border-color: #94a3b8; }
.epi-plazo-opt:has(input:checked) {
  background: #fff;
  border-color: #0f766e;
  color: #0f766e;
  box-shadow: none;
}
.epi-output {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 1rem;
  min-height: 100%;
}
.epi-cuota-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}
.epi-cuota-value {
  margin: 0.2rem 0 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f766e;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.epi-cuota-value.is-placeholder {
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0;
  font-variant-numeric: normal;
  line-height: 1.4;
}
.epi-total {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.epi-alerta {
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.6rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.epi-output.is-alert {
  border-color: #fed7aa;
}
.epi-output.is-alert .epi-cuota-value { color: #c2410c; }
@media (max-width: 900px) {
  .epi-layout,
  .epi-plazo { grid-template-columns: 1fr; }
}
.lso-exp-audit {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lso-exp-audit-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.lso-exp-audit-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
}
.lso-exp-audit-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}
.lso-exp-audit-meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}
.lso-exp-audit-empty {
  font-size: 0.8125rem;
  color: #a3a3a3;
  padding: 0.35rem 0;
}
.lso-exp-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.lso-exp-eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #737373;
}
.lso-exp-cliente {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #111827;
  line-height: 1.2;
}
.lso-exp-meta {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #737373;
}
.lso-exp-fase-wrap { min-width: 12rem; }
.lso-exp-fase {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111827;
}
.lso-exp-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  margin-top: 1rem;
  gap: 1rem;
}
.lso-exp-metric {
  flex: none;
  min-height: 0;
  height: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: none;
}
.lso-exp-metric:last-child { border-right: 1px solid #e5e7eb; }
.lso-exp-metric-label {
  margin: 0 0 0.25rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}
.lso-exp-metric-value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.3;
}
.lso-exp-metric.is-ok .lso-exp-metric-value { color: #047857; }
.lso-exp-metric.is-warn .lso-exp-metric-value { color: #b45309; }
.lso-exp-metric.is-warn { border-color: #e5e7eb; background: #fff; }
.lso-exp-metric.is-bad .lso-exp-metric-value { color: #b91c1c; }
.lso-exp-metric.is-bad { border-color: #e5e7eb; background: #fff; }
.lso-exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 0.9rem;
  align-items: start;
}
.lso-exp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 0.85rem 1rem 1rem;
  box-shadow: none;
}
.lso-exp-semaforo-card {
  padding: 0;
}
.lso-exp-semaforo-card > header {
  margin: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}
.lso-exp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.lso-exp-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #111827;
}
.lso-exp-card-sub {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}
.lso-exp-add {
  white-space: nowrap;
  flex-shrink: 0;
}
.lso-exp-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lso-exp-doc {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.lso-exp-doc:hover {
  background: #fafafa;
}
.lso-exp-doc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.75rem 1rem;
}
.lso-exp-doc .lso-check-actions {
  grid-column: auto;
  grid-row: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}
.lso-exp-doc .lso-ocr-preview,
.lso-exp-doc [data-ocr-preview] {
  flex: 1 0 100%;
}
.lso-exp-doc .lso-check-file {
  display: block;
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  color: #9ca3af;
}
.lso-exp-doc-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}
.lso-exp-doc-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  line-height: 1.25;
}
.lso-exp-doc-status {
  display: inline-flex;
  align-items: center;
  margin: 0;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: inherit;
}
.lso-exp-doc.is-falta .lso-exp-doc-status,
.lso-exp-doc.is-ok .lso-exp-doc-status,
.lso-exp-doc.is-ia .lso-exp-doc-status,
.lso-exp-doc.is-pendiente .lso-exp-doc-status { color: inherit; }
.lso-exp-doc-icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0;
}
.lso-exp-doc-icon.is-falta { background: #fef2f2; color: #b91c1c; }
.lso-exp-doc-icon.is-ok { background: #ecfdf5; color: #047857; }
.lso-exp-doc-icon.is-ia { background: #f5f3ff; color: #6d28d9; }
.lso-exp-doc-icon.is-processing { background: #f4f4f5; color: #525252; }
.lso-exp-doc.is-cirbe { align-items: stretch; }
.lso-exp-doc-hint {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75rem;
  color: #9ca3af;
}
.lso-exp-doc-hint[hidden] { display: none !important; }
.lso-exp-doc .lso-cirbe-dropzone { display: none !important; }
.lso-cirbe-dropzone {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 1rem 0.85rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.lso-cirbe-dropzone:hover,
.lso-cirbe-dropzone:focus-visible {
  color: #374151;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.lso-cirbe-dropzone.is-dragover {
  color: #111827;
  background: #f9fafb;
  box-shadow: none;
}
.lso-cirbe-dropzone.is-busy {
  pointer-events: none;
  cursor: wait;
  border-style: none;
  border-color: transparent;
}
.lso-cirbe-sparkle {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 500;
  color: #6b7280;
  flex-shrink: 0;
}
.lso-cirbe-dropzone.is-busy .lso-cirbe-sparkle {
  animation: lso-cirbe-spark 1.15s ease-in-out infinite;
}
.lso-cirbe-drop-text {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
  color: #6b7280;
}
.lso-cirbe-dropzone.is-ia-on .lso-cirbe-drop-text {
  color: #059669;
  font-weight: 500;
}
.lso-cirbe-dropzone.is-busy .lso-cirbe-drop-text {
  animation: lso-cirbe-status 0.45s ease;
}
@keyframes lso-cirbe-spark {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.65; filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.18) rotate(14deg); opacity: 1; filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.55)); }
}
@keyframes lso-cirbe-status {
  from { opacity: 0.35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
html.dark .lso-cirbe-dropzone {
  background: transparent;
  border-color: transparent;
  color: #a1a1aa;
}
html.dark .lso-cirbe-dropzone:hover,
html.dark .lso-cirbe-dropzone.is-dragover {
  background: #18181b;
  border-color: transparent;
}
html.dark .lso-cirbe-drop-text { color: #a1a1aa; }
html.dark .lso-cirbe-dropzone.is-ia-on .lso-cirbe-drop-text { color: #34d399; }
html.dark .lso-cirbe-sparkle { color: #71717a; }
.lso-exp-portal {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 0;
  border-top: 1px solid #f3f4f6;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}
.lso-exp-portal:hover {
  background: #f9fafb;
}
.lso-exp-portal svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: block;
}
.lso-exp-portal.is-copied,
.lso-exp-portal.is-copied span,
.lso-exp-portal.is-copied svg {
  color: #059669 !important;
}
.lso-exp-table-wrap { overflow-x: auto; }
.lso-exp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.lso-exp-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #737373;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}
.lso-exp-table td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid #f8f8f8;
  color: #374151;
  vertical-align: middle;
}
.lso-exp-td-name { font-weight: 600; color: #111827; }
.lso-exp-td-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lso-exp-td-actions { text-align: right; white-space: nowrap; }
.lso-exp-tipo {
  display: inline-flex;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.lso-exp-tipo.is-privada { background: #f4f4f5; color: #3f3f46; }
.lso-exp-tipo.is-publica { background: #eff6ff; color: #1d4ed8; }
.lso-exp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
  color: #737373;
  border-radius: 0.4rem;
  cursor: pointer;
}
.lso-exp-icon-btn:hover { background: #f4f4f5; color: #111827; }
.lso-exp-icon-btn.is-danger,
html.dark .lso-exp-icon-btn.is-danger { color: #dc2626; }
.lso-exp-icon-btn.is-danger:hover { background: #fef2f2; color: #b91c1c; }
.lso-exp-empty-row td {
  text-align: center;
  color: #a3a3a3;
  padding: 1.5rem 0.75rem;
}
.lso-exp-cta-mobile {
  display: none;
  position: sticky;
  bottom: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
  box-shadow: none;
  flex-direction: column;
  gap: 0.45rem;
}
@media (max-width: 900px) {
  .lso-exp-metrics { flex-direction: column; grid-template-columns: 1fr; }
  .lso-exp-metric { border-right: 1px solid #e5e7eb; border-bottom: 0; }
  .lso-exp-metric:last-child { border-bottom: 0; }
  .lso-exp-grid { grid-template-columns: 1fr; }
  .lso-exp-cta { display: none; }
  .lso-exp-cta-mobile { display: flex; }
  .lso-exp-cta-mobile .lso-exp-generate { width: 100%; justify-content: center; }
}
html.dark .lso-exp-cliente,
html.dark .lso-exp-card-title,
html.dark .lso-exp-doc-label,
html.dark .lso-exp-td-name,
html.dark .lso-exp-metric-value { color: #fafafa; }
html.dark .lso-exp-card,
html.dark .lso-exp-metric,
html.dark .lso-exp-fase,
html.dark .lso-exp-cta-mobile {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .lso-exp-doc { background: transparent; border-color: transparent; }
html.dark .lso-exp-doc:hover { background: #1c1c1c; }
html.dark .lso-exp-credits { background: #262626; border-color: #3f3f46; color: #e5e5e5; }
html.dark .lso-exp-audit-text { color: #fafafa; }
html.dark .lso-exp-audit-dot { background: #fafafa; }
html.dark .lso-exp-back,
html.dark .lso-exp-meta,
html.dark .lso-exp-card-sub { color: #a3a3a3; }
html.dark .epi-card {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .epi-label { color: #cbd5e1; }
html.dark .epi-input-wrap input[type="number"] {
  background: #0a0a0a;
  border-color: #3f3f46;
  color: #fafafa;
}
html.dark .epi-plazo-opt {
  background: rgba(10, 10, 10, 0.45);
  border-color: #3f3f46;
  color: #a3a3a3;
}
html.dark .epi-plazo-opt:has(input:checked) {
  background: #0a0a0a;
  border-color: #2dd4bf;
  color: #5eead4;
}
html.dark .epi-output {
  background: #0a0a0a;
  border-color: #134e4a;
}
html.dark .epi-cuota-value { color: #5eead4; }
html.dark .epi-cuota-value.is-placeholder { color: #94a3b8; }
html.dark .epi-alerta {
  background: #431407;
  border-color: #c2410c;
  color: #fdba74;
}
html.dark .epi-output.is-alert { border-color: #c2410c; }
html.dark .epi-output.is-alert .epi-cuota-value { color: #fb923c; }

.lexia-help-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}
.lexia-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  cursor: help;
  outline: none;
}
.lexia-help-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 1px solid #d4d4d8;
  background: #fafafa;
  color: #52525b;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}
.lexia-help-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  container-type: normal;
  box-sizing: border-box;
  width: 16.5rem;
  max-width: min(16.5rem, calc(100vw - 2rem));
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #0a0a0a;
  border: 1px solid #e4e4e7;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity 0.12s ease;
}
html.liquid-glass:not(.dark) #app-shell .lexia-help-bubble,
html:not(.dark) #app-shell .lexia-help-bubble {
  background: #ffffff !important;
  color: #0a0a0a !important;
  -webkit-text-fill-color: #0a0a0a !important;
}
.lexia-help:hover .lexia-help-bubble,
.lexia-help:focus .lexia-help-bubble,
.lexia-help:focus-visible .lexia-help-bubble {
  opacity: 1;
}
.lexia-mult-badge {
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #f4f4f5;
  color: #18181b;
  border: 1px solid #e4e4e7;
}
.lso-kanban-board.is-board-empty,
.lso-casos-tabla.is-board-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  height: 100%;
  min-height: 20rem;
  max-height: calc(100vh - 18rem);
  padding: 0.15rem 0.1rem 0.5rem;
}
.lso-casos-tabla.is-board-empty[hidden] {
  display: none !important;
}
.lso-board-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  color: #a3a3a3;
}
.lso-board-empty-art { color: #d4d4d8; }
.lso-board-empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #171717;
}
.lso-kanban-chip.is-demo {
  background: #f5f3ff;
  color: #6d28d9;
}
.lso-exp-doc.is-pendiente .lso-exp-doc-status { color: inherit; }
.lso-exp-doc-icon.is-pendiente { background: #fff7ed; color: #c2410c; }
.lso-acreedores-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.lso-acreedores-empty svg { color: #94a3b8; }
.lso-acreedores-empty p { margin: 0; }
.lso-acreedores-empty[hidden] { display: none !important; }
.lso-exp-empty-row td {
  padding: 0.5rem !important;
  border: 0 !important;
}
html.dark .lexia-help-q {
  background: #171717;
  border-color: #3f3f46;
  color: #a1a1aa;
}
html.dark .lexia-mult-badge {
  background: #27272a;
  border-color: #3f3f46;
  color: #fafafa;
}
html.dark .lso-board-empty-title { color: #fafafa; }
html.dark .lso-acreedores-empty {
  background: #171717;
  border-color: #3f3f46;
  color: #a3a3a3;
}
html.dark .lso-kanban-chip.is-demo {
  background: #2e1065;
  color: #ddd6fe;
}

/* ============================================================
   Layout móvil: header compacto + drawer sidebar
   ============================================================ */
html,
body,
#app-shell,
#app-workspace,
#main-container,
#main-container > main {
  overflow-x: hidden;
}

.header-brand-mobile {
  display: none;
  align-items: center;
  gap: 0.45rem;
  pointer-events: none;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #09090b;
  white-space: nowrap;
}
html.dark .header-brand-mobile {
  color: #fafafa;
}

@media (max-width: 767px) {
  html.erp-sidebar-open,
  html.erp-sidebar-open body {
    overflow: hidden;
  }

  #app-header,
  #app-header.app-header-floating,
  html.dark #app-header.app-header-floating,
  html.liquid-glass #app-header.app-header-floating,
  html.dark.liquid-glass #app-header.app-header-floating,
  html.auth-session #app-header.app-header-floating,
  html.auth-session.layout-historial-open #app-header.app-header-floating {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    height: var(--app-header-height, 3.75rem) !important;
    min-height: var(--app-header-height, 3.75rem) !important;
    max-height: var(--app-header-height, 3.75rem) !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 0.75rem !important;
    margin: 0 !important;
    overflow: visible !important;
    pointer-events: auto !important;
    z-index: 60 !important;
    background: var(--app-background, #fff) !important;
    background-color: var(--app-background, #fff) !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }

  #app-header .header-side-left {
    position: relative !important;
    margin: 0 !important;
    z-index: 60;
    pointer-events: auto !important;
  }

  #app-header .header-side-right,
  #app-header .header-floating-controls,
  #app-header .header-floating-controls,
  #time-tracker-widget,
  #time-tracker-widget,
  #btn-modo-concentracion,
  #btn-modo-concentracion,
  #theme-toggle,
  #btn-lang-toggle,
  #btn-lang-toggle,
  #header-utility-controls,
  #header-utility-controls {
    display: none !important;
    position: static !important;
  }

  .header-brand-mobile {
    display: flex !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  html.auth-session #btn-abrir-erp-sidebar,
  #btn-abrir-erp-sidebar {
    display: inline-flex !important;
    position: relative !important;
    z-index: 60 !important;
    pointer-events: auto !important;
  }

  #erp-sidebar,
  .erp-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    height: 100dvh !important;
    transform: translateX(-100%);
    z-index: 50 !important;
    pointer-events: auto !important;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  html.erp-sidebar-open #erp-sidebar,
  html.erp-sidebar-open .erp-sidebar,
  html.auth-session.erp-nav-collapsed.erp-sidebar-open #erp-sidebar,
  html.auth-session.erp-nav-collapsed.erp-sidebar-open .erp-sidebar {
    transform: translateX(0) !important;
    pointer-events: auto !important;
    z-index: 50 !important;
  }

  #erp-sidebar-backdrop {
    z-index: 40 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  .erp-sidebar-close {
    display: inline-flex !important;
  }

  #btn-toggle-erp-nav {
    display: none !important;
  }
}

/* Nav IA: switcher, grupos, flyouts, rail, tab bar móvil */
.erp-niche-switcher { position: sticky; top: 0; z-index: 10; margin: 0.35rem 0.85rem 0.15rem; flex-shrink: 0; background: transparent; }
.erp-niche-combo { display: none; }
.erp-niche-swatch { flex-shrink: 0; width: 1.4rem; height: 1.4rem; border-radius: 0.35rem; display: inline-flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; color: #fff; background: #2563eb; }
.erp-niche-swatch[data-nicho-swatch="bancario"] { background: #059669; }
.erp-niche-swatch[data-nicho-swatch="extranjeria"] { background: #7c3aed; }
.erp-niche-listbox { position: absolute; left: 0; right: 0; top: calc(100% + 0.25rem); z-index: 80; background: #fff; border: none; border-radius: 24px; box-shadow: none; padding: 0.3rem; }
.erp-niche-option { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.45rem 0.5rem; border: 0; background: transparent; border-radius: 0.45rem; cursor: pointer; font-size: 0.8125rem; text-align: left; }
.erp-niche-option:hover, .erp-niche-option:focus { background: #f4f4f5; outline: none; }
.erp-niche-option-label { flex: 1; font-weight: 500; }
.erp-niche-check { color: #16a34a; font-weight: 700; }
.erp-niche-meta { font-size: 0.65rem; color: #71717a; text-transform: uppercase; letter-spacing: .04em; }
.erp-sidebar-search-wrap { padding: 0 0.7rem 0.55rem; flex-shrink: 0; }
.erp-sidebar-search { display: flex; align-items: center; gap: 0.45rem; width: 100%; min-height: 2.1rem; padding: 0 0.55rem; border-radius: 24px; border: none; background: #fff; color: #52525b; font-size: 0.75rem; cursor: pointer; box-shadow: none; }
.erp-sidebar-search span { flex: 1; text-align: left; }
.erp-nav-kbd,
.erp-nav-badge,
.erp-sidebar kbd,
.erp-sidebar [id^="nav-badge-"],
.vercel-nav-item[data-nav-shortcut]::before,
.vercel-nav-item[data-nav-shortcut]::after,
.erp-sidebar .vercel-nav-item::before,
.erp-sidebar .vercel-nav-item::after {
  display: none !important;
  content: none !important;
}
.erp-nav-group { margin-bottom: 0.35rem; }
#nav-principal > .erp-sidebar-nav > .erp-nav-group {
  margin-top: 0;
  margin-bottom: 0.35rem;
}
#nav-principal > .erp-sidebar-nav > .erp-nav-group > .erp-sidebar-label {
  margin: 0.7rem 0 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
}
#nav-principal > .erp-sidebar-nav > .erp-nav-group:first-child > .erp-sidebar-label {
  margin-top: 0.1rem;
}
#nav-principal > .erp-sidebar-nav > .erp-nav-group > .erp-nav-group-body > .vercel-nav-item,
#nav-principal > .erp-sidebar-nav > .erp-nav-group > .erp-nav-group-body > .nav-ai-group {
  margin-top: 0;
  margin-bottom: 0;
}
.erp-nav-item-wrap { position: relative; display: flex; align-items: stretch; }
.erp-nav-item-wrap > .vercel-nav-item { flex: 1; }
.erp-nav-flyout-chevron { width: 1.4rem; flex-shrink: 0; border: 0; background: transparent; color: #a1a1aa; cursor: pointer; border-radius: 0.35rem; }
.erp-nav-flyout-mas { width: 15.5rem; }
.erp-nav-flyout-mas .vercel-nav-item { width: 100%; }
.erp-niche-filter { display: block; width: 100%; margin: 0 0 0.35rem; padding: 0.4rem 0.55rem; border: 1px solid #e4e4e7; border-radius: 0.4rem; font: inherit; font-size: 0.78rem; background: #fafafa; }
.erp-nav-item-wrap[data-nav-flyout="mas"] { position: relative; }
.erp-fly-label { font-size: 0.65rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #a1a1aa; margin: 0.45rem 0.35rem 0.15rem; }
.erp-fly-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0.4rem 0.5rem; border-radius: 0.4rem; font-size: 0.8rem; cursor: pointer; }
.erp-fly-item:hover { background: #f4f4f5; }
.erp-fly-item.is-cta { font-weight: 600; color: #2563eb; }
.erp-fly-empty, .erp-fly-hint { font-size: 0.72rem; color: #71717a; padding: 0.25rem 0.5rem; }
.erp-nav-badge { display: none !important; }
.erp-sidebar-footer { position: relative; z-index: 40; overflow: visible; flex-shrink: 0; padding: 0.55rem 0.7rem 0.75rem; border-top: none; }
.erp-user-chip { display: flex; align-items: center; gap: 0.5rem; width: 100%; border: 0; background: transparent; padding: 0.25rem; border-radius: 0.5rem; cursor: default; text-align: left; }
.erp-user-chevron-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0.15rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  line-height: 0;
}
.erp-user-chip .erp-user-chevron {
  flex-shrink: 0;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}
.erp-user-chevron-btn[aria-expanded="true"] .erp-user-chevron {
  transform: rotate(-180deg);
}
.erp-user-avatar { width: 1.75rem; height: 1.75rem; border-radius: 999px; background: #18181b; color: #fafafa; font-size: 0.65rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.erp-user-meta { min-width: 0; flex: 1; }
.erp-user-name { display: block; font-size: 0.78rem; font-weight: 600; color: #09090b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-user-firm { display: block; font-size: 0.65rem; color: #71717a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-user-menu { position: absolute; left: 0.7rem; right: 0.7rem; bottom: calc(100% + 0.25rem); background: #fff; border: none; border-radius: 24px; box-shadow: none; padding: 0.35rem; z-index: 80; pointer-events: auto; }
.erp-user-plan { font-size: 0.68rem; color: #71717a; padding: 0.25rem 0.5rem 0.4rem; }
.erp-user-menu button { display: flex; align-items: center; gap: 0.45rem; width: 100%; text-align: left; border: 0; background: transparent; padding: 0.45rem 0.5rem; border-radius: 0.4rem; font-size: 0.8rem; cursor: pointer; color: #09090b; }
.erp-user-menu button .nav-item-icon { flex-shrink: 0; }
.erp-user-menu button:hover { background: #f4f4f5; }
.erp-user-menu .is-danger { color: #dc2626; }
.erp-user-menu .erp-help-switch {
  margin-left: auto;
  width: 1.75rem;
  height: 1rem;
  border-radius: 999px;
  background: #d4d4d8;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}
.erp-user-menu .erp-help-switch-knob {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
  transition: transform 0.15s ease;
}
.erp-user-menu button.is-checked .erp-help-switch { background: #18181b; }
.erp-user-menu button.is-checked .erp-help-switch-knob { transform: translateX(0.75rem); }
html.dark .erp-user-menu .erp-help-switch { background: #3f3f46; }
html.dark .erp-user-menu button.is-checked .erp-help-switch { background: #fafafa; }
html.dark .erp-user-menu button.is-checked .erp-help-switch-knob { background: #18181b; }
.erp-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: #71717a; margin-bottom: 0.35rem; }
.erp-breadcrumb button { border: 0; background: none; color: #52525b; cursor: pointer; padding: 0; font: inherit; }
.erp-breadcrumb button:hover { color: #09090b; text-decoration: underline; }
.erp-overflow-wrap { position: relative; }
.erp-overflow-menu { position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 30; min-width: 14rem; background: #fff; border: 1px solid #e4e4e7; border-radius: 0.55rem; box-shadow: none; padding: 0.3rem; }
.erp-overflow-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0.45rem 0.55rem; border-radius: 0.4rem; font-size: 0.8rem; cursor: pointer; }
.lso-view-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
.lso-view-toggle-btn { border: 1px solid #e4e4e7; background: #fff; color: #18181b; padding: 0.4rem 0.75rem; font-size: 0.75rem; cursor: pointer; border-radius: 0.5rem; font-weight: 500; }
.lso-view-toggle-btn.is-active { background: var(--app-primary); color: #fff; border-color: var(--app-primary); }
.lso-exp-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
  margin: 0 0 1.5rem;
}
.lso-exp-subnav > * + * { margin-left: 1.5rem; }
.lso-exp-subnav button {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0 0.75rem;
  margin-bottom: -1px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lso-exp-subnav button:hover {
  color: #334155;
  border-bottom-color: #cbd5e1;
  background: transparent;
  box-shadow: none;
}
.lso-exp-subnav button.is-active,
.lso-exp-subnav button[aria-current="page"],
.lso-exp-subnav button[aria-selected="true"] {
  background: transparent;
  color: #0f172a;
  font-weight: 500;
  box-shadow: none;
  border-bottom-color: #0f172a;
}
.lso-exp-subnav button.is-active:hover,
.lso-exp-subnav button[aria-selected="true"]:hover {
  color: #0f172a;
  border-bottom-color: #0f172a;
}
html.dark .lso-exp-subnav { border-bottom-color: #27272a; }
html.dark .lso-exp-subnav button { color: #94a3b8; background: transparent; box-shadow: none; }
html.dark .lso-exp-subnav button:hover { color: #e2e8f0; border-bottom-color: #52525b; }
html.dark .lso-exp-subnav button.is-active,
html.dark .lso-exp-subnav button[aria-current="page"],
html.dark .lso-exp-subnav button[aria-selected="true"],
html.dark .lso-exp-subnav button.is-active:hover {
  background: transparent;
  color: #f8fafc;
  box-shadow: none;
  border-bottom-color: #f8fafc;
}
html.dark .lso-exp-panels { background: transparent; }
.lso-exp-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; margin: 0.75rem 0 0.25rem; padding: 0; font-size: 0.875rem; font-weight: 500; position: relative; z-index: 2; }
.lso-step-sep { font-size: 0.875rem; line-height: 1; }
#lso-exp-fase,
label[for="lso-exp-fase"] {
  pointer-events: none !important;
}
.lso-step {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  color: #94a3b8;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.lso-step.is-active { background: transparent; color: #0f172a; font-weight: 500; border-color: transparent; }
.lso-exp-generate-wrap { position: relative; }
.lso-exp-escritos-menu, .lso-ctx-menu { position: absolute; right: 0; top: calc(100% + 0.3rem); z-index: 20; min-width: 16rem; background: #fff; border: 1px solid #e4e4e7; border-radius: 0.55rem; box-shadow: none; padding: 0.3rem; }
.lso-ctx-menu { position: fixed; z-index: 80; min-width: 13rem; }
.lso-exp-escritos-menu button, .lso-ctx-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0.5rem 0.6rem; border-radius: 0.4rem; font-size: 0.8rem; cursor: pointer; }
.lso-ctx-menu .is-danger { color: #dc2626; }
.erp-nicho-confirm { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.erp-nicho-confirm[hidden] { display: none; }
.erp-nicho-confirm-panel { width: min(26rem, 100%); background: #fff; border-radius: 0.75rem; padding: 1.25rem; }
.erp-nicho-confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
.erp-mobile-tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #f4f4f5; border-top: 1px solid #e4e4e7; padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr); }
.erp-mobile-tab { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.62rem; color: #52525b; text-decoration: none; padding: 0.25rem; }
.erp-mobile-tab[aria-current="page"] { color: #09090b; font-weight: 600; }
.settings-local-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.5rem 0 1rem; }
.settings-local-tab { border: 1px solid #e4e4e7; background: #fff; border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.75rem; cursor: pointer; }
.settings-local-tab.is-active { background: #18181b; color: #fff; border-color: #18181b; }
.tpl-select { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.erp-linkish { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }
.is-pref-hidden { display: none !important; }
.app-skip-link { position: absolute; left: 0.75rem; top: -3rem; z-index: 100; background: #18181b; color: #fff; padding: 0.4rem 0.7rem; border-radius: 0.4rem; }
.app-skip-link:focus { top: 0.75rem; }
html.erp-nav-collapsed .erp-sidebar-brand,
html.erp-nav-collapsed .erp-niche-selector-label,
html.erp-nav-collapsed .erp-sidebar-search span,
html.erp-nav-collapsed .erp-sidebar-search .erp-nav-kbd,
html.erp-nav-collapsed .erp-sidebar .erp-nav-kbd,
html.erp-nav-collapsed .erp-sidebar-label,
html.erp-nav-collapsed .erp-user-meta,
html.erp-nav-collapsed .erp-nav-item-wrap .erp-nav-flyout-chevron { display: none !important; }
html.erp-nav-collapsed .vercel-nav-item { justify-content: center; position: relative; }
html.erp-nav-collapsed .erp-sidebar-search { justify-content: center; }
html.erp-nav-collapsed .vercel-nav-item > span:not(.nav-ai-glyph):not(.erp-nav-badge) {
  position: absolute;
  left: calc(100% + 0.55rem);
  top: 50%;
  transform: translateY(-50%);
  width: max-content;
  max-width: 14rem;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  background: #18181b;
  color: #fafafa;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 70;
  box-shadow: none;
}
html.erp-nav-collapsed .vercel-nav-item:hover > span:not(.nav-ai-glyph):not(.erp-nav-badge),
html.erp-nav-collapsed .vercel-nav-item:focus-visible > span:not(.nav-ai-glyph):not(.erp-nav-badge) {
  opacity: 1;
  visibility: visible;
}
html.erp-nav-collapsed #nav-flyout-expedientes .vercel-nav-item > span:not(.nav-ai-glyph):not(.erp-nav-badge) {
  position: static;
  transform: none;
  width: auto;
  max-width: none;
  background: none;
  color: inherit;
  padding: 0;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
html.erp-nav-collapsed .erp-sidebar { overflow: hidden; }
html.erp-nav-collapsed .erp-sidebar-nav { overflow-x: hidden; overflow-y: auto; }
@media (max-width: 767px) {
  .erp-mobile-tabbar { display: grid; }
  html.auth-session #app-workspace { padding-bottom: 4.25rem; }
}
html.dark .erp-niche-combo,
html.dark .erp-sidebar-search,
html.dark .erp-niche-listbox,
html.dark .erp-nav-flyout,
html.dark .erp-user-menu,
html.dark .erp-overflow-menu,
html.dark .lso-ctx-menu,
html.dark .lso-exp-escritos-menu,
html.dark .erp-nicho-confirm-panel { background: #18181b; color: #fafafa; border-color: #27272a; }
html.dark .erp-user-name, html.dark .erp-niche-selector-label { color: #fafafa; }

.erp-sidebar-nav-stack { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
html.erp-nav-collapsed .erp-nav-flyout-chevron { display: none; }
html.erp-nav-collapsed .erp-fly-label { display: none !important; }
html.erp-nav-collapsed .erp-sidebar,
html.erp-nav-collapsed .erp-sidebar-nav { overflow-x: hidden; overflow-y: auto; }
#nav-herramientas { display: flex; flex-direction: column; width: 100%; }
#nav-herramientas .vercel-nav-item { width: 100%; }
#nav-herramientas .vercel-nav-item.hidden,
#nav-herramientas .vercel-nav-item[hidden] {
  display: none !important;
}

/* ============================================================
   Quiet Luxury — override final (B2B Enterprise)
   ============================================================ */
html:not(.dark) body {
  font-family: "Inter", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background-color: var(--app-background) !important;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
}
html:not(.dark) #app-shell,
html:not(.dark) #app-workspace,
html:not(.dark) #main-container,
html:not(.dark) #main-container > main {
  background-color: var(--app-background) !important;
}
html:not(.dark) :where(h1, h2, h3, .vercel-page-title, .settings-card-title, .erp-sidebar-brand) {
  color: #0F172A !important;
  font-weight: 600;
  letter-spacing: -0.03em;
}
html:not(.dark) .btn-primary,
html:not(.dark) .app-primary-bg,
html:not(.dark) #btn-login-submit,
html:not(.dark) #btn-register-submit,
html:not(.dark) #txt-btn-aperturar-wrap,
html:not(.dark) .cartera-accion-btn.btn-primary {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
  border-radius: 0.5rem !important;
  box-shadow: none !important;
}
html:not(.dark) .btn-primary:hover,
html:not(.dark) .app-primary-bg:hover,
html:not(.dark) #btn-login-submit:hover:not(:disabled),
html:not(.dark) #btn-register-submit:hover:not(:disabled),
html:not(.dark) #txt-btn-aperturar-wrap:hover,
html:not(.dark) .cartera-accion-btn.btn-primary:hover {
  background-color: var(--app-primary-dark) !important;
  border-color: var(--app-primary-dark) !important;
}
html:not(.dark) button.btn-primary.boe-cta,
button.btn-primary.boe-cta {
  border-radius: 9999px !important;
  padding: 0.48rem 1.05rem !important;
  font-size: 0.78rem !important;
  line-height: 1.2 !important;
}
html:not(.dark) .btn-secondary,
html:not(.dark) .btn-marfil,
html:not(.dark) .cartera-accion-btn.btn-secondary {
  color: #0F172A !important;
  border-radius: 0.5rem !important;
  border-color: #E2E8F0 !important;
  box-shadow: none !important;
}
html:not(.dark) .payment-shell,
html:not(.dark) .command-palette-panel,
html:not(.dark) .settings-panel-shell {
  background-color: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 24px !important;
  box-shadow: none !important;
}
html:not(.dark) .command-palette-panel {
  box-shadow: none !important;
}
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #E5E7EB;
  box-shadow: none;
}
html:not(.dark) .erp-sidebar .vercel-nav-item.is-drop-idle,
html:not(.dark) .erp-sidebar .vercel-nav-item.is-drop-idle:hover,
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active.is-drop-idle:hover,
html:not(.dark) .erp-sidebar .is-drop-idle .vercel-nav-item,
html:not(.dark) .erp-sidebar .is-drop-idle .vercel-nav-item:hover,
html:not(.dark) .erp-sidebar .is-drop-idle .vercel-nav-item.is-active:hover {
  background: #FFFFFF !important;
  color: #0F172A !important;
}
html:not(.dark) .erp-sidebar .vercel-nav-item.is-drop-idle:hover .nav-item-icon,
html:not(.dark) .erp-sidebar .is-drop-idle .vercel-nav-item:hover .nav-item-icon {
  transform: none !important;
}
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active i,
html:not(.dark) .erp-sidebar .vercel-nav-item.is-active .nav-item-icon,
html:not(.dark) .erp-sidebar .vercel-nav-item:hover i,
html:not(.dark) .erp-sidebar .vercel-nav-item:hover .nav-item-icon {
  color: var(--app-primary) !important;
}
.shadow-google {
  box-shadow: none !important;
}
.shadow-google-active {
  box-shadow: none !important;
}
.shadow-sm {
  box-shadow: none !important;
}
.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl,
.shadow-ql,
.shadow {
  box-shadow: none !important;
}

#cartera-acciones-facturacion .factura-btn-nueva,
html:not(.dark) #cartera-acciones-facturacion .factura-btn-nueva.btn-primary {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
  border-radius: 0.375rem !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 150ms cubic-bezier(0, 0, 0.2, 1);
}
#cartera-acciones-facturacion .factura-btn-nueva:hover,
html:not(.dark) #cartera-acciones-facturacion .factura-btn-nueva.btn-primary:hover {
  transform: scale(0.98);
}
#cartera-acciones-facturacion .factura-btn-nueva:active,
html:not(.dark) #cartera-acciones-facturacion .factura-btn-nueva.btn-primary:active {
  transform: scale(0.96);
}

#facturas-metricas article > svg {
  color: #a1a1aa !important;
}
#facturas-metricas #metrica-total-facturado,
#facturas-metricas #metrica-cobrado,
#facturas-metricas #metrica-pendiente {
  color: #18181b !important;
  -webkit-text-fill-color: #18181b !important;
}

.factura-row-delete,
.factura-row-delete:hover,
.factura-row-delete:focus {
  background: transparent !important;
  color: #dc2626 !important;
}
.factura-row-delete svg {
  color: inherit;
  stroke: currentColor;
}

#lista-facturas-global tr:hover,
#lista-facturas-global tr:hover td,
#detalle-lista-facturas tr:hover,
#detalle-lista-facturas tr:hover td {
  background-color: transparent !important;
}

.factura-estado-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
  min-height: 1.375rem;
  padding: 0 0.625rem !important;
  line-height: 1 !important;
  text-align: center;
  background-color: transparent !important;
  border: 1px solid #e4e4e7 !important;
  color: #3f3f46 !important;
  -webkit-text-fill-color: #3f3f46 !important;
}
.factura-estado-badge[data-estado="cobrada"],
.factura-estado-badge[data-estado="pagada"] {
  gap: 0.375rem;
}
.factura-estado-badge .factura-estado-dot {
  display: inline-block !important;
  width: 0.375rem !important;
  height: 0.375rem !important;
  min-width: 0.375rem;
  min-height: 0.375rem;
  border-radius: 9999px !important;
  background-color: #10b981 !important;
  flex-shrink: 0;
}

#sheet-nueva-factura .sheet-nueva-factura-overlay {
  background: rgb(0 0 0 / 0.4) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}
#sheet-nueva-factura .sheet-nueva-factura-header {
  isolation: isolate;
}
#sheet-nueva-factura .sheet-nueva-factura-header::before,
#sheet-nueva-factura .sheet-nueva-factura-header::after,
#sheet-nueva-factura .sheet-nueva-factura-close::before,
#sheet-nueva-factura .sheet-nueva-factura-close::after {
  content: none !important;
  display: none !important;
}
#sheet-nueva-factura .sheet-nueva-factura-header i,
#sheet-nueva-factura .sheet-nueva-factura-header .password-toggle-btn,
#sheet-nueva-factura .sheet-nueva-factura-header svg:not(.icon-close-x) {
  display: none !important;
}
#sheet-nueva-factura .sheet-nueva-factura-title-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  cursor: pointer;
}
#sheet-nueva-factura .sheet-nueva-factura-title,
#sheet-nueva-factura .sheet-nueva-factura-close {
  cursor: pointer;
}
#sheet-nueva-factura .sheet-nueva-factura-title {
  display: inline-block;
  margin: 0;
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
#sheet-nueva-factura .sheet-nueva-factura-close {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #18181b;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: center center;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
#sheet-nueva-factura .sheet-nueva-factura-close:hover {
  transform: translateY(-50%) scale(0.86) !important;
}
#sheet-nueva-factura .sheet-nueva-factura-close .icon-close-x {
  display: block !important;
}
#sheet-nueva-factura .sheet-nueva-factura-title-row:hover .sheet-nueva-factura-title,
#sheet-nueva-factura .sheet-nueva-factura-title-row:focus-within .sheet-nueva-factura-title {
  transform: translateX(1.75rem);
}
#sheet-nueva-factura .sheet-nueva-factura-title-row:hover .sheet-nueva-factura-close,
#sheet-nueva-factura .sheet-nueva-factura-title-row:focus-within .sheet-nueva-factura-close {
  opacity: 1;
  pointer-events: auto;
}
#sheet-nueva-factura input::-ms-reveal,
#sheet-nueva-factura input::-webkit-credentials-auto-fill-button,
#sheet-nueva-factura input::-webkit-contacts-auto-fill-button {
  display: none !important;
}

#erp-sidebar :is(a, button),
.erp-sidebar :is(a, button),
.vercel-nav-item {
  -webkit-tap-highlight-color: transparent;
}
#erp-sidebar *:focus,
#erp-sidebar *:focus-visible,
.erp-sidebar *:focus,
.erp-sidebar *:focus-visible,
.vercel-nav-item:focus,
.vercel-nav-item:focus-visible,
.vercel-nav-item:active,
.erp-fly-item:focus,
.erp-fly-item:focus-visible {
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
}
@media (forced-colors: active) {
  #erp-sidebar *:focus,
  #erp-sidebar *:focus-visible,
  .vercel-nav-item:focus,
  .vercel-nav-item:focus-visible {
    outline: none !important;
    forced-color-adjust: none;
  }
}

/* ============================================================
   Ajustes — sistema de diseño SaaS premium (Stripe / Linear)
   ============================================================ */
#view-ajustes .settings-form-narrow {
  max-width: 28rem;
}
#view-ajustes .settings-form-wide {
  max-width: 32rem;
}
#view-ajustes .settings-form-grid {
  max-width: 42rem;
}
#view-ajustes .settings-card > h4,
#view-ajustes .settings-card h4.text-xl,
#view-ajustes .settings-card h4.border-b {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0.35rem;
}
#view-ajustes label.block,
#view-ajustes .settings-label {
  display: block;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #334155 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin-bottom: 0.375rem !important;
}
#view-ajustes input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
#view-ajustes select,
#view-ajustes textarea {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
  font-size: 0.875rem !important;
  color: #0f172a !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
#view-ajustes input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="hidden"]):focus,
#view-ajustes input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="hidden"]):focus-visible,
#view-ajustes select:focus,
#view-ajustes select:focus-visible,
#view-ajustes textarea:focus,
#view-ajustes textarea:focus-visible {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35) !important;
}
#view-ajustes input[readonly] {
  background: #f8fafc !important;
  color: #475569 !important;
}
html.dark #view-ajustes input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
html.dark #view-ajustes select,
html.dark #view-ajustes textarea {
  background: #0f0f0f !important;
  border-color: #404040 !important;
  color: #fafafa !important;
  box-shadow: none !important;
}
html.dark #view-ajustes input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="hidden"]):focus,
html.dark #view-ajustes select:focus,
html.dark #view-ajustes textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4) !important;
}
#view-ajustes .settings-crypto-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.125rem;
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.55;
}
html.dark #view-ajustes .settings-crypto-note {
  background: #171717;
  border-color: #333;
  color: #a3a3a3;
}
#view-ajustes-billing .billing-plan-row > .w-full > .grid > div,
#view-ajustes-billing #panel-plan-facturacion-ia {
  border-radius: 0.75rem !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
#view-ajustes-billing .billing-plan-row button,
#view-ajustes-billing #btn-portal-stripe,
#view-ajustes-billing #btn-activar-premium {
  border-radius: 0.5rem !important;
}
html.vista-erp-ajustes .erp-sidebar .vercel-nav-item.settings-group-tab.is-active,
html:not(.dark).vista-erp-ajustes .erp-sidebar .vercel-nav-item.settings-group-tab.is-active,
html:not(.dark) #nav-ajustes .settings-group-tab.is-active,
html:not(.dark) #nav-ajustes .settings-group-tab[aria-selected="true"] {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 500 !important;
  border: none !important;
  box-shadow: none !important;
}
html:not(.dark) #nav-ajustes .settings-group-tab.is-active span,
html:not(.dark) #nav-ajustes .settings-group-tab[aria-selected="true"] span {
  color: #1d4ed8 !important;
}
html.dark.vista-erp-ajustes .erp-sidebar .vercel-nav-item.settings-group-tab.is-active,
html.dark #nav-ajustes .settings-group-tab.is-active,
html.dark #nav-ajustes .settings-group-tab[aria-selected="true"] {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
  border: none !important;
}
#view-ajustes .shadow-sm {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}
#view-ajustes .settings-unified-panel {
  border-radius: 0.75rem !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}
html.vista-erp-ajustes .erp-sidebar,
html:not(.dark).vista-erp-ajustes .erp-sidebar,
html:not(.dark).vista-erp-ajustes #erp-sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
}
#view-ajustes .settings-card.settings-danger-card,
html:not(.dark) #view-ajustes .settings-card.settings-danger-card {
  background: rgba(254, 242, 242, 0.5) !important;
  border-color: #fecaca !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}
html:not(.dark) #view-ajustes .settings-card-desc,
html:not(.dark) #view-ajustes .settings-group > div:first-child p,
html:not(.dark) #view-ajustes .settings-group > div:first-child span {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}
html:not(.dark) #view-ajustes .settings-card-title,
html:not(.dark) #view-ajustes .settings-group > div:first-child h4 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html:not(.dark) #view-ajustes .settings-label,
html:not(.dark) #view-ajustes label.block {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
}
#view-ajustes .settings-group.hidden,
#view-ajustes .setting-content-pane.hidden {
  display: none !important;
}
#view-ajustes .settings-group:not(.hidden) {
  display: flex;
}
#view-ajustes #tab-api.hidden {
  display: none !important;
}

html,
body,
#app-shell,
#app-header,
#app-header.app-header-floating,
#app-header:not(.app-header-floating),
.erp-sidebar-header,
.erp-sidebar-footer {
  border: none !important;
  border-bottom: none !important;
  border-top: none !important;
  outline: none !important;
}
#app-header.app-header-floating::before,
#app-header.app-header-floating::after,
html.liquid-glass #app-header::before,
html.liquid-glass #app-header::after {
  content: none !important;
  display: none !important;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}
#chat-drawer.chat-closed,
#sidebar-historial:not(.historial-abierto),
#panel-historial:not(.historial-abierto) {
  border: none !important;
  box-shadow: none !important;
}

#erp-sidebar .vercel-nav-item.is-drop-idle,
#erp-sidebar .vercel-nav-item.is-drop-idle:hover,
#erp-sidebar .vercel-nav-item.is-drop-idle:active,
#erp-sidebar .vercel-nav-item.is-active.is-drop-idle,
#erp-sidebar .vercel-nav-item.is-active.is-drop-idle:hover,
#erp-sidebar .vercel-nav-item.is-active.is-drop-idle:active,
#erp-sidebar .is-drop-idle .vercel-nav-item,
#erp-sidebar .is-drop-idle .vercel-nav-item:hover,
#erp-sidebar .is-drop-idle .vercel-nav-item:active,
#erp-sidebar .is-drop-idle .vercel-nav-item.is-active,
#erp-sidebar .is-drop-idle .vercel-nav-item.is-active:hover,
html:not(.dark) #erp-sidebar .vercel-nav-item.is-drop-idle:hover,
html:not(.dark) #erp-sidebar .vercel-nav-item.is-active.is-drop-idle:hover,
html:not(.dark) #erp-sidebar .is-drop-idle .vercel-nav-item.is-active:hover {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  color: #0F172A !important;
}
#erp-sidebar .vercel-nav-item.is-drop-idle:not(.is-press),
#erp-sidebar .vercel-nav-item.is-drop-idle:not(.is-press):hover,
#erp-sidebar .is-drop-idle:not(.is-press) .vercel-nav-item,
#erp-sidebar .is-drop-idle:not(.is-press) .vercel-nav-item:hover {
  transform: none !important;
}

.ai-notif-prompt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 1rem);
  z-index: 40;
  display: none;
  padding: 1rem 1.15rem 0.95rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #E5E7EB;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.ai-notif-prompt.is-open,
.ai-notif-prompt:not([hidden]) {
  display: block;
}
.ai-notif-prompt[hidden] {
  display: none !important;
}
.ai-notif-prompt-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #A1A1AA;
  border-radius: 999px;
  cursor: pointer;
}
.ai-notif-prompt-close:hover {
  color: #52525B;
  background: #F4F4F5;
}
.ai-notif-prompt-text {
  margin: 0 1.4rem 0.85rem 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #3F3F46;
  font-weight: 500;
}
.ai-notif-prompt-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.ai-notif-prompt-activar {
  appearance: none;
  border: 0;
  background: #09090B;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.ai-notif-prompt-activar:hover {
  background: #18181B;
}
.ai-notif-prompt-mute {
  appearance: none;
  border: 0;
  background: transparent;
  color: #71717A;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.15rem;
  cursor: pointer;
}
.ai-notif-prompt-mute:hover {
  color: #3F3F46;
}
html.dark .ai-notif-prompt {
  background: rgba(24, 24, 27, 0.96);
  border-color: #27272A;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
html.dark .ai-notif-prompt-text {
  color: #E4E4E7;
}
html.dark .ai-notif-prompt-close {
  color: #71717A;
}
html.dark .ai-notif-prompt-close:hover {
  color: #E4E4E7;
  background: #27272A;
}
html.dark .ai-notif-prompt-activar {
  background: #FAFAFA;
  color: #09090B;
}
html.dark .ai-notif-prompt-mute {
  color: #A1A1AA;
}

.nav-presence {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.nav-presence:empty {
    display: none;
}
.nav-presence-avatar {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    margin-left: -4px;
    object-fit: cover;
    background: #18181b;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border: 1.5px solid #f4f4f5;
    display: inline-block;
}
.nav-presence-avatar:first-child {
    margin-left: 0;
}

.fa-trash,
.fa-trash-can,
.fa-trash-alt,
.btn-borrar-pregunta,
.btn-borrar-pregunta-draft,
.btn-borrar-norma,
html.dark .fa-trash,
html.dark .fa-trash-can,
html.dark .fa-trash-alt,
html.dark .btn-borrar-pregunta,
html.dark .btn-borrar-pregunta-draft,
html.dark .btn-borrar-norma,
#lso-casos-trash,
#lso-casos-trash:hover,
#lso-casos-trash svg,
#lso-casos-trash svg path,
.lso-casos-row-trash,
.lso-casos-row-trash:hover,
.lso-casos-row-trash svg,
.lso-casos-row-trash svg path,
.lso-casos-trash,
.lso-casos-trash:hover,
.btn-borrar-dir,
.btn-borrar-dir:hover,
.lexnet-bandeja-borrar,
.lexnet-bandeja-borrar:hover,
.erp-sidebar-tpl-del,
.erp-sidebar-tpl-del:hover,
.agenda-side-del,
.agenda-side-del:hover,
.erp-factura-delete,
.factura-row-delete,
.lso-exp-icon-btn.is-danger,
button:has(.fa-trash),
button:has(.fa-trash-can),
button:has(.fa-trash-alt),
button:has(.fa-trash):hover,
button:has(.fa-trash-can):hover,
button:has(.fa-trash-alt):hover {
  color: #b91c1c !important;
  stroke: #b91c1c !important;
}
.fa-trash.opacity-70,
.fa-trash-can.opacity-70,
.fa-trash-alt.opacity-70 {
  opacity: 1;
}
.chat-voice-engine-status {
  margin: 0 auto 0.35rem;
  max-width: 42rem;
  width: 100%;
  padding: 0 0.35rem;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #a1a1aa;
}
.chat-voice-engine-status[hidden] {
  display: none !important;
}

/* Historial: el drawer sigue fijo. Ojo y temporizador se deslizan con el panel. */
html.vista-erp-chat #app-header .header-side-right,
html.vista-erp-chat #app-header .header-floating-controls,
html.vista-erp-chat.layout-historial-open #app-header .header-side-right,
html.vista-erp-chat.layout-historial-open #app-header .header-floating-controls,
html.layout-historial-open #app-header .header-side-right,
html.layout-historial-open #app-header .header-floating-controls {
  transition: right var(--historial-duration, 0.42s) var(--historial-ease-out, cubic-bezier(0.22, 1, 0.36, 1)) !important;
}
html.vista-erp-chat.historial-closing #app-header .header-side-right,
html.vista-erp-chat.historial-closing #app-header .header-floating-controls,
html.historial-closing #app-header .header-side-right,
html.historial-closing #app-header .header-floating-controls {
  right: 1rem !important;
  transition: right var(--historial-duration-close, 0.42s) var(--historial-ease-in, cubic-bezier(0.32, 0, 0.67, 0)) !important;
}
@media (prefers-reduced-motion: reduce) {
  html.vista-erp-chat #app-header .header-side-right,
  html.vista-erp-chat #app-header .header-floating-controls {
    transition: none !important;
  }
}

#sidebar-container {
  display: contents;
}
html.auth-session #erp-sidebar {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
#erp-sidebar .erp-sidebar-nav-stack:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#erp-sidebar .erp-sidebar-footer {
  display: block;
  flex-shrink: 0;
}

.email-inbox-card {
  background: #fff;
  border: 1px solid rgba(229, 229, 229, 0.9);
  border-radius: 0.75rem;
  overflow: hidden;
}
.email-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(229, 229, 229, 0.9);
}
.email-inbox-head h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #171717;
}
.email-head-main {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.email-back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #3c4043;
  cursor: pointer;
  flex-shrink: 0;
}
.email-back-arrow:hover {
  background: transparent;
  color: #000000;
}
.email-back-arrow[hidden] {
  display: none !important;
}
.email-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  flex-shrink: 0;
}
.email-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
}
.email-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0.32rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #5f6368;
  cursor: pointer;
}
.email-tab-ico {
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2.5l2.7 5.5 6.1.9-4.4 4.3 1 6.1L12 16.8 6.6 19.3l1-6.1L3.2 8.9l6.1-.9L12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2.5l2.7 5.5 6.1.9-4.4 4.3 1 6.1L12 16.8 6.6 19.3l1-6.1L3.2 8.9l6.1-.9L12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.email-tab:hover {
  background: #f4f4f5;
  color: #202124;
}
.email-tab.is-active,
.email-tab.is-active:hover {
  background: #f2f6fc;
  color: #000000;
}
.email-tab.is-active .email-tab-ico {
  background: #000000;
}
.email-inbox-head p {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: #737373;
}
.email-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.email-refresh-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
#btn-email-actualizar.is-loading .email-refresh-ico {
  animation: email-refresh-spin 0.8s linear infinite;
}
@keyframes email-refresh-spin {
  to { transform: rotate(360deg); }
}
#btn-email-actualizar[hidden],
#btn-email-borrar-seleccion[hidden],
#email-seleccion-conteo[hidden] {
  display: none !important;
}
.email-select-count {
  min-width: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #202124;
  text-align: center;
}
.email-bulk-btn {
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  background: #ffffff;
  padding: 0.32rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #5f6368;
  cursor: pointer;
  white-space: nowrap;
}
.email-bulk-btn:hover,
.email-bulk-btn.is-active {
  background: #f2f6fc;
  color: #000000;
}
.email-bulk-trash {
  width: 2rem;
  height: 2rem;
}
.email-inbox-card.is-selecting .email-row-actions {
  display: none;
}
.email-inbox-card.is-selecting .email-row {
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr) 4.75rem;
  padding-left: 0.85rem;
}
@media (max-width: 720px) {
  .email-inbox-card.is-selecting .email-row {
    grid-template-columns: 6.5rem minmax(0, 1fr) 3.5rem;
  }
}
.email-row.is-selected,
.email-row.is-selected:hover,
.email-row.is-selected:focus-visible {
  background: #e8f0fe;
}
.email-inbox-card.is-reading .email-inbox-head {
  display: none;
}
.email-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.email-row {
  display: grid;
  grid-template-columns: auto minmax(160px, 200px) minmax(0, 1fr) 4.75rem;
  align-items: center;
  column-gap: 0.65rem;
  height: 2.5rem;
  max-height: 2.5rem;
  padding: 0 0.85rem 0 0.2rem;
  border-bottom: 1px solid #f4f4f5;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.22s ease, background-color 0.12s ease;
}
.email-row:last-child {
  border-bottom: 0;
}
.email-row:hover,
.email-row:focus-visible {
  background: #f2f6fc;
  outline: none;
}
.email-row.is-leaving {
  opacity: 0;
  max-height: 0;
  height: 0;
}
.email-row.is-entering {
  animation: email-row-in 0.4s ease;
}
@keyframes email-row-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 720px) {
  .email-row {
    grid-template-columns: auto 6.5rem minmax(0, 1fr) 3.5rem;
    column-gap: 0.4rem;
  }
}
.email-row-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}
.email-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #a3a3a3;
  cursor: pointer;
}
.email-icon-btn:hover {
  background: #f4f4f5;
  color: #171717;
}
.email-icon-btn.email-save svg {
  fill: none;
  stroke: currentColor;
}
.email-icon-btn.email-save.is-saved,
.email-icon-btn.email-save.is-saved:hover {
  color: #000000;
}
.email-icon-btn.email-save.is-saved svg {
  fill: #000000;
  stroke: #000000;
}
.email-icon-btn.email-trash,
.email-icon-btn.email-trash:hover,
html.dark .email-icon-btn.email-trash,
html.dark .email-icon-btn.email-trash:hover {
  color: #c4625a;
}
.email-icon-btn.email-trash svg,
html.dark .email-icon-btn.email-trash svg {
  stroke: #c4625a;
}
.email-icon-btn.email-trash:hover {
  background: #f6eeec;
}
.email-icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.email-more {
  display: flex;
  justify-content: center;
  padding: 0.85rem 1.25rem 1.1rem;
}
.email-from {
  margin: 0;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-line {
  min-width: 0;
  font-size: 0.875rem;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-subject {
  font-weight: 600;
}
.email-sep,
.email-snippet {
  font-weight: 400;
  color: #5f6368;
}
.email-date {
  font-size: 0.75rem;
  color: #5f6368;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.email-read {
  padding: 0.85rem 1.25rem 1.5rem;
}
.email-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.15rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
}
.email-back-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #9ca3af;
}
.email-back:hover { color: #202124; }
.email-back-ico:hover { color: #000000; }
.email-read-subject {
  margin: 0 0 0.85rem;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #202124;
}
.email-read-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f3f4;
}
.email-read-from {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #202124;
}
.email-read-to,
.email-read-date,
.email-read-loading {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: #5f6368;
}
.email-read-body {
  padding-top: 1rem;
}
.email-read-frame {
  display: block;
  width: 100%;
  min-height: 12rem;
  border: 0;
  background: #fff;
}
.email-read-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #202124;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.email-empty {
  margin: 0;
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: #737373;
}
.email-connect-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 1.25rem;
  padding: 1.35rem 1.25rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  background: #fafafa;
}
.email-connect-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  color: #171717;
}
.email-connect-card h4 {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #171717;
}
.email-connect-card p {
  margin: 0 0 0.45rem;
  max-width: 36rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #525252;
}
.email-inbox-skeleton {
  padding: 0.35rem 0;
}
.email-skel-row {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid #f4f4f5;
}
.email-skel-row span {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f4f4f5 0%, #e4e4e7 45%, #f4f4f5 100%);
  background-size: 200% 100%;
  animation: email-skel 1.15s ease-in-out infinite;
}
.email-skel-row span:nth-child(1) { width: 28%; }
.email-skel-row span:nth-child(2) { width: 62%; }
.email-skel-row span:nth-child(3) { width: 84%; }
@keyframes email-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
html.dark .email-inbox-card,
html.dark .email-connect-mark {
  background: #111111;
  border-color: #2a2a2a;
}
html.dark .email-inbox-head,
html.dark .email-row,
html.dark .email-skel-row {
  border-color: #2a2a2a;
}
html.dark .email-inbox-head h3,
html.dark .email-from,
html.dark .email-subject,
html.dark .email-line,
html.dark .email-read-subject,
html.dark .email-read-from,
html.dark .email-read-text,
html.dark .email-connect-card h4 {
  color: #fafafa;
}
html.dark .email-inbox-head p,
html.dark .email-date,
html.dark .email-sep,
html.dark .email-snippet,
html.dark .email-empty,
html.dark .email-back-ico { color: #737373; }
html.dark .email-back-ico:hover { color: #fafafa; }
html.dark .email-back,
html.dark .email-back-arrow,
html.dark .email-read-to,
html.dark .email-read-date,
html.dark .email-read-loading,
html.dark .email-connect-card p {
  color: #a3a3a3;
}
html.dark .email-row:hover,
html.dark .email-icon-btn:hover {
  background: #1c1c1c;
}
html.dark .email-read-head {
  border-color: #2a2a2a;
}
html.dark .email-read-frame {
  background: #111111;
}
html.dark .email-tab {
  color: #a3a3a3;
}
html.dark .email-bulk-btn {
  color: #a3a3a3;
  border-color: #404040;
  background: #1f1f1f;
}
html.dark .email-select-count {
  color: #fafafa;
}
html.dark .email-bulk-btn:hover,
html.dark .email-bulk-btn.is-active {
  background: #1c1c1c;
  color: #fafafa;
}
html.dark .email-row.is-selected,
html.dark .email-row.is-selected:hover {
  background: #1c2836;
}
html.dark .email-tab:hover {
  background: #1c1c1c;
  color: #fafafa;
}
html.dark .email-tab.is-active,
html.dark .email-tab.is-active:hover {
  background: #1c1c1c;
  color: #fafafa;
}
html.dark .email-tab.is-active .email-tab-ico {
  background: #fafafa;
}
html.dark .email-tab.is-active .email-tab-ico,
html.dark .email-icon-btn.email-save.is-saved,
html.dark .email-icon-btn.email-save.is-saved:hover,
html.dark .email-icon-btn.email-save.is-saved svg {
  color: #fafafa;
  fill: #fafafa;
  stroke: #fafafa;
}
html.dark .email-icon-btn.email-trash:hover {
  color: #c4625a;
  background: #2a2220;
}
html.dark .email-connect-card {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .email-skel-row span {
  background: linear-gradient(90deg, #1c1c1c 0%, #2a2a2a 45%, #1c1c1c 100%);
  background-size: 200% 100%;
}

.alarmas-lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.alarmas-vacio {
  margin: 0;
  padding: 28px 20px;
  border: 1px dashed #e4e4e7;
  border-radius: 16px;
  background: #fff;
  color: #71717a;
  font-size: 14px;
  text-align: center;
}
.alarmas-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.alarmas-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.alarmas-card-main h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #18181b;
}
.alarmas-card-main p {
  margin: 0;
  font-size: 13px;
  color: #71717a;
}
.alarmas-card-main strong {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.alarmas-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.alarmas-switch {
  width: 40px;
  height: 24px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: #e4e4e7;
  cursor: pointer;
}
.alarmas-switch span {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.16);
  transition: transform 160ms ease;
}
.alarmas-switch.is-on {
  background: #18181b;
}
.alarmas-switch.is-on span {
  transform: translateX(16px);
}
.alarmas-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #71717a;
  cursor: pointer;
}
.alarmas-icon-btn:hover,
.alarmas-trash:hover {
  background: #f4f4f5;
  color: #b91c1c;
}
.alarmas-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(0 0 0 / 0.45);
}
.alarmas-overlay.hidden,
.alarmas-overlay[hidden] {
  display: none !important;
}
.alarmas-dialog {
  width: min(440px, 100%);
  padding: 22px 22px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.12);
}
.alarmas-dialog-head,
.alarmas-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.alarmas-dialog-head {
  justify-content: space-between;
  margin-bottom: 18px;
}
.alarmas-sonara {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.alarmas-sonara-ico {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}
#view-alarmas {
  min-height: 16rem;
  cursor: pointer;
}
.alarmas-dialog-head h3,
.alarmas-ring-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #18181b;
}
.alarmas-dialog-spacer {
  flex: 1;
}
.alarmas-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.alarmas-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.alarmas-field span,
.alarmas-field legend,
.alarmas-field > label {
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46;
}
.alarmas-field input[type="text"],
.alarmas-field input[type="number"],
.alarmas-field input[type="time"],
.alarmas-field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  color: #18181b;
  font: inherit;
  font-size: 14px;
}
#alarmas-modal .alarmas-field.hidden,
#alarmas-modal .alarmas-field[hidden],
#alarmas-modal .alarmas-custom.hidden,
#alarmas-modal .alarmas-custom[hidden] {
  display: none !important;
}
#alarmas-modal .alarmas-field input[type="text"] {
  height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
#alarmas-modal .alarmas-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}
#alarmas-modal .alarmas-seg button {
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#alarmas-modal .alarmas-seg button.is-active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.18);
}
#alarmas-modal .alarmas-chips,
#alarmas-modal .alarmas-atajos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#alarmas-modal .alarmas-chip,
#alarmas-modal .alarmas-atajo {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
#alarmas-modal .alarmas-chip.is-active {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #fff;
}
#alarmas-modal .alarmas-atajo:hover,
#alarmas-modal .alarmas-chip:hover {
  background: #f8fafc;
}
#alarmas-modal .alarmas-chip.is-active:hover {
  background: var(--app-primary-dark);
}
#alarmas-modal .alarmas-reloj {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#alarmas-modal .alarmas-reloj input {
  width: 4.75rem;
  height: 4.25rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
#alarmas-modal .alarmas-reloj-sep {
  font-size: 1.75rem;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1;
}
#alarmas-modal .alarmas-dialog-actions .btn-primary,
#alarmas-modal .alarmas-dialog-actions .btn-secondary {
  border-radius: 999px;
}
.alarmas-choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #27272a;
}
.alarmas-custom {
  margin-top: 8px;
}
.alarmas-dialog-actions {
  margin-top: 18px;
}
.alarmas-dialog-actions .btn-primary,
.alarmas-dialog-actions .btn-secondary {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.alarmas-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a1a1aa;
}
.alarmas-ring-card p {
  margin: 8px 0 0;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #18181b;
}
.alarmas-overlay-ring .alarmas-ring-card {
  animation: alarmas-pulse 1.1s ease-in-out infinite;
}
@keyframes alarmas-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(24 24 27 / 0.18); }
  50% { box-shadow: 0 0 0 8px rgb(24 24 27 / 0); }
}
html.dark .alarmas-vacio,
html.dark .alarmas-card,
html.dark .alarmas-dialog {
  background: #171717;
  border-color: #2a2a2a;
}
html.dark .alarmas-sonara {
  background: #111;
  border-color: #2a2a2a;
  color: #fafafa;
}
html.dark #alarmas-modal .alarmas-seg {
  background: #111;
  border-color: #2a2a2a;
}
html.dark #alarmas-modal .alarmas-seg button { color: #a1a1aa; }
html.dark #alarmas-modal .alarmas-seg button.is-active {
  background: #fafafa;
  color: #18181b;
}
html.dark #alarmas-modal .alarmas-chip,
html.dark #alarmas-modal .alarmas-atajo,
html.dark #alarmas-modal .alarmas-reloj input,
html.dark #alarmas-modal .alarmas-field input[type="text"] {
  background: #111;
  border-color: #2a2a2a;
  color: #fafafa;
}
html.dark #alarmas-modal .alarmas-chip.is-active {
  background: #fafafa;
  border-color: #fafafa;
  color: #18181b;
}
html.dark #alarmas-modal .alarmas-reloj-sep { color: #71717a; }
html.dark .alarmas-card-main h3,
html.dark .alarmas-card-main strong,
html.dark .alarmas-dialog-head h3,
html.dark .alarmas-ring-card h2,
html.dark .alarmas-ring-card p,
html.dark .alarmas-choices label {
  color: #fafafa;
}
html.dark .alarmas-card-main p,
html.dark .alarmas-vacio,
html.dark .alarmas-field span,
html.dark .alarmas-field legend {
  color: #a1a1aa;
}
html.dark .alarmas-field input,
html.dark .alarmas-field select {
  background: #111;
  border-color: #2a2a2a;
  color: #fafafa;
}
html.dark .alarmas-switch {
  background: #3f3f46;
}
html.dark .alarmas-switch.is-on {
  background: #fafafa;
}
html.dark .alarmas-switch.is-on span {
  background: #18181b;
}
html.dark .alarmas-icon-btn:hover,
html.dark .alarmas-trash:hover {
  background: #2a2220;
  color: #c4625a;
}

.cliente-modal-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: min(100%, 32rem);
  max-height: calc(100vh - 2rem);
  position: relative;
  margin-inline: auto;
}
.cliente-modal-card {
  flex: 1 1 auto;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  transition: border-radius 0.28s ease;
}
.cliente-modal-card.is-drawer-open {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.cliente-dir-trigger {
  cursor: pointer;
}
.cliente-dir-drawer {
  position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 24rem;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-left: 0;
  border-radius: 0 1rem 1rem 0;
  overflow: hidden;
  box-shadow: 12px 0 28px -12px rgba(0, 0, 0, 0.18);
  transform: translateX(1.25rem);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}
.cliente-dir-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.cliente-dir-drawer.is-closing {
  transform: translateX(1.25rem);
  opacity: 0;
}
.cliente-dir-drawer[hidden] {
  display: none !important;
}
.cliente-dir-drawer-head,
.cliente-dir-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.1rem;
  background: #fff;
  border-radius: 0;
}
.cliente-dir-drawer-head {
  border-bottom: 1px solid #e5e7eb;
}
.cliente-dir-drawer-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #171717;
}
.cliente-dir-drawer-foot {
  border-top: 1px solid #e5e7eb;
}
.cliente-dir-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cliente-dir-step {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #525252;
}
.cliente-dir-field {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.7rem 0.8rem;
  font-size: 0.875rem;
  color: #171717;
  outline: none;
}
.cliente-dir-field + .cliente-dir-field,
.cliente-dir-list + .cliente-dir-field,
.cliente-dir-provincia + .cliente-dir-step {
  margin-top: 0.45rem;
}
.cliente-dir-field:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px #0f172a;
}
.cliente-dir-localidad {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cliente-dir-loc-row {
  display: grid;
  grid-template-columns: minmax(6.75rem, 1fr) minmax(0, 2fr);
  gap: 0.65rem;
  align-items: start;
}
.cliente-dir-loc-row:has(> .cliente-dir-loc-cell[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.cliente-dir-loc-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.cliente-dir-loc-cell[hidden] {
  display: none !important;
}
.cliente-dir-label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  color: #64748b;
}
.cliente-dir-field[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.15rem;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='1.35' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
html.dark .cliente-dir-field[type="search"]::-webkit-search-cancel-button {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fafafa' stroke-width='1.35' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}
.cliente-dir-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cliente-dir-list:empty {
  display: none;
}
.cliente-modal-card,
.cliente-dir-drawer-body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cliente-modal-card::-webkit-scrollbar,
.cliente-dir-drawer-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.cliente-dir-option {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 0.45rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  color: #171717;
  cursor: pointer;
}
.cliente-dir-elegido {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.7rem 0.8rem;
  font-size: 0.875rem;
  color: #171717;
  text-align: left;
  cursor: pointer;
}
.cliente-dir-elegido[hidden],
#dir-drawer-pais-buscar[hidden],
#dir-drawer-pais-list[hidden] {
  display: none !important;
}
.cliente-dir-cambiar {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
}
.cliente-dir-add {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: #171717;
  text-align: center;
  cursor: pointer;
}
.cliente-dir-add:hover {
  background: #fafafa;
}
.cliente-dir-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.75rem 0.7rem 0.75rem 0.85rem;
}
.cliente-dir-card[hidden],
.cliente-dir-add[hidden] {
  display: none !important;
}
.cliente-dir-pin {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1rem;
  flex: 0 0 auto;
  color: #525252;
}
.cliente-dir-card p {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #171717;
}
.cliente-dir-edit {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
  color: #525252;
  cursor: pointer;
  padding: 0.2rem;
}
.cliente-dir-edit svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cliente-dir-option:hover,
.cliente-dir-option.is-active {
  border-color: #e5e7eb;
  background: #f5f5f5;
}
.cliente-dir-field[readonly] {
  background: #f5f5f5;
  color: #404040;
}
.cliente-dir-provincia {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #525252;
}
html.dark .cliente-dir-drawer,
html.dark .cliente-dir-drawer-head,
html.dark .cliente-dir-drawer-foot,
html.dark .cliente-dir-field,
html.dark .cliente-dir-option,
html.dark .cliente-dir-elegido {
  background: #171717;
  border-color: #2a2a2a;
  color: #fafafa;
}
html.dark .cliente-dir-drawer-head h4,
html.dark .cliente-dir-step,
html.dark .cliente-dir-provincia {
  color: #e5e5e5;
}
html.liquid-glass:not(.dark) #cliente-dir-drawer .cliente-dir-label {
  color: #64748b !important;
}
html.dark .cliente-dir-label {
  color: #a3a3a3;
}
html.dark .cliente-dir-field:focus {
  border-color: #fafafa;
  box-shadow: 0 0 0 1px #fafafa;
}
html.dark .cliente-dir-option:hover,
html.dark .cliente-dir-option.is-active {
  background: #262626;
}
#nuevo-cliente-doc-tipo.cliente-doc-tipo {
  width: auto;
  max-width: 11rem;
  flex: 0 1 11rem;
  font-size: 0.68rem;
  line-height: 1.2;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  padding: 0.25rem 0.4rem;
  background: #fff;
  color: #404040;
}
#nuevo-cliente-doc-tipo.cliente-doc-tipo[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .cliente-modal-stage {
    width: min(100%, 32rem);
  }
  .cliente-dir-drawer {
    position: absolute;
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    border-left: 1px solid #e5e7eb;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  }
}

#lso-kanban-shell .vercel-filters {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 0.5rem;
}
#lso-kanban-shell .vercel-filters > .flex-1 {
  min-width: 0;
  flex: 1 1 auto;
}
#lso-kanban-shell #exp-filtros-popover-wrap,
#lso-kanban-shell #btn-filtros-expedientes,
#lso-kanban-shell .lso-view-toggle {
  display: inline-flex !important;
  flex-shrink: 0;
  visibility: visible !important;
  opacity: 1 !important;
}
#cartera-page-header,
#cartera-acciones-exp,
.erp-overflow-wrap {
  overflow: visible !important;
}
.erp-overflow-wrap {
  position: relative !important;
}
#cartera-acciones-exp [data-action="toggleOverflowCasos"].cartera-accion-btn {
  width: 2.25rem !important;
  min-width: 2.25rem !important;
  max-width: 2.25rem !important;
  padding: 0 !important;
  border-radius: 9999px !important;
}
html #app-shell #cartera-acciones-exp > button,
html #app-shell #cartera-acciones-clientes > button,
html #app-shell #cartera-acciones-alarmas > button,
html #app-shell #cartera-acciones-facturacion > button,
html #app-shell .cartera-accion-btn,
html #app-shell button.btn-primary,
html #app-shell button.btn-secondary,
html #app-shell button.btn-marfil,
html #app-shell .lso-exp-generate,
html #app-shell .lso-exp-add,
html #app-shell .lso-exp-doc-btn,
html #app-shell .lso-empty-cta,
html #app-shell .vercel-filter,
html #app-shell .lso-view-toggle-btn,
html #app-shell #txt-btn-aperturar-wrap,
html #app-shell #cartera-acciones-facturacion .factura-btn-nueva {
  border-radius: 9999px !important;
}
html .btn-primary,
html .btn-secondary,
html .btn-marfil,
html .cartera-accion-btn,
html .app-primary-bg,
html .lso-exp-generate,
html .lso-exp-add,
html .lso-exp-doc-btn,
html .lso-empty-cta,
html .vercel-filter,
html .vercel-filter-btn,
html #btn-login-submit,
html #btn-register-submit,
html #btn-confirmar-pago,
html #btn-activar-premium,
html #txt-btn-aperturar-wrap,
html #cartera-acciones-facturacion .factura-btn-nueva,
html:not(.dark) .btn-primary,
html:not(.dark) .btn-secondary,
html:not(.dark) .btn-marfil,
html:not(.dark) .cartera-accion-btn.btn-primary,
html:not(.dark) .cartera-accion-btn.btn-secondary,
html:not(.dark) #txt-btn-aperturar-wrap,
html:not(.dark) #cartera-acciones-facturacion .factura-btn-nueva.btn-primary {
  border-radius: 9999px !important;
}
#lso-kanban-shell .lso-view-toggle-btn,
.lso-view-toggle-btn {
  border-radius: 9999px !important;
}
.erp-overflow-menu {
  position: absolute !important;
  right: 0 !important;
  top: 100% !important;
  margin-top: 0.5rem !important;
  z-index: 50 !important;
  min-width: 14rem;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 1rem !important;
  box-shadow: 0 20px 25px -5px rgb(15 23 42 / 0.12), 0 8px 10px -6px rgb(15 23 42 / 0.08) !important;
  padding: 0.5rem !important;
  container-type: normal;
}
.erp-overflow-menu[hidden] {
  display: none !important;
}
.erp-overflow-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #1e293b;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.erp-overflow-menu button:hover {
  background: #f8fafc;
}
.lso-board-empty .lso-empty-sub {
  max-width: 28rem;
  font-size: 0.875rem;
  color: #64748b;
}
#view-detalle-cliente .g-select,
#view-detalle-cliente .g-select-panel,
#lso-slideover-caso .g-select,
#lso-slideover-caso .g-select-panel {
  overflow: visible !important;
}

.tareas-nav-count {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #18181b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.tareas-nav-count,
#nav-tareas-count { display: none !important; }
#view-tareas.hidden { display: none !important; }
#view-tareas.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 0 !important; }
.tareas-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  width: max-content;
  max-width: 100%;
  gap: 0.5rem;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transform: none;
  position: relative;
  isolation: auto;
}
.tareas-toolbar::before,
.tareas-toolbar::after {
  content: none;
  display: none;
}
.tareas-tab {
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
  box-shadow: none;
}
.tareas-tab:hover { color: #0f172a; }
.tareas-tab.is-active {
  background: var(--app-primary);
  border: 0;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
.tareas-composer {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tareas-composer.is-open { display: flex; }
.tareas-input {
  height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #18181b;
  padding: 0 12px;
  font-size: 14px;
}
.tareas-input:focus {
  outline: none;
  border-color: #18181b;
}
#tareas-titulo { flex: 1 1 220px; min-width: 180px; }
.tareas-input-date { width: 150px; }
.tareas-input-responsable { width: 150px; }
.tareas-input-caso { flex: 1 1 180px; min-width: 160px; max-width: 280px; }
.tareas-submit,
.tareas-cancel { height: 38px; }
.tareas-cal {
  width: 440px;
  max-width: 100%;
  margin: 12px 0 4px;
  padding: 22px 18px 16px;
  background: #fbfbf8;
  color: #17233d;
  border: 1px solid rgba(214, 211, 209, 0.6);
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(28, 25, 23, 0.2), 0 8px 10px -6px rgba(28, 25, 23, 0.12);
  transform: rotate(-1deg);
  position: relative;
}
.tareas-cal::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ff8a80, #c62828 62%, #8e1515);
  box-shadow: 0 2px 4px rgba(40, 16, 4, 0.45);
}
.tareas-cal-mes {
  margin: 0 0 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  color: #102a4c;
}
.tareas-cal-dow,
.tareas-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.tareas-cal-dow span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1d4e89;
}
.tareas-cal-grid span,
.tareas-cal-grid button {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #17233d;
}
.tareas-cal-grid button {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.tareas-cal-grid button:hover { background: rgba(90, 167, 255, 0.22); }
.tareas-cal-grid button.is-hoy {
  background: #5aa7ff;
  color: #fff;
}
.tareas-cal-grid button.is-con-tarea {
  background: #ffd8a8;
  color: #17233d;
}
#tareas-cal.is-eligiendo .tareas-cal-grid button:hover,
#tareas-cal.is-eligiendo .tareas-cal-grid button.is-hoy:hover {
  background: transparent;
  color: #17233d;
  box-shadow: inset 0 0 0 2px #16a34a;
}
.tareas-cal-grid button.is-nota,
#tareas-cal.is-eligiendo .tareas-cal-grid button.is-nota,
#tareas-cal.is-eligiendo .tareas-cal-grid button.is-hoy.is-nota,
#tareas-cal.is-eligiendo .tareas-cal-grid button.is-nota:hover {
  background: #16a34a;
  color: #fff;
  box-shadow: none;
}
.tareas-cal.is-aviso .tareas-cal-cuerpo { visibility: hidden; }
.tareas-cal-aviso {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #102a4c;
}
.tareas-cal-aviso[hidden] { display: none !important; }
.tareas-cal-volver {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #102a4c;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tareas-cal-volver:hover { background: rgba(16, 42, 76, 0.08); }
.tareas-cal.is-aviso .tareas-cal-volver { display: inline-flex; }
.tareas-tablero { position: relative; min-height: 560px; }
.tareas-corcho {
  position: absolute;
  top: 12px;
  left: 488px;
  width: 460px;
  height: 460px;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: transparent;
}
.tareas-corcho[hidden] { display: none !important; }
.tareas-corcho-hoja {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #fbfbf8;
  border: 0;
  border-radius: 18px;
  padding: 28px 22px 18px;
  overflow: auto;
  box-shadow: 0 18px 28px -16px rgba(28, 25, 23, 0.45);
  clip-path: none;
}
.tareas-corcho-hoja::before,
.tareas-corcho-hoja::after { content: none; }
.tareas-rollo,
.tareas-trozos,
.tareas-rotura { display: none !important; }
.tareas-nota {
  display: none;
  position: absolute;
  top: 12px;
  left: 488px;
  right: 0;
  z-index: 3;
  min-height: 280px;
  padding: 22px 28px;
  background: #fbfbf8;
  color: #17233d;
  border: 1px solid rgba(214, 211, 209, 0.6);
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(28, 25, 23, 0.2);
  transform: rotate(0.6deg);
  flex-direction: column;
  gap: 10px;
}
.tareas-nota.is-open { display: flex; }
.tareas-nota-kicker {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #102a4c;
}
.tareas-nota-dia {
  margin: 0;
  font-size: 14px;
  color: #1d4e89;
  text-transform: capitalize;
}
.tareas-nota-titulo {
  min-height: 42px !important;
  height: 42px;
  resize: none;
}
.tareas-nota-sola { display: flex; flex-direction: column; gap: 12px; }
.tareas-nota-volver {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: #1d4e89;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.tareas-nota-cuerpo {
  margin: 0;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.55;
  color: #18181b;
}
.tareas-nota-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #18181b;
  padding: 12px;
  font: inherit;
  font-size: 14px;
}
.tareas-nota-input:focus { outline: none; border-color: #18181b; }
.tareas-nota-vinculo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tareas-nota-vincular {
  border: 0;
  background: transparent;
  padding: 0;
  color: #102a4c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#tareas-caso-etiqueta {
  font-size: 13px;
  color: #71717a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tareas-nota-acciones { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tareas-vincular-buscar {
  width: 100%;
  height: 38px;
  margin: 0 0 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #111827;
  padding: 0 12px;
  font-size: 14px;
}
.tareas-vincular-buscar:focus { outline: none; border-color: #111827; }
.tareas-vincular-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  padding: 0.8rem 0.15rem;
  font-size: 0.875rem;
  color: #111827;
  cursor: pointer;
}
.tareas-vincular-item:hover { background: #fafafa; }
@media (max-width: 980px) {
  .tareas-corcho,
  .tareas-nota {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    margin-top: 16px;
  }
}
.tareas-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#view-tareas > #tareas-lista { display: none; }
.tareas-vacio {
  margin: 0;
  padding: 28px 20px;
  border: 1px dashed #e4e4e7;
  border-radius: 16px;
  background: #fff;
  color: #71717a;
  font-size: 14px;
  text-align: center;
}
.tareas-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.tareas-card.is-overdue { border-color: #fecaca; }
.tareas-check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid #a8a29e;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.tareas-card.is-done .tareas-check {
  background: #18181b;
  border-color: #18181b;
  box-shadow: inset 0 0 0 3px #fff;
}
.tareas-card.is-done .tareas-main h3 {
  opacity: 0.45;
  transition: opacity 0.2s ease;
}
.tareas-hoja-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(214, 211, 209, 0.7);
}
.tareas-hoja-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #1c1917;
}
.tareas-hoja-count {
  font-size: 12px;
  font-weight: 500;
  color: #a8a29e;
  white-space: nowrap;
}
.tareas-corcho-hoja .tareas-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(231, 229, 228, 0.9);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 2px;
}
.tareas-hoja-vacio {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: #78716c;
  font-size: 14px;
}
.tareas-hoja-vacio p { margin: 0; }
.tareas-hoja-add {
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #1c1917;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
}
.tareas-hoja-add:hover { background: #fafaf9; }
#cartera-acciones-tareas:not(.hidden) {
  display: inline-flex !important;
  align-items: center;
  position: static;
  width: auto;
  padding: 0;
  background: transparent !important;
  clip-path: none !important;
  filter: none !important;
  transform: none;
}
#cartera-acciones-tareas.hidden { display: none !important; }
.tareas-papel-nueva { display: none !important; }
html #cartera-acciones-tareas .cartera-accion-btn {
  grid-area: 1 / 1;
  position: relative !important;
  z-index: 2 !important;
  justify-self: center;
  align-self: center;
  margin: 0 !important;
  border-radius: 999px !important;
  background: var(--app-primary) !important;
  background-color: var(--app-primary) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  clip-path: none !important;
}
html #cartera-acciones-tareas .cartera-accion-btn * {
  position: relative;
  z-index: 2;
  color: #fff !important;
  background: transparent !important;
  background-color: transparent !important;
}
html #cartera-acciones-tareas .cartera-accion-btn.is-blanco,
html:not(.dark) #cartera-acciones-tareas .cartera-accion-btn.is-blanco {
  background: #fff !important;
  background-color: #fff !important;
  color: #000 !important;
}
html #cartera-acciones-tareas .cartera-accion-btn.is-blanco *,
html:not(.dark) #cartera-acciones-tareas .cartera-accion-btn.is-blanco * {
  color: #000 !important;
}
html.dark #cartera-acciones-tareas .cartera-accion-btn.is-blanco {
  background: #000 !important;
  background-color: #000 !important;
  color: #fff !important;
}
html.dark #cartera-acciones-tareas .cartera-accion-btn.is-blanco * {
  color: #fff !important;
}
.tareas-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.tareas-main h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #18181b;
}
.tareas-card.is-done .tareas-main h3 {
  color: #a1a1aa;
  text-decoration: line-through;
}
.tareas-main p {
  margin: 0;
  font-size: 13px;
  color: #71717a;
}
.tareas-main p.is-overdue { color: #b91c1c; font-weight: 600; }
.tareas-caso {
  max-width: 240px;
  border: 0;
  background: #f4f4f5;
  color: #3f3f46;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tareas-caso:hover { background: #e4e4e7; }
.tareas-trash {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tareas-trash:hover { background: #fef2f2; color: #b91c1c; }
html.dark .tareas-nav-count { background: #fafafa; color: #18181b; }
html.dark .tareas-tab,
html.dark .tareas-input,
html.dark .tareas-vacio,
html.dark .tareas-card,
html.dark .tareas-check { background: #111; border-color: #2a2a2a; color: #fafafa; }
html.dark .tareas-tab { color: #a1a1aa; }
html.dark .tareas-tab.is-active { background: #fafafa; border-color: #fafafa; color: #18181b; }
html.dark .tareas-main h3 { color: #fafafa; }
html.dark .tareas-card.is-done .tareas-main h3,
html.dark .tareas-main p,
html.dark .tareas-vacio { color: #a1a1aa; }
html.dark .tareas-card.is-done .tareas-check { background: #fafafa; border-color: #fafafa; box-shadow: inset 0 0 0 2px #111; }
html.dark .tareas-caso { background: #27272a; color: #e4e4e7; }
html.dark .tareas-main p.is-overdue { color: #fca5a5; }
html.dark .tareas-trash:hover { background: #2a2220; color: #fca5a5; }

html #main-container > main:has(#view-tareas:not(.hidden)),
html.has-wallpaper #main-container > main:has(#view-tareas:not(.hidden)),
html.dark #main-container > main:has(#view-tareas:not(.hidden)),
html.has-wallpaper.dark #main-container > main:has(#view-tareas:not(.hidden)) {
  background-color: #d4a574 !important;
  background-image: url("/assets/corcho.jpg") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}
#nav-erp-tareas { display: none !important; }
#agenda-vista-switch {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin-left: auto;
  flex-shrink: 0;
  gap: 2px;
  padding: 4px;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transform: none;
  position: static;
  width: max-content;
  max-width: 100%;
  flex: 0 0 auto;
  overflow: visible;
}
#agenda-vista-switch.hidden,
#agenda-vista-switch[hidden] { display: none !important; }
#agenda-vista-switch .agenda-vista-btn {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
  gap: 0.375rem;
  border: 0;
  background: transparent;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  border-radius: 9999px;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
  box-shadow: none;
  transition: color 150ms ease;
}
#agenda-vista-switch .agenda-vista-btn:hover {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
#agenda-vista-switch .agenda-vista-btn.is-active,
#agenda-vista-switch .agenda-vista-btn.is-active:hover {
  background: var(--app-primary) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
#agenda-vista-switch .agenda-vista-btn svg {
  display: block !important;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  overflow: visible;
  fill: none !important;
  stroke: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#agenda-vista-switch .agenda-vista-btn:not(.is-active) svg,
#agenda-vista-switch .agenda-vista-btn:not(.is-active) svg :is(path, line, circle, polyline) {
  stroke: #334155 !important;
  fill: none !important;
}
#agenda-vista-switch .agenda-vista-btn.is-active svg,
#agenda-vista-switch .agenda-vista-btn.is-active svg :is(path, line, circle, polyline) {
  stroke: #fff !important;
  fill: none !important;
}
html.dark #agenda-vista-switch {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.7);
}
html.dark #agenda-vista-switch .agenda-vista-btn { color: #cbd5e1; }
html.dark #agenda-vista-switch .agenda-vista-btn:hover { color: #f8fafc; }
html.dark #agenda-vista-switch .agenda-vista-btn.is-active,
html.dark #agenda-vista-switch .agenda-vista-btn.is-active:hover {
  background: #f8fafc;
  color: #0f172a;
}
#main-container > main:has(#view-tareas:not(.hidden)) #cartera-page-heading,
#main-container > main:has(#view-agenda-procesal:not(.hidden)) #cartera-page-heading {
  display: block !important;
}
#main-container > main:has(#view-tareas:not(.hidden)) .cartera-page-heading-text,
#main-container > main:has(#view-agenda-procesal:not(.hidden)) .cartera-page-heading-text {
  display: block !important;
}
#main-container > main:has(#view-tareas:not(.hidden)) #cartera-page-header,
#main-container > main:has(#view-agenda-procesal:not(.hidden)) #cartera-page-header {
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
}
html:has(#view-tareas:not(.hidden)) .header-floating-controls > .flex::before,
html:has(#view-tareas:not(.hidden)) #ojo-drag-handle .ojo-papel {
  display: none !important;
  content: none !important;
}
#ojo-drag-handle {
  display: grid !important;
  place-items: center;
  position: relative;
  z-index: 2;
  padding: 10px 12px;
}
#ojo-drag-handle .ojo-papel {
  display: none !important;
}
#ojo-drag-handle #btn-modo-concentracion {
  grid-area: 1 / 1;
  z-index: 2;
}
.header-floating-controls > .flex {
  position: relative;
  isolation: isolate;
}
.header-floating-controls > .flex::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -14px -16px -16px -8px;
  background: #fff;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s ease-out;
  clip-path: polygon(
    0% 12%, 6% 2%, 14% 10%, 24% 1%, 36% 9%, 48% 2%, 60% 11%, 72% 1%, 84% 8%, 94% 2%, 100% 12%,
    100% 84%, 92% 98%, 80% 90%, 66% 100%, 52% 91%, 38% 100%, 24% 92%, 10% 100%, 0% 90%
  );
}
html:not(.modo-concentracion) .header-floating-controls > .flex::before {
  display: none !important;
  transform: none;
}
#header-utility-controls,
#ojo-drag-handle {
  position: relative;
  z-index: 1;
}

#tareas-corcho .tareas-corcho-hoja::before,
#tareas-corcho .tareas-corcho-hoja::after {
  content: none !important;
  display: none !important;
  background: none !important;
  box-shadow: none !important;
  width: 0 !important;
  height: 0 !important;
}
html #cartera-acciones-tareas .cartera-accion-btn.is-blanco,
html:not(.dark) #cartera-acciones-tareas .cartera-accion-btn.is-blanco {
  background: #fff !important;
  background-color: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
  border: 0 !important;
}
html #cartera-acciones-tareas .cartera-accion-btn.is-blanco *,
html:not(.dark) #cartera-acciones-tareas .cartera-accion-btn.is-blanco * {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.dark #cartera-acciones-tareas .cartera-accion-btn.is-blanco {
  background: #000 !important;
  background-color: #000 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border: 0 !important;
}
html.dark #cartera-acciones-tareas .cartera-accion-btn.is-blanco * {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
#view-tareas.is-solo-cal .tareas-corcho,
#view-tareas.is-solo-cal .tareas-nota { display: none !important; }
.tareas-card { position: relative; }
.tareas-trash.lso-kanban-card-trash {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  width: 1.5rem;
  height: 1.5rem;
  color: #b91c1c;
  background: transparent;
}
.tareas-trash.lso-kanban-card-trash:hover {
  transform: scale(0.86);
  background: transparent;
  color: #b91c1c;
}
#tareas-vincular-fondo { display: none !important; background: transparent !important; opacity: 0 !important; }
#tareas-vincular.lso-slideover,
#tareas-vincular.lso-slideover.is-open {
  width: min(32rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  max-height: 90dvh !important;
  overflow-y: auto !important;
  border-radius: 1rem !important;
}
#tareas-vincular.lso-slideover.is-open {
  position: fixed !important;
  top: auto !important;
  right: 1rem !important;
  bottom: 1rem !important;
  left: auto !important;
  height: auto !important;
  max-height: 90dvh !important;
  margin: 0 !important;
  z-index: 220 !important;
}
#tareas-vincular .tareas-vincular-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}
.tareas-vincular-nichos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0;
}
.tareas-nicho-btn {
  border: 0;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.2;
  cursor: pointer;
}
.tareas-nicho-btn:hover { background: #e2e8f0; }
.tareas-nicho-btn.is-active {
  background: #0f172a;
  color: #fff;
}
.tareas-vincular-buscar-wrap {
  position: relative;
  display: block;
  margin: 0;
}
.tareas-vincular-lupa {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
#tareas-vincular .tareas-vincular-buscar {
  width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #0f172a;
  padding: 0.625rem 1rem 0.625rem 2.25rem;
  font-size: 0.875rem;
  box-shadow: none;
}
#tareas-vincular .tareas-vincular-buscar:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: none;
}
.tareas-vincular-lista {
  max-height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding-right: 0.25rem;
}
.tareas-vincular-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.625rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.tareas-vincular-card:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.tareas-vincular-card.is-selected {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.tareas-vincular-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: #f1f5f9;
  color: #475569;
  flex-shrink: 0;
}
.tareas-vincular-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.tareas-vincular-nombre {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tareas-vincular-sub {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tareas-vincular-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #f1f5f9;
  color: #475569;
}
.tareas-vincular-badge.is-lso { background: #e0e7ff; color: #3730a3; }
.tareas-vincular-badge.is-bancario { background: #fef3c7; color: #92400e; }
.tareas-vincular-badge.is-extranjeria { background: #d1fae5; color: #065f46; }
.lso-exp-tareas {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lso-exp-tareas li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  font-size: 14px;
  color: #111827;
}
.lso-exp-tareas-fecha { color: #6b7280; font-size: 12px; white-space: nowrap; }
.lso-exp-tareas-vacio { color: #6b7280; }
/* ---- Tareas dentro del expediente (LSO + ficha detalle) ---- */
.exp-tareas-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(253, 230, 138, 0.6);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.exp-tareas-count[hidden] { display: none; }
.exp-tareas {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.exp-tareas > li.exp-tarea {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
  font-size: 14px;
  color: #111827;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#detalle-tareas-lista .exp-tarea { padding-left: 4px; padding-right: 4px; }
#detalle-tareas-lista .exp-tarea:first-child { border-top: 0; }
.exp-tarea.is-done { opacity: 0.35; transform: translateX(6px); }
.exp-tarea.is-done .exp-tarea-titulo { text-decoration: line-through; }
.exp-tarea-check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid #a8a29e;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.exp-tarea-check:hover { border-color: #18181b; }
.exp-tarea-check[aria-checked="true"],
.exp-tarea.is-done .exp-tarea-check {
  background: #18181b;
  border-color: #18181b;
  box-shadow: inset 0 0 0 3px #fff;
}
.exp-tarea-body { flex: 1 1 auto; min-width: 0; }
.exp-tarea-titulo {
  margin: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exp-tarea-fecha { margin: 2px 0 0; font-size: 12px; color: #6b7280; }
.exp-tarea-fecha.is-overdue { color: #b91c1c; font-weight: 600; }
.exp-tarea-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  color: #6b7280;
  background: #f4f4f5;
}
.exp-tarea-ico.is-prioridad { color: #b45309; background: #fffbeb; }
.exp-tarea-ico.is-prioridad.is-alta { color: #b91c1c; background: #fef2f2; }
.exp-tarea-ico.is-alarma { color: #4338ca; background: #eef2ff; }
ul.exp-tareas > li.exp-tareas-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  border-top: 1px solid #f3f4f6;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}
.exp-tareas-vacio p { margin: 0; }
.exp-tareas-vacio-link {
  border: 0;
  background: none;
  padding: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.exp-tareas-vacio-link:hover { color: #000; }
html.dark ul.exp-tareas > li.exp-tarea { color: #e5e7eb; border-color: rgba(255, 255, 255, 0.08); }
html.dark .exp-tareas-vacio-link { color: #f4f4f5; }

/* Badge de tareas pendientes en tarjetas Kanban / lista */
.lso-kanban-tareas-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin-top: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(253, 230, 138, 0.6);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.lso-list-deudor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lso-list-deudor .lso-kanban-tareas-badge { margin-top: 0; }
html #tareas-form #tareas-titulo {
  min-height: 40px !important;
  height: 40px !important;
  max-height: 40px !important;
  padding: 0 12px !important;
  resize: none !important;
}
html #tareas-form #tareas-nota-texto {
  min-height: 220px !important;
  height: 220px;
}

/* Tema, idioma y móvil en toda la app */
html.dark #main-container :is(h1, h2, h3, .vercel-page-title, .lso-exp-card-title, .settings-card-title) {
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
}
html.dark #txt-lbl-registro-desc,
html.dark #main-container :is(.text-slate-500, .text-neutral-500, .text-zinc-500, .text-gray-500) {
  color: #a3a3a3 !important;
}
html.dark #main-container :is(.text-slate-900, .text-neutral-900, .text-zinc-900, .text-gray-900, .text-neutral-950) {
  color: #fafafa !important;
}
html.dark .btn-primary,
html.dark.liquid-glass .btn-primary,
html.dark #app-shell #txt-btn-aperturar-wrap,
html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap {
  background-color: #fafafa !important;
  border-color: #fafafa !important;
  color: #0a0a0a !important;
  -webkit-text-fill-color: #0a0a0a !important;
}
html.dark .btn-primary *,
html.dark.liquid-glass .btn-primary *,
html.dark #app-shell button.btn-primary,
html.dark #app-shell button.btn-primary *,
html.dark.liquid-glass #app-shell button.btn-primary,
html.dark.liquid-glass #app-shell button.btn-primary *,
html.dark #app-shell #txt-btn-aperturar-wrap *,
html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap * {
  color: #0a0a0a !important;
  -webkit-text-fill-color: #0a0a0a !important;
}
html.dark #main-container .btn-secondary,
html.dark #app-header .btn-secondary,
html.dark .btn-secondary,
html.dark .btn-marfil {
  background-color: #171717 !important;
  border-color: #2a2a2a !important;
  color: #fafafa !important;
}
html.dark #view-chat {
  background-color: #0a0a0a !important;
  color: #fafafa !important;
}
html.dark #view-deudores #filtro-clientes,
html.dark #view-deudores #filtro-clientes:hover,
html.dark #view-deudores #filtro-clientes:focus,
html.dark #view-deudores #filtro-clientes:focus-visible {
  background-color: #171717 !important;
  border-color: #2a2a2a !important;
  color: #fafafa !important;
}
html.dark #view-deudores .lso-deudores-table-wrap,
html.dark #panel-erp-facturacion article,
html.dark #panel-erp-facturacion > section,
html.dark .lso-kanban-column,
html.dark .lso-kanban-card,
html.dark .agenda-cal-card,
html.dark .agenda-side-card,
html.dark .agenda-cal-cell,
html.dark .lso-exp-card {
  background-color: #171717 !important;
  border-color: #2a2a2a !important;
  color: #fafafa;
}
html.dark .lso-deudores-table thead th {
  background: #141414 !important;
  color: #a3a3a3 !important;
  border-color: #2a2a2a !important;
}
html.dark .lso-deudores-table tbody td,
html.dark .lso-deudores-name {
  color: #fafafa !important;
  border-color: #2a2a2a !important;
}
html.dark .erp-mobile-tabbar {
  background: #111111;
  border-top-color: #2a2a2a;
}
html.dark .erp-mobile-tab {
  color: #a3a3a3;
}
html.dark .erp-mobile-tab[aria-current="page"] {
  color: #fafafa;
}
html.dark #modal-login {
  background-color: #0a0a0a !important;
}
html.dark #modal-login > div.login-card,
html.dark #modal-politica-cookies .cookie-policy-card,
html.dark #modal-politica-privacidad .privacy-policy-card,
html.dark #modal-terminos-servicio .privacy-policy-card,
html.dark .faq-modal-card {
  background: #171717 !important;
  background-color: #171717 !important;
  color: #fafafa !important;
  border-color: #2a2a2a !important;
}
html.dark #modal-login :is(h1, h2, h3, p, label, a, span) {
  color: #e5e5e5 !important;
}
html.dark #modal-login :is(h1, h2) {
  color: #fafafa !important;
}
html.dark #modal-login input {
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
  caret-color: #fafafa !important;
  background-color: #111111 !important;
  border-color: #3f3f46 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}
html.dark #modal-login input::placeholder {
  color: #a3a3a3 !important;
  -webkit-text-fill-color: #a3a3a3 !important;
}
html.dark #modal-login #btn-login-submit,
html.dark #modal-login #btn-register-submit,
html.dark #modal-login #btn-recuperar-submit,
html.dark #modal-login #btn-nueva-password-submit,
html.dark #modal-login #btn-login-submit span,
html.dark #modal-login #btn-register-submit span,
html.dark #modal-login #btn-recuperar-submit span,
html.dark #modal-login #btn-nueva-password-submit span {
  background: #fafafa !important;
  background-color: #fafafa !important;
  color: #0a0a0a !important;
  -webkit-text-fill-color: #0a0a0a !important;
}
html.dark #modal-login #btn-login-magic-link,
html.dark #modal-login #btn-login-magic-link span {
  background: transparent !important;
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
  border-color: #3f3f46 !important;
}

@media (max-width: 767px) {
  html.auth-session #app-workspace {
    padding-top: var(--app-header-height, 3.75rem) !important;
  }
  html.auth-session #main-container > main {
    padding: 1rem 1rem calc(4.85rem + env(safe-area-inset-bottom)) !important;
  }
  #view-cartera,
  #view-detalle-cliente,
  #view-ficha-cliente {
    padding-top: 0.35rem !important;
  }
  .vercel-page-title {
    font-size: 1.375rem;
    line-height: 1.25;
  }
  #txt-lbl-registro,
  #txt-lbl-registro-desc {
    overflow-wrap: anywhere;
  }
  #cartera-page-header {
    gap: 0.85rem !important;
    align-items: stretch !important;
  }
  #cartera-acciones-clientes:not(.hidden),
  #cartera-acciones-exp:not(.hidden),
  #cartera-acciones-facturacion:not(.hidden),
  #cartera-acciones-tareas:not(.hidden),
  #cartera-acciones-alarmas:not(.hidden) {
    width: 100%;
  }
  #cartera-acciones-clientes:not(.hidden) .cartera-accion-btn,
  #cartera-acciones-exp:not(.hidden) .cartera-accion-btn,
  #cartera-acciones-facturacion:not(.hidden) .cartera-accion-btn,
  #cartera-acciones-tareas:not(.hidden) .cartera-accion-btn,
  #cartera-acciones-alarmas:not(.hidden) .cartera-accion-btn {
    width: 100%;
  }
  #agenda-vista-switch:not(.hidden):not([hidden]) {
    width: 100%;
    margin-left: 0 !important;
  }
  #agenda-vista-switch .agenda-vista-btn {
    flex: 1 1 0;
    justify-content: center;
  }
  #app-header .header-side-right.header-floating-controls {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    z-index: 61 !important;
    gap: 0.35rem !important;
    margin: 0 !important;
  }
  #app-header #header-utility-controls {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    position: relative !important;
    overflow: visible !important;
  }
  #app-header #theme-toggle.theme-toggle-btn,
  #app-header #btn-lang-toggle.lang-btn {
    display: inline-flex !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }
  #app-header #time-tracker-widget,
  #app-header #ojo-drag-handle,
  #app-header #btn-modo-concentracion,
  #app-header #btn-toggle-historial {
    display: none !important;
  }
  #view-deudores .vercel-filters,
  #view-deudores .vercel-filters > div,
  #view-deudores #filtro-clientes {
    width: 100% !important;
    max-width: none !important;
  }
  #view-deudores #filtro-clientes {
    display: block !important;
    height: 2.5rem !important;
    box-sizing: border-box !important;
  }
  .lso-deudores-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .lso-deudores-table,
  .lso-deudores-table tbody {
    display: block;
    width: 100%;
  }
  .lso-deudores-table tr.lso-deudores-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f3f4f6;
  }
  .lso-deudores-table tr.lso-deudores-row td {
    display: block;
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .lso-deudores-table tr.lso-deudores-row td:first-child {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .lso-deudores-table tr.lso-deudores-row td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    text-align: right;
  }
  .lso-deudores-table tr.lso-deudores-row td:nth-child(5)::before {
    content: none;
    display: none;
  }
  .lso-deudores-table tr.lso-deudores-row td:nth-child(2),
  .lso-deudores-table tr.lso-deudores-row td:nth-child(3),
  .lso-deudores-table tr.lso-deudores-row td:nth-child(4) {
    grid-column: 1 / -1;
  }
  .lso-deudores-table tr.lso-deudores-row td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: inline;
    margin-right: 0.45rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
  }
  html.dark #view-deudores #filtro-clientes::placeholder {
    color: #a3a3a3 !important;
    -webkit-text-fill-color: #a3a3a3 !important;
    opacity: 1 !important;
  }
  .lso-deudores-table tr:not(.lso-deudores-row),
  .lso-deudores-table tr:not(.lso-deudores-row) td {
    display: block;
    width: 100%;
  }
  html.dark .lso-deudores-table tr.lso-deudores-row {
    border-bottom-color: #2a2a2a;
  }
  .lso-kanban-board {
    max-height: none;
    padding-bottom: 0.25rem;
  }
  .lso-kanban-column {
    flex: 0 0 min(86vw, 20rem);
    min-width: min(86vw, 20rem);
  }
  .agenda-cal-cell {
    min-height: 2.6rem;
    padding: 0.15rem;
  }
  .agenda-cal-weekdays,
  .agenda-cal-grid {
    gap: 0.2rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
  .agenda-cal-weekdays span {
    letter-spacing: 0;
    font-size: 0.55rem;
  }
  #panel-erp-facturacion .overflow-x-auto,
  #view-equipo .overflow-x-auto {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #view-chat {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--app-header-height, 3.75rem) - 4.6rem - env(safe-area-inset-bottom)) !important;
  }
  #modal-login .login-card {
    padding: 1rem !important;
    max-height: 90dvh;
    overflow-y: auto;
  }
  #view-ajustes #settings-workspace-panel {
    padding: 1rem 0.15rem 1.5rem !important;
  }
  .dash-metric-card {
    padding: 1.15rem !important;
  }
}

/* Oscuro: el reloj del inicio no se ve a través de la pastilla del cronómetro */
html.dark #app-header .header-side-right .time-tracker-widget,
html.dark #app-header .header-side-right .time-tracker-widget:hover,
html.dark #app-header .header-side-right .time-tracker-widget:focus-within,
html.dark #app-header .header-side-right .time-tracker-widget.is-expanded,
html.dark #app-header .header-side-right #btn-lang-toggle,
html.dark #app-header .header-side-right #btn-lang-toggle:hover,
html.dark #app-header .header-side-right #btn-chat-header,
html.dark #app-header .header-side-right #btn-chat-header:hover {
  background: #1c1c1c !important;
  background-color: #1c1c1c !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: 1px solid #3a3a3a !important;
}
html.dark #app-header .header-side-right #theme-toggle.theme-toggle-btn,
html.dark #app-header .header-side-right #theme-toggle.theme-toggle-btn:hover {
  background: #1c1c1c !important;
  background-color: #1c1c1c !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border: none !important;
}
#app-header #theme-toggle.theme-toggle-btn,
#app-header #theme-toggle.theme-toggle-btn:hover,
#app-header #theme-toggle .icon-wrapper,
#app-header #theme-toggle .theme-icon,
#app-header #theme-toggle svg {
  overflow: visible !important;
}
html.dark #dash-reloj-header {
  margin-right: 15rem;
}

/* Oscuro: el texto de los botones claros no lleva fondo propio */
html.dark #app-shell button.btn-primary *,
html.dark #app-shell .cartera-accion-btn.btn-primary *,
html.dark #app-shell #txt-btn-aperturar-wrap *,
html.dark.liquid-glass #app-shell button.btn-primary *,
html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap * {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Oscuro: buscador, filtros y vistas del pipeline */
html.dark #app-shell .vercel-filter,
html.dark #app-shell input.vercel-filter,
html.dark #app-shell button.vercel-filter,
html.dark #app-shell button.bg-white.vercel-filter,
html.dark.liquid-glass #app-shell button.bg-white.vercel-filter,
html.dark #app-shell #filtro-expedientes,
html.dark #app-shell #btn-filtros-expedientes,
html.dark #app-shell #btn-filtros-agenda,
html.dark #app-shell .lso-view-toggle-btn {
  background: #1c1c1c !important;
  background-color: #1c1c1c !important;
  background-image: none !important;
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
  border-color: #3a3a3a !important;
}
html.dark #app-shell .vercel-filter::placeholder,
html.dark #app-shell #filtro-expedientes::placeholder {
  color: #737373 !important;
  -webkit-text-fill-color: #737373 !important;
}
html.dark #app-shell button.vercel-filter *,
html.dark.liquid-glass #app-shell button.bg-white.vercel-filter *,
html.dark #app-shell .exp-filtros-icon {
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
  stroke: #fafafa !important;
  background: transparent !important;
  background-color: transparent !important;
}
html.dark #app-shell .lso-view-toggle-btn.is-active {
  background: #fafafa !important;
  background-color: #fafafa !important;
  color: #0a0a0a !important;
  -webkit-text-fill-color: #0a0a0a !important;
  border-color: #fafafa !important;
}
html.dark .erp-overflow-menu {
  background: #171717 !important;
  border-color: #3a3a3a !important;
  color: #fafafa !important;
}
html.dark .erp-overflow-menu button {
  color: #fafafa !important;
  -webkit-text-fill-color: #fafafa !important;
}
html.dark .erp-overflow-menu button:hover {
  background: #262626 !important;
}

/* Esquema de color: acciones, iconos y acentos siguen --app-primary */
html:not(.dark) button.bg-slate-900,
html:not(.dark) button.bg-slate-900:hover,
html:not(.dark) .bg-slate-900.agenda-vista-btn.is-active {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
}
html:not(.dark) button.bg-slate-900:hover {
  background-color: var(--app-primary-dark) !important;
  border-color: var(--app-primary-dark) !important;
}
html.dark .btn-primary,
html.dark.liquid-glass .btn-primary,
html.dark #app-shell button.btn-primary,
html.dark #app-shell #txt-btn-aperturar-wrap,
html.dark.liquid-glass #app-shell button.btn-primary,
html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap,
html.dark .lso-exp-generate,
html.dark .app-primary-bg {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html.dark .btn-primary:hover,
html.dark #app-shell button.btn-primary:hover,
html.dark #app-shell #txt-btn-aperturar-wrap:hover {
  background-color: var(--app-primary-dark) !important;
  border-color: var(--app-primary-dark) !important;
}
html.dark .btn-primary *,
html.dark #app-shell button.btn-primary *,
html.dark #app-shell #txt-btn-aperturar-wrap *,
html.dark.liquid-glass #app-shell button.btn-primary *,
html.dark.liquid-glass #app-shell #txt-btn-aperturar-wrap * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html.dark #app-shell .lso-view-toggle-btn.is-active {
  background: var(--app-primary) !important;
  background-color: var(--app-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: var(--app-primary) !important;
}
html #btn-recuperar-submit,
html #btn-nueva-password-submit,
html:not(.dark) button.bg-black {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Auth: split-screen + tarjeta. Gana a los resets globales del modal. */
#modal-login .hidden {
  display: none !important;
}
html.auth-login,
html.auth-login body {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
@media (min-width: 1024px) {
  html.auth-login,
  html.auth-login body {
    height: 100dvh !important;
    max-height: 100dvh;
    overflow: hidden !important;
  }
}
html.auth-login::-webkit-scrollbar,
html.auth-login body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
#modal-login.auth-root {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 70;
  min-height: 100dvh;
  height: auto !important;
  overflow: visible !important;
  background: #f8fafc !important;
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
#modal-login > .auth-stage {
  display: grid !important;
  grid-template-columns: 1fr;
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #f8fafc !important;
  overflow: visible !important;
  color: #0f172a !important;
}
@media (min-width: 1024px) {
  #modal-login.auth-root,
  #modal-login > .auth-stage {
    height: 100dvh !important;
    max-height: 100dvh;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #modal-login > .auth-stage {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}
.auth-brand {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 2rem;
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(148, 163, 184, 0.28), transparent 55%),
    #0f172a;
  color: #f8fafc !important;
  box-sizing: border-box;
}
@media (min-width: 1024px) {
  .auth-brand {
    display: flex;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    max-height: 100dvh;
    padding: 3rem;
  }
}
#modal-login .auth-brand,
#modal-login .auth-brand :where(h1, h2, h3, p, span, li) {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
.auth-brand-top,
.auth-brand-mid { max-width: 28rem; }
.auth-brand-kicker {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}
.auth-brand-title {
  margin: 0;
  font-size: 1.875rem;
  line-height: 1.15;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}
@media (min-width: 1024px) {
  .auth-brand-title { font-size: 2.25rem; }
}
.auth-brand-copy {
  margin-top: 0.75rem;
  max-width: 24rem;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  font-size: 0.95rem;
  line-height: 1.5;
}
.auth-brand-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 26rem;
}
#modal-login .auth-brand-points li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}
#modal-login .auth-brand-points li::before {
  content: "";
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23e2e8f0' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  height: auto;
  padding: 1rem;
  overflow-y: auto;
  box-sizing: border-box;
}
@media (min-width: 1024px) {
  .auth-panel {
    height: 100dvh;
    max-height: 100dvh;
    padding: 1.5rem;
    overflow: hidden;
  }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .auth-brand { padding: 1.75rem 2.5rem; }
  .auth-panel { padding: 0.5rem 1.25rem; }
  html.dark #modal-login .login-card,
  #modal-login .login-card { padding: 0.85rem 1.5rem !important; }
  #modal-login #form-register { gap: 0.4rem; }
}
#modal-login .login-card {
  margin-top: auto;
  margin-bottom: auto;
}
html.dark #modal-login,
html.dark #modal-login > .auth-stage,
html.dark #modal-login .auth-panel {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
}
html.dark #modal-login .login-card,
#modal-login .login-card {
  width: 100%;
  max-width: 28rem !important;
  margin-inline: auto;
  padding: 1.5rem !important;
  border-radius: 1rem !important;
  border: 1px solid rgb(226 232 240 / 0.8) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 20px 25px -5px rgb(15 23 42 / 0.08), 0 8px 10px -6px rgb(15 23 42 / 0.08) !important;
  color: #0f172a !important;
}
@media (min-width: 640px) {
  html.dark #modal-login .login-card,
  #modal-login .login-card { padding: 1.5rem 2rem !important; }
}
#modal-login .login-card > .text-center {
  margin-bottom: 0.65rem !important;
}
#modal-login .login-card > .text-center h1 {
  font-size: 1.25rem !important;
  line-height: 1.25 !important;
}
#modal-login .login-card > .text-center .mt-1 { margin-top: 0.15rem !important; }
#modal-login .login-card > .text-center .mt-3 { margin-top: 0.35rem !important; }
#modal-login .login-card :where(h1, h2, h3, p, span, label, a, button, li, div) {
  color: #0f172a;
}
#modal-login .auth-muted,
#modal-login .login-card .auth-muted {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0.65rem;
  padding: 0.25rem;
  border-radius: 1rem;
  background: #f1f5f9 !important;
  user-select: none;
  isolation: isolate;
}
.auth-tab-pill {
  position: absolute;
  z-index: 0;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 4px);
  height: auto;
  border-radius: 0.75rem;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
  transform: translateX(0);
  transition: transform 300ms ease-out;
  pointer-events: none;
}
.auth-tabs[data-mode="register"] .auth-tab-pill,
#modal-login .auth-tabs[data-mode="register"] .auth-tab-pill {
  transform: translateX(100%) !important;
}
.auth-tabs.is-instant .auth-tab-pill {
  transition: none !important;
}
#modal-login .auth-tab {
  position: relative;
  z-index: 10;
  border: 0;
  border-radius: 0.75rem;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500 !important;
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  cursor: pointer;
  text-align: center;
  text-decoration: none !important;
  transition: color 200ms ease-out;
}
#modal-login .auth-tab span {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  font-weight: inherit !important;
  background: transparent !important;
  transition: color 200ms ease-out;
}
#modal-login .auth-tab:hover,
#modal-login .auth-tab:hover span {
  color: #1e293b !important;
  -webkit-text-fill-color: #1e293b !important;
}
#modal-login .auth-tab[aria-selected="true"],
#modal-login .auth-tab[aria-selected="true"] span,
#modal-login .auth-tab.is-active,
#modal-login .auth-tab.is-active span {
  background: transparent !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .auth-tab-pill,
  .auth-tab { transition: none; }
}
.auth-form { display: flex; flex-direction: column; gap: 0.625rem; }
#modal-login #form-register {
  gap: 0.5rem;
  padding-top: 0;
}
.auth-form.hidden,
#modal-registro.hidden,
#modal-recuperar-password.hidden,
#modal-nueva-password.hidden { display: none !important; }
@keyframes auth-form-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
#modal-login .auth-form:not(.hidden) {
  animation: auth-form-in 220ms ease-out;
}
.auth-field { display: flex; flex-direction: column; gap: 0.25rem; }
.auth-label {
  margin-bottom: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
}
.auth-control { position: relative; display: block; }
.auth-field-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  pointer-events: none;
}
.auth-field-icon svg { width: 1.05rem; height: 1.05rem; }
#modal-login .login-card .auth-input,
html.dark #modal-login .login-card .auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.8rem !important;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
  padding: 0.5rem 0.75rem 0.5rem 2.35rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25 !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
#modal-login .login-card .auth-input-secret { padding-right: 2.75rem !important; }
#modal-login .login-card .auth-input:focus,
html.dark #modal-login .login-card .auth-input:focus {
  border-color: #94a3b8 !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 4px #f1f5f9 !important;
}
#modal-login .login-card .auth-input::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}
.auth-colegiacion-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr);
  gap: 0.75rem;
  align-items: end;
}
@media (max-width: 520px) {
  .auth-colegiacion-row { grid-template-columns: minmax(0, 1fr); }
}
#modal-colegiacion {
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.45);
}
#modal-colegiacion:not([hidden]) {
  display: flex;
}
#modal-colegiacion[hidden] {
  display: none;
}
#modal-colegiacion .onboarding-badge {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}
#modal-colegiacion .onboarding-card {
  overflow: visible;
}
#modal-colegiacion .onboarding-rol {
  position: relative;
}
#modal-colegiacion .onboarding-rol-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
#modal-colegiacion #onboarding-rol-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 2.55rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  box-shadow: none;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.25;
  cursor: pointer;
}
#modal-colegiacion #onboarding-rol-trigger:focus,
#modal-colegiacion #onboarding-rol-trigger[aria-expanded="true"] {
  outline: none;
  border-color: #94a3b8;
  background: #fff;
  box-shadow: 0 0 0 4px #f1f5f9;
}
#modal-colegiacion .onboarding-rol-chevron {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  color: #000;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}
#modal-colegiacion #onboarding-rol-trigger[aria-expanded="true"] .onboarding-rol-chevron {
  transform: rotate(0deg);
}
#modal-colegiacion #onboarding-rol-label.text-slate-500 { color: #94a3b8; }
#modal-colegiacion #onboarding-rol-label.text-slate-900 { color: #0f172a; }
#modal-colegiacion #onboarding-rol-list {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0.35rem;
  z-index: 50;
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
#modal-colegiacion #onboarding-rol-list[hidden] { display: none; }
#modal-colegiacion #onboarding-rol-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: #111;
  font-size: 0.8125rem;
  line-height: 1.35;
  cursor: pointer;
}
#modal-colegiacion #onboarding-rol-list button:hover,
#modal-colegiacion #onboarding-rol-list button[aria-selected="true"] {
  background: #fafafa;
  color: #0f172a;
}
#modal-colegiacion .onboarding-username .onboarding-at {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #000;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}
#modal-colegiacion .onboarding-username .auth-input {
  padding-left: 1.85rem !important;
}
#modal-colegiacion .onboarding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 0.85rem;
  align-items: start;
}
@media (max-width: 640px) {
  #modal-colegiacion .onboarding-grid { grid-template-columns: minmax(0, 1fr); }
}
#modal-colegiacion .login-card .auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #f8fafc;
  color: #0f172a;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.25;
  outline: none;
}
#modal-colegiacion .login-card .auth-input:focus {
  border-color: #94a3b8;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px #f1f5f9;
}
#modal-colegiacion .g-select-trigger {
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #f8fafc;
  color: #0f172a;
  min-height: 2.55rem;
  padding: 0.65rem 0.85rem;
  font-weight: 400;
}
#modal-colegiacion .g-select.is-open .g-select-trigger,
#modal-colegiacion .g-select-trigger:focus-visible {
  border-color: #94a3b8;
  background: #ffffff;
  box-shadow: 0 0 0 4px #f1f5f9;
}
#modal-colegiacion .g-select-list {
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
#modal-colegiacion .auth-submit.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
#modal-colegiacion .auth-submit.is-loading .auth-submit-label {
  visibility: hidden;
}
#modal-colegiacion .auth-submit.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.05rem;
  height: 1.05rem;
  margin: -0.525rem 0 0 -0.525rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: onboarding-spin 0.7s linear infinite;
}
@keyframes onboarding-spin { to { transform: rotate(360deg); } }
#modal-colegiacion .auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
#modal-colegiacion .auth-submit {
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.8rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 150ms cubic-bezier(0, 0, 0.2, 1);
}
#modal-colegiacion .auth-submit:hover:not(:disabled) {
  background: var(--app-primary-dark);
  transform: scale(0.98);
}
#modal-colegiacion .auth-submit:active:not(:disabled) {
  transform: scale(0.96);
}
#modal-colegiacion .auth-submit:disabled:not(.is-loading) {
  opacity: 0.5;
  cursor: not-allowed;
}
#modal-colegiacion .auth-submit.is-loading {
  opacity: 1;
  cursor: wait;
}
#modal-colegiacion select.auth-input,
#modal-colegiacion select.auth-input:focus {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 1.85rem;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='1.75'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 7.5 10 12.5 15 7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.95rem;
}
#modal-colegiacion select.auth-input:focus {
  background-color: #ffffff;
  box-shadow: 0 0 0 4px #f1f5f9;
}
#modal-login .login-card select.auth-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 1.85rem !important;
  background-color: #f8fafc !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='1.75'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 7.5 10 12.5 15 7.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.55rem center !important;
  background-size: 0.95rem !important;
  text-overflow: ellipsis;
}
#modal-login .login-card select.auth-input:focus {
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='1.75'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 7.5 10 12.5 15 7.5'/%3E%3C/svg%3E") !important;
}
#modal-login .login-card .auth-input.is-invalid,
html.dark #modal-login .login-card .auth-input.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
}
#modal-login .login-card .auth-input.is-invalid:focus,
html.dark #modal-login .login-card .auth-input.is-invalid:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18) !important;
}
.auth-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  cursor: pointer;
}
.auth-eye svg { width: 1.1rem; height: 1.1rem; }
.auth-eye .auth-eye-off { display: none; }
.auth-eye[aria-pressed="true"] .auth-eye-open { display: none; }
.auth-eye[aria-pressed="true"] .auth-eye-off { display: block; }
.auth-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.auth-link:hover { color: #0f172a !important; -webkit-text-fill-color: #0f172a !important; }
#modal-login .auth-submit,
#modal-login .auth-submit span,
html.dark #modal-login .auth-submit,
html.dark #modal-login .auth-submit span {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 0 !important;
  border-radius: 0.8rem !important;
  background: #0f172a !important;
  background-color: #0f172a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
#modal-login .auth-submit span {
  width: auto;
  min-height: 0;
  height: auto;
}
#modal-login .auth-submit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}
#modal-login .login-card #register-password.border-red-400 {
  border-color: #f87171 !important;
  background: rgb(254 242 242 / 0.2) !important;
  background-color: rgb(254 242 242 / 0.2) !important;
}
#modal-login .login-card #register-password.border-red-400:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px #ef4444 !important;
}
#modal-login .login-card #register-password.border-emerald-400 {
  border-color: #34d399 !important;
  background: rgb(236 253 245 / 0.2) !important;
  background-color: rgb(236 253 245 / 0.2) !important;
}
#modal-login .login-card #register-password.border-emerald-400:focus {
  border-color: #10b981 !important;
  box-shadow: none !important;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8 !important;
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
#modal-login .auth-divider span {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}
.auth-google,
html.dark #modal-login .auth-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.8rem !important;
  border: 1px solid #747775 !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #1f1f1f !important;
  -webkit-text-fill-color: #1f1f1f !important;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
#modal-login .auth-google span,
html.dark #modal-login .auth-google span {
  color: #1f1f1f !important;
  -webkit-text-fill-color: #1f1f1f !important;
  width: auto;
  background: transparent !important;
}
.auth-google svg { width: 1.15rem; height: 1.15rem; flex: none; }
.auth-google:hover { background: #f8f9fa !important; }
.auth-alert {
  border-radius: 0.7rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}
#modal-login .auth-alert-error,
#modal-login #login-error,
#modal-login #register-error,
#modal-login #recuperar-error,
#modal-login #nueva-password-error,
#modal-login #username-error-msg,
#modal-login #nueva-password-match {
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}
#modal-login .auth-alert-error:not(.hidden),
#modal-login #login-error:not(.hidden),
#modal-login #register-error:not(.hidden),
#modal-login #recuperar-error:not(.hidden),
#modal-login #nueva-password-error:not(.hidden) {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
#modal-login .auth-alert-ok:not(.hidden) {
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.auth-success-panel { text-align: center; padding: 0.5rem 0 0.25rem; }
.auth-mailbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669 !important;
  -webkit-text-fill-color: #059669 !important;
}
.auth-mailbox svg { width: 1.6rem; height: 1.6rem; }
.auth-meter { display: flex; flex-direction: column; gap: 0.45rem; }
.auth-meter-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
.auth-meter-bars span {
  height: 0.28rem;
  border-radius: 999px;
  background: #e2e8f0;
}
.auth-meter-bars span.is-on.is-weak { background: #ef4444; }
.auth-meter-bars span.is-on.is-mid { background: #f59e0b; }
.auth-meter-bars span.is-on.is-strong { background: #10b981; }
.auth-rules { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
#register-password-rules.auth-rules {
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 11px;
}
#modal-login .auth-rules li {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-size: 0.75rem;
}
#modal-login #register-password-rules li {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  font-size: 11px;
  line-height: 1.3;
}
#modal-login .auth-rules li.is-ok {
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
}
#modal-login .auth-rules li.is-miss {
  color: #f87171 !important;
  -webkit-text-fill-color: #f87171 !important;
}
#modal-login .auth-rules li.is-ok::before { content: "✓ "; }

[role="dialog"] > [data-stop="true"],
[role="dialog"] > .cliente-modal-stage > [data-stop="true"],
[role="dialog"] .cliente-modal-card,
[role="dialog"] .cookie-policy-card,
[role="dialog"] .privacy-policy-card {
  width: 100% !important;
  max-width: min(28rem, calc(100vw - 2rem)) !important;
  max-height: 90dvh !important;
  overflow-y: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 1rem !important;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  [role="dialog"] > [data-stop="true"],
  [role="dialog"] > .cliente-modal-stage > [data-stop="true"],
  [role="dialog"] .cliente-modal-card,
  [role="dialog"] .cookie-policy-card,
  [role="dialog"] .privacy-policy-card {
    max-width: min(32rem, calc(100vw - 2rem)) !important;
  }
}
[role="dialog"] .flex:not(.flex-col),
.tareas-vincular-nichos {
  flex-wrap: wrap;
  gap: 0.5rem;
}


