/* =========================================================
   SIGTAP FollowingStar — estilos
   ========================================================= */
:root {
    --fundo:        #0d1117;
    --fundo-2:      #131a24;
    --cartao:       #161d29;
    --cartao-2:     #1c2533;
    --borda:        #263041;
    --texto:        #e6edf5;
    --texto-suave:  #8fa0b8;
    --primaria:     #2ea3a5;
    --primaria-2:   #38c6c8;
    --destaque:     #f0a02e;
    --perigo:       #e05561;
    --ok:           #3fb950;
    --sombra:       0 10px 30px rgba(0,0,0,.35);
    --raio:         12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a { color: var(--primaria-2); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .6rem; font-weight: 600; }

.texto-suave { color: var(--texto-suave); font-size: .88rem; }

/* ---------------- Botões ---------------- */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    border: 1px solid transparent; border-radius: 9px;
    padding: .58rem 1rem; font-size: .9rem; font-weight: 600;
    cursor: pointer; transition: .15s; text-decoration: none;
    font-family: inherit;
}
.btn-primario { background: var(--primaria); color: #fff; }
.btn-primario:hover { background: var(--primaria-2); }
.btn-secundario { background: #3a4a63; color: #fff; }
.btn-secundario:hover { background: #46587a; }
.btn-fantasma { background: transparent; color: var(--texto-suave); border-color: var(--borda); }
.btn-fantasma:hover { color: var(--texto); border-color: var(--primaria); }
.btn-perigo { background: transparent; color: var(--perigo); border-color: #43242a; }
.btn-perigo:hover { background: #2a1a1d; }
.btn-mini { padding: .28rem .6rem; font-size: .76rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.largura-total { width: 100%; justify-content: center; margin-top: .4rem; }

/* ---------------- Campos ---------------- */
input[type=text], input[type=password], input[type=tel], input[type=search],
input[type=date], select, textarea {
    width: 100%;
    background: var(--fundo-2);
    border: 1px solid var(--borda);
    border-radius: 9px;
    color: var(--texto);
    padding: .6rem .75rem;
    font-size: .92rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--primaria); }
input::placeholder { color: #5f7188; }
label { display: block; font-size: .82rem; color: var(--texto-suave); margin: .8rem 0 .3rem; }

/* ---------------- Alertas ---------------- */
.alerta-erro, .alerta-ok, .aviso {
    border-radius: 9px; padding: .65rem .85rem; font-size: .87rem; margin: .6rem 0;
}
.alerta-erro { background: #2a1a1d; border: 1px solid #4a2830; color: #ff9aa3; }
.alerta-ok   { background: #14261a; border: 1px solid #23492e; color: #7ee08c; }
.aviso       { background: #2a2312; border: 1px solid #4b3d1a; color: #f0c775; }

/* =========================================================
   LOGIN
   ========================================================= */
.tela-login, .tela-simples {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.login-fundo {
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(900px 500px at 12% 10%, rgba(46,163,165,.20), transparent 60%),
        radial-gradient(800px 500px at 88% 88%, rgba(240,160,46,.12), transparent 60%),
        var(--fundo);
}
.login-box {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
    background: var(--cartao);
    border: 1px solid var(--borda);
    border-radius: 16px;
    box-shadow: var(--sombra);
    padding: 2rem 1.8rem 1.4rem;
}
.login-marca { text-align: center; margin-bottom: 1.2rem; }
.estrela { font-size: 2.2rem; color: var(--destaque); line-height: 1; }
.titulo-marca { font-size: 1.45rem; letter-spacing: .5px; }
.titulo-marca span { color: var(--primaria-2); font-weight: 400; }

.abas { display: flex; gap: .4rem; background: var(--fundo-2); padding: .25rem; border-radius: 10px; margin-bottom: .4rem; }
.aba {
    flex: 1; border: 0; background: transparent; color: var(--texto-suave);
    padding: .5rem; border-radius: 8px; cursor: pointer; font-size: .86rem; font-weight: 600; font-family: inherit;
}
.aba.ativa { background: var(--cartao-2); color: var(--texto); }

.painel-aba { display: none; }
.painel-aba.ativo { display: block; }

.campo-senha { position: relative; }
.campo-senha input { padding-right: 2.6rem; }
.olho {
    position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
    background: none; border: 0; cursor: pointer; font-size: 1rem; opacity: .6;
}
.olho:hover { opacity: 1; }

.rodape-login { text-align: center; font-size: .74rem; color: #56677f; margin: 1.2rem 0 0; }

/* Cartão genérico (instalador / importador) */
.cartao {
    background: var(--cartao); border: 1px solid var(--borda);
    border-radius: var(--raio); padding: 1.1rem 1.2rem; box-shadow: var(--sombra);
}
.cartao-largo { width: 100%; max-width: 640px; }
.lista-log { list-style: none; padding: 0; margin: .8rem 0; font-size: .85rem; }
.lista-log li { padding: .3rem 0; border-bottom: 1px solid var(--borda); }
.log-ok::before { content: '✔ '; color: var(--ok); }
.log-erro { color: #ff9aa3; }
.log-erro::before { content: '✖ '; }

/* =========================================================
   APP
   ========================================================= */
.tela-app { min-height: 100vh; background: var(--fundo); }

.topo {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .7rem 1.2rem;
    background: var(--cartao); border-bottom: 1px solid var(--borda);
    position: sticky; top: 0; z-index: 20;
}
.topo-marca { font-size: 1.05rem; letter-spacing: .4px; }
.marca-clara { color: var(--primaria-2); }
.estrela-mini { color: var(--destaque); margin-right: .3rem; }
.topo-acoes { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.usuario-nome { font-size: .85rem; color: var(--texto-suave); }
.badge {
    background: var(--perigo); color: #fff; border-radius: 20px;
    padding: 0 .4rem; font-size: .7rem; font-weight: 700; margin-left: .2rem;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 1rem;
    padding: 1rem 1.2rem 2rem;
    max-width: 1600px; margin: 0 auto;
    align-items: start;
}
.coluna-principal { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

/* ------- Busca ------- */
.tipo-busca { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.chip {
    background: var(--fundo-2); border: 1px solid var(--borda); color: var(--texto-suave);
    padding: .45rem .9rem; border-radius: 20px; cursor: pointer; font-size: .84rem;
    font-weight: 600; font-family: inherit; transition: .15s;
}
.chip.ativo { background: rgba(46,163,165,.15); border-color: var(--primaria); color: var(--primaria-2); }

.linha-busca { display: flex; gap: .5rem; }
.linha-busca input { flex: 1; font-size: 1rem; padding: .7rem .9rem; }
.dica { font-size: .78rem; color: var(--texto-suave); margin: .55rem 0 0; }

/* ------- Resultados ------- */
.cabecalho-resultados {
    display: flex; align-items: center; justify-content: space-between;
    gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem;
}
.cabecalho-resultados h2 { font-size: 1rem; margin: 0; }
.ferramentas-resultado { display: flex; gap: .5rem; flex-wrap: wrap; }
.ferramentas-resultado input[type=search] { width: 230px; }
.ferramentas-resultado select { width: auto; }

.cids-encontrados {
    background: var(--fundo-2); border: 1px solid var(--borda); border-radius: 9px;
    padding: .6rem .75rem; margin-bottom: .8rem; font-size: .82rem;
}
.cids-encontrados .rotulo { color: var(--texto-suave); margin-right: .4rem; }
.tag-cid {
    display: inline-block; background: rgba(240,160,46,.12); border: 1px solid #4b3d1a;
    color: var(--destaque); border-radius: 6px; padding: .12rem .45rem;
    margin: .15rem .25rem .15rem 0; font-size: .76rem;
    max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}

.tabela-rolagem { overflow-x: auto; max-height: 65vh; overflow-y: auto; border-radius: 9px; border: 1px solid var(--borda); }
.tabela { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 640px; }
.tabela thead th {
    position: sticky; top: 0; background: var(--cartao-2); color: var(--texto-suave);
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .6px;
    padding: .6rem .75rem; border-bottom: 1px solid var(--borda); z-index: 1;
}
.tabela tbody tr { border-bottom: 1px solid var(--borda); }
.tabela tbody tr:hover { background: rgba(46,163,165,.05); }
.tabela td { padding: .65rem .75rem; vertical-align: top; }

.col-codigo { width: 120px; }
.link-codigo {
    background: var(--fundo-2); border: 1px solid var(--borda); color: var(--primaria-2);
    font-family: "Consolas", "Courier New", monospace; font-size: .82rem;
    padding: .25rem .45rem; border-radius: 6px; cursor: pointer;
}
.link-codigo:hover { border-color: var(--primaria); }

.nome-proc { font-weight: 600; }
.meta-proc { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .3rem; }
.meta { font-size: .74rem; color: var(--texto-suave); }
.pill { font-size: .7rem; padding: .05rem .4rem; border-radius: 5px; font-weight: 700; }
.pill-A { background: rgba(224,85,97,.15); color: #ff9aa3; }
.pill-M { background: rgba(240,160,46,.15); color: var(--destaque); }
.pill-B { background: rgba(63,185,80,.15); color: var(--ok); }
.pill-N { background: rgba(143,160,184,.12); color: var(--texto-suave); }

.celula-cid {
    margin-top: .35rem; font-size: .74rem; color: var(--destaque);
    font-family: "Consolas", monospace;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.col-valor { text-align: right; width: 190px; }
.valor-total { font-weight: 700; color: var(--ok); }
.valor-detalhe { font-size: .7rem; color: var(--texto-suave); margin-top: .15rem; }

.vazio, .carregando { color: var(--texto-suave); font-size: .88rem; text-align: center; padding: 1.6rem 0; margin: 0; }

/* ------- Histórico ------- */
.coluna-historico { position: sticky; top: 70px; }
.cabecalho-historico { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.cabecalho-historico h2 { font-size: 1rem; margin: 0; }

.filtros-historico { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .7rem; }
.linha-datas { display: flex; gap: .4rem; }
.linha-datas label { flex: 1; margin: 0; font-size: .72rem; }
.linha-datas input { margin-top: .15rem; padding: .4rem .5rem; font-size: .8rem; }
.atalhos-data { display: flex; gap: .3rem; flex-wrap: wrap; }
.mini-chip {
    background: var(--fundo-2); border: 1px solid var(--borda); color: var(--texto-suave);
    border-radius: 15px; padding: .2rem .55rem; font-size: .72rem; cursor: pointer; font-family: inherit;
}
.mini-chip.ativo, .mini-chip:hover { border-color: var(--primaria); color: var(--primaria-2); }

.lista-historico { list-style: none; margin: 0; padding: 0; max-height: 58vh; overflow-y: auto; }
.item-historico {
    position: relative; background: var(--fundo-2); border: 1px solid var(--borda);
    border-radius: 9px; padding: .5rem .6rem; margin-bottom: .4rem; cursor: pointer; transition: .15s;
}
.item-historico:hover { border-color: var(--primaria); background: var(--cartao-2); }
.hist-topo { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.tag { font-size: .62rem; font-weight: 700; padding: .05rem .35rem; border-radius: 4px; letter-spacing: .5px; }
.tag-h-procedimento { background: rgba(46,163,165,.18); color: var(--primaria-2); }
.tag-h-cid { background: rgba(240,160,46,.18); color: var(--destaque); }
.hist-data { font-size: .68rem; color: var(--texto-suave); }
.hist-termo { font-size: .85rem; font-weight: 600; word-break: break-word; padding-right: 1rem; }
.hist-total { font-size: .7rem; color: var(--texto-suave); }
.hist-apagar {
    position: absolute; top: .3rem; right: .35rem;
    background: none; border: 0; color: #556780; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem;
}
.hist-apagar:hover { color: var(--perigo); }

/* ------- Toast ------- */
.toast {
    position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 200%);
    background: var(--cartao-2); border: 1px solid var(--primaria); color: var(--texto);
    padding: .65rem 1.1rem; border-radius: 10px; font-size: .85rem;
    box-shadow: var(--sombra); transition: transform .25s; z-index: 60;
}
.toast.visivel { transform: translate(-50%, 0); }
.toast-erro { border-color: var(--perigo); }

/* ------- Modal de saudação ------- */
.modal-fundo {
    position: fixed; inset: 0; background: rgba(5,8,12,.75); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; z-index: 80;
    animation: aparecer .25s ease;
}
.modal-fundo.fechando { opacity: 0; transition: opacity .25s; }
.modal-saudacao {
    background: linear-gradient(160deg, #24182a, var(--cartao));
    border: 1px solid #4a2f52; border-radius: 18px;
    padding: 2rem 2.4rem; text-align: center; box-shadow: var(--sombra);
    max-width: 90vw; animation: subir .3s ease;
}
.modal-saudacao h2 { font-size: 1.5rem; color: #ffb3d9; margin-bottom: 1.2rem; }
.coracao { font-size: 2.6rem; margin-bottom: .4rem; animation: pulsar 1.4s infinite; }

/* ------- Detalhe do procedimento ------- */
.linha-proc { cursor: pointer; }
.linha-proc:hover .ver-mais { opacity: 1; }
.ver-mais { font-size: .72rem; color: var(--primaria-2); font-weight: 500; opacity: .55; margin-left: .3rem; white-space: nowrap; }

.modal-detalhe {
    position: relative;
    background: var(--cartao); border: 1px solid var(--borda); border-radius: 16px;
    width: min(860px, 94vw); max-height: 90vh; overflow-y: auto;
    padding: 1.4rem 1.6rem 1.2rem; box-shadow: var(--sombra); animation: subir .25s ease;
}
.fechar-detalhe {
    position: absolute; top: .6rem; right: .8rem; background: none; border: 0;
    color: var(--texto-suave); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.fechar-detalhe:hover { color: var(--texto); }
.det-cabecalho { padding-right: 2rem; margin-bottom: 1rem; }
.det-codigo { font-family: Consolas, monospace; color: var(--primaria-2); font-size: .95rem; letter-spacing: .5px; }
.det-cabecalho h2 { font-size: 1.2rem; margin: .2rem 0 .4rem; }
.det-secao { border-top: 1px solid var(--borda); padding: .9rem 0 .4rem; }
.det-secao h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .7px; color: var(--texto-suave); margin-bottom: .6rem; }
.det-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .5rem .9rem; }
.det-campo { background: var(--fundo-2); border: 1px solid var(--borda); border-radius: 8px; padding: .45rem .65rem; }
.det-rotulo { display: block; font-size: .7rem; color: var(--texto-suave); }
.det-valor { font-size: .9rem; }
.det-valores .det-valor { font-family: Consolas, monospace; }
.det-cids-topo { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.det-cids-topo input { width: 240px; padding: .4rem .6rem; font-size: .82rem; }
.lista-cids { list-style: none; margin: .5rem 0 0; padding: 0; max-height: 260px; overflow-y: auto;
    border: 1px solid var(--borda); border-radius: 8px; }
.lista-cids li { padding: .4rem .65rem; border-bottom: 1px solid var(--borda); font-size: .84rem; }
.lista-cids li:last-child { border-bottom: 0; }
.lista-cids b { color: var(--destaque); font-family: Consolas, monospace; margin-right: .3rem; }
.tag-mini { font-size: .62rem; background: rgba(46,163,165,.18); color: var(--primaria-2); border-radius: 4px; padding: .05rem .35rem; margin-left: .3rem; }
.det-rodape { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; margin-top: 1rem; }

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulsar { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* =========================================================
   ADMIN
   ========================================================= */
.pagina { max-width: 1200px; margin: 0 auto; padding: 1.2rem; }
.abas-admin { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabela-admin { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tabela-admin th {
    text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px;
    color: var(--texto-suave); padding: .55rem .6rem; border-bottom: 1px solid var(--borda);
}
.tabela-admin td { padding: .6rem; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela-admin tr:hover { background: rgba(46,163,165,.04); }
.acoes-linha { display: flex; gap: .35rem; flex-wrap: wrap; }
.selo { font-size: .7rem; padding: .1rem .45rem; border-radius: 5px; font-weight: 700; }
.selo-pendente { background: rgba(240,160,46,.15); color: var(--destaque); }
.selo-aprovada, .selo-ativo { background: rgba(63,185,80,.15); color: var(--ok); }
.selo-recusada, .selo-bloqueado { background: rgba(224,85,97,.15); color: #ff9aa3; }
.selo-admin { background: rgba(46,163,165,.18); color: var(--primaria-2); }
.telefone-link { color: var(--ok); }

.grade-cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.cartao-num { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: .9rem 1rem; }
.cartao-num .n { font-size: 1.6rem; font-weight: 700; color: var(--primaria-2); }
.cartao-num .r { font-size: .78rem; color: var(--texto-suave); }

/* =========================================================
   VÍDEOS DE FUNDO
   ========================================================= */
.video-fundo {
    position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover;
    z-index: 0; pointer-events: none; filter: saturate(1.05);
}
.login-fundo-video {
    background:
        radial-gradient(900px 500px at 12% 10%, rgba(46,163,165,.18), transparent 60%),
        radial-gradient(800px 500px at 88% 88%, rgba(240,160,46,.10), transparent 60%),
        rgba(8,11,17,.55);
}
.login-box { backdrop-filter: blur(6px); background: rgba(22,29,41,.86); }

.tela-app-video { background: #05070b; }
.video-fundo-app { opacity: .55; }
.app-veu {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(5,7,11,.55), rgba(5,7,11,.80));
}
.tela-app-video .topo   { position: sticky; z-index: 20; background: rgba(22,29,41,.82); backdrop-filter: blur(8px); }
.tela-app-video .layout { position: relative; z-index: 1; }
.tela-app-video .cartao { background: rgba(22,29,41,.86); backdrop-filter: blur(8px); }

/* ---------- Saída da caixa de login ---------- */
.login-box { transition: transform .55s cubic-bezier(.6,-.28,.74,.05), opacity .5s, filter .5s; }
.login-box.saindo { transform: scale(.85) translateY(40px); opacity: 0; filter: blur(6px); pointer-events: none; }

/* ---------- Sequência de acesso ---------- */
.acesso {
    position: fixed; inset: 0; z-index: 100; display: none; overflow: hidden; background: #000;
}
.acesso.ativo { display: block; animation: aparecer .4s ease; }
.acesso-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acesso-scan {
    position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 4px);
    mix-blend-mode: multiply;
}
.acesso-msg {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: #d9fdff; text-shadow: 0 0 12px rgba(56,198,200,.9), 0 0 32px rgba(56,198,200,.5);
    animation: subir .6s ease .2s both;
}
.acesso-anel {
    width: 120px; height: 120px; border-radius: 50%; margin-bottom: 1.4rem;
    border: 2px solid rgba(56,198,200,.35); border-top-color: #38c6c8; border-right-color: #38c6c8;
    box-shadow: 0 0 30px rgba(56,198,200,.35), inset 0 0 30px rgba(56,198,200,.15);
    animation: girar 1.1s linear infinite;
    position: relative;
}
.acesso-anel::after {
    content: ''; position: absolute; inset: 14px; border-radius: 50%;
    border: 1px dashed rgba(56,198,200,.55); animation: girar 2.4s linear infinite reverse;
}
.acesso-texto {
    font-family: "Segoe UI", "Orbitron", monospace; font-size: clamp(1.4rem, 3.4vw, 2.6rem);
    letter-spacing: .28em; text-transform: uppercase; font-weight: 300;
    animation: tremeluzir 2.2s ease-in-out infinite;
}
.acesso-texto .pontos i { font-style: normal; animation: piscar 1.2s infinite; }
.acesso-texto .pontos i:nth-child(2) { animation-delay: .2s; }
.acesso-texto .pontos i:nth-child(3) { animation-delay: .4s; }
.acesso-sub {
    margin-top: .8rem; font-size: .72rem; letter-spacing: .35em; text-transform: uppercase;
    color: rgba(217,253,255,.65); text-shadow: none;
}

/* Velocidade da luz: linhas radiais que aceleram e um flash, depois o preto engole */
.warp {
    position: absolute; inset: -20%; opacity: 0; pointer-events: none;
    background:
        repeating-conic-gradient(from 0deg, rgba(255,255,255,.0) 0deg 1.4deg, rgba(200,245,255,.9) 1.4deg 1.7deg, rgba(255,255,255,0) 1.7deg 3.6deg);
    mask: radial-gradient(circle at center, transparent 0 6%, #000 22%, #000 100%);
    -webkit-mask: radial-gradient(circle at center, transparent 0 6%, #000 22%, #000 100%);
    filter: blur(.4px);
    transform: scale(.2) rotate(0deg);
}
.warp-on .warp   { animation: warp .95s cubic-bezier(.7,0,.9,.4) forwards; }
.warp-on .acesso-msg { animation: sugar .8s cubic-bezier(.7,0,1,.4) forwards; }
.warp-on .acesso-video { animation: sugarVideo .95s ease-in forwards; }

.blackout {
    position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%;
    background: #000; transform: translate(-50%,-50%) scale(0); pointer-events: none;
    box-shadow: 0 0 80px 40px #000;
}
.black-on .blackout { animation: engolir .7s cubic-bezier(.5,0,.8,.3) forwards; }

@keyframes girar     { to { transform: rotate(360deg); } }
@keyframes piscar    { 0%,100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes tremeluzir{ 0%,100% { opacity: 1; } 92% { opacity: 1; } 94% { opacity: .55; } 96% { opacity: 1; } 98% { opacity: .7; } }
@keyframes warp {
    0%   { opacity: 0;  transform: scale(.2) rotate(0deg); }
    30%  { opacity: .9; }
    100% { opacity: 1;  transform: scale(3.2) rotate(18deg); filter: blur(2px) brightness(1.8); }
}
@keyframes sugar {
    0%   { transform: scale(1); opacity: 1; filter: blur(0); }
    100% { transform: scale(.05); opacity: 0; filter: blur(8px); }
}
@keyframes sugarVideo {
    0%   { transform: scale(1); filter: brightness(1); }
    70%  { filter: brightness(2.2); }
    100% { transform: scale(1.6); filter: brightness(3) blur(6px); }
}
@keyframes engolir {
    0%   { transform: translate(-50%,-50%) scale(0); }
    100% { transform: translate(-50%,-50%) scale(400); }
}

/* ---------- Entrada no app após o login ---------- */
.entrada-flash {
    position: fixed; inset: 0; z-index: 90; background: #000; pointer-events: none;
    animation: clarear 1.1s ease-out .05s forwards;
}
@keyframes clarear { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

.entrando .topo-marca,
.entrando .topo-acoes > *,
.entrando .chip,
.entrando .linha-busca > *,
.entrando .cartao.resultados,
.entrando .coluna-historico .cartao {
    opacity: 0; transform: translateY(18px) scale(.96);
    animation: surgir .55s cubic-bezier(.2,.9,.3,1.3) forwards;
}
.entrando .topo-marca                     { animation-delay: .35s; }
.entrando .topo-acoes > *:nth-child(1)    { animation-delay: .50s; }
.entrando .topo-acoes > *:nth-child(2)    { animation-delay: .58s; }
.entrando .topo-acoes > *:nth-child(3)    { animation-delay: .66s; }
.entrando .topo-acoes > *:nth-child(4)    { animation-delay: .74s; }
.entrando .chip:nth-child(1)              { animation-delay: .60s; }
.entrando .chip:nth-child(2)              { animation-delay: .70s; }
.entrando .linha-busca > *:nth-child(1)   { animation-delay: .80s; }
.entrando .linha-busca > *:nth-child(2)   { animation-delay: .90s; }
.entrando .linha-busca > *:nth-child(3)   { animation-delay: .98s; }
.entrando .cartao.resultados              { animation-delay: 1.05s; }
.entrando .coluna-historico .cartao       { animation-delay: 1.15s; }
.entrando .cartao.busca { animation: surgirCartao .6s ease .3s both; }

@keyframes surgir { to { opacity: 1; transform: none; } }
@keyframes surgirCartao { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .video-fundo { display: none; }
    .entrando * { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 1050px) {
    .layout { grid-template-columns: 1fr; }
    .coluna-historico { position: static; }
    .lista-historico { max-height: 320px; }
}
@media (max-width: 620px) {
    .topo { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .linha-busca { flex-direction: column; }
    .ferramentas-resultado input[type=search] { width: 100%; }
    .tabela-rolagem { max-height: none; }
}
