:root{--sg-primary:#0aa6bd;--sg-primary-dark:#078da2;--sg-warning:#d99a00;--sg-danger:#c92a2a}
.sistema-guard-banner{position:sticky;top:0;z-index:24900;display:flex;align-items:center;gap:.75rem;min-height:42px;padding:8px 14px;background:#fff7df;border-bottom:1px solid #f0cf72;color:#6f5200;font-size:.8rem;box-shadow:0 2px 8px rgba(15,23,42,.06)}
.sistema-guard-banner>i{color:var(--sg-warning);font-size:1rem}.sistema-guard-banner-texto{min-width:0;flex:1}.sistema-guard-banner-texto strong{font-weight:700}.sistema-guard-banner .btn{flex:0 0 auto;border-radius:2px;font-size:.74rem;font-weight:600}
body.sistema-guard-modal-aberto{overflow:hidden!important}
.sistema-guard-overlay{position:fixed;inset:0;z-index:30000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.54);opacity:0;visibility:hidden;transition:opacity .16s ease,visibility .16s ease}
.sistema-guard-overlay.show{opacity:1;visibility:visible}
.sistema-guard-modal{width:min(620px,100%);max-height:calc(100dvh - 36px);outline:0;transform:translateY(-8px) scale(.99);transition:transform .16s ease}
.sistema-guard-overlay.show .sistema-guard-modal{transform:translateY(0) scale(1)}
.sistema-guard-modal-content{display:flex;flex-direction:column;max-height:calc(100dvh - 36px);overflow:hidden;background:#fff;border:1px solid #dfe5ea;border-radius:3px;box-shadow:0 22px 60px rgba(15,23,42,.28)}
.sistema-guard-modal-header{flex:0 0 auto;padding:13px 16px;border-bottom:1px solid #e8edf1;background:#fbfcfd}
.sistema-guard-modal-title{display:flex;align-items:center;gap:.55rem;margin:0;color:#34404a;font-size:1rem;font-weight:700}
.sistema-guard-modal-title i{color:var(--sg-warning)}
.sistema-guard-modal-body{flex:1 1 auto;overflow:auto;padding:18px 16px;color:#4b5964;font-size:.84rem;line-height:1.55}
.sistema-guard-modal-footer{flex:0 0 auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;padding:10px 16px;border-top:1px solid #e8edf1;background:#fff}
.sistema-guard-modal .btn{border-radius:2px;font-size:.78rem;font-weight:600}
.sistema-guard-detalhe{margin-top:12px;padding:10px 12px;background:#fff8e5;border:1px solid #f2d489;border-radius:2px;color:#684f0c;font-size:.78rem}
.sistema-guard-detalhe code{color:#7d5d00}.sistema-guard-modal-bloqueio .sistema-guard-modal-title i{color:var(--sg-danger)}
@media(max-width:700px){.sistema-guard-banner{position:relative;flex-wrap:wrap;padding:8px 10px}.sistema-guard-banner .btn{margin-left:1.75rem}.sistema-guard-overlay{padding:10px}.sistema-guard-modal{width:100%;max-height:calc(100dvh - 20px)}.sistema-guard-modal-content{max-height:calc(100dvh - 20px)}.sistema-guard-modal-footer{display:grid;grid-template-columns:1fr}.sistema-guard-modal-footer .btn{width:100%}}

/* V181 — estilos antigos do topo empresarial removidos.
   O componente usa exclusivamente assets/css/header.css. */

/* =========================================================
   V131 — TOPO EMPRESARIAL GLOBAL
   O seletor da empresa e o botão X são um único componente
   renderizado pelo header.php em todas as rotas.
   ========================================================= */
.empresa-contexto-topo {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.empresa-contexto-topo.d-none {
    display: none !important;
}

.empresa-contexto-topo > .empresa-contexto-desvincular {
    position: static;
    flex: 0 0 auto;
    margin: 0;
}

@media (max-width: 900px) {
    .empresa-contexto-topo {
        display: none;
    }
}


/* =========================================================
   V137 — X REMOVIDO GLOBALMENTE
   Proteção final para qualquer tela/JS legado.
   ========================================================= */
.empresa-contexto-desvincular,
[data-sg-desvincular-empresa] {
    display: none !important;
}
