/* Portal do fundo (marca JáCredita, sem white label). Tokens e blocos comuns vêm do jacredita.css (carregado antes, cópia igual à
   dos outros portais); aqui só o que é deste portal: o menu lateral escuro (como o do portal interno), o topo com o seletor de
   fundo e o aviso de reconexão (sem CSS isolado). */

/* ---------- Estrutura: menu lateral escuro ---------- */
.portal { display: flex; min-height: 100vh; }
.menu {
    width: 228px; flex-shrink: 0; background: var(--panel); color: var(--panel-ink);
    padding: 1.1rem .65rem 1.5rem; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.menu .marca { color: #fff; padding: 0 .5rem; font-size: 1.1rem; }
.menu .sistema {
    font-size: .6rem; font-weight: 500; line-height: 1; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
    padding: .7rem .5rem 1rem; border-bottom: 1px solid var(--panel-line); margin-bottom: .75rem;
}
.menu-corpo { display: flex; flex-direction: column; flex: 1; }
.menu nav { display: flex; flex-direction: column; gap: 2px; }
.menu nav a { display: flex; align-items: center; gap: 9px; color: var(--panel-ink); font-weight: 500; font-size: .93rem; padding: .45rem .55rem; border-radius: 9px; }
.menu nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.menu nav a.active { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; }
.menu nav a.active::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.menu-rodape { margin-top: auto; padding: 1rem .5rem 0; border-top: 1px solid var(--panel-line); font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.menu-rodape strong { color: #fff; display: block; }
.menu-rodape .links-conta { display: inline-flex; gap: .9rem; margin-top: .35rem; }
.menu-rodape a { color: #fff; }
.alternar-menu { display: none; align-items: center; gap: .35rem; background: transparent; color: #fff; border-color: var(--panel-line); }
.alternar-menu:hover { background: rgba(255, 255, 255, .08); }
svg.icone { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.conteudo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topo { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .6rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.topo .fundo-atual { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; }
.topo .fundo-atual label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.topo .fundo-atual select { max-width: 100%; }
.topo .fundo-nome { font-weight: 700; }
.topo .usuario { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.avatar:empty { display: none; }
main { padding: 1.5rem 1.75rem 3rem; width: 100%; max-width: 1280px; }
.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; }

/* ---------- Telas ---------- */
.cabecalho-operacao { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-bottom: 1rem; }
.cabecalho-operacao div { display: flex; flex-direction: column; }
.cabecalho-operacao dt { color: var(--muted); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }
.cabecalho-operacao dd { margin: 0; font-weight: 600; }
.vinculos { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.fundos-novo { display: flex; flex-wrap: wrap; gap: .25rem 1rem; border: 1px solid var(--line); border-radius: var(--r-controle); padding: .35rem .75rem; margin: 0; }
.fundos-novo legend { font-weight: 500; padding: 0 .25rem; }
.fundos-novo label { flex-direction: row; align-items: center; gap: .35rem; font-weight: 400; }
.filtros label.caixa { flex-direction: row; align-items: center; gap: .4rem; }
.tabela tr.riscado td { text-decoration: line-through; color: var(--muted); }

@media (max-width: 800px) {
    /* Celular: o menu vira uma barra no topo com o botão "Menu", que abre a lista. */
    .portal { flex-direction: column; }
    .menu { width: 100%; height: auto; position: static; padding: .6rem 1rem; }
    .menu .sistema { display: none; }
    .alternar-menu { display: inline-flex; }
    .menu-corpo { display: none; padding-top: .75rem; }
    .menu-aberto .menu-corpo { display: flex; }
    .topo { padding: .6rem 1rem; }
    main { padding: 1rem 1rem 2.5rem; }
}

/* ---------- Reconexão do circuito e erro do Blazor ---------- */
.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal {
    background-color: var(--bg);
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
}

#components-reconnect-modal::backdrop { background-color: rgba(0, 0, 0, 0.4); }

.components-reconnect-container { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
#components-reconnect-modal p { margin: 0; text-align: center; }
#components-reconnect-modal button { border: 0; background-color: var(--brand); color: white; padding: 4px 24px; border-radius: var(--r-controle); }
#components-reconnect-modal button:hover { background-color: var(--brand-900); }

.components-rejoining-animation { position: relative; width: 80px; height: 80px; }
.components-rejoining-animation div {
    position: absolute; border: 3px solid var(--accent); opacity: 1; border-radius: 50%;
    animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.components-rejoining-animation div:nth-child(2) { animation-delay: -0.5s; }

@keyframes components-rejoining-animation {
    0% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    4.9% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    5% { top: 40px; left: 40px; width: 0; height: 0; opacity: 1; }
    100% { top: 0px; left: 0px; width: 80px; height: 80px; opacity: 0; }
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--accent-50);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
