:root {
  --fundo: #f1f5f9;
  --cartao: #ffffff;
  --texto: #0f172a;
  --suave: #64748b;
  --borda: #e2e8f0;
  --marca: #0f766e;
  --marca-forte: #115e59;
  --topo: #0f172a;
  --ok: #16a34a;
  --atencao: #ca8a04;
  --ruim: #dc2626;
  --sombra: 0 6px 24px rgba(15, 23, 42, .16);
  --painel: 420px;
  --raio: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
}
button, input, select, textarea { font: inherit; color: inherit; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ botões e formulários */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--borda); background: var(--cartao); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn.primario { background: var(--marca); border-color: var(--marca); color: #fff; }
.btn.primario:hover { background: var(--marca-forte); }
.btn.perigo { color: var(--ruim); }
.btn.alerta { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn.mini { padding: 3px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: wait; }
.link { background: none; border: 0; padding: 0; color: var(--marca); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.perigo { color: var(--ruim); }

.form { display: grid; gap: 10px; margin: 12px 0; }
.form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--suave); font-weight: 600; }
.form input:not([type=checkbox]):not([type=color]), .form select, .form textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 9px; background: #fff; color: var(--texto); font-weight: 400;
}
.form input[type=color] { width: 100%; height: 36px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 2px; background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid #99f6e4; border-color: var(--marca); }
.form input[readonly], .form textarea[readonly] { background: #f8fafc; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--texto); }
.form h3 { margin: 8px 0 0; }
.form.sub { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: var(--raio); padding: 12px; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linha3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.botoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.nota { color: var(--suave); font-size: 12.5px; margin: 6px 0; }
.nota.alerta, li.alerta { color: #b45309; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); margin: 0 0 8px; }

/* ------------------------------------------------------------ topo */
#topo {
  position: fixed; inset: 0 0 auto 0; height: 52px; z-index: 1100;
  display: flex; align-items: center; gap: 14px; padding: 0 12px;
  background: var(--topo); color: #e2e8f0;
}
.marca { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.marca b { color: #fff; font-size: 15px; }
.marca span { color: #94a3b8; font-size: 12.5px; }
.busca { position: relative; flex: 1; max-width: 560px; }
#busca {
  width: 100%; border: 0; border-radius: 8px; padding: 8px 12px; background: #1e293b; color: #f8fafc;
}
#busca::placeholder { color: #94a3b8; }
#busca:focus { outline: 2px solid var(--marca); background: #0b1220; }
#busca-res {
  position: absolute; top: 42px; left: 0; right: 0; background: var(--cartao); color: var(--texto);
  border-radius: var(--raio); box-shadow: var(--sombra); max-height: 70vh; overflow: auto; padding: 4px;
}
#busca-res button {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
}
#busca-res button:hover { background: #f1f5f9; }
#busca-res span { display: grid; }
#busca-res small { color: var(--suave); }
#topo nav { display: flex; gap: 6px; margin-left: auto; position: relative; }
#topo nav .btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }
#topo nav .btn:hover { background: #334155; }
#menu {
  position: absolute; right: 0; top: 44px; background: var(--cartao); color: var(--texto); border-radius: var(--raio);
  box-shadow: var(--sombra); min-width: 220px; padding: 6px; display: grid;
}
#menu button, #menu a { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: inherit; text-decoration: none; }
#menu button:hover, #menu a:hover { background: #f1f5f9; }
#faixa-suporte {
  position: fixed; top: 52px; left: 0; right: 0; z-index: 1050; background: #fef3c7; color: #78350f;
  text-align: center; font-size: 12.5px; padding: 3px;
}

/* o que o tipo de usuário não pode fazer some da tela (o servidor confere de novo) */
.sem-rede .so-editor, .sem-clientes .so-clientes, .sem-pendencias .so-pendencias, .sem-admin .so-admin { display: none !important; }

/* ------------------------------------------------------------ mapa */
#mapa { position: fixed; top: 52px; left: 0; right: 0; bottom: 0; background: #dbe4ee; }
body.com-painel .leaflet-right { right: var(--painel); }
.leaflet-container { font: inherit; }
.leaflet-tooltip { font-size: 12.5px; }
body[data-modo="novo"] #mapa, body[data-modo="cabo"] #mapa, body[data-modo="medir"] #mapa,
body[data-modo="viabilidade"] #mapa, body[data-modo="mover"] #mapa, body[data-modo="local-cliente"] #mapa,
body[data-modo="novo"] .leaflet-interactive, body[data-modo="cabo"] .leaflet-interactive { cursor: crosshair; }

#ferramentas {
  position: fixed; top: 64px; left: 10px; z-index: 1000; display: grid; gap: 2px;
  background: var(--cartao); border-radius: 12px; box-shadow: var(--sombra); padding: 5px;
}
#ferramentas button {
  display: grid; justify-items: center; gap: 2px; width: 62px; padding: 6px 2px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; font-size: 11px; color: #334155;
}
#ferramentas button:hover { background: #f1f5f9; }
#ferramentas button.ativo { background: #ccfbf1; color: var(--marca-forte); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--marca); }

#legenda {
  position: fixed; left: 86px; bottom: 22px; z-index: 1000; background: var(--cartao); border-radius: var(--raio);
  box-shadow: var(--sombra); padding: 6px 10px; font-size: 12.5px; max-width: 250px;
}
.leg-titulo { border: 0; background: none; font-weight: 700; cursor: pointer; padding: 2px 0; }
#leg-corpo { display: grid; gap: 3px; margin-top: 4px; }
#leg-corpo label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.leg-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--suave); font-size: 11.5px; margin: 2px 0 2px 22px; }
.leg-sub span { display: inline-flex; align-items: center; gap: 4px; }
.traco { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.leg-nota { margin: 4px 0 0; color: var(--suave); font-size: 11px; }
.leg-modo { display: flex; align-items: center; gap: 4px; margin-left: 22px; font-size: 11.5px; color: var(--suave); }
.leg-modo button {
  border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: 0 8px; font-size: 11.5px; cursor: pointer; color: var(--suave);
}
.leg-modo button.ativo { background: #ccfbf1; border-color: var(--marca); color: var(--marca-forte); font-weight: 600; }
.leg-grupo { margin-top: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); }
.amostra { flex: none; }

#dica {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 1000; max-width: min(760px, 70vw);
  background: rgba(15, 23, 42, .92); color: #f8fafc; padding: 8px 14px; border-radius: 999px; font-size: 13px; text-align: center;
}
body.com-painel #dica { left: calc((100% - var(--painel)) / 2); max-width: calc(100vw - var(--painel) - 24px); }
#dica .dica-modelo { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; font-weight: 600; white-space: nowrap; }
#dica select { border: 0; border-radius: 999px; padding: 2px 8px; background: #334155; color: #f8fafc; max-width: 220px; }
body:has(#faixa-suporte) #dica { top: 84px; }
body:has(#faixa-suporte) #ferramentas { top: 82px; }
#aviso {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 3000; max-width: 80vw;
  background: #064e3b; color: #ecfdf5; padding: 9px 16px; border-radius: 10px; box-shadow: var(--sombra);
}
#aviso.erro { background: #7f1d1d; color: #fef2f2; }

.alca { background: #fff; border: 2.5px solid #0f172a; border-radius: 3px; }
.alca.ponta { border-color: #16a34a; border-radius: 50%; }
.alca.meio { background: rgba(255, 255, 255, .75); border: 1.5px dashed #0f172a; border-radius: 50%; cursor: copy; }

/* ------------------------------------------------------------ painel lateral */
#painel {
  position: fixed; top: 52px; right: 0; bottom: 0; width: var(--painel); z-index: 1001; overflow: auto;
  background: var(--cartao); box-shadow: var(--sombra); padding: 14px 16px 40px;
}
#painel .fechar, #dialogo .fechar {
  position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--suave);
}
.cab { display: flex; gap: 10px; align-items: center; padding-right: 26px; }
.cab small { color: var(--suave); }
.cab .ic { display: grid; place-items: center; }
.pontas-cabo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.secao { border-top: 1px solid var(--borda); padding-top: 12px; margin-top: 12px; }
.secao summary { cursor: pointer; color: var(--suave); font-weight: 600; }
.titulo-linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.titulo-linha h2, .titulo-linha h3 { margin: 0; }
.item { border: 1px solid var(--borda); border-radius: var(--raio); padding: 8px 10px; margin-bottom: 8px; }
.item-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.item-cab small { color: var(--suave); }
.acoes { margin-left: auto; display: inline-flex; gap: 10px; font-size: 12.5px; }
.selo { background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 8px; font-size: 11.5px; font-weight: 600; }
.selo.estado-projeto { background: #fae8ff; color: #a21caf; }
.selo.estado-nao_implantado { background: #fef3c7; color: #b45309; }
.selo.estado-certificado { background: #ccfbf1; color: #0f766e; }
.pontas, .tubo { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 3px 0; }
.rot { font-size: 11px; color: var(--suave); margin: 0 2px; }
.tubo-cor { border-left: 4px solid var(--c); padding-left: 4px; font-weight: 700; }

.dot {
  --c: #e2e8f0;
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(15, 23, 42, .25);
  background: var(--c); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center;
  cursor: pointer; padding: 0; position: relative;
}
.dot.clara { color: #0f172a; }
.dot.fibra { border-style: dashed; }
.dot.on { border: 2.5px solid #0f172a; box-shadow: 0 0 0 1.5px #fff inset; }
.dot.on::after {
  content: ''; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%;
  background: #0f172a; border: 1.5px solid #fff;
}
.dot.sel { outline: 3px solid #facc15; outline-offset: 1px; }
.dot.porta { --c: #f8fafc; color: #0f172a; border-style: dashed; }
.dot.porta.on { --c: #cbd5e1; }
.dot.cli { --c: #0284c7; cursor: default; border-color: #0284c7; }
.ligar-barra {
  position: sticky; top: -14px; z-index: 2; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: #fefce8; border: 1px solid #fde68a; border-radius: var(--raio); padding: 8px 10px; margin-top: 10px;
}

.ocupacao { margin: 10px 0 0; font-size: 12.5px; color: var(--suave); }
.barra { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.barra i { display: block; height: 100%; background: var(--ok); }
.barra i.quase { background: #eab308; }
.barra i.cheia { background: var(--ruim); }
.portas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.porta-cli {
  display: grid; gap: 1px; text-align: left; border: 1px solid var(--borda); border-radius: 8px; padding: 5px 7px;
  background: #fff; cursor: pointer; min-width: 0; font-size: 12px;
}
.porta-cli b { font-size: 11px; color: var(--suave); }
.porta-cli span, .porta-cli small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.porta-cli small { color: var(--suave); font-size: 11px; }
.porta-cli.ocupada { background: #eff6ff; border-color: #bfdbfe; }
.porta-cli.livre { background: #f0fdf4; border-color: #bbf7d0; border-style: dashed; color: #166534; }
.porta-cli.cascata { background: #faf5ff; border-color: #e9d5ff; cursor: default; }
.lista-pon { display: grid; gap: 6px; }
.pon { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pon small { color: var(--suave); }

.tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tab th { text-align: left; color: var(--suave); font-weight: 600; border-bottom: 1px solid var(--borda); padding: 5px 6px; }
.tab td { border-bottom: 1px solid #f1f5f9; padding: 5px 6px; vertical-align: top; }
.tab .n { text-align: right; white-space: nowrap; }
.tab .seta { color: var(--suave); }
.tab tr.clicavel { cursor: pointer; }
.tab tr.clicavel:hover td { background: #f8fafc; }
.tab tr.inativo td { color: #94a3b8; }
.tab td.detalhe { max-width: 360px; overflow-wrap: anywhere; color: var(--suave); }
.tab.ligs select { width: auto; padding: 2px 4px; border-radius: 6px; border: 1px solid #cbd5e1; }
.tab.fibras .dot { cursor: default; }
.linha-rompe { display: flex; gap: 8px; }
.linha-rompe input { flex: 1; border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 9px; min-width: 0; }

.resultado { display: grid; gap: 2px; border-radius: var(--raio); padding: 12px 14px; margin: 12px 0; background: #f1f5f9; }
.resultado b { font-size: 24px; line-height: 1.15; }
.resultado.ok { background: #f0fdf4; color: #166534; }
.resultado.compacto b { font-size: 15px; line-height: 1.4; }
.resultado.atencao { background: #fefce8; color: #854d0e; }
.resultado.ruim { background: #fef2f2; color: #991b1b; }
.sit-ok { color: var(--ok); font-weight: 600; }
.sit-atencao { color: var(--atencao); font-weight: 600; }
.sit-ruim { color: var(--ruim); font-weight: 600; }

/* ------------------------------------------------------------ diálogo */
#dialogo {
  border: 0; border-radius: 14px; padding: 18px 20px; width: min(920px, 94vw); max-height: 88vh;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .35);
}
#dialogo::backdrop { background: rgba(15, 23, 42, .45); }

/* diagrama de fusões (diálogo largo) */
#dialogo.largo { width: min(1240px, 97vw); height: 92vh; max-height: 92vh; }
#dialogo.largo[open] { display: flex; flex-direction: column; }
#dialogo.largo #dialogo-corpo { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dg-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-right: 30px; }
.dg-topo h2 { margin: 0 !important; }
.dg-barra {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 0; padding: 8px 10px;
  background: #fefce8; border: 1px solid #fde68a; border-radius: var(--raio); font-size: 13px;
}
.dg-barra label { display: inline-flex; gap: 6px; align-items: center; }
.dg-barra select { border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 6px; }
.dg-area { flex: 1; min-height: 0; overflow: auto; margin-top: 10px; border: 1px solid var(--borda); border-radius: var(--raio); background: #fff; }
.dg-area svg { display: block; width: 100%; min-width: 900px; height: auto; }
.dg .lig { cursor: pointer; }
.dg .lig:hover .tr, .dg .lig.sel .tr { stroke-width: 4; }
.dg .lig:hover .ct, .dg .lig.sel .ct { stroke-opacity: .85; }
.dg .lig.sel > rect:first-of-type { fill: rgba(250, 204, 21, .18); }
.dg .clicavel { cursor: pointer; }
.dg circle.livre { fill: #fff; stroke: #94a3b8; stroke-width: 1.5; }
.dg circle.livre.clicavel:hover { stroke: var(--marca); stroke-width: 3; }
.dg circle.livre.escolhida { fill: #facc15; stroke: #a16207; stroke-width: 3; }
.dg .inverter:hover rect { fill: #ccfbf1; stroke: var(--marca); }
#dialogo h2 { margin-bottom: 10px; padding-right: 30px; }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 8px; }
.aba { border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--suave); }
.aba.ativa { border-color: var(--marca); color: var(--texto); font-weight: 600; }
.soltar {
  position: relative; display: grid !important; place-items: center; min-height: 110px; border: 2px dashed #94a3b8;
  border-radius: 12px; background: #f8fafc; color: var(--texto) !important; font-size: 14px !important; cursor: pointer; text-align: center; padding: 10px;
}
.soltar:hover { border-color: var(--marca); background: #f0fdfa; }
.soltar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.grupos td { vertical-align: middle; }
.grupos select { min-width: 130px; }
.grupos small { display: block; color: var(--suave); }
.exemplos { color: var(--suave); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progresso { display: grid; gap: 4px; margin: 10px 0; font-size: 12.5px; color: var(--suave); }
.progresso .barra i { background: var(--marca); transition: width .4s; }

/* ------------------------------------------------------------ catálogo */
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--suave); font-weight: 600; }
.inline select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 8px; background: #fff; color: var(--texto); font-weight: 400; }
.titulo-linha .nota { margin: 0; }
.linha-spl { display: grid; grid-template-columns: 120px auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }

/* ------------------------------------------------------------ login e revenda */
.tela-login { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #0f172a, #134e4a); padding: 16px; }
.cartao-login { width: min(380px, 100%); background: var(--cartao); border-radius: 16px; padding: 26px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.cartao-login label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--suave); }
.cartao-login input { border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 10px; font-size: 15px; color: var(--texto); }
.cartao-login .btn { justify-content: center; padding: 10px; font-size: 15px; }
.logo-login { display: flex; gap: 12px; align-items: center; }
.logo-login div { display: grid; }
.logo-login b { font-size: 18px; }
.logo-login span { color: var(--suave); font-size: 13px; }
.erro-login { margin: 0; background: #fef2f2; color: #991b1b; border-radius: 8px; padding: 8px 10px; }

.tela-admin main.admin { padding: 70px 16px 30px; max-width: 1200px; margin: 0 auto; }
.cartao { background: var(--cartao); border-radius: 14px; box-shadow: 0 2px 10px rgba(15, 23, 42, .06); padding: 18px; }
.provedores td { vertical-align: middle; }
.status { border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; }
.status.ativo { background: #dcfce7; color: #166534; }
.status.suspenso { background: #fee2e2; color: #991b1b; }
.tela-admin .cartao + .cartao { margin-top: 16px; }

/* ------------------------------------------------------------ integrações com mapas */
.links-mapa { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 10px 0 0; font-size: 12.5px; align-items: center; }
.links-mapa a {
  color: var(--marca-forte); text-decoration: none; border: 1px solid #99f6e4; background: #f0fdfa;
  border-radius: 999px; padding: 2px 10px;
}
.links-mapa a:hover { background: #ccfbf1; }
.btn-gps {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: #fff; border: 2px solid rgba(0, 0, 0, .2); border-radius: 6px; color: #1d4ed8;
}
.btn-gps:hover { background: #f4f4f4; }
.btn-gps.buscando svg { animation: piscar 1s ease-in-out infinite; }
@keyframes piscar { 50% { opacity: .3; } }
.leaflet-container .marca-google {
  margin: 0; display: flex; gap: 6px; align-items: center; padding: 1px 6px;
  background: rgba(255, 255, 255, .85); color: #202124; font-size: 11px; line-height: 1.6;
}
.marca-google b { font-weight: 700; letter-spacing: .1px; }
.busca-nota { margin: 4px 8px 2px; font-size: 11.5px; color: var(--suave); }

/* ------------------------------------------------------------ relatórios */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.card { display: grid; gap: 2px; background: #f8fafc; border: 1px solid var(--borda); border-radius: var(--raio); padding: 8px 10px; }
.card b { font-size: 20px; line-height: 1.2; }
.card span { font-size: 12px; color: var(--suave); }
.card.ruim b { color: var(--ruim); }
.card.atencao b { color: var(--atencao); }
.linha-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 6px 0 10px; }
.linha-filtros label { display: grid; gap: 3px; font-size: 12px; color: var(--suave); font-weight: 600; }
.linha-filtros select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 8px; }
.mini-barra { display: inline-block; vertical-align: middle; width: 110px; height: 7px; margin-right: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.mini-barra i { display: block; height: 100%; background: var(--ok); }
.mini-barra i.quase { background: #eab308; }
.mini-barra i.cheia { background: var(--ruim); }
.nome-ic { display: inline-flex; align-items: center; gap: 6px; }
.rel-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ------------------------------------------------------------ telas pequenas */
.so-celular { display: none; }
@media (max-width: 760px) {
  :root { --painel: 100vw; }
  #topo { gap: 8px; padding: 0 8px; }
  .marca span, .marca b, .nome-usuario { display: none; }
  .so-celular { display: inline; }
  #menu .so-celular { display: block; }
  #topo nav > .btn[data-acao="importar"], #topo nav > .btn[data-acao="exportar"], #topo nav > .btn[data-acao="viabilidade"] { display: none; }
  #ferramentas, body:has(#faixa-suporte) #ferramentas {
    top: auto; bottom: 0; left: 0; right: 0; border-radius: 12px 12px 0 0; grid-auto-flow: column;
    overflow-x: auto; justify-content: start; align-items: start;
  }
  #faixa-suporte { font-size: 11.5px; }
  .leaflet-bottom { margin-bottom: 66px; }
  #ferramentas button { width: 58px; }
  #painel { top: auto; height: 62vh; border-radius: 14px 14px 0 0; }
  body.com-painel .leaflet-right { right: 0; }
  body.com-painel #dica { left: 50%; max-width: 92vw; }
  #legenda { bottom: 78px; left: 10px; }
  #dica { top: 60px; max-width: 92vw; border-radius: 12px; }
  #aviso { bottom: 90px; }
  .linha3 { grid-template-columns: 1fr 1fr; }
  .portas { grid-template-columns: repeat(3, 1fr); }
  .rel-colunas { grid-template-columns: 1fr; }
  .linha-spl { grid-template-columns: 1fr auto auto; }
  .linha-spl input[name="nome_spl"] { grid-column: 1 / -1; grid-row: 2; }
  #dica .dica-modelo { display: flex; justify-content: center; margin: 4px 0 0; }
}

/* ------------------------------------------------------------ backups (.gdp) */
.linha-backup { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 8px 0; }
.linha-backup label { flex: 1 1 260px; }
.selo.bk-auto { background: #e0f2fe; color: #075985; }
.selo.bk-manual { background: #dcfce7; color: #166534; }
.selo.bk-enviado { background: #fef3c7; color: #92400e; }
.selo.bk-antes { background: #f3e8ff; color: #6b21a8; }
.acoes-bk { white-space: nowrap; }
.acoes-bk .link + .link { margin-left: 8px; }

/* nome editável direto na tabela de usuários */
.nome-edit {
  width: 100%; min-width: 120px; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin: -3px -6px;
  background: transparent; color: inherit; font: inherit; cursor: text;
}
.nome-edit:hover { border-color: #cbd5e1; background: #fff; }
.nome-edit:focus { outline: 2px solid #99f6e4; border-color: var(--marca); background: #fff; }

/* ferramentas em grupos (estilo OZmap): quadrados que abrem uma fileira para o lado */
#ferramentas { display: flex; flex-direction: column; gap: 6px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
#ferramentas .fg { display: flex; align-items: center; gap: 6px; }
#ferramentas .fg-btn {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 10px;
  background: var(--cartao); color: var(--marca-forte); box-shadow: var(--sombra); cursor: pointer;
}
#ferramentas .fg-btn:hover { background: #f0fdfa; }
#ferramentas .fg-btn.ativo, #ferramentas .fg.ativo > .fg-btn, #ferramentas .fg-btn[aria-expanded="true"] {
  background: var(--marca); color: #fff; box-shadow: var(--sombra), inset 0 0 0 1.5px var(--marca-forte);
}
#ferramentas .fg-btn[aria-expanded="true"] svg *, #ferramentas .fg.ativo > .fg-btn svg * { stroke: #fff; }
#ferramentas .fg-linha { display: flex; gap: 2px; padding: 4px; background: var(--cartao); border-radius: 10px; box-shadow: var(--sombra); }
#ferramentas .fg-linha[hidden] { display: none; }
#ferramentas .fg-linha button {
  display: grid; justify-items: center; gap: 2px; width: 62px; padding: 5px 2px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; font-size: 11px; color: #334155;
}
#ferramentas .fg-linha button:hover { background: #f1f5f9; }
#ferramentas .fg-linha button.ativo { background: #ccfbf1; color: var(--marca-forte); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--marca); }
@media (max-width: 760px) {
  #ferramentas, body:has(#faixa-suporte) #ferramentas {
    top: auto; bottom: 10px; left: 10px; right: auto; flex-direction: row; align-items: flex-end; overflow: visible; border-radius: 0;
  }
  body.com-lateral #ferramentas { left: 10px; }
  #ferramentas .fg { flex-direction: column-reverse; align-items: flex-start; }
  #ferramentas .fg-linha { position: fixed; left: 10px; right: 10px; bottom: 62px; overflow-x: auto; }
  #ferramentas .fg-linha button { width: 58px; flex: none; }
  .leaflet-bottom { margin-bottom: 0; }
  #legenda { bottom: 62px; }
  /* com uma fileira de ferramentas aberta, a legenda (mesmo lugar) sai da frente */
  body:has(#ferramentas .fg-linha:not([hidden])) #legenda { display: none; }
}

/* ------------------------------------------------------------ página inicial (gridisp.com.br) */
.tela-inicio { min-height: 100vh; display: flex; flex-direction: column; background: #f8fafc; }
.ini-topo {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 10px clamp(16px, 4vw, 48px); background: rgba(15, 23, 42, .96); color: #e2e8f0;
}
.ini-marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.ini-marca b { font-size: 20px; letter-spacing: .3px; }
.ini-login { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ini-login-rot { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ini-login input {
  width: 150px; border: 1px solid #334155; border-radius: 8px; padding: 7px 10px; background: #1e293b; color: #f8fafc;
}
.ini-login input::placeholder { color: #94a3b8; }
.ini-login input:focus { outline: 2px solid var(--marca); background: #0b1220; }
.ini-erro { margin: 0; padding: 9px clamp(16px, 4vw, 48px); background: #fef2f2; color: #991b1b; font-weight: 600; }
.ini-hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center;
  padding: clamp(36px, 7vw, 90px) clamp(16px, 4vw, 48px); background: linear-gradient(135deg, #0f172a, #134e4a); color: #e2e8f0;
}
.ini-hero h1 { margin: 0 0 14px; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.15; color: #fff; }
.ini-hero p { margin: 0; font-size: clamp(15px, 1.4vw, 18px); color: #cbd5e1; max-width: 60ch; }
.ini-acesso { background: var(--cartao); color: var(--texto); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.ini-acesso h2 { margin: 0 0 6px; }
.ini-acesso p { margin: 0 0 12px; color: var(--suave); font-size: 13.5px; }
.ini-acesso-linha { display: flex; gap: 8px; }
.ini-acesso-linha input { flex: 1; min-width: 0; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 11px; font-size: 15px; }
.ini-erro-campo { color: #991b1b !important; font-weight: 600; }
.ini-recursos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px;
  padding: clamp(28px, 5vw, 60px) clamp(16px, 4vw, 48px); max-width: 1280px; width: 100%; margin: 0 auto;
}
.ini-recursos article { background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; padding: 18px; }
.ini-recursos h3 { margin: 10px 0 6px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--texto); }
.ini-recursos p { margin: 0; color: var(--suave); font-size: 13.5px; }
.ini-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #ccfbf1; }
.ini-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--marca-forte); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ini-rodape { margin-top: auto; padding: 18px; text-align: center; color: var(--suave); font-size: 12.5px; border-top: 1px solid var(--borda); }
@media (max-width: 760px) {
  .ini-hero { grid-template-columns: 1fr; }
  .ini-login { width: 100%; }
  .ini-login input { flex: 1 1 120px; width: auto; }
  .ini-login-rot { width: 100%; }
}

/* ------------------------------------------------------------ menu lateral do provedor (estilo OZmap) */
body.com-lateral { --lateral: 196px; }
body.com-lateral.lateral-recolhido { --lateral: 58px; }
.btn-lateral { display: none; }
#lateral {
  position: fixed; top: 52px; bottom: 0; left: 0; z-index: 1040; width: var(--lateral, 0);
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  background: #1f2937; color: #e5e7eb; transition: width .18s ease;
}
body:has(#faixa-suporte) #lateral { top: 74px; }
.lat-recolher {
  align-self: stretch; border: 0; background: #2563eb0d; color: #93c5fd; font-size: 20px; line-height: 1; padding: 8px 0;
  cursor: pointer; border-bottom: 1px solid #374151; transition: transform .18s;
}
.lat-recolher:hover { background: #374151; color: #fff; }
.lateral-recolhido .lat-recolher { transform: scaleX(-1); }
.lat-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px; border: 0; border-left: 3px solid transparent;
  background: none; color: #d1d5db; font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap;
}
.lat-item svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lat-item:hover { background: #374151; color: #fff; }
.lat-item.ativo { background: #111827; color: #fff; border-left-color: #2dd4bf; font-weight: 600; }
a.lat-item { text-decoration: none; }
.lat-grupo { padding: 4px 0; }
.lat-grupo + .lat-grupo { border-top: 1px solid #374151; }
.lat-titulo { padding: 10px 18px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; white-space: nowrap; }
.lat-rodape { margin-top: auto; border-top: 1px solid #374151; padding: 6px 0 4px; }
.lat-usuario { display: grid; padding: 8px 18px 6px; line-height: 1.25; white-space: nowrap; overflow: hidden; }
.lat-usuario b { color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.lat-usuario small { color: #9ca3af; font-size: 11.5px; }
.lateral-recolhido .lat-item { justify-content: center; padding: 12px 0; }
.lateral-recolhido .lat-item span, .lateral-recolhido .lat-titulo, .lateral-recolhido .lat-usuario { display: none; }
body.com-lateral #mapa { left: var(--lateral); }
body.com-lateral #ferramentas { left: calc(var(--lateral) + 10px); }
body.com-lateral #legenda { left: calc(var(--lateral) + 86px); }
body.com-lateral #faixa-suporte { left: var(--lateral); }
body.com-lateral #dica { left: calc(var(--lateral) + (100% - var(--lateral)) / 2); max-width: min(760px, calc(100vw - var(--lateral) - 24px)); }
body.com-lateral.com-painel #dica {
  left: calc(var(--lateral) + (100% - var(--lateral) - var(--painel)) / 2); max-width: calc(100vw - var(--lateral) - var(--painel) - 24px);
}

/* dashboard */
#dialogo.painel-grande { width: min(1280px, 97vw); max-height: 94vh; background: #f8fafc; }
.dash-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-right: 30px; }
.dash-topo h2 { margin: 0; }
.dash-periodo { display: inline-flex; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; background: #fff; }
.dash-periodo button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--suave); }
.dash-periodo button + button { border-left: 1px solid var(--borda); }
.dash-periodo button.ativo { background: var(--marca); color: #fff; font-weight: 600; }
.dash-secao { margin: 18px 0 8px; }
.dash-alertas-topo { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--raio); padding: 8px 12px 8px 28px; }
.g-grade-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.g-grade-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; margin-bottom: 12px; }
.g-cartao { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.g-cartao h4 { margin: 0 0 8px; font-size: 13px; color: var(--texto); }
.g-cartao h4 + .dash-dist { margin-top: 4px; }
.g-pizza { display: flex; align-items: center; gap: 14px; }
.g-pizza svg { flex: none; }
.g-centro { font-size: 15px; font-weight: 700; fill: var(--texto); }
.g-leg { border-collapse: collapse; font-size: 12.5px; width: 100%; min-width: 0; }
.g-leg td { padding: 2px 4px; white-space: nowrap; }
.g-leg td:first-child { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.g-leg i, .g-leg-linha i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.g-pct { color: var(--suave); }
.g-linha { width: 100%; height: auto; display: block; }
.g-grade { stroke: #e2e8f0; stroke-width: 1; }
.g-eixo { font-size: 11px; fill: #64748b; }
.g-leg-linha { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--suave); margin-top: 4px; }

/* operação: problemas, pendências */
.prob-grupos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.prob-g { border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 12.5px; color: var(--texto); }
.prob-g b { margin-left: 4px; }
.prob-g.erro b { color: var(--ruim); }
.prob-g.aviso b { color: #b45309; }
.prob-g.ativo { background: var(--marca); border-color: var(--marca); color: #fff; }
.prob-g.ativo b { color: #fff; }
.selo.prob-erro { background: #fee2e2; color: #991b1b; }
.selo.prob-aviso { background: #fef3c7; color: #92400e; }
td.atrasada { color: var(--ruim); font-weight: 700; }
.leg-pend { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #f59e0b; border: 2px solid #fff; box-shadow: 0 0 0 1px #94a3b8; }
.dash-dist { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: #e2e8f0; margin: 6px 0; }
.dash-dist i { display: block; height: 100%; }
.dash-dist i.ok, .dash-leg i.ok { background: var(--ok); }
.dash-dist i.atencao, .dash-leg i.atencao { background: #eab308; }
.dash-dist i.ruim, .dash-leg i.ruim { background: var(--ruim); }
.dash-dist i.vazia, .dash-leg i.vazia { background: #94a3b8; }
.dash-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--suave); margin-bottom: 14px; }
.dash-leg span { display: inline-flex; align-items: center; gap: 6px; }
.dash-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dash-alertas { margin: 0 0 12px; padding-left: 18px; color: #b45309; font-size: 13px; }
.dash-alertas li + li { margin-top: 4px; }

@media (max-width: 760px) {
  body.com-lateral, body.com-lateral.lateral-recolhido { --lateral: 0px; }
  .btn-lateral {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid #334155; border-radius: 8px;
    background: #1e293b; color: #e2e8f0; font-size: 18px; cursor: pointer; flex: none;
  }
  #lateral { width: 240px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0, 0, 0, .35); z-index: 1300; }
  body.lateral-aberto #lateral { transform: none; }
  .lat-recolher { display: none; }
  .lateral-recolhido .lat-item { justify-content: flex-start; padding: 12px 18px; }
  .lateral-recolhido .lat-item span { display: inline; }
  .lateral-recolhido .lat-titulo, .lateral-recolhido .lat-usuario { display: block; }
  .lat-item { padding: 12px 18px; }
  body.com-lateral #ferramentas { left: 0; }
  body.com-lateral #legenda { left: 10px; }
  body.com-lateral #dica, body.com-lateral.com-painel #dica { left: 50%; max-width: 92vw; }
}

/* ------------------------------------------------------------ integrações */
ol.passos { margin: 8px 0 12px; padding-left: 22px; line-height: 1.7; }
ol.passos code, #int-chave { word-break: break-all; }
.tab tr.erro-linha td { background: color-mix(in srgb, #ef4444 10%, transparent); }

/* ------------------------------------------------------------ financeiro */
.fin-graf { width: 100%; height: auto; max-height: 220px; color: var(--suave, #64748b); }
.fin-legenda { display: flex; gap: 14px; font-size: 12px; margin: 4px 0 10px; }
.fin-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.fin-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.fin-filtros select, .fin-filtros input { padding: 6px 8px; }
.status.pago { background: #dcfce7; color: #166534; }
.status.cancelado { background: #e2e8f0; color: #475569; }
.pix-qr { display: flex; justify-content: center; margin: 8px 0; }
.pix-qr svg { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; }
.pix-qr svg path { fill: #000; }
.cartao-suspenso { max-width: 520px; }
.fatura-pix { border: 1px solid var(--borda, #e2e8f0); border-radius: 10px; padding: 12px; margin: 10px 0; }
.fatura-cab { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fatura-cab span { color: var(--suave, #64748b); font-size: 13px; }
.fatura-valor { font-size: 22px; font-weight: 700; margin: 6px 0; }
.fatura-valor small { font-size: 12px; font-weight: 400; color: var(--suave, #64748b); }
.fatura-pix textarea { width: 100%; font-family: monospace; font-size: 12px; }
