        :root { 
            --fx-azul: #0056b3; 
            --fx-sidebar-width: 260px;
            --fx-sidebar-collapsed: 70px;
            --fx-sidebar-bg: #1a1a1a;
            --fx-fundo: #f8f9fa;
            --fx-topbar-bg: #ffffff;
        }
        body { background-color: var(--fx-fundo); font-family: 'Inter', sans-serif; margin: 0; overflow-x: hidden; }
        .tela { display: none; }
        .auth-container { height: 100vh; display: flex; align-items: center; justify-content: center; background: #eee; padding: 20px; }
        .auth-box { background: white; padding: 40px; border-radius: 12px; width: 100%; box-shadow: 0 15px 35px rgba(0,0,0,0.1); border-top: 6px solid var(--fx-azul); display: none; }
        .box-sm { max-width: 400px; }
        .box-lg { max-width: 600px; }
        .auth-link { color: var(--fx-azul); text-decoration: none; font-size: 0.85rem; font-weight: bold; cursor: pointer; }
        .auth-link:hover { text-decoration: underline; }

        .sidebar { width: var(--fx-sidebar-width); background-color: var(--fx-sidebar-bg); height: 100vh; position: fixed; left: 0; top: 0; transition: all 0.3s; z-index: 1050; overflow-x: hidden; display: flex; flex-direction: column; }
        body.sidebar-unpinned .sidebar { width: var(--fx-sidebar-collapsed); }
        body.sidebar-unpinned .sidebar:hover { width: var(--fx-sidebar-width); }
        body.sidebar-unpinned .sidebar:not(:hover) .nav-link span { opacity: 0; visibility: hidden; }
        body.sidebar-unpinned .sidebar:not(:hover) .sidebar-header { justify-content: center; padding-left: 8px; padding-right: 8px; }
        body.sidebar-unpinned .sidebar:not(:hover) .sidebar-header img { max-width: 34px; opacity: 1; visibility: visible; }
        body.sidebar-unpinned .sidebar:not(:hover) .sidebar-header .btn-pin { display: none; }
        .sidebar-header { padding: 20px; display: flex; align-items: center; justify-content: space-between; min-height: 70px; border-bottom: 1px solid rgba(255,255,255,0.05); }
        .sidebar-header img { max-width: 130px; transition: 0.2s; }
        .btn-pin { background: none; border: none; color: #666; cursor: pointer; font-size: 1.2rem; transition: 0.2s; }
        .btn-pin:hover { color: white; }
        body.sidebar-pinned .btn-pin { color: var(--fx-azul); }
        .nav-link { color: #adb5bd; padding: 14px 22px; text-decoration: none; display: flex; align-items: center; gap: 15px; white-space: nowrap; border-left: 4px solid transparent; transition: 0.2s; cursor: pointer; }
        .nav-link i { font-size: 1.2rem; min-width: 25px; text-align: center; }
        .nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,0.05); }
        .nav-link.active { border-left-color: var(--fx-azul); background: rgba(0, 86, 179, 0.1); }
        .fx-menu-group { margin-bottom: 2px; }
        .fx-menu-parent .fx-menu-caret { margin-left: auto; font-size: .9rem; opacity: .85; transition: transform .2s ease; }
        .fx-menu-group.fx-menu-open .fx-menu-parent .fx-menu-caret { transform: rotate(180deg); }
        .fx-submenu { display: none; }
        .fx-menu-group.fx-menu-open .fx-submenu { display: block; }
        .fx-submenu-link { padding: 9px 20px 9px 44px; font-size: .92rem; color: #9ca3af; border-left: 4px solid transparent; gap: 10px; }
        .fx-submenu-link i { font-size: 1rem; min-width: 18px; }
        .fx-submenu-link.active, .fx-submenu-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
        .fx-submenu-link.active { border-left-color: var(--fx-azul); background: rgba(0, 86, 179, 0.1); }
        /* v2.222.0 — contador de pendências no item de submenu (ex.: Recebimentos
           Pendentes). O link já é flex (.nav-link); margin-left:auto empurra o
           badge para a direita, mesmo padrão já usado por .fx-menu-caret. */
        .fx-submenu-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
        /* Busca semântica do menu (D-099) */
        .fx-menu-busca-wrap { position: relative; }
        .fx-menu-busca-input { background-color: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); color: #fff; padding-left: 32px; padding-right: 30px; }
        .fx-menu-busca-input::placeholder { color: rgba(255,255,255,0.45); }
        .fx-menu-busca-input:focus { background-color: rgba(255,255,255,0.10); border-color: var(--fx-azul); box-shadow: none; color: #fff; }
        .fx-menu-busca-icone { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.45); pointer-events: none; font-size: .9rem; }
        .fx-menu-busca-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 0; opacity: .65; filter: invert(1) grayscale(1) brightness(2); }
        .fx-menu-busca-clear:hover { opacity: 1; }
        .fx-menu-busca-sugestoes { background-color: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; margin-top: 6px; max-height: 320px; overflow-y: auto; padding: 4px 0; }
        .fx-menu-busca-grupo-titulo { padding: 6px 12px 4px 12px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,0.45); font-weight: 700; display: flex; align-items: center; gap: 6px; }
        .fx-menu-busca-grupo-titulo .badge { font-size: .6rem; font-weight: 600; }
        .fx-menu-busca-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 12px; color: #d8dbe0; cursor: pointer; border-left: 3px solid transparent; }
        .fx-menu-busca-item:hover, .fx-menu-busca-item.fx-busca-ativo { background: rgba(255,255,255,0.06); color: #fff; border-left-color: var(--fx-azul); }
        .fx-menu-busca-item i.bi { font-size: 1rem; min-width: 18px; padding-top: 2px; opacity: .85; }
        .fx-menu-busca-item .fx-busca-titulo { font-size: .85rem; font-weight: 600; line-height: 1.15; }
        .fx-menu-busca-item .fx-busca-subtitulo { font-size: .72rem; color: rgba(255,255,255,0.55); line-height: 1.15; margin-top: 1px; }
        .fx-menu-busca-vazio { padding: 8px 12px; font-size: .78rem; color: rgba(255,255,255,0.55); }
        .fx-menu-busca-loader { padding: 8px 12px; font-size: .78rem; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 6px; }
        body.sidebar-unpinned .sidebar:not(:hover) .fx-menu-busca-wrap { visibility: hidden; }
        .main-container { margin-left: var(--fx-sidebar-width); width: calc(100% - var(--fx-sidebar-width)); transition: all 0.3s; min-height: 100vh; display: flex; flex-direction: column; }
        body.sidebar-unpinned .main-container { margin-left: var(--fx-sidebar-collapsed); width: calc(100% - var(--fx-sidebar-collapsed)); }
        .topbar { height: 70px; background: var(--fx-topbar-bg); padding: 0 25px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 999; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
        .btn-menu-mobile { display: none; background: none; border: none; font-size: 1.5rem; }
        .main-content { padding: 25px; flex-grow: 1; }
        .sidebar-version { margin-top: auto; padding: 10px 16px 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); color: #9ca3af; font-size: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
        .fx-logo-rodape { max-width: 130px; width: 100%; height: auto; opacity: .92; margin-bottom: 8px; }
        #fx-versao-sistema { display: block; width: 100%; text-align: center; line-height: 1.2; }
        .fx-btn-acoes { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
        .fx-menu-acoes { min-width: 160px; }
        .fx-menu-acoes.fx-menu-acoes-portal {
            position: fixed !important;
            z-index: 2000;
            margin: 0;
            inset: auto auto auto auto;
            right: auto !important;
            bottom: auto !important;
            width: max-content;
            max-width: calc(100vw - 16px);
            max-height: calc(100vh - 16px);
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            transform: none !important;
        }
        .fx-menu-acoes.fx-menu-acoes-portal .dropdown-item,
        .fx-menu-acoes.fx-menu-acoes-portal .dropdown-item-text {
            white-space: normal;
            overflow-wrap: anywhere;
        }
        .fx-btn-notif { width: 40px; height: 40px; border: 1px solid #dee2e6; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
        .fx-btn-notif i { font-size: 1.05rem; color: #334155; }
        .fx-notif-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
        .fx-notif-menu { width: min(420px, 92vw); }
        .fx-notif-lista { max-height: 360px; overflow-y: auto; }
        .fx-notif-item { border-bottom: 1px solid #eef2f7; }
        .fx-notif-item:last-child { border-bottom: 0; }
        .fx-topbar-user { font-size: 0.78rem; text-align: center; line-height: 1.1; margin-top: 2px; color: #334155; }
        .fx-topbar-user .fx-topbar-user-name { color: #64748b; font-weight: 700; }
        /* v2.218.2 — menu da empresa (topbar) passou a reunir Empresa ativa,
           Ajuda e Suporte, Logs e Sair num único dropdown. */
        .fx-menu-empresa { min-width: 240px; }
        .fx-menu-empresa #fxEmpresaAtivaSelect { width: 100%; }
        .fx-superadmin-contexto {
            background: #fff3cd;
            border-bottom: 1px solid #ffe69c;
            color: #664d03;
            padding: 10px 25px;
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            font-size: .92rem;
        }
        .fx-acc-toggle { border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: .4rem; }
        .fx-acc-toggle:hover { background: rgba(0,0,0,.06); }
        .fx-acc-toggle i { transition: transform .2s ease; }
        .card.fx-acc-open .fx-acc-toggle i { transform: rotate(180deg); }
        .fx-modal-padrao .modal-content { border-color: var(--fx-azul); }
        .fx-modal-padrao .modal-body { max-height: calc(100vh - 172px); min-height: 0; overflow-y: auto; }
        .fx-modal-padrao .modal-footer { position: sticky; bottom: 0; z-index: 2; background: #f8f9fa; }
        .fx-modal-header-padrao { background: #212529; color: #fff; }
        .fx-modal-header-padrao .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
        .fx-modal-header-semantico .btn-close:not(.btn-close-white) { filter: none; }
        #fxModalMensagemTexto { white-space: pre-line; }
        .fx-validacao-pendente,
        .fx-validacao-pendente.form-control,
        .fx-validacao-pendente.form-select,
        .fx-validacao-pendente.form-control-color {
            background: #fff3cd !important;
            border-color: #ffc107 !important;
            box-shadow: 0 0 0 .2rem rgba(255, 193, 7, .18) !important;
        }
        .fx-validacao-bloco-pendente {
            background: rgba(255, 243, 205, .45) !important;
            border: 1px solid #ffc107 !important;
            border-radius: .5rem;
            transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
            box-shadow: 0 0 0 .15rem rgba(255, 193, 7, .12);
        }
        @media (max-width: 992px) {
            .sidebar { left: -100%; width: 280px !important; }
            .sidebar.mobile-open { left: 0; }
            body.sidebar-unpinned .sidebar.mobile-open .nav-link span {
                opacity: 1;
                visibility: visible;
            }
            body.sidebar-unpinned .sidebar.mobile-open .fx-menu-busca-wrap {
                visibility: visible;
            }
            .main-container { margin-left: 0 !important; width: 100% !important; }
            .btn-menu-mobile { display: block; }
            .btn-pin { display: none; }
            .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1040; }
            .sidebar-overlay.show { display: block; }
            .fx-btn-acoes { width: 36px; height: 36px; }
            .fx-menu-acoes { min-width: 176px; font-size: 0.95rem; }
            .fx-btn-notif { width: 38px; height: 38px; }
            .fx-notif-menu { width: min(94vw, 380px); }
            .fx-acc-toggle { width: 34px; height: 34px; }
            /* v2.37.1 — topbar responsiva: evita sobreposicao do titulo com seletor de empresa/sino/usuario no celular. */
            .topbar { height: auto; min-height: 60px; padding: 8px 14px; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
            .topbar > div:first-child { flex: 1 1 auto; min-width: 0; }
            .topbar > div:first-child #tituloPagina { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
            .topbar > div:last-child { flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 100%; }
            /* v2.218.2 — Empresa ativa saiu do topbar (linha própria) e foi para
               dentro do dropdown "menu da empresa"; o dropdown já rola/ajusta
               sozinho no celular (mesmo comportamento do menu de Notificações). */
            .fx-menu-empresa { min-width: min(90vw, 260px); }
        }

        /* v2.10.0 (D-106): cabecalhos clicaveis para ordenar listagens.
           Reutilizado por todas as telas que usam window.FX.tabela. */
        .fx-th-ordenavel { cursor: pointer; user-select: none; }
        .fx-th-ordenavel:hover { background-color: rgba(0, 0, 0, 0.04); }
        .fx-th-ordenavel .fx-seta-ordem { margin-left: 4px; opacity: 0.5; font-size: 0.85em; }
        .fx-th-ordenavel.fx-th-ordem-ativa .fx-seta-ordem { opacity: 1; }

        /* =================================================================
           FXLoader (v2.47.0 / D-107) — carregamento global INDETERMINADO.
           Sem porcentagem falsa. Overlay translúcido + card central + barra
           indeterminada animada. Compatível com Bootstrap e tema (var --fx-azul).
           ================================================================= */
        .fx-loader {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(33, 37, 41, 0.28);
            backdrop-filter: blur(1.5px);
            -webkit-backdrop-filter: blur(1.5px);
            z-index: 12000;
            padding: 16px;
        }
        .fx-loader[hidden] { display: none !important; }
        .fx-loader.is-visible { display: flex; animation: fxLoaderFadeIn 0.18s ease-out; }
        @keyframes fxLoaderFadeIn { from { opacity: 0; } to { opacity: 1; } }

        .fx-loader-card {
            background: #ffffff;
            border-radius: 14px;
            box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
            border-top: 4px solid var(--fx-azul);
            padding: 26px 30px 22px;
            width: 100%;
            max-width: 340px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }
        .fx-loader-spinner {
            width: 46px;
            height: 46px;
            border-radius: 50%;
            border: 4px solid rgba(0, 0, 0, 0.10);
            border-top-color: var(--fx-azul);
            animation: fxLoaderSpin 0.85s linear infinite;
        }
        @keyframes fxLoaderSpin { to { transform: rotate(360deg); } }

        .fx-loader-title {
            font-weight: 700;
            font-size: 1.02rem;
            color: #212529;
            line-height: 1.25;
        }
        .fx-loader-subtitle {
            font-size: 0.85rem;
            color: #6c757d;
            line-height: 1.3;
        }
        .fx-loader-bar {
            width: 100%;
            height: 4px;
            margin-top: 6px;
            border-radius: 4px;
            background: rgba(0, 0, 0, 0.08);
            overflow: hidden;
            position: relative;
        }
        .fx-loader-bar-inner {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 40%;
            border-radius: 4px;
            background: var(--fx-azul);
            animation: fxLoaderBar 1.2s ease-in-out infinite;
        }
        @keyframes fxLoaderBar {
            0%   { left: -40%; width: 40%; }
            50%  { left: 30%; width: 55%; }
            100% { left: 100%; width: 40%; }
        }
        .fx-loader-hide {
            margin-top: 8px;
            background: transparent;
            border: 1px solid rgba(0, 0, 0, 0.15);
            color: #6c757d;
            font-size: 0.8rem;
            font-weight: 600;
            border-radius: 8px;
            padding: 5px 14px;
            cursor: pointer;
            transition: background 0.15s ease, color 0.15s ease;
        }
        .fx-loader-hide:hover { background: rgba(0, 0, 0, 0.05); color: #212529; }
        .fx-loader-hide[hidden] { display: none !important; }

        @media (max-width: 575.98px) {
            .fx-loader-card { max-width: 300px; padding: 22px 22px 18px; }
            .fx-loader-spinner { width: 40px; height: 40px; }
        }
        @media (prefers-reduced-motion: reduce) {
            .fx-loader-spinner,
            .fx-loader-bar-inner { animation-duration: 2.4s; }
        }

        /* ===== D-130 — Histórico e auditoria unificados (window.FX.historico) ===== */
        .fx-historico-lista {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .fx-historico-item {
            display: flex;
            gap: 10px;
            align-items: flex-start;
        }
        .fx-historico-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-top: 6px;
            flex: 0 0 auto;
            background: #adb5bd;
        }
        .fx-historico-dot-success { background: #198754; }
        .fx-historico-dot-danger { background: #dc3545; }
        .fx-historico-dot-neutro { background: var(--fx-azul, #0d6efd); }
        .fx-historico-corpo { flex: 1 1 auto; min-width: 0; }
        .fx-historico-toggle { text-decoration: none; }
        .fx-historico-vazio,
        .fx-historico-carregando { padding: 8px 0; }
