/* =========================================================
   IECJS — E7.4A
   Shell global do Portal + base de tema claro/escuro
========================================================= */

:root {
    --iecjs-azul: #22B8EF;
    --iecjs-azul-claro: #46C3F1;
    --iecjs-amarelo: #FFF212;
    --iecjs-vermelho: #ED3237;
    --iecjs-laranja: #FF4000;
    --iecjs-dourado: #D7B07C;
    --iecjs-areia: #EDDDC7;
    --iecjs-branco: #FEFEFE;
    --iecjs-texto: #17324A;
    --iecjs-texto-secundario: #79869F;

    --iecjs-fundo: #F4F7FA;
    --iecjs-superficie: #FEFEFE;
    --iecjs-superficie-2: #EDF5F9;
    --iecjs-borda: rgba(23, 50, 74, .12);
    --iecjs-sombra: 0 12px 34px rgba(23, 50, 74, .10);
    --iecjs-topbar: #102F49;
    --iecjs-topbar-2: #173F5D;
    --iecjs-sidebar: #0D2538;
    --iecjs-sidebar-hover: rgba(70, 195, 241, .12);
    --iecjs-sidebar-ativo: rgba(34, 184, 239, .19);

    --iecjs-topbar-altura: 72px;
    --iecjs-sidebar-largura: 272px;
    --iecjs-sidebar-recolhida: 78px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --iecjs-fundo: #09131D;
    --iecjs-superficie: #102536;
    --iecjs-superficie-2: #17354A;
    --iecjs-borda: rgba(248, 246, 240, .12);
    --iecjs-sombra: 0 16px 40px rgba(0, 0, 0, .26);
    --iecjs-topbar: #09131D;
    --iecjs-topbar-2: #102536;
    --iecjs-sidebar: #071019;
    --iecjs-sidebar-hover: rgba(56, 199, 250, .12);
    --iecjs-sidebar-ativo: rgba(56, 199, 250, .20);
    --iecjs-texto: #F8F6F0;
    --iecjs-texto-secundario: #ABB8C4;
    --iecjs-azul: #38C7FA;
    --iecjs-amarelo: #FFE94A;
    --iecjs-vermelho: #FF5158;
    --iecjs-laranja: #FF6A2A;
    --iecjs-dourado: #D8B478;
}

html.iecjs-contexto-interno body {
    padding-top: var(--iecjs-topbar-altura);
    padding-left: var(--iecjs-sidebar-largura);
    background: var(--iecjs-fundo);
    color: var(--iecjs-texto);
    transition: padding-left .22s ease;
}

html.iecjs-contexto-interno.iecjs-sidebar-recolhida body {
    padding-left: var(--iecjs-sidebar-recolhida);
}

html[data-theme="dark"].iecjs-contexto-interno body {
    background: var(--iecjs-fundo);
    color: var(--iecjs-texto);
}

.iecjs-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* =========================================================
   TOPBAR
========================================================= */

#cabecalhoPrincipal.iecjs-topbar {
    min-height: var(--iecjs-topbar-altura);
    height: var(--iecjs-topbar-altura);
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 9px clamp(14px, 2.4vw, 30px);
    background: linear-gradient(135deg, var(--iecjs-topbar) 0%, var(--iecjs-topbar-2) 100%);
    color: #fff;
    box-shadow: 0 4px 22px rgba(5, 23, 37, .16);
    z-index: 5000;
}

html.iecjs-contexto-interno #cabecalhoPrincipal.iecjs-topbar {
    position: fixed;
    inset: 0 0 auto 0;
}

#cabecalhoPrincipal .cabecalho-esquerda {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

#cabecalhoPrincipal .cabecalho-menu-toggle,
#cabecalhoPrincipal .cabecalho-icone-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px;
    background: rgba(255,255,255,.055);
    color: #fff;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

#cabecalhoPrincipal .cabecalho-menu-toggle:hover,
#cabecalhoPrincipal .cabecalho-icone-btn:hover {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.28);
}

#cabecalhoPrincipal .cabecalho-menu-toggle:active,
#cabecalhoPrincipal .cabecalho-icone-btn:active {
    transform: translateY(1px);
}

#cabecalhoPrincipal .cabecalho-menu-toggle svg,
#cabecalhoPrincipal .cabecalho-icone-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#cabecalhoPrincipal[data-contexto="publico"] .cabecalho-menu-toggle,
#cabecalhoPrincipal[data-contexto="publico"] .cabecalho-tema {
    display: none;
}

#cabecalhoPrincipal .cabecalho-logo-link {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    border-radius: 13px;
    background: rgba(255,255,255,.08);
    text-decoration: none;
}

#cabecalhoPrincipal .logo {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
}

#cabecalhoPrincipal .cabecalho-nav {
    min-width: 0;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
}

#cabecalhoPrincipal[data-contexto="interno"] .cabecalho-nav {
    display: none;
}

#cabecalhoPrincipal .menu-publico {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.7vw, 26px);
    margin: 0 0 0 12px;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}

#cabecalhoPrincipal .menu-publico a {
    color: rgba(255,255,255,.86);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

#cabecalhoPrincipal .menu-publico a:hover,
#cabecalhoPrincipal .menu-publico a.ativo {
    color: #fff;
}

#cabecalhoPrincipal .cabecalho-centro {
    min-width: 180px;
    display: grid;
    gap: 2px;
    flex: 1 1 auto;
    justify-items: center;
    text-align: center;
    pointer-events: none;
}

#cabecalhoPrincipal[data-contexto="publico"] .cabecalho-centro {
    display: none;
}

#cabecalhoPrincipal .cabecalho-centro span {
    color: rgba(255,255,255,.62);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#cabecalhoPrincipal .cabecalho-centro strong {
    max-width: min(42vw, 560px);
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 760;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cabecalhoPrincipal .cabecalho-acoes {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-left: auto;
    flex: 0 0 auto;
}

#cabecalhoPrincipal .cabecalho-contexto-switch {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 11px;
    background: rgba(0,0,0,.10);
}

#cabecalhoPrincipal .cabecalho-contexto-atual,
#cabecalhoPrincipal .btn-contexto {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-size: 11px;
    font-weight: 760;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

#cabecalhoPrincipal .cabecalho-contexto-atual {
    background: rgba(255,255,255,.11);
    color: #fff;
}

#cabecalhoPrincipal .btn-contexto:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

#cabecalhoPrincipal .btn-area-membro {
    background: #fff;
    color: #17324A;
}

#cabecalhoPrincipal[data-contexto="interno"] .contexto-publico,
#cabecalhoPrincipal[data-contexto="publico"] .contexto-portal {
    display: none;
}

/* Tema */
html[data-theme="light"] #btnTemaIECJS .tema-sol,
html[data-theme="dark"] #btnTemaIECJS .tema-lua {
    display: none;
}

/* Notificações - alinhadas ao shell */
#cabecalhoPrincipal .btn-notificacoes {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

#cabecalhoPrincipal .notificacoes-badge {
    border-color: var(--iecjs-topbar);
    background: var(--iecjs-vermelho);
}

/* =========================================================
   IDENTIDADE DO USUÁRIO
========================================================= */

#cabecalhoPrincipal .cabecalho-identidade {
    position: relative;
    min-width: 0;
}

#cabecalhoPrincipal .cabecalho-identidade-btn {
    width: auto;
    min-width: 184px;
    max-width: 245px;
    height: 48px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 9px;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(255,255,255,.055);
    color: #fff;
    text-align: left;
}

#cabecalhoPrincipal .cabecalho-identidade-btn:hover,
#cabecalhoPrincipal .cabecalho-identidade.aberto .cabecalho-identidade-btn {
    background: rgba(255,255,255,.11);
    border-color: rgba(255,255,255,.25);
}

#cabecalhoPrincipal .cabecalho-identidade-avatar {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(56,199,250,.15);
    color: #7DDBFC;
}

#cabecalhoPrincipal .cabecalho-identidade-avatar svg,
#cabecalhoPrincipal .cabecalho-identidade-chevron {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#cabecalhoPrincipal .cabecalho-identidade-texto {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
}

#cabecalhoPrincipal .cabecalho-identidade-texto strong {
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cabecalhoPrincipal .cabecalho-sessao-linha {
    display: block;
    width: 100%;
    height: 1px;
    margin: 1px 0;
    background: linear-gradient(90deg, rgba(70,195,241,.45), rgba(255,255,255,.04));
}

#cabecalhoPrincipal .cabecalho-identidade-texto small {
    color: rgba(255,255,255,.57);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .02em;
    white-space: nowrap;
}

#cabecalhoPrincipal .cabecalho-identidade-texto small.sessao-alerta {
    color: #FFE94A;
}

#cabecalhoPrincipal .cabecalho-identidade-texto small.sessao-critica {
    color: #FF8085;
}

#cabecalhoPrincipal .cabecalho-identidade-chevron {
    width: 13px;
    height: 13px;
    transition: transform .18s ease;
}

#cabecalhoPrincipal .cabecalho-identidade.aberto .cabecalho-identidade-chevron {
    transform: rotate(90deg);
}

#cabecalhoPrincipal .menu-usuario-opcoes {
    top: calc(100% + 8px);
    min-width: 205px;
    border-radius: 12px;
    border-color: var(--iecjs-borda);
    background: var(--iecjs-superficie);
    color: var(--iecjs-texto);
    box-shadow: var(--iecjs-sombra);
}

#cabecalhoPrincipal .cabecalho-identidade.aberto .menu-usuario-opcoes,
#cabecalhoPrincipal .cabecalho-identidade:focus-within .menu-usuario-opcoes {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#cabecalhoPrincipal .menu-usuario-opcoes a,
#cabecalhoPrincipal .menu-usuario-opcoes button {
    color: var(--iecjs-texto);
}

#cabecalhoPrincipal .menu-usuario-opcoes a:hover,
#cabecalhoPrincipal .menu-usuario-opcoes button:hover {
    background: var(--iecjs-superficie-2);
}

#cabecalhoPrincipal .menu-usuario-opcoes .opcao-sair {
    color: var(--iecjs-vermelho);
    border-top-color: var(--iecjs-borda);
}

#cabecalhoPrincipal[data-contexto="publico"] .cabecalho-sessao-linha,
#cabecalhoPrincipal[data-contexto="publico"] #tempoSessaoCabecalho {
    display: none;
}

#cabecalhoPrincipal[data-contexto="publico"] .cabecalho-identidade-btn {
    min-width: 150px;
    height: 40px;
    grid-template-columns: 28px minmax(0, 1fr) 12px;
}

#cabecalhoPrincipal[data-contexto="publico"] .cabecalho-identidade-avatar {
    width: 28px;
    height: 28px;
}

/* =========================================================
   SIDEBAR DO PORTAL
========================================================= */

.portal-sidebar[hidden],
.portal-sidebar-backdrop[hidden] {
    display: none !important;
}

.portal-sidebar {
    position: fixed;
    top: var(--iecjs-topbar-altura);
    bottom: 0;
    left: 0;
    z-index: 4200;
    width: var(--iecjs-sidebar-largura);
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: linear-gradient(180deg, var(--iecjs-sidebar) 0%, #0B1F30 100%);
    color: #fff;
    border-right: 1px solid rgba(255,255,255,.055);
    box-shadow: 8px 0 28px rgba(3,16,27,.08);
    transition: width .22s ease, transform .22s ease;
}

html[data-theme="dark"] .portal-sidebar {
    background: linear-gradient(180deg, #071019 0%, #091722 100%);
}

.portal-sidebar-topo {
    display: grid;
    gap: 2px;
    padding: 18px 19px 13px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    white-space: nowrap;
    overflow: hidden;
}

.portal-sidebar-topo span {
    color: rgba(255,255,255,.43);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.portal-sidebar-topo strong {
    color: rgba(255,255,255,.92);
    font-size: 13px;
    font-weight: 750;
}

.portal-sidebar-nav {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: visible;
    padding: 10px 9px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.14) transparent;
}

.portal-menu,
.portal-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.portal-menu-secao {
    padding: 14px 11px 6px;
    color: rgba(255,255,255,.35);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-menu-item,
.portal-menu-grupo {
    position: relative;
    margin: 2px 0;
}

.portal-nav-link,
.portal-grupo-toggle {
    position: relative;
    width: 100%;
    min-height: 44px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: rgba(255,255,255,.72);
    font: inherit;
    font-size: 12px;
    font-weight: 680;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .17s ease, color .17s ease, transform .17s ease;
}

.portal-nav-link > svg,
.portal-grupo-toggle > svg:first-child {
    width: 19px;
    height: 19px;
    justify-self: center;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-nav-link:hover,
.portal-grupo-toggle:hover {
    background: var(--iecjs-sidebar-hover);
    color: #fff;
}

.portal-nav-link.ativo,
.portal-submenu a.ativo {
    background: var(--iecjs-sidebar-ativo);
    color: #74D9FC;
    box-shadow: inset 3px 0 0 var(--iecjs-azul);
}

.portal-nav-link.ativo::before {
    content: "";
    position: absolute;
    right: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--iecjs-azul);
    box-shadow: 0 0 10px rgba(56,199,250,.7);
}

.portal-grupo-chevron {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: transform .18s ease;
}

.portal-menu-grupo.aberto .portal-grupo-chevron {
    transform: rotate(90deg);
}

.portal-submenu {
    display: grid;
    gap: 2px;
    padding: 4px 0 5px 34px;
}

.portal-submenu[hidden] {
    display: none !important;
}

.portal-submenu a {
    display: block;
    padding: 9px 11px;
    border-radius: 9px;
    color: rgba(255,255,255,.59);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
}

.portal-submenu a:hover {
    background: rgba(255,255,255,.055);
    color: #fff;
}

.portal-sidebar-rodape {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,.07);
    color: rgba(255,255,255,.42);
    white-space: nowrap;
    overflow: hidden;
}

.portal-sidebar-rodape svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-sidebar-rodape span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

/* Ao Vivo dentro da nova navegação */
.portal-sidebar .navegacao-ao-vivo {
    display: grid;
}

.portal-sidebar .ao-vivo-menu-ponto {
    position: absolute;
    right: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}

.portal-sidebar .navegacao-ao-vivo.transmissao-ativa {
    color: #FF7B80;
    background: rgba(255,81,88,.10);
}

.portal-sidebar .navegacao-ao-vivo.transmissao-ativa .ao-vivo-menu-ponto {
    width: 8px;
    height: 8px;
    background: #FF5158;
    animation: iecjsShellLivePulse 1.35s ease-out infinite;
}

@keyframes iecjsShellLivePulse {
    0% { box-shadow: 0 0 0 0 rgba(255,81,88,.52); }
    70% { box-shadow: 0 0 0 7px rgba(255,81,88,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,81,88,0); }
}

/* Garante a paleta do shell mesmo nas páginas antigas em que index.css
   é carregado depois do cabeçalho. */
.portal-sidebar a.portal-nav-link,
.portal-sidebar button.portal-grupo-toggle {
    color: rgba(255,255,255,.72);
}

.portal-sidebar a.portal-nav-link:hover,
.portal-sidebar button.portal-grupo-toggle:hover {
    color: #fff;
}

.portal-sidebar a.portal-nav-link.ativo,
.portal-sidebar .portal-submenu a.ativo {
    color: #74D9FC;
}

/* =========================================================
   SIDEBAR RECOLHIDA
========================================================= */

html.iecjs-sidebar-recolhida .portal-sidebar {
    width: var(--iecjs-sidebar-recolhida);
}

html.iecjs-sidebar-recolhida .portal-sidebar-topo,
html.iecjs-sidebar-recolhida .portal-menu-secao,
html.iecjs-sidebar-recolhida .portal-sidebar-rodape span,
html.iecjs-sidebar-recolhida .portal-nav-link > span,
html.iecjs-sidebar-recolhida .portal-grupo-toggle > span,
html.iecjs-sidebar-recolhida .portal-grupo-chevron,
html.iecjs-sidebar-recolhida .portal-nav-link.ativo::before {
    display: none;
}

html.iecjs-sidebar-recolhida .portal-sidebar-topo {
    min-height: 12px;
    padding: 6px 0;
    border: 0;
}

html.iecjs-sidebar-recolhida .portal-sidebar-nav {
    padding: 8px;
}

html.iecjs-sidebar-recolhida .portal-nav-link,
html.iecjs-sidebar-recolhida .portal-grupo-toggle {
    min-height: 46px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 9px;
}

html.iecjs-sidebar-recolhida .portal-nav-link.ativo {
    box-shadow: none;
}

html.iecjs-sidebar-recolhida .portal-sidebar-rodape {
    justify-content: center;
    padding: 10px;
}

html.iecjs-sidebar-recolhida .portal-submenu.portal-submenu-flyout {
    position: fixed;
    left: calc(var(--iecjs-sidebar-recolhida) + 9px);
    z-index: 4700;
    width: 225px;
    max-height: min(430px, calc(100vh - 110px));
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: #102536;
    box-shadow: 0 18px 42px rgba(0,0,0,.28);
}

html.iecjs-sidebar-recolhida .portal-submenu.portal-submenu-flyout::before {
    content: attr(data-title);
    display: block;
    padding: 6px 8px 8px;
    color: rgba(255,255,255,.42);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

html.iecjs-sidebar-recolhida .portal-submenu.portal-submenu-flyout a {
    color: rgba(255,255,255,.74);
}

/* tooltip dos ícones */
html.iecjs-sidebar-recolhida .portal-nav-link:hover::after,
html.iecjs-sidebar-recolhida .portal-grupo-toggle:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 13px);
    top: 50%;
    z-index: 4800;
    transform: translateY(-50%);
    padding: 7px 9px;
    border-radius: 8px;
    background: #071019;
    color: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,.24);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

/* =========================================================
   DARK — PAINÉIS DO CABEÇALHO
========================================================= */

html[data-theme="dark"] #cabecalhoPrincipal .notificacoes-painel,
html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-item {
    background: var(--iecjs-superficie);
    color: var(--iecjs-texto);
    border-color: var(--iecjs-borda);
}

html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-item:hover,
html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-item.nao-lida {
    background: var(--iecjs-superficie-2);
}

html[data-theme="dark"] #cabecalhoPrincipal .notificacoes-painel-topo,
html[data-theme="dark"] #cabecalhoPrincipal .notificacoes-painel-rodape,
html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-item {
    border-color: var(--iecjs-borda);
}

html[data-theme="dark"] #cabecalhoPrincipal .notificacoes-painel-topo strong,
html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-conteudo strong {
    color: var(--iecjs-texto);
}

html[data-theme="dark"] #cabecalhoPrincipal .notificacoes-painel-topo span,
html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-conteudo p,
html[data-theme="dark"] #cabecalhoPrincipal .notificacao-cabecalho-conteudo time {
    color: var(--iecjs-texto-secundario);
}

/* =========================================================
   MOBILE / TABLET
========================================================= */

.portal-sidebar-backdrop {
    position: fixed;
    inset: var(--iecjs-topbar-altura) 0 0 0;
    z-index: 4100;
    border: 0;
    background: rgba(3,13,21,.55);
    backdrop-filter: blur(2px);
}

@media (max-width: 1120px) {
    #cabecalhoPrincipal .cabecalho-centro strong {
        max-width: 260px;
    }

    #cabecalhoPrincipal .cabecalho-identidade-btn {
        min-width: 158px;
        max-width: 190px;
    }

    #cabecalhoPrincipal .cabecalho-contexto-atual {
        display: none;
    }
}

@media (max-width: 980px) {
    html.iecjs-contexto-interno body,
    html.iecjs-contexto-interno.iecjs-sidebar-recolhida body {
        padding-left: 0;
    }

    .portal-sidebar,
    html.iecjs-sidebar-recolhida .portal-sidebar {
        width: min(286px, 86vw);
        transform: translateX(-104%);
        box-shadow: 18px 0 44px rgba(0,0,0,.28);
    }

    html.iecjs-sidebar-aberta .portal-sidebar {
        transform: translateX(0);
    }

    html.iecjs-sidebar-recolhida .portal-sidebar-topo,
    html.iecjs-sidebar-recolhida .portal-menu-secao,
    html.iecjs-sidebar-recolhida .portal-sidebar-rodape span,
    html.iecjs-sidebar-recolhida .portal-nav-link > span,
    html.iecjs-sidebar-recolhida .portal-grupo-toggle > span,
    html.iecjs-sidebar-recolhida .portal-grupo-chevron {
        display: initial;
    }

    html.iecjs-sidebar-recolhida .portal-sidebar-topo {
        display: grid;
        min-height: initial;
        padding: 18px 19px 13px;
        border-bottom: 1px solid rgba(255,255,255,.07);
    }

    html.iecjs-sidebar-recolhida .portal-sidebar-nav {
        padding: 10px 9px 14px;
    }

    html.iecjs-sidebar-recolhida .portal-nav-link,
    html.iecjs-sidebar-recolhida .portal-grupo-toggle {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        justify-items: initial;
        padding: 8px 11px;
    }

    html.iecjs-sidebar-recolhida .portal-sidebar-rodape {
        justify-content: flex-start;
        padding: 10px 20px;
    }

    html.iecjs-sidebar-recolhida .portal-submenu.portal-submenu-flyout {
        position: static;
        width: auto;
        max-height: none;
        padding: 4px 0 5px 34px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    html.iecjs-sidebar-recolhida .portal-submenu.portal-submenu-flyout::before {
        display: none;
    }

    html.iecjs-sidebar-recolhida .portal-nav-link:hover::after,
    html.iecjs-sidebar-recolhida .portal-grupo-toggle:hover::after {
        display: none;
    }

    #cabecalhoPrincipal .cabecalho-centro {
        justify-items: start;
        text-align: left;
    }

    #cabecalhoPrincipal .cabecalho-centro span {
        display: none;
    }
}

@media (max-width: 760px) {
    :root {
        --iecjs-topbar-altura: 64px;
    }

    #cabecalhoPrincipal.iecjs-topbar {
        height: var(--iecjs-topbar-altura);
        min-height: var(--iecjs-topbar-altura);
        flex-wrap: nowrap;
        gap: 7px;
        padding: 7px 10px;
    }

    #cabecalhoPrincipal .cabecalho-logo-link {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 11px;
    }

    #cabecalhoPrincipal .logo {
        width: 36px;
        height: 36px;
    }

    #cabecalhoPrincipal .cabecalho-menu-toggle,
    #cabecalhoPrincipal .cabecalho-icone-btn,
    #cabecalhoPrincipal .btn-notificacoes {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    #cabecalhoPrincipal .cabecalho-centro {
        min-width: 0;
        flex: 1 1 auto;
    }

    #cabecalhoPrincipal .cabecalho-centro strong {
        max-width: 34vw;
        font-size: 12px;
    }

    #cabecalhoPrincipal .cabecalho-contexto-switch {
        display: none;
    }

    #cabecalhoPrincipal .cabecalho-identidade-btn {
        min-width: 38px;
        width: 38px;
        height: 38px;
        display: flex;
        justify-content: center;
        padding: 4px;
        border-radius: 11px;
    }

    #cabecalhoPrincipal .cabecalho-identidade-texto,
    #cabecalhoPrincipal .cabecalho-identidade-chevron {
        display: none;
    }

    #cabecalhoPrincipal .cabecalho-identidade-avatar {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    #cabecalhoPrincipal .menu-usuario-opcoes {
        position: fixed;
        top: calc(var(--iecjs-topbar-altura) - 1px);
        right: 10px;
        min-width: 205px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-nav {
        order: initial;
        width: auto;
        flex-basis: auto;
        overflow-x: auto;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico {
        gap: 14px;
        margin-left: 2px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico .item-menu:nth-child(n+4) {
        display: none;
    }
}

@media (max-width: 500px) {
    #cabecalhoPrincipal .cabecalho-centro {
        display: none;
    }

    #cabecalhoPrincipal .cabecalho-acoes {
        margin-left: auto;
        gap: 6px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico .item-menu:nth-child(n+3) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.iecjs-contexto-interno body,
    .portal-sidebar,
    .portal-nav-link,
    .portal-grupo-toggle,
    #cabecalhoPrincipal .cabecalho-identidade-chevron {
        transition: none;
    }

    .portal-sidebar .navegacao-ao-vivo.transmissao-ativa .ao-vivo-menu-ponto {
        animation: none;
    }
}

/* =========================================================
   E7.4A2 — refinamentos da navegação
   - sidebar recolhida sem rolagem horizontal
   - tooltips fora do fluxo/scroll
   - submenus controlados somente por interação do usuário
========================================================= */

.portal-sidebar-nav,
.portal-menu {
    min-width: 0;
}

.portal-sidebar-nav {
    overflow-x: hidden;
}

.portal-nav-link,
.portal-grupo-toggle {
    min-width: 0;
    max-width: 100%;
}

.portal-nav-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: min(260px, calc(100vw - 24px));
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 9px;
    background: #071019;
    color: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,.28);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
    white-space: nowrap;
    pointer-events: none;
}

.portal-nav-tooltip[hidden] {
    display: none !important;
}

/* Desativa o tooltip pseudo-elemento antigo: agora o tooltip é anexado ao body
   e não é cortado pelo container rolável da sidebar. */
html.iecjs-sidebar-recolhida .portal-nav-link:hover::after,
html.iecjs-sidebar-recolhida .portal-grupo-toggle:hover::after {
    display: none !important;
    content: none !important;
}

html.iecjs-sidebar-recolhida .portal-sidebar-nav {
    overflow-x: hidden !important;
}

html.iecjs-sidebar-recolhida .portal-menu,
html.iecjs-sidebar-recolhida .portal-menu-item,
html.iecjs-sidebar-recolhida .portal-menu-grupo {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

html.iecjs-sidebar-recolhida .portal-nav-link,
html.iecjs-sidebar-recolhida .portal-grupo-toggle {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

html.iecjs-sidebar-recolhida .portal-nav-link > span,
html.iecjs-sidebar-recolhida .portal-grupo-toggle > span,
html.iecjs-sidebar-recolhida .portal-grupo-chevron {
    display: none !important;
}

html.iecjs-sidebar-recolhida .portal-nav-link > svg,
html.iecjs-sidebar-recolhida .portal-grupo-toggle > svg:first-child {
    margin: 0;
    justify-self: center;
}

/* Não há mais ícone decorativo sem ação no rodapé. */
.portal-sidebar-rodape {
    display: none !important;
}

/* =========================================================
   E7.5A — SHELL RESPONSIVO / SAFE AREA
========================================================= */
@media (max-width: 760px) {
    :root {
        --iecjs-topbar-altura: 68px;
    }

    #cabecalhoPrincipal.iecjs-topbar {
        padding-top: max(7px, env(safe-area-inset-top));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    #cabecalhoPrincipal .cabecalho-menu-toggle,
    #cabecalhoPrincipal .cabecalho-icone-btn,
    #cabecalhoPrincipal .btn-notificacoes,
    #cabecalhoPrincipal .cabecalho-identidade-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    #cabecalhoPrincipal .cabecalho-logo-link {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    #cabecalhoPrincipal .logo {
        width: 38px;
        height: 38px;
    }

    .portal-sidebar,
    html.iecjs-sidebar-recolhida .portal-sidebar {
        width: min(304px, 88vw);
        max-width: calc(100vw - 36px);
    }

    .portal-sidebar-nav {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .portal-nav-link,
    .portal-grupo-toggle {
        min-height: 46px;
    }

    #cabecalhoPrincipal .menu-usuario-opcoes {
        right: max(8px, env(safe-area-inset-right));
        max-width: calc(100vw - 16px);
    }
}

@media (max-width: 430px) {
    #cabecalhoPrincipal.iecjs-topbar {
        gap: 5px;
        padding-inline: 7px;
    }

    #cabecalhoPrincipal .cabecalho-acoes {
        gap: 5px;
    }

    #cabecalhoPrincipal .cabecalho-menu-toggle,
    #cabecalhoPrincipal .cabecalho-icone-btn,
    #cabecalhoPrincipal .btn-notificacoes,
    #cabecalhoPrincipal .cabecalho-identidade-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }

    #cabecalhoPrincipal .cabecalho-logo-link {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    #cabecalhoPrincipal .logo {
        width: 36px;
        height: 36px;
    }
}

/* =========================================================
   E7.5B — NAVEGAÇÃO PÚBLICA MOBILE
   Todos os destinos públicos permanecem acessíveis sem
   transformar a barra superior em uma fileira espremida.
========================================================= */
@media (max-width: 760px) {
    #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-menu-toggle {
        display: inline-flex;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-nav {
        position: fixed;
        top: calc(var(--iecjs-topbar-altura) + max(8px, env(safe-area-inset-top)));
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        z-index: 4900;
        width: auto;
        max-height: calc(100dvh - var(--iecjs-topbar-altura) - 26px);
        display: none;
        overflow: auto;
        padding: 10px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 15px;
        background: linear-gradient(160deg, #0D2538 0%, #123A55 100%);
        box-shadow: 0 22px 50px rgba(0,0,0,.28);
    }

    html.iecjs-menu-publico-aberto #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-nav {
        display: block;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico {
        width: 100%;
        display: grid;
        gap: 3px;
        margin: 0;
        padding: 0;
        white-space: normal;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico .item-menu,
    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico .item-menu:nth-child(n+3),
    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico .item-menu:nth-child(n+4) {
        display: block;
        width: 100%;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico a {
        min-height: 46px;
        display: flex;
        align-items: center;
        padding: 0 13px;
        border-radius: 10px;
        color: rgba(255,255,255,.84);
        font-size: 14px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico a:hover,
    #cabecalhoPrincipal[data-contexto="publico"] .menu-publico a.ativo {
        background: rgba(56,199,250,.12);
        color: #fff;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-contexto-switch {
        display: inline-flex;
        min-height: 42px;
        padding: 2px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-contexto-atual {
        display: none;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .btn-contexto {
        min-height: 36px;
        padding-inline: 10px;
        font-size: 10px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .btn-area-membro {
        background: rgba(255,255,255,.96);
        color: #17324A;
    }
}

@media (max-width: 430px) {
    #cabecalhoPrincipal[data-contexto="publico"] .cabecalho-contexto-switch {
        max-width: 104px;
    }

    #cabecalhoPrincipal[data-contexto="publico"] .btn-contexto {
        max-width: 98px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
