/* =====================================================================
   CTECH COMPRAS - estilos
   Sem variáveis CSS nem recursos novos: funciona também em navegador
   corporativo antigo (IE11).

   Paleta
   fundo      #eef1f3   texto     #1e2a33   linha   #d5dde2
   petróleo   #1f4e5f   lateral   #16323d
   ok         #2d7248   alerta    #a4570f   erro    #a52a1f
   ===================================================================== */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #1e2a33;
    background: #eef1f3;
}

a { color: #1f4e5f; }
a:hover { color: #173c49; }

h1, h2 { margin: 0; font-weight: 600; }

:focus { outline: 2px solid #3b8fb0; outline-offset: 1px; }

code { background: #e4e9ec; padding: 1px 4px; border-radius: 3px; }

/* ---------------- Estrutura ---------------- */
.app { display: flex; min-height: 100vh; }

.lateral {
    width: 232px;
    flex: 0 0 232px;
    background: #16323d;
    color: #cfdde3;
    padding: 18px 0;
}

.marca {
    display: flex;
    align-items: center;
    padding: 0 18px 20px;
    text-decoration: none;
    color: #fff;
}
.marca:hover { color: #fff; }

.marca-selo {
    display: inline-block;
    width: 38px;
    height: 38px;
    line-height: 34px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    color: #16323d;
    background: #e9b949;
    border: 2px solid #fff;
    border-radius: 50%;
    margin-right: 10px;
    flex: 0 0 38px;
}

.marca-nome { font-size: 17px; font-weight: 600; }
.marca-nome small { display: block; font-size: 12px; font-weight: 400; color: #8fb0bd; }

.menu a {
    display: block;
    padding: 9px 18px 9px 15px;
    color: #cfdde3;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.menu a:hover { background: #1d4150; color: #fff; }
.menu a.ativo { background: #1f4e5f; color: #fff; border-left-color: #e9b949; }

.menu-grupo {
    display: block;
    padding: 16px 18px 6px;
    font-size: 12px;
    color: #7f9fac;
}

.principal { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topo {
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #d5dde2;
    padding: 12px 24px;
    min-height: 58px;
}
.topo h1 { font-size: 19px; flex: 1 1 auto; }

.topo-usuario { font-size: 13px; }
.topo-usuario a { margin-left: 14px; }
.topo-nome { color: #56666f; }

.btn-menu { display: none; }

.conteudo { padding: 20px 24px 40px; }

/* ---------------- Avisos ---------------- */
.aviso {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
    border-left: 4px solid;
}
.aviso-ok    { background: #e6f2ea; border-color: #2d7248; color: #1f4f32; }
.aviso-erro  { background: #f9e5e2; border-color: #a52a1f; color: #6f1c15; }
.aviso-info  { background: #e3eef5; border-color: #245a7a; color: #1b4560; }

.senha-provisoria {
    display: inline-block;
    font-family: Consolas, "Courier New", monospace;
    font-size: 17px;
    letter-spacing: 1px;
    background: #fff;
    padding: 2px 8px;
    border: 1px dashed #2d7248;
    border-radius: 3px;
    margin: 4px 0;
}

/* ---------------- Botões ---------------- */
.btn {
    display: inline-block;
    padding: 7px 14px;
    font: inherit;
    font-size: 13px;
    color: #1e2a33;
    background: #fff;
    border: 1px solid #b9c6cd;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: #f1f5f7; color: #1e2a33; }
.btn-primario { background: #1f4e5f; border-color: #1f4e5f; color: #fff; }
.btn-primario:hover { background: #173c49; color: #fff; }
.btn-perigo { color: #a52a1f; border-color: #dfb3ad; }
.btn-perigo:hover { background: #f9e5e2; color: #a52a1f; }
.btn-pequeno { padding: 3px 9px; font-size: 12px; }
.btn-largo { display: block; width: 100%; padding: 10px; font-size: 15px; }

.link-botao {
    background: none; border: 0; padding: 0; font: inherit;
    color: #1f4e5f; text-decoration: underline; cursor: pointer;
}

/* ---------------- Formulários ---------------- */
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], select {
    font: inherit;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #b9c6cd;
    border-radius: 4px;
    background: #fff;
    color: #1e2a33;
    height: 34px;
}
input:disabled { background: #eef1f3; color: #56666f; }

.filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #fff;
    border: 1px solid #d5dde2;
    border-radius: 6px;
    padding: 12px 12px 4px;
    margin-bottom: 16px;
}
.campo { width: 170px; margin: 0 10px 10px 0; }
.campo label { display: block; font-size: 12px; color: #56666f; margin-bottom: 3px; }
.campo-curto { width: 120px; }
.campo-largo { width: 240px; }
.campo-botoes { width: auto; }
.campo-botoes .btn { height: 34px; margin-right: 4px; }

.form-vertical label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }
.form-vertical label:first-child { margin-top: 0; }
.form-vertical .marcar { font-weight: 400; margin-top: 14px; }
.dica, .opcional { font-size: 12px; color: #6b7a83; font-weight: 400; }

.acoes-form { margin-top: 18px; }
.acoes-form .btn { margin-right: 6px; }

/* ---------------- Painéis ---------------- */
.painel {
    background: #fff;
    border: 1px solid #d5dde2;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.painel-estreito { max-width: 440px; }

.painel-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.painel-topo h2 { font-size: 16px; }
.painel-acoes { display: flex; align-items: center; }
.painel-acoes .btn { margin-left: 8px; }
.filtro-rapido { width: 200px !important; }

.grade-2 { display: flex; align-items: flex-start; }
.grade-2 > .painel:first-child { flex: 1 1 auto; min-width: 0; }
.painel-lado { width: 280px; flex: 0 0 280px; margin-left: 16px; }

.grade-form { display: flex; flex-wrap: wrap; align-items: flex-start; }
.grade-form > .painel { flex: 1 1 360px; margin-right: 16px; }
.acoes-form-fim { width: 100%; margin-top: 0; }

.voltar { margin: 0 0 12px; }

/* ---------------- Tabelas ---------------- */
.tabela-rolagem { overflow: auto; max-height: 68vh; border: 1px solid #e1e7eb; border-radius: 4px; }

.tabela { width: 100%; border-collapse: collapse; }
.tabela th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: #f3f6f8;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #3c4b54;
    padding: 8px 10px;
    border-bottom: 1px solid #d5dde2;
    white-space: nowrap;
}
.tabela th[data-tipo] { cursor: pointer; }
.tabela th[data-tipo]:hover { background: #e7edf0; }
.tabela th.ord-asc:after  { content: " \25B2"; font-size: 9px; }
.tabela th.ord-desc:after { content: " \25BC"; font-size: 9px; }

.tabela td { padding: 7px 10px; border-bottom: 1px solid #edf1f3; vertical-align: top; }
.tabela tbody tr:hover td { background: #f7fafb; }
.tabela .num { text-align: right; white-space: nowrap; }
.tabela .sub, .sub { display: block; font-size: 12px; color: #6b7a83; }
.tabela td.acoes { white-space: nowrap; }
.tabela td.acoes form { display: inline; }
.tabela td.acoes .btn { margin: 0 4px 4px 0; }

.num, .numero strong, .tabela td { font-variant-numeric: tabular-nums; }

.linha-alerta td { background: #fdf6ee; }
.linha-apagada td { color: #8a979e; }
.valor-alerta { color: #a4570f; font-weight: 600; }

/* ---------------- Selos de status ---------------- */
.selo {
    display: inline-block;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #b9c6cd;
    border-radius: 3px;
    color: #56666f;
    background: #fff;
}
.selo-ok     { color: #2d7248; border-color: #2d7248; background: #e6f2ea; }
.selo-alerta { color: #a4570f; border-color: #a4570f; background: #fbefe2; }
.selo-admin  { color: #1f4e5f; border-color: #1f4e5f; background: #e3eef5; }

/* ---------------- Números em destaque ---------------- */
.numeros { display: flex; flex-wrap: wrap; margin: 0 -8px 8px; }
.numero {
    display: block;
    flex: 1 1 220px;
    margin: 0 8px 12px;
    background: #fff;
    border: 1px solid #d5dde2;
    border-top: 4px solid #1f4e5f;
    border-radius: 6px;
    padding: 14px 16px;
    text-decoration: none;
    color: #1e2a33;
}
a.numero:hover { border-color: #9fb3bd; border-top-color: #173c49; color: #1e2a33; }
.numero strong { display: block; font-size: 28px; line-height: 1.1; }
.numero span { font-size: 13px; color: #56666f; }
.numero-ok     { border-top-color: #2d7248; }
.numero-alerta { border-top-color: #a4570f; }
.numero-alerta strong { color: #a4570f; }
.numeros-compactos .numero strong { font-size: 22px; }

.saudacao { font-size: 18px; margin: 0 0 16px; }

/* ---------------- Atalhos da página inicial ---------------- */
.atalhos { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.atalho {
    display: block;
    flex: 1 1 280px;
    max-width: 420px;
    margin: 0 8px 16px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #d5dde2;
    border-radius: 6px;
    text-decoration: none;
    color: #1e2a33;
}
.atalho:hover { border-color: #1f4e5f; color: #1e2a33; }
.atalho strong { display: block; font-size: 16px; color: #1f4e5f; margin-bottom: 4px; }
.atalho span { font-size: 13px; color: #56666f; }

/* ---------------- Ranking por solicitante ---------------- */
.ranking { list-style: none; margin: 0; padding: 0; max-height: 64vh; overflow: auto; }
.ranking li { display: flex; align-items: center; border-bottom: 1px solid #edf1f3; }
.ranking a { flex: 1 1 auto; min-width: 0; padding: 7px 4px; text-decoration: none; color: #1e2a33; }
.ranking a:hover .ranking-nome { color: #1f4e5f; text-decoration: underline; }
.ranking-nome { display: block; font-weight: 600; font-size: 13px; }
.ranking-sub { display: block; font-size: 12px; color: #6b7a83; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking strong { padding: 0 6px; font-size: 15px; }

/* ---------------- Abas ---------------- */
.abas { display: flex; flex-wrap: wrap; border-bottom: 1px solid #d5dde2; margin-bottom: 14px; }
.abas a {
    padding: 8px 16px;
    text-decoration: none;
    color: #56666f;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.abas a:hover { color: #1e2a33; }
.abas a.ativo { color: #1f4e5f; font-weight: 600; border-bottom-color: #1f4e5f; }

/* ---------------- Permissões ---------------- */
.telas { border: 0; padding: 0; margin: 0 0 14px; }
.telas legend { font-weight: 600; font-size: 13px; color: #56666f; padding: 0; margin-bottom: 6px; }
.tela-opcao {
    display: flex;
    align-items: flex-start;
    padding: 9px 10px;
    border: 1px solid #e1e7eb;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
}
.tela-opcao:hover { background: #f7fafb; }
.tela-opcao input { margin: 3px 10px 0 0; }
.tela-opcao strong { display: block; }
.tela-opcao small { display: block; color: #6b7a83; }
.aviso-admin { display: none; }
.modo-admin .aviso-admin { display: block; margin-bottom: 10px; }
.modo-admin .telas { opacity: .55; }

/* ---------------- Estado vazio ---------------- */
.vazio { text-align: center; padding: 30px 16px; color: #56666f; }
.vazio h2 { font-size: 17px; color: #1e2a33; margin-bottom: 6px; }

/* ---------------- Carregando (gif) ---------------- */
.carregando {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(238, 241, 243, .72);
    z-index: 200;
}
.carregando.visivel, html.pagina-carregando .carregando {
    display: flex; align-items: center; justify-content: center;
    -webkit-animation: carregando-surge .2s ease .25s both; animation: carregando-surge .2s ease .25s both;
}
.carregando-caixa {
    display: flex; flex-direction: column; align-items: center;
    min-width: 190px; padding: 18px 24px 16px;
    background: #fff; border: 1px solid #d5dde2; border-radius: 14px;
    text-align: center; box-shadow: 0 10px 30px rgba(22, 50, 61, .18);
}
.carregando-caixa img { display: block; width: 96px; height: 96px; }
.carregando-texto { margin-top: 8px; font-size: 14px; font-weight: 600; color: #1f4e5f; }
/* surge só depois de 0,25s: tela rápida não pisca */
@-webkit-keyframes carregando-surge { from { opacity: 0; } to { opacity: 1; } }
@keyframes carregando-surge { from { opacity: 0; } to { opacity: 1; } }
.giro {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid #d5dde2;
    border-top-color: #1f4e5f;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    animation: giro .8s linear infinite;
}
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------------- Janela (modal) ---------------- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(22, 50, 61, .45);
    z-index: 60;
    overflow: auto;
}
.modal.visivel { display: block; }
.modal-caixa {
    background: #fff;
    width: 760px;
    max-width: 94%;
    margin: 6vh auto;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.modal-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #d5dde2;
}
.modal-topo h2 { font-size: 16px; }
.modal-fechar { background: none; border: 1px solid #b9c6cd; border-radius: 4px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.modal-corpo { padding: 14px 18px 18px; max-height: 70vh; overflow: auto; }

/* ---------------- Login / páginas soltas ---------------- */
.pagina-login, .pagina-solta { background: #16323d; }

.login { width: 380px; max-width: 92%; margin: 9vh auto 40px; }
.login-marca { display: flex; align-items: center; color: #fff; margin-bottom: 18px; }
.login-marca .marca-selo { width: 48px; height: 48px; line-height: 44px; flex-basis: 48px; font-size: 17px; margin-right: 12px; }
.login-marca strong { display: block; font-size: 22px; }
.login-marca span { font-size: 13px; color: #9fbdc8; }

.login-form { background: #fff; border-radius: 6px; padding: 24px; }
.login-form h1 { font-size: 20px; margin-bottom: 14px; }
.login-form label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
.login-form input { height: 38px; }
.login-form .btn-largo { margin-top: 20px; }
.login-rodape { font-size: 12px; color: #6b7a83; margin: 14px 0 0; text-align: center; }

.caixa-solta { width: 560px; max-width: 92%; margin: 12vh auto; background: #fff; border-radius: 6px; padding: 24px; }
.caixa-solta h1 { font-size: 20px; margin-bottom: 10px; }
.detalhe-erro { background: #f9e5e2; color: #6f1c15; padding: 10px; white-space: pre-wrap; font-size: 12px; border-radius: 4px; }

/* ---------------- Celular / tela estreita ---------------- */
@media (max-width: 900px) {
    .lateral {
        display: none;
        position: fixed;
        top: 0; bottom: 0; left: 0;
        z-index: 40;
        overflow: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, .25);
    }
    .lateral.aberta { display: block; }
    .btn-menu {
        display: inline-block;
        margin-right: 12px;
        padding: 6px 10px;
        background: #fff;
        border: 1px solid #b9c6cd;
        border-radius: 4px;
        font: inherit;
        font-size: 13px;
    }
    .topo { flex-wrap: wrap; padding: 10px 14px; }
    .topo-usuario { width: 100%; margin-top: 6px; }
    .topo-usuario a:first-of-type { margin-left: 0; }
    .topo-nome { display: none; }
    .conteudo { padding: 14px; }
    .campo, .campo-largo { width: 100%; margin-right: 0; }
    .campo-curto { width: 48%; margin-right: 2%; }
    .grade-2 { display: block; }
    .painel-lado { width: auto; margin-left: 0; }
    .grade-form > .painel { margin-right: 0; flex-basis: 100%; }
    .painel-acoes { width: 100%; margin-top: 8px; }
    .filtro-rapido { width: auto !important; flex: 1 1 auto; }
    .tabela-rolagem { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
    .giro { animation: none; }
}

/* =====================================================================
   COMITÊ, SELEÇÃO, PERMISSÕES E GRÁFICOS
   ===================================================================== */

textarea {
    font: inherit;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #b9c6cd;
    border-radius: 4px;
    resize: vertical;
}

/* ---------------- Seleção de linhas ---------------- */
.col-marca { width: 34px; text-align: center; }
.tabela td.col-marca, .tabela th.col-marca { padding-left: 6px; padding-right: 6px; }
.linha-marcada td { background: #eaf3f7; }
.tabela tbody tr.linha-marcada:hover td { background: #e0edf3; }

.barra-selecao {
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: #f3f6f8;
    border: 1px solid #d5dde2;
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 10px;
    z-index: 5;
}
.barra-selecao > * { margin: 3px 10px 3px 0; }
.barra-selecao select { width: auto; min-width: 220px; }
.barra-selecao label { font-size: 13px; color: #56666f; }
.barra-selecao.com-selecao { background: #1f4e5f; border-color: #1f4e5f; color: #fff; }
.barra-selecao.com-selecao label, .barra-selecao.com-selecao .sub { color: #d5e5ec; }
.barra-selecao.com-selecao a { color: #fff; }
.barra-contagem strong { font-size: 16px; }
.campo-parecer { width: 280px !important; }

/* ---------------- Selos de status do comitê ---------------- */
.selo-pendente { color: #245a7a; border-color: #245a7a; background: #e3eef5; }
.selo-erro     { color: #a52a1f; border-color: #a52a1f; background: #f9e5e2; }

.numero-st-P { border-top-color: #245a7a; }
.numero-st-A { border-top-color: #2d7248; }
.numero-st-R { border-top-color: #a52a1f; }
.numero-st-G { border-top-color: #a4570f; }
.numero-ativo { background: #f3f6f8; box-shadow: inset 0 0 0 1px #9fb3bd; }
.numero-st-A strong { color: #2d7248; }
.numero-st-R strong { color: #a52a1f; }

.btn-aprovar { background: #2d7248; border-color: #2d7248; color: #fff; }
.btn-aprovar:hover { background: #245c3a; color: #fff; }

.cabecalho-comite { margin: 0 0 14px; }
.cabecalho-comite h2 { font-size: 22px; }
.cabecalho-comite p { margin: 4px 0 0; }

.barra-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.abas-inline { margin-bottom: 0; flex: 1 1 auto; margin-right: 12px; }

/* Decisão dentro da janela */
.decisao { margin-top: 16px; padding-top: 14px; border-top: 1px solid #d5dde2; }
.decisao label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.decisao-botoes { display: flex; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.decisao-botoes > * { margin: 0 8px 6px 0; }
.decisao-botoes select { width: auto; min-width: 200px; }
.modal-corpo tfoot td { font-weight: 600; background: #f3f6f8; padding: 7px 10px; }

/* ---------------- Permissões (usuário) ---------------- */
.grade-form > .painel-dados { flex: 1 1 320px; max-width: 420px; }
.grade-form > .painel-permissoes { flex: 2 1 480px; }
.tela-bloco { border: 1px solid #e1e7eb; border-radius: 4px; margin-bottom: 8px; }
.tela-bloco .tela-opcao { border: 0; margin: 0; }
.tela-bloco.tela-marcada { border-color: #9fc1cf; background: #f6fafc; }
.acoes-tela { display: flex; flex-wrap: wrap; padding: 0 10px 8px 34px; }
.acao-opcao {
    font-size: 12px;
    border: 1px solid #d5dde2;
    border-radius: 3px;
    padding: 3px 8px;
    margin: 0 6px 4px 0;
    background: #fff;
    cursor: pointer;
}
.acao-opcao input { margin: 0 4px 0 0; vertical-align: -2px; }

/* ---------------- Gráficos ---------------- */
.periodo-painel { margin: -6px 0 12px; }
.graficos { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.graficos > .painel { flex: 1 1 460px; margin: 0 8px 16px; min-width: 0; }

.barras-legenda { font-size: 12px; color: #56666f; margin-bottom: 8px; }
.barras-legenda span { margin-right: 14px; }
.barras-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.barra-linha { display: flex; align-items: center; padding: 5px 0; border-bottom: 1px solid #f0f3f5; }
.barra-rotulo {
    width: 38%;
    flex: 0 0 38%;
    font-size: 12px;
    padding-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.barra-pos { display: inline-block; width: 22px; color: #8a979e; font-variant-numeric: tabular-nums; }
.barra-trilhas { flex: 1 1 auto; min-width: 0; }
.barra-trilha { position: relative; height: 16px; margin: 2px 0; }
.barra-trilha .barra { display: block; height: 100%; border-radius: 2px; min-width: 2px; }
.barra-trilha em {
    position: absolute;
    top: 0; right: 0;
    font-style: normal;
    font-size: 11px;
    line-height: 16px;
    padding-left: 6px;
    background: rgba(255, 255, 255, .85);
    font-variant-numeric: tabular-nums;
}
.cor-1 { background: #1f4e5f; }
.cor-2 { background: #7fa9ba; }
.cor-3 { background: #e9b949; }
.rolagem-grafico { max-height: 520px; overflow: auto; }

/* ---------------- Mapa por UF ---------------- */
.alternar-metrica .btn.ativo { background: #1f4e5f; border-color: #1f4e5f; color: #fff; }
.mapa-bloco { display: flex; flex-wrap: wrap; align-items: flex-start; }
.mapa-area { flex: 0 1 400px; margin-right: 24px; }
.mapa-uf { width: 100%; max-width: 400px; height: auto; display: block; }
.mapa-lado { flex: 1 1 320px; min-width: 0; }

.mapa-uf .uf { cursor: pointer; }
.mapa-uf .uf rect { stroke: #fff; stroke-width: 2; }
.mapa-uf .uf-sigla { font-size: 13px; font-weight: 700; text-anchor: middle; fill: #1e2a33; }
.mapa-uf .uf-pct { font-size: 11px; text-anchor: middle; fill: #1e2a33; }
.mapa-uf .uf.uf-ativa rect, .mapa-uf .uf:focus rect { stroke: #e9b949; stroke-width: 4; }

.nivel-0 rect { fill: #eef1f3; }
.nivel-1 rect { fill: #d3e3ea; }
.nivel-2 rect { fill: #a9c8d5; }
.nivel-3 rect { fill: #6f9fb3; }
.nivel-4 rect { fill: #3b7189; }
.nivel-5 rect { fill: #1f4e5f; }
.nivel-4 text, .nivel-5 text { fill: #fff !important; }

.mapa-escala { display: flex; align-items: center; font-size: 11px; color: #6b7a83; margin-top: 6px; }
.mapa-escala i { display: inline-block; width: 26px; height: 10px; margin: 0 1px; }
.mapa-escala span { margin: 0 6px; }
.mapa-escala .nivel-1 { background: #d3e3ea; }
.mapa-escala .nivel-2 { background: #a9c8d5; }
.mapa-escala .nivel-3 { background: #6f9fb3; }
.mapa-escala .nivel-4 { background: #3b7189; }
.mapa-escala .nivel-5 { background: #1f4e5f; }

.mapa-detalhe {
    border: 1px solid #d5dde2;
    border-left: 4px solid #e9b949;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 12px;
    min-height: 84px;
}
.mapa-detalhe h3 { margin: 0 0 6px; font-size: 17px; }
.mapa-detalhe h3 span { font-size: 13px; color: #6b7a83; font-weight: 400; }
.mapa-detalhe dl { margin: 0; }
.mapa-detalhe dt { font-size: 12px; color: #6b7a83; }
.mapa-detalhe dd { margin: 0 0 6px; font-size: 15px; }
.mapa-detalhe dd strong { color: #1f4e5f; margin-left: 6px; }

.tabela-compacta td, .tabela-compacta th { padding: 5px 8px; font-size: 12px; }
.tabela-compacta tfoot td { font-weight: 600; border-top: 1px solid #d5dde2; }
.sub-inline { color: #6b7a83; font-size: 11px; }

@media (max-width: 900px) {
    .barra-selecao select, .campo-parecer { width: 100% !important; min-width: 0; }
    .mapa-area { margin-right: 0; }
    .barra-rotulo { width: 45%; flex-basis: 45%; }
}
a.numero { color: inherit; text-decoration: none; display: block; }
a.numero:hover { background: #f3f6f8; }

/* =====================================================================
   CONFERÊNCIA AGRUPADA, LINHA DO TEMPO E ANÁLISE DE PREÇOS
   ===================================================================== */
.modal-caixa.modal-largo { width: 1080px; }
.modal-largo .modal-corpo { max-height: 78vh; }

/* Balão de várias entradas */
.bolha {
    display: inline-block;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #1f4e5f;
    background: #e3eef5;
    border: 1px solid #9fc1cf;
    border-radius: 12px;
    padding: 2px 9px;
    cursor: pointer;
    white-space: nowrap;
}
.bolha:hover, .bolha:focus { background: #1f4e5f; color: #fff; border-color: #1f4e5f; }
.bolha-mais { padding: 1px 7px; margin-left: 4px; }

/* Barra de progresso */
.progresso { width: 90px; height: 8px; background: #e7ecef; border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; }
.progresso-barra { display: block; height: 100%; background: #e9b949; }
.progresso-barra.progresso-ok { background: #2d7248; }
.progresso-barra.progresso-acima { background: #a52a1f; }
.progresso-grande { width: 100%; height: 10px; display: block; margin: 6px 0 4px; }
td .progresso + small { display: block; font-size: 11px; color: #56666f; }

/* Linha do tempo */
.tl-cabecalho { margin-bottom: 10px; }
.tl-numeros { display: flex; flex-wrap: wrap; margin: 0 -6px 4px; }
.tl-numeros > div { flex: 1 1 150px; margin: 0 6px 8px; padding: 8px 12px; border: 1px solid #d5dde2; border-radius: 4px; }
.tl-numeros span { display: block; font-size: 12px; color: #56666f; }
.tl-numeros strong { font-size: 18px; }
.tl-numeros .tl-falta { border-color: #e9b949; background: #fdf6e3; }
.tl-numeros .tl-ok { border-color: #2d7248; background: #eaf5ee; }
.tl-numeros .tl-acima { border-color: #a52a1f; background: #f9e5e2; }
.tl-leitura { background: #f3f6f8; border-left: 4px solid #1f4e5f; padding: 8px 12px; margin: 10px 0 14px; }
.tl-titulo { font-size: 15px; margin: 18px 0 8px; }
.tl-lista { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid #d5dde2; }
.tl-lista li { position: relative; padding: 0 0 14px 14px; }
.tl-lista .tl-ponto { position: absolute; left: -26px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #1f4e5f; border: 2px solid #fff; box-shadow: 0 0 0 1px #1f4e5f; }
.tl-lista .tl-inicio .tl-ponto { background: #fff; }
.tl-linha-valores { font-size: 13px; margin-top: 3px; }
.tl-itens small.sub { display: block; }

/* Análise de preços */
.tabela-precos td { vertical-align: top; }
.link-produto { text-align: left; font-weight: 600; }
.celula-var { white-space: nowrap; }
.preco-ant { display: block; font-size: 12px; color: #56666f; }
.preco-ant small { color: #8a979e; }
.var { display: inline-block; font-weight: 600; font-size: 13px; }
.var small { display: block; font-weight: 400; font-size: 11px; }
.var-alta { color: #a52a1f; }
.var-baixa { color: #2d7248; }
.var-igual { color: #56666f; }
.var-sem { color: #8a979e; font-weight: 400; font-size: 12px; }
.valor-alta { color: #a52a1f; font-weight: 600; }
.valor-baixa { color: #2d7248; font-weight: 600; }
.tendencia { display: inline-block; font-size: 11px; font-weight: 600; color: #a52a1f; background: #f9e5e2; border-radius: 3px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.destaques { line-height: 1.7; }

/* Gráfico de preço */
.grafico-caixa { border: 1px solid #d5dde2; border-radius: 4px; padding: 8px; margin: 0 0 14px; }
.grafico-preco { width: 100%; height: auto; display: block; }
.gp-grade { stroke: #e7ecef; stroke-width: 1; }
.gp-eixo { font-size: 11px; fill: #6b7a83; }
.gp-area { fill: #1f4e5f; fill-opacity: .08; stroke: none; }
.gp-linha { fill: none; stroke: #1f4e5f; stroke-width: 2.5; stroke-linejoin: round; }
.gp-ponto { fill: #fff; stroke: #1f4e5f; stroke-width: 2; cursor: pointer; }
.gp-ponto.gp-alta { stroke: #a52a1f; }
.gp-ponto.gp-baixa { stroke: #2d7248; }
.gp-ponto.gp-ultimo { fill: #e9b949; }
.gp-rotulo { font-size: 13px; font-weight: 700; fill: #1e2a33; }

/* =====================================================================
   PWA E RESPONSIVO (celular, tablet e computador)
   Computador: acima de 1100px | Tablet: 701 a 1100px | Celular: até 700px
   ===================================================================== */
[hidden] { display: none !important; }

.btn-instalar { margin-right: 12px; border-color: #1f4e5f; color: #1f4e5f; }
.btn-filtros { display: none; }

.icone-menu, .icone-menu:before, .icone-menu:after {
    display: inline-block;
    width: 16px;
    height: 2px;
    background: #1e2a33;
    border-radius: 1px;
    vertical-align: middle;
    position: relative;
}
.icone-menu { margin-right: 6px; top: -1px; }
.icone-menu:before, .icone-menu:after { content: ""; position: absolute; left: 0; }
.icone-menu:before { top: -5px; }
.icone-menu:after { top: 5px; }

/* Avisos flutuantes (sem internet / versão nova) */
.aviso-rede, .aviso-versao {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    max-width: 92%;
    z-index: 80;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.aviso-rede { background: #a52a1f; color: #fff; }
.aviso-versao { background: #1f4e5f; color: #fff; bottom: 64px; }
.aviso-versao .btn { margin-left: 10px; }

/* Página offline */
.offline-caixa { text-align: center; }
.offline-caixa img { border-radius: 16px; margin-bottom: 10px; }

/* App instalado: respeita a área do relógio/entalhe do celular */
.modo-app .topo { padding-top: calc(10px + env(safe-area-inset-top)); }
.modo-app .lateral { padding-top: env(safe-area-inset-top); }
.barra-selecao { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

/* Toque: alvos maiores */
@media (pointer: coarse) {
    .btn { min-height: 38px; }
    .btn-pequeno { min-height: 32px; padding: 5px 11px; }
    .tabela input[type=checkbox], .acao-opcao input, .tela-opcao input { width: 20px; height: 20px; }
    .menu a { padding-top: 11px; padding-bottom: 11px; }
}

/* ---------------- Tablet ---------------- */
@media (min-width: 701px) and (max-width: 1100px) {
    .conteudo { padding: 16px 18px 40px; }
    .campo { width: 31%; margin-right: 2%; }
    .campo-curto { width: 23%; }
    .campo-largo { width: 48%; }
    .campo-botoes { width: 100%; }
    .graficos > .painel { flex-basis: 100%; }
    .mapa-area { flex-basis: 100%; margin-right: 0; }
    .mapa-uf { margin: 0 auto; }
    .numero { flex-basis: 45%; }
    .modal-caixa.modal-largo { width: 96%; }
}

/* ---------------- Celular e tablet em pé ---------------- */
@media (max-width: 900px) {
    input, select, textarea { font-size: 16px; }          /* evita o zoom automático do iPhone */
    .lateral { width: 270px; }
    .abas { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .abas a { display: inline-block; }
    .btn-instalar { order: 3; margin: 6px 0 0; }
}

/* ---------------- Celular ---------------- */
@media (max-width: 700px) {
    body { font-size: 15px; }
    .topo h1 { font-size: 17px; }
    .conteudo { padding: 12px 10px 90px; }

    /* Filtros recolhíveis depois de consultar */
    .btn-filtros { display: block; width: 100%; margin-bottom: 8px; text-align: left; font-weight: 600; }
    .btn-filtros:after { content: " \25B2"; float: right; font-size: 11px; }
    .btn-filtros.recolhido:after { content: " \25BC"; }
    .filtros.filtros-recolhido { display: none; }
    .campo-curto { width: 48%; }
    .campo-botoes { width: 100%; display: flex; flex-wrap: wrap; }
    .campo-botoes .btn { flex: 1 1 auto; margin-bottom: 6px; }

    /* Números */
    .numeros { margin: 0 -4px 8px; }
    .numero { flex: 1 1 45%; margin: 0 4px 8px; padding: 10px; }
    .numero strong, .numeros-compactos .numero strong { font-size: 19px; }
    .numero span { font-size: 12px; }

    /* Painéis */
    .painel { padding: 12px 10px; border-radius: 6px; }
    .painel-topo { flex-wrap: wrap; }
    .painel-acoes { display: flex; flex-wrap: wrap; }
    .painel-acoes .btn { margin: 4px 6px 0 0; }

    /* Tabelas viram cartões */
    .tabela-rolagem { overflow: visible; max-height: none; border: 0; }
    .tabela-cartao, .tabela-cartao tbody, .tabela-cartao tr, .tabela-cartao td, .tabela-cartao tfoot { display: block; width: 100%; }
    .tabela-cartao thead { display: none; }
    .tabela-cartao tbody tr {
        background: #fff;
        border: 1px solid #d5dde2;
        border-radius: 6px;
        margin: 0 0 10px;
        padding: 6px 0;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    }
    .tabela-cartao tbody tr.linha-alerta { border-left: 4px solid #e9b949; }
    .tabela-cartao tbody tr.linha-marcada { border-color: #1f4e5f; box-shadow: 0 0 0 1px #1f4e5f; }
    .tabela-cartao tbody tr:hover td, .tabela-cartao tbody tr.linha-marcada td { background: transparent; }
    .tabela-cartao td {
        position: relative;
        border: 0;
        padding: 5px 12px 5px 42%;
        text-align: left !important;
        white-space: normal !important;
        min-height: 28px;
        word-wrap: break-word;
    }
    .tabela-cartao td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 6px;
        width: 36%;
        font-size: 12px;
        color: #6b7a83;
        line-height: 1.3;
    }
    .tabela-cartao td[data-label=""] { padding-left: 12px; }
    .tabela-cartao td[data-label=""]:before { display: none; }
    .tabela-cartao td:empty { display: none; }
    .tabela-cartao td.col-marca { width: 100%; }
    .tabela-cartao td .btn { margin-top: 2px; }
    .tabela-cartao tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; background: #f3f6f8; border-radius: 6px; padding: 6px 12px; }
    .tabela-cartao tfoot td { width: auto; padding: 2px 0; }
    .tabela-cartao tfoot td:before { display: none; }

    /* Barra de seleção/decisão fica presa embaixo */
    .barra-selecao { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; box-shadow: 0 -4px 16px rgba(0, 0, 0, .15); }
    .barra-selecao > * { flex: 1 1 100%; margin-right: 0; }
    .barra-selecao .barra-contagem { flex: 0 0 auto; }
    .barra-selecao label { display: none; }

    /* Janela ocupa a tela toda */
    .modal-caixa, .modal-caixa.modal-largo { width: 100%; max-width: 100%; margin: 0; min-height: 100%; border-radius: 0; }
    .modal-topo { position: -webkit-sticky; position: sticky; top: 0; background: #fff; z-index: 2; padding-top: calc(12px + env(safe-area-inset-top)); }
    .modal-corpo, .modal-largo .modal-corpo { max-height: none; padding: 12px 10px 40px; }
    .decisao-botoes > *, .decisao-botoes select { flex: 1 1 100%; margin-right: 0; }

    /* Linha do tempo e gráficos */
    .tl-numeros > div { flex-basis: 40%; }
    .tl-numeros strong { font-size: 16px; }
    .barra-rotulo { width: 42%; flex-basis: 42%; }
    .mapa-area, .mapa-lado { flex-basis: 100%; margin-right: 0; }
    .grade-form > .painel-dados { max-width: none; }
    .acoes-tela { padding-left: 12px; }

    .aviso-rede, .aviso-versao { bottom: calc(12px + env(safe-area-inset-bottom)); width: 92%; text-align: center; }
    .aviso-versao { bottom: calc(60px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
    /* Barra fica pequena até marcar algo; depois mostra as opções */
    .barra-selecao:not(.com-selecao) > *:not(.barra-contagem) { display: none; }
    .barra-selecao:not(.com-selecao) { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
    .barra-selecao:not(.com-selecao) .barra-contagem:after { content: " - marque as linhas"; font-size: 12px; opacity: .8; }
    .barra-selecao .btn { flex: 1 1 30%; margin-right: 6px; }
    .barra-selecao select, .barra-selecao input[type=text] { flex: 1 1 100%; }
}

/* Logo no menu e no login */
.marca-logo { width: 44px; height: 44px; flex: 0 0 44px; margin-right: 10px; }
.login-marca .marca-logo { width: 56px; height: 56px; flex-basis: 56px; margin-right: 12px; }

/* Login com o logo em destaque */
.login-marca-destaque { flex-direction: column; text-align: center; margin-bottom: 22px; }
.login-logo { width: 112px; height: 112px; margin-bottom: 12px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.login-marca-destaque strong { font-size: 24px; letter-spacing: .3px; }
.login-marca-destaque span { display: block; margin-top: 2px; }
@media (max-width: 700px) {
    .login { margin-top: calc(5vh + env(safe-area-inset-top)); }
    .login-logo { width: 88px; height: 88px; }
}

/* =====================================================================
   LOGIN MV, BANCOS, FILTROS AVANÇADOS, ESTOQUE E STAND-BY
   ===================================================================== */

/* ---------------- Bancos (Produção / Treinamento) ---------------- */
.rotulo-grupo { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 6px; }
.seletor-banco { display: flex; }
.opcao-banco { flex: 1 1 50%; margin: 0 !important; cursor: pointer; }
.opcao-banco + .opcao-banco { margin-left: 8px !important; }
.opcao-banco input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opcao-banco span {
    display: block; text-align: center; padding: 9px 6px; border: 2px solid #d5dde2; border-radius: 6px;
    font-weight: 600; color: #56666f; background: #fff;
}
.opcao-banco input:checked + span { border-color: #1f4e5f; background: #eaf3f7; color: #1f4e5f; }
.opcao-banco.opcao-teste input:checked + span { border-color: #c2700f; background: #fdf1e2; color: #a4570f; }
.opcao-banco input:focus + span { box-shadow: 0 0 0 3px rgba(31, 78, 95, .25); }
.aviso-bloco p { margin: 6px 0 0; }

.selo-banco {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    padding: 3px 8px; border-radius: 10px; background: #e3eef5; color: #1f4e5f; margin-right: 10px;
}
.selo-banco-teste { background: #c2700f; color: #fff; }
.topo-nome small { display: block; font-size: 11px; color: #8a979e; line-height: 1.1; }
.faixa-treinamento {
    background: repeating-linear-gradient(45deg, #c2700f, #c2700f 12px, #b8650a 12px, #b8650a 24px);
    color: #fff; text-align: center; font-size: 13px; padding: 5px 10px;
}

/* ---------------- Sem telas liberadas ---------------- */
.sem-permissao {
    max-width: 620px; margin: 20px auto; background: #fff; border: 1px solid #d5dde2;
    border-top: 4px solid #e9b949; border-radius: 8px; padding: 26px 28px; text-align: center;
}
.sem-permissao h2 { font-size: 21px; margin: 10px 0 8px; }
.sem-permissao-icone { display: inline-block; background: #fdf6e3; border-radius: 50%; padding: 16px; }
.sem-permissao-passos { text-align: left; background: #f3f6f8; border-radius: 6px; padding: 12px 18px; margin: 16px 0 12px; }
.sem-permissao-passos ul { margin: 6px 0 0; padding-left: 20px; }
.sem-permissao-passos li { margin: 4px 0; }

/* ---------------- Lista com caixinhas (multi) ---------------- */
.multi { position: relative; }
.multi-botao {
    width: 100%; min-height: 36px; text-align: left; font: inherit; font-size: 14px; background: #fff;
    border: 1px solid #b9c6cd; border-radius: 4px; padding: 6px 28px 6px 9px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative;
}
.multi-botao:after { content: ""; position: absolute; right: 10px; top: 50%; margin-top: -2px;
    border: 5px solid transparent; border-top-color: #6b7a83; }
.multi.com-valor .multi-botao { border-color: #1f4e5f; background: #f3f8fa; }
.multi-vazio { color: #6b7a83; }
.multi-painel {
    display: none; position: absolute; z-index: 60; top: 100%; left: 0; min-width: 100%; width: 320px; max-width: 92vw;
    background: #fff; border: 1px solid #9fb3bd; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); margin-top: 3px;
}
.multi.aberto .multi-painel { display: block; }
.multi-busca { width: 100%; border: 0 !important; border-bottom: 1px solid #e1e7eb !important; border-radius: 6px 6px 0 0; padding: 9px 10px; }
.multi-acoes { display: flex; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid #f0f3f5; }
.multi-acoes button { background: none; border: 0; color: #1f4e5f; font: inherit; font-size: 12px; cursor: pointer; padding: 3px 2px; text-decoration: underline; }
.multi-lista { max-height: 260px; overflow-y: auto; padding: 4px 0; }
.multi-opcao { display: flex; align-items: flex-start; padding: 6px 10px; margin: 0 !important; font-weight: 400 !important; font-size: 13px; cursor: pointer; }
.multi-opcao:hover { background: #f3f6f8; }
.multi-opcao.marcada { background: #eaf3f7; }
.multi-opcao input { margin: 2px 8px 0 0; flex: 0 0 auto; }
.multi-nada { padding: 10px; margin: 0; font-size: 13px; color: #6b7a83; }

/* ---------------- Selos e ações ---------------- */
.selo-cinza { color: #56666f; border-color: #aab5bb; background: #f0f3f5; }
.selo-standby { color: #5b3f8c; border-color: #7a5bb0; background: #efe9f8; }
.selo-vencido { box-shadow: 0 0 0 2px #e9b949; }
.selo-botao { font: inherit; font-size: 12px; cursor: pointer; }
.selo-botao:hover { filter: brightness(.95); text-decoration: underline; }
.selo-aviso { display: inline-block; width: 15px; height: 15px; line-height: 15px; text-align: center; border-radius: 50%;
    background: #a52a1f; color: #fff; font-size: 10px; margin-left: 3px; }
.btn-standby { background: #5b3f8c; border-color: #5b3f8c; color: #fff; }
.btn-standby:hover { background: #4a3274; color: #fff; }
.barra-grupo { display: inline-flex; flex-wrap: wrap; align-items: center; padding-left: 10px; border-left: 1px solid rgba(0, 0, 0, .12); }
.barra-grupo > * { margin: 3px 6px 3px 0; }
.campo-motivo { width: 220px !important; }
.campo-dias { width: 64px !important; }
.numero-acao-comprar { border-top-color: #a52a1f; }
.numero-acao-comprar strong { color: #a52a1f; }
.numero-acao-esperar { border-top-color: #e9b949; }

/* ---------------- Análise de estoque ---------------- */
.analise-topo { margin-bottom: 10px; }
.analise-topo .selo { font-size: 14px; padding: 4px 10px; }
.tabela-analise .linha-texto td { font-size: 12.5px; color: #3c4a52; background: #fafbfc; border-top: 0; padding-top: 2px; padding-bottom: 10px; }
.tabela-analise tr.linha-analise-COMPRAR td:first-child { box-shadow: inset 4px 0 0 #a52a1f; }
.tabela-analise tr.linha-analise-ESPERAR td:first-child { box-shadow: inset 4px 0 0 #e9b949; }
.avisos-item { margin: 4px 0 0; padding-left: 18px; color: #a4570f; }
.dias { display: inline-block; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.dias-VERMELHO { background: #f9e5e2; color: #a52a1f; }
.dias-AMARELO { background: #fdf1d8; color: #8a5a00; }
.dias-VERDE { background: #e6f3ea; color: #2d7248; }
.dias-SEM { background: #f0f3f5; color: #6b7a83; font-weight: 400; }
.faixa-cores { display: flex; flex-wrap: wrap; margin: -4px 0 12px; font-size: 13px; }
.faixa-cores span { margin: 0 14px 4px 0; }
.faixa-cores span:before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.cor-VERMELHO:before { background: #a52a1f; }
.cor-AMARELO:before { background: #e9b949; }
.cor-VERDE:before { background: #2d7248; }
.cor-SEM:before { background: #aab5bb; }
.obrigatorio { color: #a52a1f; }

/* ---------------- Parâmetros ---------------- */
.explicacao { background: #fff; border: 1px solid #d5dde2; border-left: 4px solid #1f4e5f; border-radius: 6px; padding: 14px 18px; margin-bottom: 16px; }
.explicacao h2 { font-size: 16px; margin: 0 0 6px; }
.explicacao p { margin: 6px 0; line-height: 1.55; }
.grade-param label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 12px; }
.grade-param input { width: 70px; display: inline-block; margin: 0 6px; text-align: right; }
.grade-param small { display: block; font-weight: 400; font-size: 12px; color: #6b7a83; margin-top: 2px; }

/* ---------------- Cadastro: usuário do MV ---------------- */
.busca-mv { position: relative; }
.busca-resultados { border: 1px solid #d5dde2; border-radius: 4px; max-height: 260px; overflow-y: auto; margin-top: 4px; }
.busca-resultados:empty { display: none; }
.resultado-mv { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; background: #fff; border: 0;
    border-bottom: 1px solid #f0f3f5; padding: 8px 10px; cursor: pointer; }
.resultado-mv:hover { background: #eaf3f7; }
.resultado-mv[disabled] { color: #8a979e; cursor: not-allowed; background: #fafbfc; }
.resultado-mv em { font-size: 11px; margin-left: 6px; }
.usuario-escolhido { display: flex; flex-wrap: wrap; align-items: baseline; background: #eaf3f7; border: 1px solid #9fc1cf; border-radius: 4px; padding: 8px 12px; margin: 8px 0 4px; }
.usuario-escolhido span { width: 100%; font-size: 11px; color: #56666f; }
.usuario-escolhido strong { margin-right: 10px; font-size: 16px; }

@media (max-width: 700px) {
    .barra-grupo { border-left: 0; padding-left: 0; width: 100%; }
    .campo-motivo, .campo-dias { width: 100% !important; }
    .multi-painel { position: fixed; left: 4vw; right: 4vw; top: auto; bottom: 0; width: auto; max-width: none; border-radius: 10px 10px 0 0; }
    .multi-lista { max-height: 50vh; }
    .selo-banco { margin-right: 6px; }
}

/* =====================================================================
   NAVEGAÇÃO NOVA: menu lateral com ícones (recolhido) que expande ao clicar
   ===================================================================== */
.app .lateral {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: 72px; flex: none; padding: 0; display: flex; flex-direction: column;
    background: #16323d; background: linear-gradient(180deg, #183744 0%, #122a34 100%);
    box-shadow: 1px 0 0 rgba(0, 0, 0, .08);
    transition: width .2s ease, transform .22s ease, box-shadow .2s ease;
}
.app .principal { margin-left: 72px; }
.lateral-fundo { display: none; }

.lateral-topo { display: flex; align-items: center; justify-content: center; height: 68px; flex: 0 0 68px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.app .marca { padding: 0; display: flex; align-items: center; color: #fff; text-decoration: none; }
.app .marca-logo { width: 40px; height: 40px; flex: 0 0 40px; margin: 0; border-radius: 10px; }
.app .marca-nome { display: none; margin-left: 11px; font-size: 16px; font-weight: 700; white-space: nowrap; line-height: 1.15; }
.app .marca-nome small { color: #8fb0bd; font-weight: 400; font-size: 11.5px; }
.lateral-fechar { display: none; margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .08);
    color: #cfdde3; font-size: 22px; line-height: 1; cursor: pointer; }
.lateral-fechar:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.app .menu { flex: 1 1 auto; padding: 12px 0; }
.menu-item {
    position: relative; display: flex; align-items: center; width: calc(100% - 20px); height: 46px; margin: 3px 10px; padding: 0 14px;
    border: 0; border-radius: 10px; background: none; color: #b9ccd4; font: inherit; font-size: 14.5px; text-align: left;
    text-decoration: none; cursor: pointer; box-sizing: border-box;
}
.app .menu a.menu-item { display: flex; border-left: 0; padding: 0 14px; color: #b9ccd4; }
.app .menu a.menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.app .menu a.menu-item.ativo { background: #1f4e5f; color: #fff; }
.app .menu-grupo { display: block; padding: 0; font-size: inherit; color: inherit; }
.menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.menu-item:focus { outline: 2px solid #e9b949; outline-offset: -2px; }
.menu-item.ativo, .menu-grupo.tem-ativo > .menu-pai { background: #1f4e5f; color: #fff; box-shadow: inset 3px 0 0 #e9b949; }
.menu-icone { display: flex; align-items: center; justify-content: center; width: 22px; flex: 0 0 22px; }
.menu-texto { display: none; margin-left: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.menu-seta { display: none; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s; margin-top: -4px; opacity: .7; }
.menu-grupo.aberto > .menu-pai .menu-seta { transform: rotate(-135deg); margin-top: 4px; }
.submenu { display: none; }

/* Dica com o nome ao passar o mouse (menu recolhido) */
.lateral:not(.expandida) .menu-item:after {
    content: attr(data-rotulo); position: absolute; left: 100%; top: 50%; margin-left: 14px; transform: translateY(-50%);
    background: #0f2530; color: #fff; padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; z-index: 5;
}
.lateral:not(.expandida) .menu-item:before {
    content: ""; position: absolute; left: 100%; top: 50%; margin: -6px 0 0 2px; border: 6px solid transparent; border-right-color: #0f2530;
    opacity: 0; visibility: hidden; transition: opacity .12s; z-index: 5;
}
.lateral:not(.expandida) .menu-item:hover:after, .lateral:not(.expandida) .menu-item:hover:before { opacity: 1; visibility: visible; }

/* Expandido (clicou num ícone): mostra nomes e submenus por cima da página */
.app .lateral.expandida { width: 284px; box-shadow: 10px 0 40px rgba(0, 0, 0, .28); }
.lateral.expandida .menu { overflow-y: auto; }
.lateral.expandida .lateral-topo { justify-content: flex-start; padding: 0 14px 0 16px; }
.lateral.expandida .marca-nome, .lateral.expandida .menu-texto { display: block; }
.lateral.expandida .menu-seta { display: block; }
.lateral.expandida .lateral-fechar { display: block; }
.lateral.expandida .menu-grupo.aberto > .submenu { display: block; }
body.menu-aberto .lateral-fundo { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 45;
    background: rgba(10, 25, 32, .38); }

.submenu { padding: 2px 0 8px; }
.app .submenu a {
    position: relative; display: block; margin: 1px 10px; padding: 9px 12px 9px 50px; border-left: 0; border-radius: 8px;
    color: #a9c0c9; font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app .submenu a:before { content: ""; position: absolute; left: 31px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: #4f7382; }
.app .submenu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.app .submenu a.ativo { background: rgba(233, 185, 73, .14); color: #fff; font-weight: 600; }
.app .submenu a.ativo:before { background: #e9b949; }

/* ---------------- Topo: título + usuário + sair ---------------- */
.app .topo {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; min-height: 68px; padding: 10px 24px;
    background: #fff; border-bottom: 1px solid #e1e7eb; box-shadow: 0 1px 6px rgba(22, 50, 61, .05);
}
.app .topo h1 { flex: 1 1 auto; min-width: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 16px; }
.topo-conta { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.usuario-cartao {
    display: flex; align-items: center; min-width: 0; max-width: 460px; padding: 5px 16px 5px 5px;
    background: #f4f7f9; border: 1px solid #e1e7eb; border-radius: 30px;
}
.avatar {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
    background: #1f4e5f; background: linear-gradient(135deg, #1f4e5f, #2f8196); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px;
}
.usuario-dados { display: flex; flex-direction: column; min-width: 0; margin-left: 11px; line-height: 1.25; }
.usuario-nome { font-size: 14px; font-weight: 600; color: #1c2b33; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ambiente { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: #2d7248; white-space: nowrap; }
.ambiente i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px;
    box-shadow: 0 0 0 3px rgba(45, 114, 72, .15); }
.ambiente-teste { color: #c2700f; }
.ambiente-teste i { box-shadow: 0 0 0 3px rgba(194, 112, 15, .18); }
.btn-sair {
    display: inline-flex; align-items: center; flex: 0 0 auto; margin-left: 12px; padding: 9px 16px; border: 1px solid #e1c3be; border-radius: 30px;
    color: #a52a1f; background: #fff; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s;
}
.btn-sair:hover { background: #fbeceA; background: #fbecea; color: #8a2018; }
.btn-sair span { margin-left: 7px; }
.faixa-treinamento { position: sticky; top: 68px; z-index: 29; }

.app .btn-menu {
    display: none; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 42px; margin-right: 12px; padding: 0;
    border: 1px solid #d5dde2; border-radius: 10px; background: #fff; color: #16323d; cursor: pointer;
}
.app .btn-menu .icone-menu, .app .btn-menu .icone-menu:before, .app .btn-menu .icone-menu:after {
    display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative; content: ""; border: 0; margin: 0;
}
.app .btn-menu .icone-menu:before { position: absolute; top: -6px; left: 0; }
.app .btn-menu .icone-menu:after { position: absolute; top: 6px; left: 0; }

.modo-app .app .lateral { padding-top: env(safe-area-inset-top); }
.modo-app .app .topo { padding-top: calc(10px + env(safe-area-inset-top)); }

/* ---------------- Login: ambiente ---------------- */
.opcao-banco span { display: flex; align-items: center; justify-content: center; }
.ponto-banco { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2d7248; margin-right: 7px; }
.opcao-teste .ponto-banco { background: #c2700f; }
.opcao-off { cursor: not-allowed; opacity: .5; }
.dica-banco { display: block; font-size: 12px; color: #8a5a00; margin-top: 6px; }
.info-fixa { background: #eaf3f7; border: 1px solid #c3dbe5; border-radius: 6px; padding: 9px 14px; margin: 0 0 14px; font-size: 14px; }

/* ---------------- Tablet e celular: menu vira gaveta ---------------- */
@media (max-width: 900px) {
    .app .principal { margin-left: 0; }
    .app .lateral { display: flex; width: 284px; transform: translateX(-105%); box-shadow: none; }
    .app .lateral.expandida { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .3); }
    .app .lateral .lateral-topo { justify-content: flex-start; padding: 0 14px 0 16px; }
    .app .lateral .marca-nome, .app .lateral .menu-texto, .app .lateral .menu-seta, .app .lateral .lateral-fechar { display: block; }
    .app .lateral .menu { overflow-y: auto; }
    .app .lateral .menu-grupo.aberto > .submenu { display: block; }
    .app .lateral .menu-item:after, .app .lateral .menu-item:before { display: none; }
    .app .btn-menu { display: inline-flex; }
    .app .topo { padding: 10px 16px; }
}

@media (max-width: 700px) {
    .app .topo { flex-wrap: wrap; padding: 8px 12px 10px; min-height: 0; }
    .app .topo h1 { font-size: 17px; margin-right: 0; }
    .app .btn-instalar { order: 2; margin: 0 0 0 8px; }
    .topo-conta { order: 3; width: 100%; margin-top: 8px; }
    .usuario-cartao { flex: 1 1 auto; max-width: none; padding: 4px 12px 4px 4px; }
    .avatar { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; }
    .usuario-nome { font-size: 13.5px; }
    .btn-sair { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; margin-left: 8px; }
    .btn-sair span { display: none; }
    .faixa-treinamento { position: static; font-size: 12px; }
}

/* ---------------- Liberar usuário do MV ---------------- */
.painel-busca-mv { margin-bottom: 16px; }
.busca-mv-form { padding: 4px 0 0; }
.busca-mv { display: flex; align-items: stretch; }
.busca-mv input { flex: 1 1 auto; min-width: 0; font-size: 15px; padding: 10px 12px; }
.busca-mv .btn { margin-left: 8px; flex: 0 0 auto; }
.busca-resultados { max-height: 340px; }
a.resultado-mv {
    display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid #f0f3f5; color: #1c2b33; text-decoration: none; background: #fff;
}
a.resultado-mv:hover { background: #eaf3f7; }
a.resultado-mv strong { display: block; font-size: 14px; }
a.resultado-mv small { display: block; font-size: 12px; color: #6b7a83; }
a.resultado-mv em { margin-left: auto; padding-left: 10px; font-size: 12px; white-space: nowrap; color: #6b7a83; }
a.resultado-mv.resultado-off { opacity: .6; cursor: not-allowed; background: #fafbfc; }
a.resultado-mv.escolhido { background: #e6f3ea; box-shadow: inset 3px 0 0 #2d7248; }
.avatar-p { width: 32px; height: 32px; flex: 0 0 32px; font-size: 12px; margin-right: 10px; }
.usuario-escolhido strong { font-size: 15px; }
.usuario-escolhido em { font-style: normal; color: #56666f; font-size: 13px; }
.lista-busca-mv { display: flex; align-items: center; }
.lista-busca-mv input { width: 240px; margin-right: 6px; }
@media (max-width: 700px) {
    .lista-busca-mv { width: 100%; margin-top: 8px; }
    .lista-busca-mv input { flex: 1 1 auto; width: auto; }
}
.painel-liberar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 14px;
    border-left: 4px solid #2d7248; }

/* ---------------- Análise: conta do consumo e outras unidades ---------------- */
.analise-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.analise-topo > div { margin: 0 12px 6px 0; }
.seletor-unidade { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.seletor-unidade select { margin-left: 8px; width: auto; min-width: 150px; padding: 5px 8px; }
.celula-consumo strong { font-size: 14px; }
.un-consumo { font-size: 11px; color: #56666f; }
.conta-consumo { display: block; font-size: 11.5px; color: #1f4e5f; background: #eaf3f7; border-radius: 4px; padding: 1px 6px; margin-top: 3px; white-space: nowrap; }
.link-unidades { display: block; margin: 3px 0 0 auto; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; color: #1f4e5f; text-decoration: underline; cursor: pointer; }
.linha-unidades td { background: #f7fafb; border-top: 0; }
.tabela-unidades { width: auto; min-width: 60%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 6px; }
.tabela-unidades th, .tabela-unidades td { padding: 5px 10px; border-bottom: 1px solid #e1e7eb; text-align: left; }
.tabela-unidades th { font-weight: 600; color: #56666f; background: #eef3f5; }
.tabela-unidades .num { text-align: right; }
.tabela-unidades tr.un-ref td { background: #eaf3f7; font-weight: 600; }
@media (max-width: 700px) {
    .seletor-unidade { width: 100%; }
    .seletor-unidade select { flex: 1 1 auto; }
    .conta-consumo { white-space: normal; }
}

/* ---------------- Análise: movimentações que formam o consumo ---------------- */
.mov-secao { margin-top: 18px; padding-top: 14px; border-top: 2px solid #e1e7eb; }
.mov-secao h3 { font-size: 15px; margin: 0 0 2px; }
.mov-produto { border: 1px solid #e1e7eb; border-radius: 6px; margin-top: 10px; overflow: hidden; }
.mov-cabeca { display: flex; flex-wrap: wrap; align-items: center; width: 100%; padding: 9px 12px; border: 0; background: #f4f7f9;
    font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; color: #1c2b33; }
.mov-cabeca:hover { background: #eaf1f4; }
.mov-seta { width: 7px; height: 7px; border-right: 2px solid #56666f; border-bottom: 2px solid #56666f; transform: rotate(-45deg);
    margin-right: 10px; transition: transform .15s; }
.mov-cabeca[aria-expanded="true"] .mov-seta { transform: rotate(45deg); }
.mov-resumo { margin-left: auto; padding-left: 12px; font-size: 12.5px; color: #3c4a52; }
.mov-corpo { padding: 6px 12px 10px; }
.mov-rolagem { max-height: 320px; overflow-y: auto; }
.tabela-mov { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabela-mov th, .tabela-mov td { padding: 5px 8px; border-bottom: 1px solid #edf1f3; text-align: left; white-space: nowrap; }
.tabela-mov td:nth-child(3) { white-space: normal; }
.tabela-mov thead th { position: sticky; top: 0; background: #eef3f5; color: #56666f; font-weight: 600; }
.tabela-mov .num { text-align: right; }
.tabela-mov tfoot td { background: #eaf3f7; font-weight: 600; border-bottom: 0; }
.tabela-mov tr.mov-dev td { color: #2d7248; background: #f3faf5; }
.mov-tipo { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11.5px; background: #fdf1e2; color: #a4570f; }
.mov-tipo-D, .mov-tipo-C, .mov-tipo-N { background: #e6f3ea; color: #2d7248; }
@media (max-width: 700px) {
    .mov-resumo { margin: 4px 0 0 17px; padding-left: 0; width: 100%; }
}
.tabela-mov td.mov-estoque { white-space: normal; min-width: 120px; }
.tabela-mov td.mov-estoque small { color: #6b7a83; }

/* ---------------- Motor de reposição: estado OC insuficiente e motivo ---------------- */
.selo-laranja { color: #9a4a06; border-color: #e08a2c; background: #fdeedd; }
.numero-acao-oc { border-top-color: #e08a2c; }
.numero-acao-oc strong { color: #9a4a06; }
.tabela-analise tr.linha-analise-OC_INSUFICIENTE td:first-child { box-shadow: inset 4px 0 0 #e08a2c; }
.tabela-analise tr.linha-analise-NAO_PRECISA td:first-child { box-shadow: inset 4px 0 0 #2d7248; }
.conclusao { margin: 2px 0 6px; padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.45; border-left: 4px solid; }
.conclusao-COMPRAR { background: #fbeceA; background: #fbecea; border-color: #a52a1f; color: #7d1f17; }
.conclusao-OC_INSUFICIENTE { background: #fdf1e2; border-color: #e08a2c; color: #7a3d05; }
.conclusao-ESPERAR { background: #fdf6e0; border-color: #e9b949; color: #6b4a00; }
.conclusao-NAO_PRECISA { background: #e9f5ee; border-color: #2d7248; color: #1f5534; }
.conclusao-SEM_CONSUMO { background: #f0f3f5; border-color: #aab5bb; color: #3c4a52; }
.link-motivo { margin: 4px 0; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #1f4e5f; cursor: pointer; }
.link-motivo:before { content: "\25B8"; display: inline-block; margin-right: 5px; transition: transform .15s; }
.link-motivo[aria-expanded="true"]:before { transform: rotate(90deg); }
.motivo { margin: 4px 0 6px; padding: 10px 12px; background: #fff; border: 1px solid #e1e7eb; border-radius: 6px; }
.motivo-grade { display: flex; flex-wrap: wrap; margin: 0 0 8px; }
.motivo-grade > div { flex: 1 1 200px; margin: 0 12px 8px 0; }
.motivo-grade dt { font-size: 11px; color: #6b7a83; text-transform: uppercase; letter-spacing: .3px; }
.motivo-grade dd { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; color: #1c2b33; }
.tabela-projecao { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabela-projecao th, .tabela-projecao td { padding: 5px 8px; border-bottom: 1px solid #edf1f3; text-align: left; }
.tabela-projecao th { background: #eef3f5; color: #56666f; font-weight: 600; }
.tabela-projecao .num { text-align: right; white-space: nowrap; }
.tabela-projecao tr.proj-alerta td { background: #fdf6e0; }
.tabela-projecao tr.proj-ruptura td { background: #fbecea; color: #7d1f17; }
.tabela-projecao tr.proj-marco td { font-style: italic; color: #56666f; }
.tabela-projecao tr.proj-marco.proj-alerta td { color: #7a5200; }

/* ---------------- App instalado (PWA) no celular: topo mais baixo ----------------
   Desce o cabeçalho para longe da barra de status/entalhe e aumenta o botão
   do menu, para dar para tocar com folga. */
@media (max-width: 900px) {
    .modo-app .app .topo { padding-top: calc(env(safe-area-inset-top, 0px) + 22px); padding-bottom: 12px; }
    .modo-app .app .btn-menu { width: 48px; height: 48px; flex-basis: 48px; border-radius: 12px; }
    .modo-app .app .lateral-topo { height: auto; flex-basis: auto; padding-top: calc(env(safe-area-inset-top, 0px) + 22px); padding-bottom: 14px; }
    .modo-app .app .lateral-fechar { width: 44px; height: 44px; font-size: 26px; }
    .modo-app .faixa-treinamento { position: static; }
}
@supports (padding-top: max(1px, 2px)) {
    @media (max-width: 900px) {
        /* garante pelo menos 34px mesmo quando o aparelho não informa a área da barra de status */
        .modo-app .app .topo { padding-top: max(34px, calc(env(safe-area-inset-top, 0px) + 16px)); }
        .modo-app .app .lateral-topo { padding-top: max(34px, calc(env(safe-area-inset-top, 0px) + 16px)); }
    }
}
.carregando-caixa img { mix-blend-mode: multiply; }

/* =====================================================================
   iPhone/app instalado: nada por baixo da barra da hora
   env(safe-area-inset-top) = altura da barra de status quando o app
   desenha por baixo dela (iOS "black-translucent"); no navegador é 0.
   Não depende de JavaScript nem da classe modo-app.
   ===================================================================== */
@media (max-width: 900px) {
    html body .app .topo { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
    html body .app .lateral-topo { height: auto; flex-basis: auto; padding-top: calc(env(safe-area-inset-top, 0px) + 14px); padding-bottom: 14px; }
    html body .app .btn-menu { width: 48px; height: 48px; flex-basis: 48px; border-radius: 12px; }
    html body .app .lateral-fechar { width: 44px; height: 44px; font-size: 26px; }
}
@media (display-mode: standalone) and (max-width: 900px) {
    /* no app, um pouco mais de folga abaixo da hora */
    html body .app .topo { padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
    .faixa-treinamento { position: static; }
}
.modal-caixa { margin-top: calc(6vh + env(safe-area-inset-top, 0px)); }
.aviso-versao, .aviso-rede { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }

/* ---------------- Zoom (botão Aa) ---------------- */
.zoom-controle { position: relative; flex: 0 0 auto; margin-left: 10px; }
.btn-zoom {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid #d5dde2; border-radius: 50%; background: #fff; color: #1f4e5f; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer;
}
.btn-zoom small { font-size: 11px; margin-left: 1px; }
.btn-zoom:hover, .btn-zoom[aria-expanded="true"] { background: #eaf3f7; }
.zoom-painel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 220px; padding: 12px 14px;
    background: #fff; border: 1px solid #d5dde2; border-radius: 12px; box-shadow: 0 10px 30px rgba(22, 50, 61, .2); text-align: center;
}
.zoom-painel strong { display: block; font-size: 13px; margin-bottom: 8px; color: #1c2b33; }
.zoom-linha { display: flex; align-items: center; justify-content: space-between; }
.zoom-linha button {
    width: 56px; height: 44px; border: 1px solid #c3d3db; border-radius: 10px; background: #f4f7f9; color: #1f4e5f;
    font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.zoom-linha button:active { background: #dcebf1; }
#zoom-valor { font-size: 17px; font-weight: 700; color: #1c2b33; min-width: 56px; }
.zoom-padrao { margin-top: 10px; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; color: #1f4e5f; text-decoration: underline; cursor: pointer; }
.zoom-painel small { display: block; margin-top: 6px; font-size: 11px; color: #8a979e; }
@media (max-width: 700px) {
    .zoom-controle { margin-left: 8px; }
    .btn-zoom { width: 44px; height: 44px; }
}

/* Menu lateral no iPhone/app: cabeçalho (logo, nome, X) abaixo da barra da hora.
   Especificidade alta de propósito: vence ".app .lateral .lateral-topo" e ".lateral.expandida .lateral-topo". */
@media (max-width: 900px) {
    html body .app .lateral.lateral { padding-top: 0; }   /* vence ".modo-app .app .lateral" */
    html body .app .lateral .lateral-topo {
        height: auto; flex: 0 0 auto;
        padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 14px 16px;
    }
    html body .app .lateral .menu { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
}
