/*
 * Topo do sistema (barra.php), no desenho da área logada do cadastro_colaborador_v2: faixa no azul da
 * marca, fonte Inter, submenus em cartão branco. Serve às telas legadas (Bootstrap 3, estilos.css) e ao
 * usuario_v2 (Bootstrap 4), por isso tudo fica sob .ts-topo, com as próprias variáveis e com os valores
 * que os Bootstraps mudam (fonte, margens, links, box-sizing) definidos aqui. Medidas em px: o
 * Bootstrap 3 muda o tamanho do rem (html em 10px).
 *
 * .ts-fixo: position fixed, como a navbar antiga, para as telas legadas, que já reservam o espaço do topo
 * (padding do signin.css e <br> do topo_1.php). Sem ela, a faixa é sticky e ocupa o próprio espaço.
 * Pontos de quebra: 1439.98px (menu recolhido no botão "Menu") e 575.98px (celular).
 */
.ts-topo {
    --ts-branco: #ffffff;
    --ts-marca: #271d67;
    --ts-marca-fundo: #f1f0f8;
    --ts-magenta-claro: #e3bcd9;
    --ts-texto: rgba(255, 255, 255, .9);
    --ts-texto-suave: rgba(255, 255, 255, .6);
    --ts-separador: rgba(255, 255, 255, .25);
    --ts-fundo-item: rgba(255, 255, 255, .12);
    --ts-foco: rgba(255, 255, 255, .5);
    --ts-submenu-texto: #1f2333;
    --ts-submenu-texto-suave: #7d7b8e;
    --ts-submenu-borda: #e6e5ec;
    --ts-submenu-divisoria: #f0eff4;
    --ts-sombra: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);
    --ts-raio: 8px;
    --ts-altura: 60px;

    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 16px;
    height: var(--ts-altura); margin: 0; padding: 0 40px; background: var(--ts-marca);
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.5;
    text-align: left;
}
.ts-topo *, .ts-topo *::before, .ts-topo *::after { box-sizing: border-box; }
.ts-topo [hidden] { display: none !important; }
.ts-fixo { position: fixed; left: 0; right: 0; }

.ts-marcas { display: flex; align-items: center; gap: 20px; flex-shrink: 0; text-decoration: none; }
.ts-marcas:hover, .ts-marcas:focus { text-decoration: none; }
.ts-logo { display: block; height: 30px; width: auto; max-width: none; border: 0; filter: brightness(0) invert(1); }
.ts-portal {
    padding-left: 20px; border-left: 1px solid var(--ts-separador); white-space: nowrap;
    font-size: 15px; font-weight: 600; color: var(--ts-branco);
}

.ts-navegacao { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.ts-menu { display: flex; align-items: center; gap: 2px; margin-left: 16px; }
.ts-grupo { position: relative; display: block; margin: 0; }
.ts-item {
    display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: var(--ts-raio);
    white-space: nowrap; list-style: none; cursor: pointer; user-select: none;
    font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--ts-texto); text-decoration: none;
}
.ts-item::-webkit-details-marker { display: none; }
.ts-item::marker { content: ''; }
.ts-item:hover, .ts-item:focus, .ts-grupo[open] > .ts-item { background: var(--ts-fundo-item); color: var(--ts-branco); text-decoration: none; }
.ts-item:focus { outline: none; }
.ts-item:focus-visible { box-shadow: 0 0 0 2px var(--ts-foco); }
.ts-atual { color: var(--ts-branco); box-shadow: inset 0 -2px 0 var(--ts-magenta-claro); border-radius: var(--ts-raio) var(--ts-raio) 0 0; }
.ts-seta {
    width: 6.4px; height: 6.4px; margin-top: -3.2px;
    border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s;
}
.ts-grupo[open] .ts-seta { margin-top: 3.2px; transform: rotate(-135deg); }

.ts-submenu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 1;
    min-width: 240px; max-height: calc(100vh - var(--ts-altura) - 16px); overflow-y: auto; padding: 6px;
    background: var(--ts-branco); border: 1px solid var(--ts-submenu-borda); border-radius: 10px; box-shadow: var(--ts-sombra);
}
.ts-conta .ts-submenu { left: auto; right: 0; min-width: 192px; }
.ts-secao + .ts-secao { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ts-submenu-divisoria); }
.ts-secao-titulo {
    margin: 0; padding: 8px 12px 4px;
    font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; text-transform: uppercase;
    color: var(--ts-submenu-texto-suave);
}
.ts-lista { margin: 0; padding: 0; list-style: none; }
.ts-subitem {
    display: block; padding: 8px 12px; border-radius: 6px; white-space: nowrap;
    font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--ts-submenu-texto); text-decoration: none;
}
.ts-subitem:hover, .ts-subitem:focus { background: var(--ts-marca-fundo); color: var(--ts-marca); text-decoration: none; outline: none; }
.ts-subitem-atual { background: var(--ts-marca-fundo); color: var(--ts-marca); font-weight: 600; }

.ts-iniciais {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%; background: var(--ts-fundo-item);
    font-size: 11px; font-weight: 600; color: var(--ts-branco);
}
.ts-nome { max-width: 224px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }

.ts-alternar {
    display: none; align-items: center; gap: 8px; margin: 0 0 0 auto; padding: 6px 12px;
    background: transparent; border: 1px solid var(--ts-separador); border-radius: var(--ts-raio);
    font: inherit; font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--ts-branco); cursor: pointer;
}
.ts-alternar:hover, .ts-alternar[aria-expanded="true"] { background: var(--ts-fundo-item); }
.ts-alternar-icone, .ts-alternar-icone::before, .ts-alternar-icone::after {
    display: block; width: 16px; height: 2px; border-radius: 1px; background: currentColor;
}
.ts-alternar-icone { position: relative; }
.ts-alternar-icone::before, .ts-alternar-icone::after { content: ''; position: absolute; left: 0; }
.ts-alternar-icone::before { top: -5px; }
.ts-alternar-icone::after { top: 5px; }

@media (max-width: 1439.98px) {
    .ts-topo { flex-wrap: wrap; height: auto; min-height: var(--ts-altura); padding: 10px 16px; row-gap: 10px; }
    .ts-logo { height: 25.6px; }
    .ts-alternar { display: inline-flex; }
    .ts-topo[data-ts-recolhido] .ts-navegacao { display: none; }
    .ts-navegacao {
        flex: 1 0 100%; flex-direction: column; align-items: stretch; gap: 4px;
        max-height: calc(100vh - var(--ts-altura)); overflow-y: auto; padding-top: 10px; border-top: 1px solid var(--ts-separador);
    }
    .ts-menu { flex-direction: column; align-items: stretch; gap: 2px; margin: 0; }
    .ts-item { justify-content: space-between; padding: 10px 12px; }
    .ts-atual { box-shadow: inset 2px 0 0 var(--ts-magenta-claro); border-radius: 0 var(--ts-raio) var(--ts-raio) 0; }
    .ts-conta { padding-top: 4px; border-top: 1px solid var(--ts-separador); }
    .ts-conta .ts-item { justify-content: flex-start; }
    .ts-conta .ts-seta { margin-left: auto; }
    .ts-nome { max-width: none; }
    .ts-submenu, .ts-conta .ts-submenu {
        position: static; min-width: 0; max-height: none; overflow: visible; padding: 0 0 6px 16px;
        background: transparent; border: 0; border-radius: 0; box-shadow: none;
    }
    .ts-secao + .ts-secao { border-top-color: var(--ts-separador); }
    .ts-secao-titulo { color: var(--ts-texto-suave); }
    .ts-subitem { color: var(--ts-texto); white-space: normal; }
    .ts-subitem:hover, .ts-subitem:focus, .ts-subitem-atual { background: var(--ts-fundo-item); color: var(--ts-branco); }
}

@media (max-width: 575.98px) {
    .ts-marcas { gap: 12px; }
    .ts-portal { max-width: 104px; padding-left: 12px; white-space: normal; font-size: 12px; line-height: 1.2; }
    .ts-alternar { padding: 8px 10px; }
    .ts-alternar-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
