/* Athos Financeiro - grafite + amarelo mineração, mobile-first */
:root {
  --fundo: #15181D;
  --superficie: #1F242B;
  --superficie-2: #262C35;
  --linha: #313945;
  --texto: #E9EDF2;
  --texto-2: #96A0AC;
  --amarelo: #F5B301;       /* acento: amarelo de frota de mineração */
  --verde: #3FC97C;         /* entradas / realizado */
  --vermelho: #E5484D;      /* saídas / atrasado */
  --azul: #4E9CF5;          /* previsto */
  --raio: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Archivo', -apple-system, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  font-size: 16px;
  overscroll-behavior: none;
}
.tela { display: none; min-height: 100dvh; }
.tela.ativa { display: block; }
.oculto { display: none !important; }

/* ---------- Login ---------- */
#tela-login.ativa { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.marca { margin-bottom: 18px; }
.marca-tag {
  font-weight: 900; font-stretch: 115%; letter-spacing: 4px; font-size: 13px;
  color: var(--fundo); background: var(--amarelo); padding: 3px 10px; border-radius: 4px;
}
.marca h1 { font-size: 40px; font-weight: 800; font-stretch: 105%; margin-top: 10px; }
.marca-sub { color: var(--texto-2); font-size: 14px; }

/* ---------- Campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-size: 13px; font-weight: 600; color: var(--texto-2); letter-spacing: .3px; }
.campo small { font-weight: 400; }
input, select {
  width: 100%; padding: 14px; font-size: 16px; color: var(--texto);
  background: var(--superficie); border: 1px solid var(--linha);
  border-radius: var(--raio); font-family: inherit; appearance: none;
}
input:focus, select:focus { outline: 2px solid var(--amarelo); outline-offset: -1px; border-color: transparent; }
input[readonly] { cursor: pointer; }
.input-valor { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campo-linha { flex-direction: row; align-items: center; gap: 10px; }
.campo-linha input { width: 22px; height: 22px; accent-color: var(--amarelo); }

.btn-primario {
  padding: 16px; font-size: 17px; font-weight: 800; font-family: inherit;
  color: var(--fundo); background: var(--amarelo); border: 0; border-radius: var(--raio);
  cursor: pointer; letter-spacing: .3px;
}
.btn-primario:active { transform: scale(.98); }
.btn-perigo {
  padding: 14px; font-size: 15px; font-weight: 700; font-family: inherit;
  color: var(--vermelho); background: transparent; border: 1px solid var(--vermelho);
  border-radius: var(--raio); cursor: pointer; margin-top: 4px;
}
.erro { color: var(--vermelho); font-size: 14px; min-height: 18px; }
.dica { color: var(--texto-2); font-size: 14px; line-height: 1.45; }

/* ---------- Topo / navegação de mês ---------- */
.topo {
  position: sticky; top: 0; z-index: 5; background: var(--fundo);
  padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; flex-direction: column; gap: 8px;
  border-bottom: 1px solid var(--linha);
}
.sel-empresa {
  background: transparent; border: 0; padding: 4px 0; font-size: 14px; font-weight: 700;
  color: var(--amarelo); letter-spacing: .5px; width: auto;
}
.nav-mes { display: flex; align-items: center; justify-content: space-between; }
#mes-label { font-size: 22px; font-weight: 800; font-stretch: 105%; text-transform: capitalize; }
.nav-seta {
  width: 42px; height: 42px; font-size: 26px; color: var(--texto);
  background: var(--superficie); border: 1px solid var(--linha); border-radius: 10px; cursor: pointer;
}
.topo-form { flex-direction: row; align-items: center; gap: 12px; }
.topo-form h2 { font-size: 19px; font-weight: 800; }
.btn-voltar {
  background: none; border: 0; color: var(--amarelo); font-size: 17px;
  font-weight: 700; font-family: inherit; cursor: pointer; padding: 6px 4px;
}

/* ---------- Cards de resumo ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px 4px; }
.card {
  text-align: left; background: var(--superficie); border: 1px solid var(--linha);
  border-radius: var(--raio); padding: 12px 14px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.card-rotulo { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--texto-2); }
.card-valor { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--texto); }
.card-valor.pos { color: var(--verde); }
.card-valor.neg { color: var(--vermelho); }
.card-valor.prev { color: var(--azul); }
.card-valor.atras { color: var(--vermelho); }

/* ---------- Filtros ---------- */
.filtros { padding: 10px 16px 4px; display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  padding: 8px 14px; font-size: 14px; font-weight: 700; font-family: inherit; white-space: nowrap;
  color: var(--texto-2); background: var(--superficie); border: 1px solid var(--linha);
  border-radius: 99px; cursor: pointer;
}
.chip.ativa { color: var(--fundo); background: var(--amarelo); border-color: var(--amarelo); }

/* ---------- Lista de lançamentos ---------- */
.lista { padding: 8px 16px calc(140px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.dia-cab {
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--texto-2); margin: 12px 2px 2px;
}
.item {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 12px 14px; cursor: pointer; font-family: inherit; color: var(--texto);
  border-left: 4px solid var(--linha);
}
.item.st-REALIZADO { border-left-color: var(--verde); }
.item.st-PREVISTO  { border-left-color: var(--azul); }
.item.st-ATRASADO  { border-left-color: var(--vermelho); }
.item-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-conta { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 13px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-dir { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.item-valor { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.item-valor.entrada { color: var(--verde); }
.item-valor.saida { color: var(--texto); }
.btn-baixar {
  font-size: 12px; font-weight: 800; font-family: inherit; letter-spacing: .5px;
  color: var(--fundo); background: var(--verde); border: 0; border-radius: 7px;
  padding: 6px 10px; cursor: pointer;
}
.vazio { text-align: center; color: var(--texto-2); padding: 48px 20px; line-height: 1.5; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 18px; bottom: calc(76px + var(--safe-b)); z-index: 6;
  width: 60px; height: 60px; font-size: 32px; font-weight: 400; line-height: 1;
  color: var(--fundo); background: var(--amarelo); border: 0; border-radius: 18px;
  box-shadow: 0 6px 18px rgba(245, 179, 1, .35); cursor: pointer;
}
.fab:active { transform: scale(.94); }

/* ---------- Abas inferiores ---------- */
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; background: var(--superficie); border-top: 1px solid var(--linha);
  padding-bottom: var(--safe-b);
}
.aba {
  flex: 1; padding: 14px 6px; font-size: 13px; font-weight: 700; font-family: inherit;
  color: var(--texto-2); background: none; border: 0; cursor: pointer;
}
.aba.ativa { color: var(--amarelo); }

/* ---------- Formulário ---------- */
.form-corpo { padding: 16px; display: flex; flex-direction: column; gap: 14px; padding-bottom: calc(40px + var(--safe-b)); }
.rateio-chip {
  display: none; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .8px;
  padding: 2px 8px; border-radius: 5px; margin-left: 6px; vertical-align: 1px;
}
.rateio-chip.eq { display: inline; color: var(--fundo); background: var(--amarelo); }
.rateio-chip.mo { display: inline; color: var(--fundo); background: var(--azul); }
.rateio-chip.ge { display: inline; color: var(--texto); background: var(--superficie-2); }
.alterna { display: flex; background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.alterna button {
  flex: 1; padding: 13px 4px; font-size: 13.5px; font-weight: 700; font-family: inherit;
  color: var(--texto-2); background: none; border: 0; cursor: pointer;
}
.alterna button.ativa { color: var(--fundo); background: var(--amarelo); }

/* ---------- Seletor de contas ---------- */
.contas-lista { display: flex; flex-direction: column; gap: 4px; }
.grupo-cab {
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--amarelo); margin: 14px 2px 4px;
}
.conta-op {
  text-align: left; padding: 13px 14px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: var(--texto); background: var(--superficie); border: 1px solid var(--linha);
  border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.conta-op small { color: var(--texto-2); font-weight: 400; flex-shrink: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: var(--texto); color: var(--fundo); font-weight: 700; font-size: 14.5px;
  padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: all .25s ease; z-index: 20; max-width: 90vw; text-align: center;
}
.toast.mostra { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .form-corpo, .lista, .filtros { max-width: 680px; margin: 0 auto; width: 100%; }
}

/* ================== PORTAL v2: layout com sidebar ================== */
#portal.ativa { display: block; }
.layout { display: flex; min-height: 100dvh; }

.sidebar {
  width: 236px; flex-shrink: 0; background: var(--superficie);
  border-right: 1px solid var(--linha); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; z-index: 30;
}
.sb-marca {
  padding: calc(18px + var(--safe-t)) 18px 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.sb-fechar { display: none; background: none; border: 0; color: var(--texto-2); font-size: 26px; cursor: pointer; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.sb-grupo { margin-bottom: 16px; }
.sb-grupo-titulo {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--texto-2); padding: 8px 10px 6px;
}
.sb-item {
  display: block; width: 100%; text-align: left; padding: 11px 12px;
  font-size: 14.5px; font-weight: 600; font-family: inherit; color: var(--texto);
  background: none; border: 0; border-radius: 9px; cursor: pointer;
}
.sb-item:hover { background: var(--superficie-2); }
.sb-item.ativa { background: var(--amarelo); color: var(--fundo); font-weight: 800; }
.sb-rodape {
  padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--linha);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
#sb-usuario { font-size: 13px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-sair { background: none; border: 0; color: var(--vermelho); font-weight: 700; font-family: inherit; cursor: pointer; font-size: 14px; }
.sb-veu { display: none; }

.conteudo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topo-portal {
  position: sticky; top: 0; z-index: 20; background: var(--fundo);
  border-bottom: 1px solid var(--linha);
  padding: calc(10px + var(--safe-t)) 18px 10px;
  display: flex; align-items: center; gap: 14px;
}
.hamb { display: none; background: none; border: 0; color: var(--texto); font-size: 24px; cursor: pointer; padding: 4px; }
.topo-portal .sel-empresa { flex: 1; min-width: 0; }
.topo-portal .nav-mes { gap: 8px; display: flex; align-items: center; }
.topo-portal #mes-label { font-size: 17px; min-width: 130px; text-align: center; }

.paginas { padding: 18px; flex: 1; }
.pagina { display: none; max-width: 1100px; margin: 0 auto; }
.pagina.ativa { display: block; }
.pg-titulo { font-size: 24px; font-weight: 800; font-stretch: 105%; margin-bottom: 16px; }

.cards-3 { grid-template-columns: repeat(3, 1fr); }
.pagina .cards { padding: 0 0 14px; }
.pagina .filtros { padding: 0 0 10px; }
.pagina .lista { padding: 0 0 90px; }

.painel {
  background: var(--superficie); border: 1px solid var(--linha);
  border-radius: var(--raio); padding: 16px; margin-bottom: 14px;
}
.painel-titulo { font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--texto-2); margin-bottom: 12px; }
.grafico-wrap { position: relative; height: 260px; }
.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.ranking { display: flex; flex-direction: column; gap: 6px; }
.rk-item { display: flex; align-items: center; gap: 10px; }
.rk-pos { width: 24px; font-weight: 800; color: var(--texto-2); font-size: 13px; }
.rk-nome { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-barra-wrap { flex: 1.4; height: 8px; background: var(--superficie-2); border-radius: 6px; overflow: hidden; }
.rk-barra { height: 100%; background: var(--amarelo); border-radius: 6px; }
.rk-valor { width: 110px; text-align: right; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.construcao {
  background: var(--superficie); border: 1px dashed var(--linha); border-radius: var(--raio);
  padding: 40px 24px; text-align: center; color: var(--texto-2); line-height: 1.5;
}

/* Mobile: sidebar vira gaveta */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%);
    transition: transform .22s ease; box-shadow: 8px 0 30px rgba(0,0,0,.4);
  }
  .sidebar.aberta { transform: translateX(0); }
  .sb-fechar { display: block; }
  .sb-veu.aberta { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 25; }
  .hamb { display: block; }
  .duas-colunas { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .topo-portal #mes-label { min-width: 0; font-size: 15px; }
  .paginas { padding: 14px; }
}

/* ===== Correções v4.1: barras do ranking + responsividade mobile ===== */
.rk-barra { display: block; }
.rk-barra-wrap { display: block; }

.conteudo, .paginas, .pagina, .painel { min-width: 0; }
.paginas { overflow-x: hidden; }
.grafico-wrap canvas { max-width: 100%; }

@media (max-width: 860px) {
  .pagina .cards.cards-3 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 10px 12px; }
  .card-valor { font-size: 16px; }
  .card-rotulo { font-size: 10.5px; letter-spacing: .6px; }
  .grafico-wrap { height: 200px; }
  .rk-barra-wrap { flex: 0.7; }
  .rk-valor { width: auto; min-width: 86px; font-size: 12.5px; }
  .rk-nome { font-size: 13px; }
  .painel { padding: 12px; }
  .pg-titulo { font-size: 20px; }
}
@media (max-width: 400px) {
  .rk-barra-wrap { display: none; }   /* telas muito estreitas: só posição, nome e valor */
}

/* ===== Tabelas do bloco operacional ===== */
.tabela-wrap { overflow-x: auto; padding: 8px 6px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela th {
  text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--texto-2); padding: 10px 10px 8px;
  border-bottom: 1px solid var(--linha); white-space: nowrap;
}
.tabela td { padding: 10px; border-bottom: 1px solid rgba(49,57,69,.5); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela tr:last-child td { border-bottom: 0; }
.td-forte { font-weight: 700; }
.td-valor { font-weight: 700; text-align: right; }
.linha-drill { cursor: pointer; }
.linha-drill:hover td { background: var(--superficie-2); }
.linha-diaria td { background: rgba(38,44,53,.55); font-size: 12.5px; color: var(--texto-2); padding: 7px 10px; }
.td-alerta { color: var(--vermelho); font-weight: 800; }
.td-ok { color: var(--verde); }
.txt-alerta { color: var(--vermelho); font-weight: 700; }
.tabela-mini { font-size: 12.5px; }
.tabela-mini td { padding: 7px 8px; }
.grafico-alto { height: 320px; }
.filtros-linha { display: flex; gap: 10px; margin-bottom: 10px; }
.filtros-linha select { width: auto; min-width: 130px; }
@media (max-width: 860px) {
  .tabela { font-size: 12px; }
  .tabela th, .tabela td { padding: 8px 6px; }
  .grafico-alto { height: 260px; }
  .filtros-linha { flex-direction: column; }
  .filtros-linha select { width: 100%; }
}

/* ===== Cross-filter da aba Eventos ===== */
.filtro-chip {
  display: inline-block; margin-left: 8px; padding: 3px 10px;
  font-size: 12px; font-weight: 800; font-family: inherit; letter-spacing: .3px;
  color: var(--fundo); background: var(--amarelo); border: 0; border-radius: 99px;
  cursor: pointer; text-transform: none; vertical-align: middle;
}
.filtro-nota { color: var(--amarelo); font-weight: 700; text-transform: none; letter-spacing: 0; }
.linha-filtrada td { background: rgba(245, 179, 1, .12); }
.linha-filtrada td:first-child { box-shadow: inset 3px 0 0 var(--amarelo); }

/* ===== Cross-filter bidirecional ===== */
.filtros-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px 0 14px; min-height: 30px; }
.filtro-limpar {
  padding: 3px 10px; font-size: 12px; font-weight: 700; font-family: inherit;
  color: var(--texto-2); background: none; border: 1px solid var(--linha); border-radius: 99px; cursor: pointer;
}
.dica-inline { font-size: 13px; color: var(--texto-2); }
.dia-clicavel { cursor: pointer; }
.dia-clicavel:hover td { background: rgba(245, 179, 1, .07); }
.dia-sel td { background: rgba(245, 179, 1, .16) !important; color: var(--texto); font-weight: 700; }
.dia-sel td:first-child { box-shadow: inset 3px 0 0 var(--amarelo); }

/* ===== Bloco financeiro ===== */
.th-dir, .td-dir { text-align: right; }
.dre-subtotal td { background: rgba(245,179,1,.08); font-weight: 800; border-top: 1px solid var(--linha); }
.delta-alta { color: var(--vermelho); font-weight: 700; font-size: 12px; }
.delta-baixa { color: var(--verde); font-weight: 700; font-size: 12px; }
.pos-txt { color: var(--verde); }
.td-sub { color: var(--texto-2); font-size: 12px; }
.td-sub-grupo { display: block; color: var(--texto-2); font-size: 10.5px; font-weight: 400; }
.rk-clicavel { cursor: pointer; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; }
.rk-clicavel:hover { background: var(--superficie-2); }
.rk-sel { background: rgba(245,179,1,.12); box-shadow: inset 3px 0 0 var(--amarelo); }
.rk-sub { display: block; font-weight: 400; font-size: 10.5px; color: var(--texto-2); }
.pareto-core td { background: rgba(245,179,1,.05); }
.pareto-core td:first-child { box-shadow: inset 2px 0 0 rgba(245,179,1,.5); }
.venc-atrasado td { background: rgba(229,72,77,.07); }
#cat-tipo { margin-bottom: 12px; }

/* ===== v7: header destaque + export + detalhe gargalos ===== */
.topo-portal { flex-direction: column; align-items: stretch; gap: 6px; }
.topo-linha1 { display: flex; align-items: center; gap: 10px; }
.topo-icone { font-size: 20px; }
.sel-empresa-grande {
  flex: 1; min-width: 0; background: transparent; border: 0; padding: 2px 0;
  font-family: inherit; font-size: 21px; font-weight: 800; font-stretch: 105%;
  letter-spacing: .5px; color: var(--amarelo); text-transform: uppercase;
  appearance: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sel-empresa-grande:focus { outline: none; }
.sel-empresa-grande option { background: var(--superficie); color: var(--texto); font-size: 15px; text-transform: none; }
.topo-linha2 { display: flex; justify-content: flex-end; }
.topo-linha2 .nav-mes { gap: 8px; }

.barra-acoes { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; }
.botoes-export { display: flex; gap: 8px; margin-left: auto; }
.btn-export {
  padding: 8px 14px; font-size: 13px; font-weight: 800; font-family: inherit;
  color: var(--texto); background: var(--superficie); border: 1px solid var(--linha);
  border-radius: 9px; cursor: pointer; letter-spacing: .3px;
}
.btn-export:hover { border-color: var(--amarelo); color: var(--amarelo); }

.rk-qtd { color: var(--texto-2); font-weight: 600; font-size: 11px; }
.rk-detalhe { margin: 4px 0 10px 30px; display: flex; flex-direction: column; gap: 4px; }
.occ {
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  font-size: 12.5px; padding: 6px 10px; background: var(--superficie-2);
  border-radius: 7px; border-left: 3px solid var(--amarelo);
}
.occ-dia { font-weight: 800; min-width: 52px; }
.occ-hora { font-variant-numeric: tabular-nums; color: var(--texto); }
.occ-dur { font-weight: 700; color: var(--amarelo); }
.occ-quem { color: var(--texto-2); font-size: 11.5px; }

@media (max-width: 860px) {
  .sel-empresa-grande { font-size: 17px; }
  .topo-linha2 { justify-content: center; }
  .rk-detalhe { margin-left: 8px; }
}

/* ===== Logomarca ===== */
.logo-login { width: min(300px, 72vw); display: block; margin: 0 auto 6px; border-radius: 16px; }
.sb-logo { height: 64px; display: block; border-radius: 10px; }
.sb-marca { padding-bottom: 8px; }
@media (max-width: 860px) { .sb-logo { height: 54px; } }

/* ===== v9 ===== */
.filtro-horas { display: flex; align-items: center; gap: 6px; }
.filtro-horas input[type="time"] {
  width: auto; padding: 10px 8px; background: var(--superficie);
  border: 1px solid var(--linha); border-radius: 9px; color: var(--texto);
  font-family: inherit; font-size: 14px; color-scheme: dark;
}
.btn-mini { background: var(--superficie); border: 1px solid var(--linha); color: var(--texto-2);
  border-radius: 8px; width: 34px; height: 40px; cursor: pointer; font-size: 16px; }
.rk-barra-alerta { background: var(--vermelho); }
.occ-alerta { border-left-color: var(--vermelho); }
.apurado-linha { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn-compacto { width: auto; padding: 12px 18px; margin: 0; font-size: 14px; }
.tag-ok {
  display: inline-block; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 700;
  background: rgba(63, 201, 124, .12); color: var(--verde); border: 1px solid rgba(63, 201, 124, .3);
}
@media (max-width: 860px) { .apurado-linha { flex-direction: column; align-items: flex-start; } }

/* v10 */
.card-clicavel { cursor: pointer; text-align: left; }
.card-clicavel:hover { border-color: var(--vermelho); }

/* v11 */
.card-delta { display: block; margin-top: 3px; font-size: 11px; color: var(--texto-2); }
.delta-pos { color: var(--verde); font-weight: 700; }
.delta-neg { color: var(--vermelho); font-weight: 700; }

/* v12: comparativo maior + cadastros */
.card-delta { display: block; margin-top: 5px; font-size: 13.5px; font-weight: 600; color: var(--texto-2); }
.card-delta .delta-pos, .card-delta .delta-neg { font-size: 14.5px; }
.tag-ext {
  display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 10px; font-weight: 800;
  background: rgba(245,179,1,.15); color: var(--amarelo); vertical-align: middle; letter-spacing: .5px;
}
#pg-cad .rk-item { padding: 4px 0; border-bottom: 1px solid rgba(49,57,69,.4); }

/* v14: filtros globais + export destacado */
.topo-linha2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.filtros-globais { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-filtro {
  width: auto; max-width: 210px; padding: 8px 10px; font-size: 13px; font-weight: 600;
  background: var(--superficie); border: 1px solid var(--linha); border-radius: 9px;
  color: var(--texto); font-family: inherit;
}
.g-filtro:not([value=""]):focus { border-color: var(--amarelo); }
#g-limpar { width: auto; padding: 0 12px; font-size: 12.5px; font-weight: 700; color: var(--amarelo); border-color: var(--amarelo); }
.fh-label { font-size: 12px; color: var(--texto-2); font-weight: 700; white-space: nowrap; }
#rel-turno { width: auto; }

.btn-export {
  background: rgba(245, 179, 1, .12); border: 1.5px solid var(--amarelo);
  color: var(--amarelo); font-size: 13.5px; padding: 9px 16px;
}
.btn-export:hover { background: var(--amarelo); color: var(--fundo); }

@media (max-width: 860px) {
  .topo-linha2 { flex-direction: column; align-items: stretch; }
  .filtros-globais { justify-content: space-between; }
  .g-filtro { flex: 1; max-width: none; }
}

/* ===== v15: barra de filtros redesenhada (estilo pílula) ===== */
.filtros-globais { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-filtro {
  appearance: none; -webkit-appearance: none;
  height: 38px; padding: 0 34px 0 14px; max-width: 220px;
  background: #1B1F26 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2396A0AC' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid #2E3641; border-radius: 10px;
  color: var(--texto); font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.g-filtro:hover { border-color: #46536392; }
.g-filtro.ativo {
  border-color: var(--amarelo); color: var(--amarelo);
  background-color: rgba(245, 179, 1, .07);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23F5B301' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.g-limpar {
  height: 38px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px dashed var(--amarelo); color: var(--amarelo);
  font-family: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  transition: background .15s, color .15s;
}
.g-limpar:hover { background: var(--amarelo); color: var(--fundo); border-style: solid; }

/* filtros do relatório na mesma linguagem */
.filtros-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filtros-linha input[type="search"], .filtros-linha select, .filtro-horas input[type="time"] {
  height: 38px; padding: 0 12px; background: #1B1F26; border: 1px solid #2E3641;
  border-radius: 10px; color: var(--texto); font-family: inherit; font-size: 13.5px;
}
.filtros-linha select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; font-weight: 600; cursor: pointer;
  background: #1B1F26 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2396A0AC' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.filtro-horas {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px;
  background: #1B1F26; border: 1px solid #2E3641; border-radius: 10px;
}
.filtro-horas input[type="time"] { height: 30px; border: none; background: transparent; padding: 0 2px; color-scheme: dark; }
.filtro-horas .btn-mini { width: 26px; height: 26px; border-radius: 7px; font-size: 14px; }
.fh-label { font-size: 12px; color: var(--texto-2); font-weight: 700; white-space: nowrap; }

@media (max-width: 860px) {
  .filtros-globais { width: 100%; }
  .g-filtro { flex: 1; max-width: none; }
  .g-limpar { width: 100%; }
  .filtros-linha input[type="search"] { width: 100%; }
}

/* v16: mês junto dos filtros */
.filtros-globais .nav-mes {
  height: 38px; padding: 0 4px; display: flex; align-items: center; gap: 2px;
  background: #1B1F26; border: 1px solid #2E3641; border-radius: 10px;
}
.filtros-globais .nav-mes .nav-seta { width: 30px; height: 30px; border-radius: 8px; }
.filtros-globais #mes-label { min-width: 108px; text-align: center; font-size: 13.5px; font-weight: 700; }

/* v17: id de ciclo e alerta de linha no relatório */
.td-id { font-family: 'SF Mono', ui-monospace, monospace; font-size: 11px; color: var(--texto-2); }
.linha-alerta { background: rgba(229, 72, 77, .07); }
.linha-alerta .td-alerta { color: var(--vermelho); font-weight: 800; }

/* v17 */
.td-mono { font-family: monospace; font-size: 11px; color: var(--texto-2); }
.btn-excluir {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--texto-2); cursor: pointer; font-size: 13px; padding: 3px 8px; margin-left: 8px;
  transition: all .15s;
}
.btn-excluir:hover { color: var(--vermelho); border-color: var(--vermelho); }
.btn-excluir.confirmando {
  color: var(--fundo); background: var(--vermelho); border-color: var(--vermelho);
  font-size: 11px; font-weight: 800;
}

/* v18: plano de contas */
.tag-rateio {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  background: rgba(91, 107, 232, .15); color: #8B9AF0; margin-left: 6px; vertical-align: middle;
}
#pg-plano .barra-acoes { display: flex; gap: 10px; align-items: center; }
#pg-plano #plano-busca { flex: 1; }
#plano-grupos { margin: 10px 0 14px; }

/* ===== v20: indicador de carregamento ===== */
#carregador-barra {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200;
  pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden;
}
#carregador-barra.on { opacity: 1; }
#carregador-barra::before {
  content: ''; position: absolute; height: 100%; width: 42%;
  background: linear-gradient(90deg, transparent, var(--amarelo), transparent);
  animation: cb-desliza 1.05s linear infinite;
}
@keyframes cb-desliza { from { left: -42%; } to { left: 100%; } }

#carregador-anel {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 1190;
  pointer-events: none; opacity: 0; transition: opacity .25s;
}
#carregador-anel.on { opacity: 1; }
#carregador-anel .anel {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(245, 179, 1, .16); border-top-color: var(--amarelo);
  animation: ca-gira .8s linear infinite;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45));
}
@keyframes ca-gira { to { transform: rotate(360deg); } }

/* v21: usuários */
.linha-inativa { opacity: .45; }
.tag-inativo { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
  background: rgba(139, 148, 158, .15); color: var(--texto-2); }
.td-acoes { white-space: nowrap; }
.btn-mini-acao {
  background: var(--superficie); border: 1px solid var(--linha); color: var(--texto-2);
  border-radius: 8px; padding: 4px 10px; margin-left: 4px; cursor: pointer; font-size: 11.5px; font-weight: 700;
}
.btn-mini-acao:hover { border-color: var(--amarelo); color: var(--amarelo); }
.btn-mini-acao.acao-off:hover { border-color: var(--vermelho); color: var(--vermelho); }
.btn-mini-acao.acao-on { border-color: var(--verde); color: var(--verde); }

/* v24: 4 cards de índices */
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }

/* v25 */
.tag-frota { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 700;
  background: rgba(139, 148, 158, .14); color: var(--texto-2); margin-left: 6px; }

/* v30: rosca da classificação de horas */
.grafico-rosca { max-width: 720px; margin: 0 auto; height: 320px; position: relative; }
@media (max-width: 640px) { .grafico-rosca { height: 380px; } }


/* v32: dupla de gráficos de utilização */
.colunas-utilizacao { align-items: stretch; }
.grafico-barras-cam { position: relative; height: 320px; }
@media (max-width: 900px) { .colunas-utilizacao { grid-template-columns: 1fr; } }

/* v37: primeiro acesso */
.dica-primeiro { color: var(--amarelo, #F5B301); font-size: 13px; line-height: 1.4; margin: 2px 0 6px; }
.tag-pend { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 800;
  background: rgba(245,179,1,.16); color: var(--amarelo, #F5B301); white-space: nowrap; }


/* ===== v42: marca escrita (recriação nativa da logo) ===== */
.marca { display: flex; flex-direction: column; align-items: center; line-height: 1; user-select: none; }
.marca-nome { font-family: 'Archivo', sans-serif; font-weight: 900; color: #E9E0C8; letter-spacing: .05em; }
.marca-sub  { font-family: 'Archivo', sans-serif; font-weight: 700; color: #7A8D95; letter-spacing: .24em; margin-top: .38em; white-space: nowrap; }
.marca-login { margin: 0 auto 18px; }
.marca-login .marca-nome { font-size: clamp(44px, 12vw, 64px); }
.marca-login .marca-sub  { font-size: clamp(9px, 2.5vw, 13px); }
.marca-sb { padding: 4px 0 10px; align-items: center; width: 100%; }
.marca-sb .marca-nome { font-size: 34px; }
.marca-sb .marca-sub  { font-size: 9.5px; letter-spacing: .22em; }
@media (max-width: 860px) { .marca-sb .marca-nome { font-size: 28px; } .marca-sb .marca-sub { font-size: 8px; } }

/* ===== v44: data-bar (barra horizontal em células de faturamento, estilo BI) ===== */
.cel-bar { position: relative; }
.cel-bar .cel-fill {
  position: absolute; top: 3px; bottom: 3px; left: 4px;
  background: linear-gradient(90deg, rgba(63, 201, 124, .30), rgba(63, 201, 124, .16));
  border-radius: 4px; z-index: 0; pointer-events: none;
}
.cel-bar .cel-val { position: relative; z-index: 1; }

/* v44: linha da limpeza destacada na tabela de faixas */
.linha-limpeza td { border-top: 1px dashed rgba(245, 179, 1, .35); }


/* v49: frase do login inteira no celular */
@media (max-width: 520px) {
  #tela-login .marca-sub {
    white-space: normal;
    font-size: clamp(10px, 2.8vw, 13px);
    letter-spacing: .12em;
    line-height: 1.6;
    max-width: 100%;
    padding: 0 8px;
  }
}
