/* =====================================================================
   Tema suave da Gestão (carrega DEPOIS de styles.css; só "veste" o que já existe).
   Pensado para ficar aberto o dia todo: fundo em degradê leve, blocos arredondados e translúcidos,
   cores pastel derivadas da cor da marca (--cor-marca, definida pelo tema do estabelecimento),
   ícones de linha monocromáticos. As cores de status da AGENDA ficam no Balcão e não mudam.
   Para desligar o tema: remover a linha <link ... tema-suave.css> do index.html.
   ===================================================================== */
:root {
  --s-tinta-1: color-mix(in srgb, var(--cor-marca) 6%, white);
  --s-tinta-2: color-mix(in srgb, var(--cor-marca) 12%, white);
  --s-tinta-3: color-mix(in srgb, var(--cor-marca) 20%, white);
  --s-linha: color-mix(in srgb, var(--cor-marca) 13%, #ffffff);
  --s-texto: #3b3238;
  --s-apoio: #8b8189;
  --s-cartao: rgba(255, 255, 255, .78);
  --s-sombra: 0 1px 2px rgba(70, 40, 60, .04), 0 8px 24px -10px rgba(70, 40, 60, .12);
  --s-raio: 18px;
  --dash-trilho: color-mix(in srgb, var(--cor-marca) 9%, #f1edf3);
  --s-grad: linear-gradient(135deg, color-mix(in srgb, var(--cor-marca) 72%, white), var(--cor-marca));
  --s-superficie: #ffffff;
  --s-dialogo: #fffdfe;
  --s-ponto: #ffffff;
  --cor-marca-base: #8a4b5c;
  --cor-borda: var(--s-linha);
  --cor-texto: var(--s-texto);
  --cor-neutro: var(--s-apoio);
}

body {
  color: var(--s-texto);
  background:
    radial-gradient(900px 620px at 6% -6%, color-mix(in srgb, var(--cor-marca) 17%, transparent), transparent 62%),
    radial-gradient(820px 600px at 104% 8%, rgba(176, 164, 240, .30), transparent 60%),
    radial-gradient(900px 700px at 58% 112%, rgba(255, 206, 186, .38), transparent 62%),
    #f8f4f7;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--s-tinta-3); }
* { scrollbar-width: thin; scrollbar-color: var(--s-tinta-3) transparent; }

/* ---------- casca: painel flutuante (só no computador) ---------- */
.sidebar { background: transparent; border-right: 1px solid var(--s-linha); }
@media (min-width: 801px) {
  body { padding: 16px; }
  body.vendo-como { padding-top: 54px; }
  .shell {
    height: calc(100vh - 32px); border-radius: 28px; overflow: hidden;
    background: rgba(255, 255, 255, .58); border: 1px solid rgba(255, 255, 255, .85);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    box-shadow: 0 2px 4px rgba(70, 40, 60, .04), 0 24px 60px -24px rgba(70, 40, 60, .22);
  }
  body.vendo-como .shell { height: calc(100vh - 70px); }
  .sidebar { flex-basis: 232px; padding: 20px 14px; }
  .area-principal { padding: 26px 34px; }
}
.marca-sidebar { font-size: 17px; letter-spacing: -.01em; margin-bottom: 20px; padding: 0 6px; }
.link-voltar-balcao { border-radius: 50%; border-color: var(--s-linha); background: var(--s-superficie); }

/* ---------- menu: ícones de linha, item ativo em "pílula" ---------- */
.nav-secoes { gap: 3px; }
a.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px;
  color: var(--s-texto); font-size: 14px; transition: background .15s, color .15s;
}
.nav-ico { width: 19px; height: 19px; flex: 0 0 auto; opacity: .62; transition: opacity .15s; }
a.nav-item:hover { background: var(--s-tinta-1); }
a.nav-item:hover .nav-ico { opacity: .9; }
a.nav-item.ativa { background: var(--s-tinta-2); color: var(--cor-marca); font-weight: 600; box-shadow: inset 0 0 0 1px var(--s-linha); }
a.nav-item.ativa .nav-ico { opacity: 1; }
.nav-rotulo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-master { border-top-color: var(--s-linha); }
.instalar-app { background: var(--s-tinta-1); border: 1px solid var(--s-linha); border-radius: 14px; }

/* ---------- topo, abas em "pílulas" ---------- */
.barra-topo h1 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
body[data-secao="dashboard"] .barra-topo h1 { visibility: hidden; height: 0; margin: 0; }
body[data-secao="dashboard"] .barra-topo { margin-bottom: 0; }
body[data-secao="dashboard"] .barra-topo-linha { justify-content: flex-end; margin-bottom: -34px; position: relative; z-index: 3; pointer-events: none; }
body[data-secao="dashboard"] .topo-acoes { pointer-events: auto; }
.btn-perfil { border-radius: 999px; background: var(--s-superficie); border-color: var(--s-linha); box-shadow: var(--s-sombra); }
.abas { border-bottom: 0; gap: 6px; }
.aba {
  border-bottom: 0 !important; margin-bottom: 0; padding: 8px 15px; border-radius: 999px; color: var(--s-apoio);
  transition: background .15s, color .15s;
}
a.aba:hover { background: var(--s-tinta-1); color: var(--s-texto); }
.aba.ativa { background: var(--s-tinta-2); color: var(--cor-marca); font-weight: 600; box-shadow: inset 0 0 0 1px var(--s-linha); }
.conteudo { padding-top: 16px; }

/* ---------- blocos: cartões, KPIs, tabelas, filtros ---------- */
.kpi {
  background: var(--s-cartao); border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--s-raio);
  box-shadow: var(--s-sombra); padding: 15px 20px;
}
.kpi-valor { color: var(--s-texto); font-size: 21px; }
.ficha-painel, .linha-config, .filtros-caixa, .cartao-import, .chave-agenda, .bloco-acordo, .grupo-unidades, .barra-selecao {
  background: var(--s-cartao); border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--s-raio); box-shadow: var(--s-sombra);
}
.chave-agenda--off { background: #fff4f4; border-color: #f0cdcd; }
.tabela-caixa-wrapper { border-radius: var(--s-raio); box-shadow: var(--s-sombra); border-color: rgba(255, 255, 255, .9); }

table.tabela-gestao { background: var(--s-cartao); border-radius: var(--s-raio); box-shadow: var(--s-sombra); }
table.tabela-gestao th { background: var(--s-tinta-1); color: var(--s-apoio); font-weight: 600; letter-spacing: .02em; padding: 12px 14px; }
table.tabela-gestao td { border-top-color: var(--s-linha); padding: 12px 14px; }
table.tabela-gestao tr:hover td { background: var(--s-tinta-1); }
.th-ordenavel:hover, .th-ordenavel:focus-visible { background: var(--s-tinta-2); }
.th-ordenavel.th-ativo { background: var(--s-tinta-2); }

.barra-filtros input, .barra-filtros select, .filtros-caixa-linha input, .filtros-caixa-linha select,
dialog input, dialog select, dialog textarea, .form-vertical input, .caixa-login input, .linha-config input, .linha-config select, .linha-config textarea {
  border-color: var(--s-linha); border-radius: 12px; background: rgba(255, 255, 255, .92);
}
.barra-filtros input:focus, .barra-filtros select:focus, dialog input:focus, dialog select:focus, dialog textarea:focus,
.form-vertical input:focus, .caixa-login input:focus, .linha-config input:focus, .linha-config select:focus {
  outline: none; border-color: color-mix(in srgb, var(--cor-marca) 55%, white); box-shadow: 0 0 0 4px var(--s-tinta-2);
}

button.primario, .botao-acao, .acoes-modal button.primario[type="button"] {
  background: var(--s-grad);
  border-radius: 12px; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--cor-marca) 60%, transparent);
}
button.primario:hover, .botao-acao:hover { opacity: 1; filter: brightness(1.05); }
button.secundario, a.secundario {
  background: rgba(255, 255, 255, .85); color: var(--cor-marca); border: 1px solid var(--s-linha); border-radius: 12px;
}
button.secundario:hover, a.secundario:hover { background: var(--s-tinta-1); border-color: var(--s-tinta-3); }
.acoes-modal button[type="button"]:not(.primario) { border-radius: 12px; }
.seg-filtro { border-radius: 12px; border-color: var(--s-linha); }
.seg-botao.seg-ativo { background: var(--s-grad); }
.btn-icone { border-radius: 10px; border-color: var(--s-linha); }
code { background: var(--s-tinta-2); }

/* caixa (financeiro): cabeçalhos e linhas em tons suaves */
.tabela-caixa-wrapper, table.tabela-caixa { background: rgba(255, 255, 255, .85); }
table.tabela-caixa .cab-topo-caixa th { background: var(--s-tinta-1); color: var(--s-apoio); font-weight: 600; }
table.tabela-caixa .cab-sub-caixa th { background: var(--s-tinta-2); color: var(--cor-marca); font-weight: 600; }
.linha-mes-caixa { background: var(--s-tinta-1); }
.linha-dia-caixa { border-top-color: var(--s-linha); }
.linha-dia-caixa:hover td { background: var(--s-tinta-1); }
.linha-detalhe-caixa td { background: rgba(255, 255, 255, .6); }
table.tabela-gestao tr.linha-grupo td, table.tabela-gestao tr.linha-grupo:hover td { background: var(--s-tinta-2); }
.grupo-contagem { background: var(--s-superficie); }

/* pílulas de status em tons pastel */
.pill { padding: 3px 11px; font-weight: 600; }
.pill--ok { background: #e1f3ea; color: #2f7a55; }
.pill--alerta { background: #fde8e8; color: #b04a4a; }
.pill--atencao { background: #fcf0dc; color: #a97426; }
.pill--neutro { background: #efeaf1; color: #7d7381; }
.msg-erro { background: #fde8e8; border-radius: 12px; }
.aviso-caixa--ok, .resultado-envio--ok { background: #e1f3ea; }
.aviso-caixa--alerta { background: #fcf0dc; }

/* janelas */
dialog { border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(70, 40, 60, .35); background: var(--s-dialogo); }
dialog::backdrop { background: rgba(60, 40, 60, .30); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.perfil-abas { border-bottom-color: var(--s-linha); }
.perfil-chip { background: var(--s-tinta-2); }

/* login */
.caixa-login { border-radius: 26px; box-shadow: 0 30px 70px -26px rgba(70, 40, 60, .3); border-color: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .88); }

/* ---------- celular ---------- */
@media (max-width: 800px) {
  .barra-mobile { background: linear-gradient(135deg, color-mix(in srgb, var(--cor-marca) 78%, white), var(--cor-marca)); }
  .sidebar { background: #fffafc; border-right: 0; }
  a.nav-item { padding: 13px 12px; font-size: 16px; }
  .nav-ico { width: 21px; height: 21px; }
  table.tabela-gestao tr { background: var(--s-cartao); border-color: rgba(255, 255, 255, .9); border-radius: var(--s-raio); box-shadow: var(--s-sombra); }
  table.tabela-gestao td::before { color: var(--s-apoio); }
  table.tabela-gestao tr:hover td { background: none; }
  dialog { border-radius: 24px 24px 0 0; }
  .acoes-modal { background: var(--s-dialogo); }
  .aba { padding: 10px 15px; }
  body[data-secao="dashboard"] .barra-topo-linha { margin-bottom: 0; }
}

/* =====================================================================
   INÍCIO — dashboard do administrador
   ===================================================================== */
.dash { container-type: inline-size; display: flex; flex-direction: column; gap: 18px; }
.dash-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dash-topo h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.dash-topo p { margin: 2px 0 0; color: var(--s-apoio); font-size: 14px; }
.dash-controles { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dash-controles select {
  padding: 9px 14px; border: 1px solid var(--s-linha); border-radius: 999px; background: var(--s-superficie); font: inherit; font-size: 13px; color: var(--s-texto); cursor: pointer;
}
.dash-seg { display: inline-flex; padding: 4px; gap: 2px; background: rgba(255, 255, 255, .8); border: 1px solid var(--s-linha); border-radius: 999px; }
.dash-seg button {
  border: 0; background: none; padding: 7px 16px; border-radius: 999px; font: inherit; font-size: 13px; color: var(--s-apoio); cursor: pointer; transition: background .15s, color .15s;
}
.dash-seg button:hover { color: var(--s-texto); }
.dash-seg button.ativo {
  background: var(--s-grad); color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--cor-marca) 60%, transparent);
}

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-col--meio { order: -1; }
@container (min-width: 700px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-col--meio { grid-column: 1 / -1; order: -1; }
}
@container (min-width: 1020px) {
  .dash-grid { grid-template-columns: minmax(235px, 270px) minmax(0, 1fr) minmax(255px, 295px); }
  .dash-col--meio { grid-column: auto; order: 0; }
}

.dash-card {
  background: var(--s-cartao); border: 1px solid rgba(255, 255, 255, .92); border-radius: 22px; box-shadow: var(--s-sombra); padding: 18px 20px; min-width: 0;
}
.dash-card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; color: var(--s-texto); }
.dash-card-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.dash-card-cab h3 { margin: 0; }
.dash-ico { width: 18px; height: 18px; flex: 0 0 auto; color: color-mix(in srgb, var(--cor-marca) 70%, #6c6c7c); }
.dash-link { font-size: 12.5px; color: var(--cor-marca); text-decoration: none; font-weight: 600; }
.dash-link:hover { text-decoration: underline; }
.dash-vazio { color: var(--s-apoio); font-size: 13px; padding: 6px 0; list-style: none; }

/* alertas */
.dash-alertas { display: flex; flex-direction: column; gap: 8px; }
.dash-alerta {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 16px; text-decoration: none; color: var(--s-texto);
  background: #fcf0dc; transition: transform .12s;
}
a.dash-alerta:hover { transform: translateX(2px); }
.dash-alerta > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-alerta b { font-size: 13px; font-weight: 650; }
.dash-alerta span { font-size: 12px; color: #6d6270; }
.dash-alerta .dash-ico { color: #b27a2b; }
.dash-alerta .dash-seta { width: 15px; height: 15px; opacity: .55; }
.dash-alerta--alerta { background: #fde8e8; }
.dash-alerta--alerta .dash-ico { color: #b85a5a; }
.dash-alerta--atencao { background: #fcf0dc; }
.dash-alerta--info { background: #e7effb; }
.dash-alerta--info .dash-ico { color: #5b86be; }
.dash-alerta--ok { background: #e1f3ea; }
.dash-alerta--ok .dash-ico { color: #3f9569; }

/* pares "rótulo ··· valor" */
.dash-pares { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-pares li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; border-top: 1px solid var(--s-linha); }
.dash-pares li:first-child { border-top: 0; }
.dash-pares li > span { color: var(--s-apoio); }
.dash-pares li > b { font-weight: 650; }
.dash-pares small { color: var(--s-apoio); }

/* KPIs pastel */
.dash-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container (min-width: 700px) and (max-width: 1019px) { .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 1400px) { .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash-kpi { border-radius: 22px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: var(--s-sombra); border: 1px solid rgba(255, 255, 255, .7); }
.dash-kpi .dash-ico { width: 34px; height: 34px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .66); margin-bottom: 8px; }
.dash-kpi span { font-size: 12.5px; color: #6d6270; }
.dash-kpi b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dash-kpi small { font-size: 11.5px; color: #867b89; }
.dash-kpi--lilas { background: linear-gradient(160deg, #f1edfd, #e7e1fa); } .dash-kpi--lilas .dash-ico { color: #6b5fd0; }
.dash-kpi--azul { background: linear-gradient(160deg, #eaf3fc, #dfecf9); } .dash-kpi--azul .dash-ico { color: #4b84bd; }
.dash-kpi--rosa { background: linear-gradient(160deg, #fdedf2, #f9e0e8); } .dash-kpi--rosa .dash-ico { color: #c4627f; }
.dash-kpi--verde { background: linear-gradient(160deg, #e9f6ef, #dcf0e5); } .dash-kpi--verde .dash-ico { color: #3f9569; }
.dash-kpi--ambar { background: linear-gradient(160deg, #fdf3e2, #f9e8cc); } .dash-kpi--ambar .dash-ico { color: #b27a2b; }

/* gráfico de linhas */
.dash-linhas { width: 100%; height: auto; max-height: 270px; display: block; }
.dash-grade { stroke: var(--s-linha); stroke-width: 1; stroke-dasharray: 3 4; }
.dash-eixo { font-size: 10.5px; fill: var(--s-apoio); }
.dash-leg-linhas { display: flex; gap: 14px; font-size: 12px; color: var(--s-apoio); }
.dash-leg-linhas span { display: inline-flex; align-items: center; gap: 6px; }
.dash-leg-linhas i { width: 14px; height: 4px; border-radius: 4px; display: inline-block; }

/* balancete */
.dash-balancete { display: grid; grid-template-columns: 1fr; gap: 14px 24px; }
@container (min-width: 520px) { .dash-balancete { grid-template-columns: 1fr 1fr; } }
.dash-bal-col { display: flex; flex-direction: column; }
.dash-bal-col .dash-total { margin-top: auto; }
.dash-bal-col ul { margin-bottom: 8px; }
.dash-bal-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--s-apoio); font-weight: 650; }
.dash-bal-col ul { list-style: none; margin: 0; padding: 0; }
.dash-bal-col li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; border-top: 1px solid var(--s-linha); }
.dash-bal-col li:first-child { border-top: 0; }
.dash-bal-col li.dash-sub { color: var(--s-apoio); font-size: 12px; }
.dash-total { display: flex; justify-content: space-between; margin-top: 8px; padding: 10px 14px; border-radius: 14px; background: var(--s-tinta-1); font-size: 13px; }
.dash-total b { font-weight: 700; }
.dash-resultado { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 13px 16px; border-radius: 16px; font-size: 14px; flex-wrap: wrap; }
.dash-resultado b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.dash-resultado--pos { background: #e1f3ea; color: #2c6e4d; }
.dash-resultado--neg { background: #fde8e8; color: #a84646; }

/* rosca */
.dash-donut { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dash-donut svg { width: 170px; max-width: 100%; height: auto; }
.dash-donut-rot { font-size: 10px; fill: var(--s-apoio); letter-spacing: .08em; text-transform: uppercase; }
.dash-donut-val { font-size: 15px; font-weight: 700; fill: var(--s-texto); }
.dash-legenda { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 7px; }
.dash-legenda li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.dash-leg-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--s-apoio); }
.dash-bolinha { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* barras horizontais */
.dash-barras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.dash-barra-cab { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.dash-barra-cab span { color: var(--s-apoio); }
.dash-trilho { height: 9px; border-radius: 999px; background: var(--dash-trilho); overflow: hidden; }
.dash-preench { height: 100%; border-radius: 999px; transition: width .4s ease; }

/* listas (próximas contas, unidades) e ranking */
.dash-lista { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.dash-card > h3 + .dash-lista { margin-top: 0; }
.dash-lista li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--s-linha); font-size: 13px; }
.dash-lista li:first-child { border-top: 0; }
.dash-lista li > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-lista small { color: var(--s-apoio); font-size: 11.5px; }
.dash-conta-dir { text-align: right; align-items: flex-end; flex: 0 0 auto; }
.dash-atraso { color: #b04a4a !important; font-weight: 600; }
.dash-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-rank li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--s-linha); font-size: 13px; }
.dash-rank li:first-child { border-top: 0; }
.dash-rank li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-rank small { color: var(--s-apoio); font-size: 11.5px; }
.dash-rank-n { width: 26px; height: 26px; border-radius: 50%; background: var(--s-tinta-2); color: var(--cor-marca); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dash-rank li:nth-child(1) .dash-rank-n { background: #fcefd0; color: #a9741f; }

/* aviso do ponto (recepção) */
.tela-ponto-portao {
  background:
    radial-gradient(800px 560px at 8% -4%, color-mix(in srgb, var(--cor-marca) 17%, transparent), transparent 62%),
    radial-gradient(760px 560px at 100% 8%, rgba(176, 164, 240, .30), transparent 60%),
    #f8f4f7;
}

/* ---------- botões só com ícone (ações das tabelas) ---------- */
.btn-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; margin: 0 2px 0 0;
  border: 1px solid var(--s-linha); border-radius: 11px; background: rgba(255, 255, 255, .9); color: color-mix(in srgb, var(--cor-marca) 80%, #555);
  cursor: pointer; vertical-align: middle; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn-ico svg { width: 17px; height: 17px; }
.btn-ico:hover { background: var(--s-tinta-2); border-color: var(--s-tinta-3); color: var(--cor-marca); }
.btn-ico:active { transform: scale(.94); }
.btn-ico:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--s-tinta-2); }
.btn-ico.ok { color: #3f9569; }
.btn-ico.ok:hover { background: #e1f3ea; border-color: #bfe3d0; color: #2c6e4d; }
.btn-ico.perigo { color: #b85a5a; }
.btn-ico.perigo:hover { background: #fde8e8; border-color: #f0c8c8; color: #a84646; }
.btn-ico[hidden] { display: none; }
.btn-ico:disabled { opacity: .45; cursor: default; }
td .btn-ico:last-child { margin-right: 0; }
table.tabela-gestao td:last-child:has(.btn-ico) { white-space: nowrap; }
@media (max-width: 800px) {
  .btn-ico { width: 44px; height: 44px; margin-right: 6px; }
  .btn-ico svg { width: 20px; height: 20px; }
  table.tabela-gestao td[data-rotulo=""] .btn-ico { min-height: 44px; }
}
@media (min-width: 801px) {
  #lista-prof th.col-acoes { background: var(--s-tinta-1); }
  #lista-prof td.col-acoes { background: #fffcfd; box-shadow: -8px 0 10px -8px rgba(70, 40, 60, .14); }
  #lista-prof tr:hover td.col-acoes { background: var(--s-tinta-1); }
}

/* ---------- botão de tema (claro/escuro) ---------- */
.topo-acoes { display: flex; align-items: center; gap: 10px; }
.btn-tema, .btn-desempenho {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid var(--s-linha); background: var(--s-superficie); color: var(--s-apoio); box-shadow: var(--s-sombra); transition: color .15s, background .15s;
}
.btn-tema:hover { color: var(--cor-marca); background: var(--s-tinta-1); }
.btn-tema svg { width: 19px; height: 19px; }
.btn-tema .tema-lua { display: none; }
html[data-tema="escuro"] .btn-tema .tema-sol { display: none; }
html[data-tema="escuro"] .btn-tema .tema-lua { display: block; }
body.sem-sessao .btn-tema, body.sem-sessao .btn-desempenho { display: none; }
.bm-botao.btn-tema { width: 46px; height: 46px; border: 0; background: none; box-shadow: none; color: #fff; border-radius: 10px; }
.bm-botao.btn-tema:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.bm-botao.btn-tema svg { width: 22px; height: 22px; }
@media (min-width: 801px) { .bm-botao.btn-tema { display: none; } }

/* =====================================================================
   TEMA ESCURO (grafite, como as referências escuras; a cor da marca vira o destaque)
   Escolha por pessoa: botão ☀/☾ no topo; guardado no navegador (gestao_tema).
   ===================================================================== */
html[data-tema="escuro"] {
  color-scheme: dark;
  --cor-marca: color-mix(in srgb, var(--cor-marca-base) 40%, #ffffff) !important;
  --cor-marca-claro: rgba(255, 255, 255, .06) !important;
  --s-tinta-1: rgba(255, 255, 255, .045);
  --s-tinta-2: color-mix(in srgb, var(--cor-marca-base) 32%, #202126);
  --s-tinta-3: color-mix(in srgb, var(--cor-marca-base) 48%, #202126);
  --s-linha: rgba(255, 255, 255, .09);
  --s-texto: #e9e6ee;
  --s-apoio: #a29eac;
  --s-cartao: rgba(43, 45, 51, .82);
  --s-sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 28px -14px rgba(0, 0, 0, .6);
  --s-superficie: #2c2e34;
  --s-dialogo: #26282d;
  --s-ponto: #2b2d33;
  --dash-trilho: rgba(255, 255, 255, .08);
  --s-grad: linear-gradient(135deg, color-mix(in srgb, var(--cor-marca-base) 86%, #ffffff), var(--cor-marca-base));
  --cor-fundo: #1b1c20;
  --cor-borda: rgba(255, 255, 255, .09);
  --cor-sucesso: #6fd0a0;
  --cor-alerta: #f09a9a;
  --cor-atencao: #eebf73;
}
html[data-tema="escuro"] body {
  background:
    radial-gradient(900px 620px at 6% -6%, color-mix(in srgb, var(--cor-marca-base) 30%, transparent), transparent 62%),
    radial-gradient(820px 600px at 104% 8%, rgba(110, 100, 210, .20), transparent 60%),
    radial-gradient(900px 700px at 58% 112%, rgba(60, 70, 110, .30), transparent 62%),
    #16171a;
  background-attachment: fixed;
}
html[data-tema="escuro"] .shell { background: rgba(32, 33, 38, .78); border-color: rgba(255, 255, 255, .06); box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 28px 70px -24px rgba(0, 0, 0, .7); }
html[data-tema="escuro"] .sidebar { border-right-color: var(--s-linha); }
html[data-tema="escuro"] .marca-sidebar { color: #f1eef6; }
html[data-tema="escuro"] .piloto, html[data-tema="escuro"] .master-info span { color: var(--s-apoio); }
html[data-tema="escuro"] a.nav-item.ativa { color: #fff; }
html[data-tema="escuro"] .nav-ico { opacity: .7; }
html[data-tema="escuro"] .area-master, html[data-tema="escuro"] .master-info { color: var(--s-texto); }
html[data-tema="escuro"] .barra-topo h1, html[data-tema="escuro"] .dash-topo h2 { color: #f4f1f8; }
html[data-tema="escuro"] .aba.ativa { color: #fff; }
html[data-tema="escuro"] a.nav-item, html[data-tema="escuro"] .dash-card h3, html[data-tema="escuro"] .kpi-valor, html[data-tema="escuro"] .ficha-painel h3 { color: var(--s-texto); }
html[data-tema="escuro"] .kpi-valor { color: #f4f1f8; }

/* superfícies que no claro eram "white" fixo */
html[data-tema="escuro"] .tabela-caixa-wrapper, html[data-tema="escuro"] table.tabela-caixa,
html[data-tema="escuro"] table.tabela-gestao, html[data-tema="escuro"] .seg-filtro, html[data-tema="escuro"] .seg-botao,
html[data-tema="escuro"] .btn-icone, html[data-tema="escuro"] .barra-selecao, html[data-tema="escuro"] .barra-progresso,
html[data-tema="escuro"] .nota-item, html[data-tema="escuro"] .perfil-rodape, html[data-tema="escuro"] .historico-rolagem { background: var(--s-cartao); color: var(--s-texto); }
html[data-tema="escuro"] .seg-botao { background: transparent; }
html[data-tema="escuro"] .seg-botao.seg-ativo { background: var(--s-grad); color: #fff; }
html[data-tema="escuro"] .btn-icone { background: var(--s-superficie); }
html[data-tema="escuro"] .btn-icone:hover { background: rgba(240, 120, 120, .16); }
html[data-tema="escuro"] table.tabela-gestao td, html[data-tema="escuro"] table.tabela-caixa td { color: var(--s-texto); }
html[data-tema="escuro"] .linha-detalhe-caixa td, html[data-tema="escuro"] .nota-item { background: rgba(255, 255, 255, .03); }
html[data-tema="escuro"] table.tabela-gestao th, html[data-tema="escuro"] table.tabela-caixa .cab-topo-caixa th { color: var(--s-apoio); }
html[data-tema="escuro"] table.tabela-caixa .cab-sub-caixa th { background: var(--s-tinta-2); color: #fff; }
html[data-tema="escuro"] .th-ordenavel:hover, html[data-tema="escuro"] .th-ordenavel.th-ativo { background: var(--s-tinta-2); }
html[data-tema="escuro"] #lista-prof td.col-acoes { background: #2a2c32; box-shadow: -8px 0 10px -8px rgba(0, 0, 0, .6); }
html[data-tema="escuro"] #lista-prof th.col-acoes { background: #30323a; }
html[data-tema="escuro"] #lista-prof tr:hover td.col-acoes { background: #33353d; }

/* campos, botões, janelas */
html[data-tema="escuro"] input, html[data-tema="escuro"] select, html[data-tema="escuro"] textarea,
html[data-tema="escuro"] .barra-filtros input, html[data-tema="escuro"] .barra-filtros select, html[data-tema="escuro"] .filtros-caixa-linha input,
html[data-tema="escuro"] .filtros-caixa-linha select, html[data-tema="escuro"] dialog input, html[data-tema="escuro"] dialog select,
html[data-tema="escuro"] dialog textarea, html[data-tema="escuro"] .form-vertical input, html[data-tema="escuro"] .caixa-login input,
html[data-tema="escuro"] .linha-config input, html[data-tema="escuro"] .linha-config select, html[data-tema="escuro"] .linha-config textarea,
html[data-tema="escuro"] .form-nota textarea, html[data-tema="escuro"] .chave-agenda input, html[data-tema="escuro"] .dash-controles select {
  background: rgba(255, 255, 255, .05); color: var(--s-texto); border-color: var(--s-linha);
}
html[data-tema="escuro"] input::placeholder, html[data-tema="escuro"] textarea::placeholder { color: #7f7b89; }
html[data-tema="escuro"] select option { background: #2a2c31; color: var(--s-texto); }
html[data-tema="escuro"] input[type="date"], html[data-tema="escuro"] input[type="month"], html[data-tema="escuro"] input[type="time"] { color-scheme: dark; }
html[data-tema="escuro"] button.secundario, html[data-tema="escuro"] a.secundario, html[data-tema="escuro"] .acoes-modal button[type="button"]:not(.primario),
html[data-tema="escuro"] .btn-ico, html[data-tema="escuro"] .btn-perfil, html[data-tema="escuro"] .link-voltar-balcao {
  background: rgba(255, 255, 255, .06); color: var(--s-texto); border-color: var(--s-linha);
}
html[data-tema="escuro"] button.secundario:hover, html[data-tema="escuro"] a.secundario:hover, html[data-tema="escuro"] .btn-ico:hover { background: var(--s-tinta-2); color: #fff; border-color: var(--s-tinta-3); }
html[data-tema="escuro"] .btn-ico { color: #cfc9da; }
html[data-tema="escuro"] .btn-ico.ok { color: #7fdcaa; }
html[data-tema="escuro"] .btn-ico.ok:hover { background: rgba(80, 200, 140, .18); border-color: rgba(80, 200, 140, .4); color: #9ae8be; }
html[data-tema="escuro"] .btn-ico.perigo { color: #f2a0a0; }
html[data-tema="escuro"] .btn-ico.perigo:hover { background: rgba(240, 110, 110, .18); border-color: rgba(240, 110, 110, .4); color: #f7b8b8; }
html[data-tema="escuro"] dialog { color: var(--s-texto); border: 1px solid var(--s-linha); }
html[data-tema="escuro"] dialog::backdrop { background: rgba(0, 0, 0, .55); }
html[data-tema="escuro"] .acoes-modal { background: var(--s-dialogo); }
html[data-tema="escuro"] .perfil-rodape .btn-sair { background: transparent; border-color: rgba(240, 110, 110, .4); }
html[data-tema="escuro"] .perfil-chip, html[data-tema="escuro"] code { background: var(--s-tinta-2); color: #fff; }
html[data-tema="escuro"] .caixa-login { background: rgba(38, 40, 45, .92); border-color: var(--s-linha); }
html[data-tema="escuro"] .caixa-login h2 { color: #f4f1f8; }

/* avisos e status */
html[data-tema="escuro"] .pill--ok { background: rgba(80, 200, 140, .16); color: #7fdcaa; }
html[data-tema="escuro"] .pill--alerta { background: rgba(240, 110, 110, .16); color: #f2a0a0; }
html[data-tema="escuro"] .pill--atencao { background: rgba(240, 180, 80, .16); color: #f0c27a; }
html[data-tema="escuro"] .pill--neutro { background: rgba(255, 255, 255, .08); color: #b9b4c3; }
html[data-tema="escuro"] .aviso-caixa, html[data-tema="escuro"] .resultado-envio { background: rgba(255, 255, 255, .06); color: var(--s-texto); }
html[data-tema="escuro"] .aviso-caixa--ok, html[data-tema="escuro"] .resultado-envio--ok { background: rgba(80, 200, 140, .14); }
html[data-tema="escuro"] .aviso-caixa--alerta { background: rgba(240, 180, 80, .14); }
html[data-tema="escuro"] .msg-erro { background: rgba(240, 110, 110, .15); color: #f2a0a0; }
html[data-tema="escuro"] .chave-agenda--off { background: rgba(240, 110, 110, .1); border-color: rgba(240, 110, 110, .35); }
html[data-tema="escuro"] .aviso-inline { color: #eebf73; }
html[data-tema="escuro"] .instalar-app { background: rgba(255, 255, 255, .05); }
html[data-tema="escuro"] .tela-ponto-portao {
  background: radial-gradient(800px 560px at 8% -4%, color-mix(in srgb, var(--cor-marca-base) 30%, transparent), transparent 62%), #17181b; color: var(--s-texto);
}
html[data-tema="escuro"] .pp-caixa h2 { color: #f4f1f8; }

/* Início (dashboard) */
html[data-tema="escuro"] .dash-controles select, html[data-tema="escuro"] .dash-seg { background: rgba(255, 255, 255, .05); border-color: var(--s-linha); }
html[data-tema="escuro"] .dash-seg button.ativo { color: #fff; }
html[data-tema="escuro"] .dash-card { border-color: rgba(255, 255, 255, .06); }
html[data-tema="escuro"] .dash-donut-val { fill: #f4f1f8; }
html[data-tema="escuro"] .dash-alerta { color: var(--s-texto); }
html[data-tema="escuro"] .dash-alerta span { color: #b4afbe; }
html[data-tema="escuro"] .dash-alerta--alerta { background: rgba(240, 110, 110, .15); }
html[data-tema="escuro"] .dash-alerta--atencao { background: rgba(240, 180, 80, .14); }
html[data-tema="escuro"] .dash-alerta--info { background: rgba(110, 160, 230, .15); }
html[data-tema="escuro"] .dash-alerta--ok { background: rgba(80, 200, 140, .14); }
html[data-tema="escuro"] .dash-alerta--alerta .dash-ico { color: #f2a0a0; }
html[data-tema="escuro"] .dash-alerta--atencao .dash-ico { color: #f0c27a; }
html[data-tema="escuro"] .dash-alerta--info .dash-ico { color: #8fb6ec; }
html[data-tema="escuro"] .dash-alerta--ok .dash-ico { color: #7fdcaa; }
html[data-tema="escuro"] .dash-ico { color: #b9b3c6; }
html[data-tema="escuro"] .dash-kpi { border-color: rgba(255, 255, 255, .06); }
html[data-tema="escuro"] .dash-kpi span, html[data-tema="escuro"] .dash-kpi small { color: #b4afbe; }
html[data-tema="escuro"] .dash-kpi b { color: #f4f1f8; }
html[data-tema="escuro"] .dash-kpi .dash-ico { background: rgba(255, 255, 255, .08); }
html[data-tema="escuro"] .dash-kpi--lilas { background: linear-gradient(160deg, rgba(143, 134, 232, .26), rgba(143, 134, 232, .12)); } html[data-tema="escuro"] .dash-kpi--lilas .dash-ico { color: #b6afff; }
html[data-tema="escuro"] .dash-kpi--azul { background: linear-gradient(160deg, rgba(110, 160, 230, .26), rgba(110, 160, 230, .12)); } html[data-tema="escuro"] .dash-kpi--azul .dash-ico { color: #9cc4f2; }
html[data-tema="escuro"] .dash-kpi--rosa { background: linear-gradient(160deg, rgba(239, 155, 180, .26), rgba(239, 155, 180, .12)); } html[data-tema="escuro"] .dash-kpi--rosa .dash-ico { color: #f4a9c0; }
html[data-tema="escuro"] .dash-kpi--verde { background: linear-gradient(160deg, rgba(100, 200, 150, .24), rgba(100, 200, 150, .11)); } html[data-tema="escuro"] .dash-kpi--verde .dash-ico { color: #86dcae; }
html[data-tema="escuro"] .dash-kpi--ambar { background: linear-gradient(160deg, rgba(240, 190, 100, .24), rgba(240, 190, 100, .11)); } html[data-tema="escuro"] .dash-kpi--ambar .dash-ico { color: #f0c987; }
html[data-tema="escuro"] .dash-resultado--pos { background: rgba(80, 200, 140, .16); color: #8fe3b8; }
html[data-tema="escuro"] .dash-resultado--neg { background: rgba(240, 110, 110, .16); color: #f4a6a6; }
html[data-tema="escuro"] .dash-atraso { color: #f2a0a0 !important; }
html[data-tema="escuro"] .dash-rank li:nth-child(1) .dash-rank-n { background: rgba(240, 190, 100, .22); color: #f0c987; }
html[data-tema="escuro"] .dash-rank-n { color: #fff; }
html[data-tema="escuro"] .dash-link { color: color-mix(in srgb, var(--cor-marca-base) 35%, #ffffff); }
html[data-tema="escuro"] .dash-total { background: rgba(255, 255, 255, .05); }

@media (max-width: 800px) {
  html[data-tema="escuro"] .sidebar { background: #1f2024; }
  html[data-tema="escuro"] table.tabela-gestao tr { background: var(--s-cartao); border-color: rgba(255, 255, 255, .06); }
  html[data-tema="escuro"] .barra-mobile { background: linear-gradient(135deg, #2a2b31, #202126); border-bottom: 1px solid var(--s-linha); }
}

/* ---------- seletor de unidade (cartão + lista suspensa) ---------- */
.faixa-unidade { position: relative; display: block; margin: 0 0 16px; padding: 0; background: none !important; color: var(--s-texto); }
.un-botao {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 16px; text-align: left; font: inherit; cursor: pointer;
  background: var(--s-cartao); border: 1px solid var(--s-linha); box-shadow: var(--s-sombra); color: var(--s-texto); transition: border-color .15s, background .15s;
}
.un-botao:disabled { cursor: default; }
.un-botao:not(:disabled):hover { border-color: var(--s-tinta-3); background: var(--s-tinta-1); }
.un-botao:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--s-tinta-2); }
.un-emblema {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--un-cor) 78%, white), var(--un-cor));
  box-shadow: 0 6px 12px -6px var(--un-cor);
}
.col-un { width: 56px; text-align: center; white-space: nowrap; }
.col-un .un-emblema--mini, .acao-un .un-emblema--mini { margin: 0; }
.acao-un { display: inline-flex; width: 30px; justify-content: center; align-items: center; vertical-align: middle; margin-right: 4px; }
.un-emblema--mini { width: 20px; height: 20px; border-radius: 7px; font-size: 9.5px; margin-left: 6px; vertical-align: middle; box-shadow: none; cursor: help; }
.un-textos { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.un-textos small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--s-apoio); font-weight: 600; }
.un-textos b { font-size: 13.5px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.un-seta { width: 16px; height: 16px; color: var(--s-apoio); flex: 0 0 auto; }
.un-lista {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--s-dialogo); border: 1px solid var(--s-linha); border-radius: 18px; box-shadow: 0 20px 44px -12px rgba(50, 30, 50, .32);
}
.un-lista[hidden] { display: none; }
.un-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 14px;
  color: var(--s-texto); cursor: pointer; text-align: left;
}
.un-item span:not(.un-emblema) { flex: 1; min-width: 0; line-height: 1.2; }
.un-item .un-emblema { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; box-shadow: none; }
.un-item:hover, .un-item:focus-visible { background: var(--s-tinta-2); outline: none; }
.un-item.atual { font-weight: 650; }
.un-check { width: 16px; height: 16px; color: var(--cor-marca); flex: 0 0 auto; }
@media (max-width: 800px) { .faixa-unidade { margin: 0 0 14px; } .un-botao { padding: 11px 12px; } .un-item { padding: 12px 10px; font-size: 16px; } }

/* bordas dos cartões no escuro */
html[data-tema="escuro"] .kpi, html[data-tema="escuro"] .ficha-painel, html[data-tema="escuro"] .linha-config, html[data-tema="escuro"] .filtros-caixa,
html[data-tema="escuro"] .cartao-import, html[data-tema="escuro"] .chave-agenda, html[data-tema="escuro"] .bloco-acordo, html[data-tema="escuro"] .grupo-unidades,
html[data-tema="escuro"] .barra-selecao, html[data-tema="escuro"] .tabela-caixa-wrapper, html[data-tema="escuro"] .caixa-login { border-color: var(--s-linha); }
html[data-tema="escuro"] .un-lista { box-shadow: 0 20px 44px -12px rgba(0, 0, 0, .7); }

/* ---------- Relatórios: grupos que abrem para mostrar o conteúdo ---------- */
.botao-link { background: none; border: 0; color: var(--cor-marca); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 6px; }
.botao-link:hover { text-decoration: underline; }
.rel-acoes { display: flex; gap: 8px; justify-content: flex-end; margin: 6px 0 4px; }
.rel-lista { background: var(--s-cartao); border-radius: var(--s-raio); box-shadow: var(--s-sombra); overflow: hidden; }
.rel-cab, .rel-grupo > summary { display: grid; grid-template-columns: minmax(0, 1fr) 120px 140px; gap: 12px; align-items: center; padding: 12px 20px; }
.rel-cab { background: var(--s-tinta-1); color: var(--s-apoio); font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--s-linha); }
.rel-cab:not(:has(span:nth-child(3))), .rel-grupo > summary:not(:has(> span:nth-child(3))) { grid-template-columns: minmax(0, 1fr) 120px; }
.rel-grupo { border-bottom: 1px solid var(--s-linha); }
.rel-grupo:last-child { border-bottom: 0; }
.rel-grupo > summary { cursor: pointer; list-style: none; }
.rel-grupo > summary::-webkit-details-marker { display: none; }
.rel-grupo > summary:hover { background: var(--s-tinta-1); }
.rel-grupo[open] > summary { background: var(--s-tinta-2); font-weight: 600; }
.rel-nome { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.rel-seta { display: inline-block; width: 14px; color: var(--cor-marca); transition: transform .15s; }
.rel-grupo[open] .rel-seta { transform: rotate(90deg); }
.rel-corpo { padding: 4px 20px 16px 42px; background: var(--s-tinta-1); overflow-x: auto; }
.rel-corpo table.rel-itens { background: var(--s-superficie, #fff); }
@media (max-width: 800px) {
  .rel-cab, .rel-grupo > summary { grid-template-columns: minmax(0, 1fr) 84px 104px; padding: 12px 14px; gap: 8px; }
  .rel-cab:not(:has(span:nth-child(3))), .rel-grupo > summary:not(:has(> span:nth-child(3))) { grid-template-columns: minmax(0, 1fr) 84px; }
  .rel-corpo { padding: 4px 10px 12px; }
}

/* itens do painel que abrem a tela de origem */
.dash-clicavel { cursor: pointer; border-radius: 10px; transition: background-color .15s ease; }
.dash-pares li.dash-clicavel { margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.dash-clicavel:hover, .dash-clicavel:focus-visible { background: var(--s-tinta-1); outline: none; }
