:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --borda: #e7ebf0;
  --borda-forte: #d5dbe3;
  --texto: #0f172a;
  --texto-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --verde: #16a34a;
  --verde-escuro: #15803d;
  --verde-claro: #ecfdf3;
  --verde-borda: #bbf7d0;
  --azul: #2563eb;
  --vermelho: #dc2626;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --sombra-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --raio: 12px;
  --s-mens: #2a78d6;   /* série: mensalidades */
  --s-taxa: #eb6834;   /* série: taxas de instalação */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--texto);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 13px; }
.carregando { padding: 80px; text-align: center; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--borda);
  display: flex; align-items: center; gap: 28px;
  padding: 10px 24px; min-height: 64px;
}
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.marca img { height: 34px; display: block; }
.marca span { color: var(--muted-2); font-size: 15px; font-weight: 500; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 14px; border-radius: 10px; text-decoration: none;
  color: var(--texto-2); font-weight: 500; font-size: 15px;
}
.nav a:hover { background: #f1f5f9; }
.nav a.ativo { background: var(--verde-claro); color: var(--verde-escuro); }
.usuario-topo { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.usuario-info { text-align: right; line-height: 1.25; }
.usuario-info b { font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.usuario-info small { display: block; color: var(--muted); font-size: 12.5px; }
.selo { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; vertical-align: 2px; }
.selo.master { background: #fef3c7; color: #a16207; }
.selo.operador { background: #e0f2fe; color: #0369a1; }
.selo.supervisor { background: #ede9fe; color: #6d28d9; }
.selo.coordenador { background: #cffafe; color: #0e7490; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--verde-claro); color: var(--verde-escuro);
}
.sino { position: relative; background: none; border: none; cursor: pointer; padding: 6px; color: var(--texto-2); }
.sino .bolha { position: absolute; top: -2px; right: -6px; background: var(--vermelho); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 9px; border: 2px solid #fff; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 60;
  background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra-lg); padding: 6px;
}
.menu-pop button, .menu-pop .item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.menu-pop button:hover { background: #f1f5f9; }
.menu-pop .titulo { padding: 8px 10px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.rel { position: relative; }

/* ---------- página ---------- */
.pagina { max-width: 1680px; margin: 0 auto; padding: 28px 32px 60px; }
.cab-pagina { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cab-pagina h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.cab-pagina p { margin: 4px 0 0; color: var(--muted); }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--borda-forte);
  background: #fff; cursor: pointer; font-weight: 500; font-size: 14.5px; white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s; text-decoration: none; color: var(--texto);
}
.btn:hover { background: #f8fafc; border-color: #c4ccd6; }
.btn.prim { background: var(--verde); border-color: var(--verde); color: #fff; font-weight: 600; }
.btn.prim:hover { background: var(--verde-escuro); }
.btn.perigo { color: var(--vermelho); border-color: #fecaca; }
.btn.perigo:hover { background: #fef2f2; }
.btn.icone { padding: 10px 12px; }
.btn.peq { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.prim:disabled { background: #86c79c; border-color: #86c79c; opacity: 1; }

.card { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); }
.card + .card { margin-top: 20px; }
.card-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; cursor: pointer; user-select: none; }
.card-cab h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--texto-2); }
.card-cab h3 small { font-weight: 400; color: var(--muted-2); font-size: 13.5px; margin-left: 4px; }
.card-cab .seta { color: var(--muted-2); transition: transform .15s; }
.card.fechado .seta { transform: rotate(180deg); }
.card.fechado .card-corpo { display: none; }
.card-corpo { padding: 16px 22px 20px; border-top: 1px solid #f1f4f7; }

/* ---------- status ---------- */
.chips-status { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-status {
  display: inline-flex; align-items: center; gap: 10px; border: 2px solid transparent;
  padding: 8px 16px; border-radius: 10px; font-size: 15.5px; font-weight: 500; cursor: pointer;
  transition: transform .08s, box-shadow .12s, opacity .12s;
}
.chip-status b { font-size: 18px; font-weight: 700; }
.chip-status:hover { transform: translateY(-1px); box-shadow: var(--sombra); }
.chip-status.zero { opacity: .45; }
.chip-status.ativo { border-color: currentColor; box-shadow: 0 0 0 3px rgba(22, 163, 74, .08); }
.chips-status.filtrando .chip-status:not(.ativo) { opacity: .5; }
.limpar-status { margin-left: 4px; align-self: center; font-size: 13px; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; }

.st-instalado { background: #dcfce7; color: #15803d; }
.st-atribuido { background: #f1f5f9; color: #334155; }
.st-pendencia { background: #ffedd5; color: #c2410c; }
.st-agendado { background: #dbeafe; color: #1d4ed8; }
.st-impedido { background: #fee2e2; color: #b91c1c; }
.st-viabilidade { background: #f3e8ff; color: #7e22ce; }
.st-em-instalacao { background: #fef9c3; color: #a16207; }
.st-cancelado { background: #ffe4e6; color: #be123c; }
.st-nao-atribuido { background: #fff; color: #475569; border-color: #cbd5e1 !important; border-style: dashed !important; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.pend { background: #ffedd5; color: #c2410c; border-color: #fdba74; font-size: 11.5px; white-space: normal; line-height: 1.25; padding: 3px 9px; border-radius: 10px; max-width: 140px; }
.badge.vel { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.status-cel { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }

/* ---------- financeiro ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; background: #fcfdfd; }
.kpi span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted-2); font-size: 12.5px; }
.kpi.destaque { background: var(--verde-claro); border-color: var(--verde-borda); }
.kpi.destaque b { color: var(--verde-escuro); }
.ops-rapido { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px; }
.op-rapido { display: flex; flex-direction: column; gap: 9px; border: 1px solid var(--borda); border-radius: 10px; padding: 11px 13px; }
.op-rapido.ativo { border-color: var(--verde); background: #fbfefc; }
.op-nome { display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 0; cursor: pointer; text-align: left; font-size: 14.5px; }
.op-nome b { font-weight: 600; }
.op-nome:hover b { text-decoration: underline; }
.op-linha-topo { display: flex; align-items: center; gap: 8px; }
.op-linha-topo > em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.pend-total { margin-left: auto; border: 1.5px solid #fde68a; background: #fffbeb; color: #b45309; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pend-total.ativo { border-color: #b45309; }
.op-nome em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 12.5px; }
.op-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-mini { border: 1.5px solid transparent; border-radius: 7px; padding: 4px 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip-mini b { font-weight: 700; margin-left: 3px; font-variant-numeric: tabular-nums; }
.chip-mini.zero { opacity: .45; }
.chip-mini.ativo { border-color: currentColor; }
.grade-filtros.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meus-cli { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.meu-cli { text-align: left; border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; background: #fff; cursor: pointer; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; }
.meu-cli:hover { border-color: var(--verde-borda); }
.meu-cli.ativo { border-color: var(--verde); background: var(--verde-claro); }
.meu-cli .nome { grid-column: 1 / -1; font-weight: 600; font-size: 14px; letter-spacing: .02em; color: var(--texto-2); }
.meu-cli b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.meu-cli .rot { color: var(--muted); }
.meu-cli .det { grid-column: 1 / -1; display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); }
.meu-cli .det span:first-child { color: #b45309; font-weight: 600; }
table.tab.tab-op { min-width: 980px; }
.tab-op td:first-child, .tab-op th:first-child { width: 8px; padding-left: 8px; }
.falta { color: #b45309; font-weight: 600; font-size: 13px; }
.info-escola { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 18px; background: #f8fafc; border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.info-escola span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.perfis-ajuda { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.perfis-ajuda > div { background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; color: var(--texto-2); line-height: 1.45; }
.perfis-ajuda .selo { margin: 0 0 6px; display: table; }
.bloco-perm { background: #faf9ff; border: 1px solid #e9e5fb; border-radius: 12px; padding: 16px; }
.bloco-perm[hidden], .equipe-lista[hidden] { display: none; }
.perm-lista, .equipe-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--borda); border-radius: 9px; padding: 10px 12px; cursor: pointer; }
.perm:has(input:checked) { border-color: #a78bfa; background: #f5f3ff; }
.perm input { width: 17px; height: 17px; margin-top: 2px; accent-color: #7c3aed; flex: none; }
.perm b { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.perm small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
/* ---------- financeiro ---------- */
.legenda { display: flex; gap: 16px; font-size: 13px; color: var(--texto-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i, .g-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.grafico { position: relative; overflow: hidden; }
.grafico svg { display: block; }
.g-grade { stroke: #eef1f4; stroke-width: 1; }
.g-eixo { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.g-eixo.forte { fill: var(--texto); font-weight: 700; }
.g-hit { fill: transparent; cursor: pointer; }
.g-col:hover .g-hit, .g-col.sel .g-hit { fill: #f3f6f9; }
.g-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--borda); border-radius: 10px; box-shadow: var(--sombra-lg); padding: 10px 12px; font-size: 13px; min-width: 230px; z-index: 5; }
.g-tip b { display: block; margin-bottom: 6px; }
.g-tip div { display: flex; align-items: center; gap: 8px; color: var(--texto-2); padding: 2px 0; }
.g-tip span { margin-left: auto; font-weight: 600; color: var(--texto); font-variant-numeric: tabular-nums; }
.g-tip .tt { border-top: 1px solid var(--borda); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.tab .dir, .mini-tab .dir { text-align: right; }
table.tab.tab-fin { min-width: 720px; }
.tab-fin td:first-child, .tab-fin th:first-child { width: auto; padding-left: 22px; }
.tab-fin td { text-transform: none; }
.fin-detalhe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px; }
.fin-detalhe > div { min-width: 0; overflow-x: auto; }
.fin-detalhe h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-tab th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--borda); }
.mini-tab td { padding: 8px; border-bottom: 1px solid #f0f3f6; vertical-align: top; }
.mini-tab .sub { display: block; color: var(--muted); font-size: 12px; }

/* ---------- fotos ---------- */
.fotos-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.foto { position: relative; margin: 0; border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; background: #f8fafc; }
.foto img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.foto figcaption { font-size: 11px; color: var(--muted); padding: 5px 7px; line-height: 1.3; }
.foto-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(15, 23, 42, .65); color: #fff; display: grid; place-items: center; cursor: pointer; }
.foto-x svg { width: 14px; height: 14px; }
.foto-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 2px dashed var(--verde-borda); border-radius: 10px; color: var(--verde-escuro); font-weight: 600; font-size: 13px; cursor: pointer; background: #fbfefc; text-align: center; padding: 8px; }
.foto-add:hover { background: var(--verde-claro); }
.foto-add small { font-weight: 400; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
#caixa-fotos.arrastando .fotos-grade { outline: 2px dashed var(--verde); outline-offset: 6px; border-radius: 10px; background: var(--verde-claro); }
.foto-add svg { width: 26px; height: 26px; }
.foto-qtd { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--verde-escuro); font-size: 13px; }
.foto-qtd svg { width: 15px; height: 15px; }

.opcoes-modo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opcoes-modo .perm input { accent-color: var(--verde); width: 17px; height: 17px; padding: 0; flex: none; margin-top: 2px; box-shadow: none; }
.opcoes-modo .perm:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
details.aviso summary { cursor: pointer; font-weight: 600; }
.mapa-col { border: 1px solid var(--borda); border-radius: 10px; padding: 12px 14px; background: #fcfdfd; }
.mapa-col summary { cursor: pointer; font-size: 14px; color: var(--texto-2); }
.mapa-col summary u { color: var(--verde-escuro); font-size: 13px; margin-left: 4px; }
.mapa-grade { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 8px 14px; align-items: center; font-size: 14px; }
.mapa-grade .entrada { height: 38px; font-size: 13.5px; }
/* ---------- módulos R.E. / R.I. ---------- */
.mod-switch { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.mod-switch button { border: none; background: none; border-radius: 8px; padding: 5px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; color: var(--muted); }
.mod-switch button b { font-size: 13px; font-weight: 700; }
.mod-switch button span { font-size: 10.5px; }
.mod-switch button.ativo { background: #fff; color: var(--verde-escuro); box-shadow: var(--sombra); }
.tag-mod { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #0e7490; background: #cffafe; padding: 3px 9px; border-radius: 6px; vertical-align: 5px; margin-left: 6px; }
.eq-nums { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; font-variant-numeric: tabular-nums; }
.eq-nums em { display: block; font-style: normal; color: var(--muted); font-size: 11.5px; }
.kit { display: inline-block; padding: 2px 9px; border-radius: 6px; background: #e0f2fe; color: #075985; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.kit-diff { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.kit-diff.mais { background: #fef3c7; color: #b45309; }
.kit-diff.menos { background: #e0e7ff; color: #4338ca; }
.quadro-kit { background: #f8fafc; border: 1px solid var(--borda); border-radius: 10px; padding: 12px 14px; }
.kit-cab { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.kit-itens { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-itens span { background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: 6px 10px; min-width: 86px; }
.kit-itens em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.kit-itens b { font-size: 17px; font-variant-numeric: tabular-nums; }
.kit-pag { margin: 10px 0 0; font-size: 14px; }
.kit-pag small { color: var(--muted); }
.forma-pag { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--texto-2); background: #f8fafc; border-radius: 8px; padding: 7px 10px; }
.forma-pag svg { width: 15px; height: 15px; color: var(--verde-escuro); }
.op-card.inativa { opacity: .6; }
.tab tr.det td { background: #fafcfb; padding-top: 4px; }
.saldo { font-variant-numeric: tabular-nums; }
.saldo.neg { color: var(--vermelho); }
.saldo.zero { color: var(--muted); }
.est-itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.est-itens label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; }
.est-itens input { height: 42px; border: 1px solid var(--borda-forte); border-radius: 9px; padding: 0 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.est-itens input:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.tab-kits td, .tab-kits th { padding: 6px 10px; }
.tab-est td:first-child { width: auto; }

.clientes { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cli-card { border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: border-color .12s, background .12s; }
.cli-card:hover { border-color: var(--verde-borda); }
.cli-card.ativo { background: var(--verde-claro); border-color: var(--verde); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
.cli-card.apagado { opacity: .55; }
.cli-card.apagado:hover { opacity: 1; }
.tira-filtro { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-right: 8px; vertical-align: 1px; }
.tira-filtro svg { width: 12px; height: 12px; }
.filtro-cli { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--texto-2); }
.cli-topo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cli-topo b { font-size: 15px; letter-spacing: .01em; }
.cli-topo span { font-weight: 700; color: var(--verde-escuro); font-variant-numeric: tabular-nums; }
.cli-card .barra { height: 7px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.cli-card .barra i { display: block; height: 100%; background: var(--verde); }
.cli-nums { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; margin: 12px 0 8px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cli-nums em { display: block; font-style: normal; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.cli-card small { color: var(--muted); font-size: 12.5px; }
.cli-nums .foco { background: #fff; border: 1.5px solid var(--borda-forte); border-radius: 8px; padding: 2px 8px; margin: -3px -4px; }
.cli-nums .esmaecido { opacity: .4; }
.cli-filtro { font-size: 12.5px; color: var(--texto-2); background: #f1f5f9; border-radius: 6px; padding: 4px 8px; margin-bottom: 6px; }
.tab .cli { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: #f1f5f9; color: var(--texto-2); white-space: nowrap; }
.provedores { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 28px; }
.prov-linha { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font-size: 13.5px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.prov-linha:hover { background: #f8fafc; }
.prov-linha.ativo { background: var(--verde-claro); }
.prov-linha .barra { grid-column: 1 / -1; height: 6px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.prov-linha .barra i { display: block; height: 100%; background: var(--verde); border-radius: 4px; }
.prov-linha em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- filtros ---------- */
.filtros { padding: 22px; }
.grade-filtros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; }
.grade-filtros.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grade-filtros.g5 .busca { grid-column: span 2; }
.campo label { display: block; font-weight: 500; font-size: 14.5px; color: var(--texto-2); margin-bottom: 7px; }
.campo input, .campo select, .campo textarea, .entrada {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--borda-forte); border-radius: 9px;
  background: #fff; outline: none; font-size: 14.5px; transition: border-color .12s, box-shadow .12s;
}
.campo textarea { height: auto; min-height: 76px; padding: 10px 14px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.campo input:disabled, .campo select:disabled, .campo textarea:disabled { background: #f8fafc; color: var(--muted); }
.campo .com-icone { position: relative; }
.campo .com-icone svg { position: absolute; left: 13px; top: 13px; color: var(--muted-2); }
.campo .com-icone input { padding-left: 40px; }
.campo .ajuda { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.linha-toggles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid #f1f4f7; }
.toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--borda-forte); background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--texto-2);
}
.toggle svg { width: 15px; height: 15px; }
.toggle.ativo { background: var(--texto); border-color: var(--texto); color: #fff; }
.rotulo-inline { color: var(--muted); font-weight: 500; font-size: 13.5px; margin-left: 8px; }
.prio { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500; cursor: pointer; border: 1px solid; background: #fff; }
.prio svg { width: 14px; height: 14px; }
.prio.critica { color: #dc2626; border-color: #fecaca; }
.prio.alta { color: #ea580c; border-color: #fed7aa; }
.prio.media { color: #2563eb; border-color: #bfdbfe; }
.prio.baixa { color: #64748b; border-color: #e2e8f0; }
.prio.critica.ativo { background: #dc2626; color: #fff; border-color: #dc2626; }
.prio.alta.ativo { background: #ea580c; color: #fff; border-color: #ea580c; }
.prio.media.ativo { background: #2563eb; color: #fff; border-color: #2563eb; }
.prio.baixa.ativo { background: #64748b; color: #fff; border-color: #64748b; }
.prio.estatico { cursor: default; font-size: 12.5px; padding: 3px 10px; }
.ordenar { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ordenar select { height: 40px; border: 1px solid var(--borda-forte); border-radius: 9px; padding: 0 12px; background: #fff; min-width: 230px; }

/* ---------- tabela ---------- */
.barra-resultados { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; gap: 12px; flex-wrap: wrap; }
.barra-resultados .cont { color: var(--texto-2); font-size: 15.5px; }
.barra-resultados .cont b { font-weight: 600; }
.tabela-wrap { overflow-x: auto; }
table.tab { width: 100%; border-collapse: collapse; min-width: 1200px; }
.tab th { text-align: left; font-weight: 600; font-size: 14px; color: var(--texto-2); padding: 16px 12px; border-bottom: 1px solid var(--borda); white-space: nowrap; background: #fcfdfe; }
.tab th:first-child, .tab td:first-child { padding-left: 18px; width: 40px; }
.tab td { padding: 16px 12px; border-bottom: 1px solid #f0f3f6; vertical-align: middle; color: var(--texto-2); font-size: 14px; }
.tab tbody tr:hover { background: #fafcfb; }
.tab tbody tr.sel { background: #f0fdf4; }
.tab .esc { color: var(--verde-escuro); font-weight: 600; text-decoration: none; cursor: pointer; text-transform: uppercase; line-height: 1.35; display: inline-block; max-width: 220px; }
.tab .esc:hover { text-decoration: underline; }
.tab .sub { display: block; color: var(--muted); font-size: 12.5px; }
.tab .proj { color: var(--muted); font-size: 13px; max-width: 120px; line-height: 1.35; }
.tab .data-ok { color: var(--verde-escuro); font-weight: 500; }
.tab .data-atraso { color: var(--vermelho); font-weight: 600; }
.tab .vazio { color: var(--muted-2); }
.tab .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--verde); cursor: pointer; }
.op-tag { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13.5px; }
.ponto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.reag { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; background: #fef3c7; color: #a16207; font-weight: 700; font-size: 12.5px; }
.sem-dados { padding: 60px 20px; text-align: center; color: var(--muted); }
.sem-dados b { display: block; color: var(--texto-2); font-size: 16px; margin-bottom: 4px; }
.paginacao { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: var(--muted); font-size: 13.5px; gap: 10px; flex-wrap: wrap; }
.paginacao .acoes { gap: 6px; }

/* ---------- modal ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 860px; box-shadow: var(--sombra-lg); animation: sobe .16s ease-out; }
.modal.peq { max-width: 480px; }
.modal.med { max-width: 620px; }
.modal-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px 0; }
.modal-cab h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.modal-cab p { margin: 4px 0 0; color: var(--muted); }
.fechar { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; }
.fechar:hover { background: #f1f5f9; }
.modal-corpo { padding: 20px 26px; }
.modal-rodape { display: flex; justify-content: space-between; gap: 10px; padding: 16px 26px 22px; border-top: 1px solid #f1f4f7; flex-wrap: wrap; }
.modal-rodape .dir { display: flex; gap: 10px; margin-left: auto; }
.grade-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.grade-form .c2 { grid-column: span 2; }
.grade-form .c3 { grid-column: 1 / -1; }
.secao-form { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-top: 8px; padding-top: 14px; border-top: 1px solid #f1f4f7; display: flex; align-items: center; gap: 8px; }
.secao-form:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.secao-form .destaque { background: var(--verde-claro); color: var(--verde-escuro); padding: 2px 8px; border-radius: 5px; letter-spacing: .03em; text-transform: none; font-weight: 600; }
.abas { display: flex; gap: 4px; padding: 14px 26px 0; border-bottom: 1px solid var(--borda); }
.abas button { background: none; border: none; padding: 10px 14px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas button.ativo { color: var(--verde-escuro); border-bottom-color: var(--verde); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 12px 0 12px 22px; border-left: 2px solid #e2e8f0; position: relative; margin-left: 6px; }
.hist li::before { content: ""; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--verde); }
.hist small { color: var(--muted); display: block; margin-bottom: 3px; }
.aviso { padding: 12px 14px; border-radius: 10px; background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; font-size: 13.5px; margin-bottom: 14px; }
.aviso.erro { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.aviso.ok { background: var(--verde-claro); color: var(--verde-escuro); border-color: var(--verde-borda); }

@keyframes fade { from { opacity: 0; } }
@keyframes sobe { from { transform: translateY(10px); opacity: 0; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--texto); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--sombra-lg); font-size: 14px; animation: sobe .16s; max-width: 380px; }
.toast.erro { background: #b91c1c; }

/* ---------- login ---------- */
.login-fundo { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #dcfce7 0%, transparent 60%), var(--bg); }
.login { width: 100%; max-width: 410px; padding: 34px 32px; }
.login img { height: 58px; display: block; margin: 0 auto 8px; }
.login h1 { text-align: center; font-size: 19px; margin: 14px 0 4px; }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.login .campo { margin-bottom: 14px; }
.login .btn { width: 100%; height: 46px; margin-top: 6px; }

/* ---------- mapa ---------- */
.mapa-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; height: calc(100vh - 190px); min-height: 520px; }
.mapa-lado { overflow-y: auto; padding: 18px; }
.mapa-lado h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mapa-lado .bloco + .bloco { margin-top: 20px; padding-top: 18px; border-top: 1px solid #f1f4f7; }
#mapa { border-radius: var(--raio); border: 1px solid var(--borda); overflow: hidden; z-index: 1; }
.leg-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.leg-item:hover { background: #f8fafc; }
.leg-item.off { opacity: .4; }
.leg-item em { margin-left: auto; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--borda-forte); border-radius: 9px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 500; }
.seg button.ativo { background: var(--texto); color: #fff; }
.popup h4 { margin: 0 0 2px; font-size: 14px; }
.popup p { margin: 2px 0; color: var(--texto-2); }
.leaflet-popup-content { font-family: Inter, sans-serif; font-size: 13px; margin: 12px 14px; }

/* ---------- calendário ---------- */
.cal-cab { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--borda); flex-wrap: wrap; }
.cal-cab h3 { margin: 0 8px 0 0; font-size: 18px; min-width: 170px; }
.cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grade .dsem { padding: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--borda); }
.cal-dia { min-height: 128px; border-right: 1px solid #f0f3f6; border-bottom: 1px solid #f0f3f6; padding: 8px; }
.cal-dia:nth-child(7n) { border-right: none; }
.cal-dia.fora { background: #fafbfc; }
.cal-dia.fora .n { color: var(--muted-2); }
.cal-dia .n { font-weight: 600; font-size: 13px; margin-bottom: 6px; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.cal-dia.hoje .n { background: var(--verde); color: #fff; }
.evento { display: block; width: 100%; text-align: left; border: none; border-left: 3px solid; font-size: 12px; padding: 4px 7px; border-radius: 5px; margin-bottom: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.mais { font-size: 12px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 2px 4px; }

/* ---------- operadores ---------- */
.grade-ops .card + .card { margin-top: 0; }
.grade-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.op-card { padding: 20px; }
.op-card .topo-op { display: flex; align-items: center; gap: 12px; }
.op-card .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.op-card h3 { margin: 0; font-size: 16px; }
.op-card .topo-op small { color: var(--muted); }
.op-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 12px; }
.op-nums div { background: #f8fafc; border-radius: 8px; padding: 9px 10px; }
.op-nums span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.op-nums b { font-size: 17px; font-variant-numeric: tabular-nums; }
.barra-status { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: #f1f5f9; }
.barra-status i { display: block; height: 100%; }
.cidades { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cidades span { font-size: 12px; background: #f1f5f9; color: var(--texto-2); padding: 3px 9px; border-radius: 999px; }
.op-acoes { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- responsivo ---------- */
@media (max-width: 1280px) {
  .usuario-info { display: none; }
  .nav a { padding: 9px 11px; font-size: 14px; }
  .marca span { display: none; }
  .mod-switch span { display: none; }
}
@media (max-width: 1024px) {
  .grade-filtros, .grade-filtros.g5, .grade-filtros.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mapa-layout { grid-template-columns: 1fr; height: auto; }
  .mapa-lado { max-height: none; }
  #mapa { height: 65vh; }
  .grade-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topo { padding: 8px 16px; gap: 10px; flex-wrap: wrap; }
  .marca img { height: 28px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a span { display: none; }
  .nav a.ativo span { display: inline; }
  .pagina { padding: 18px 16px 50px; }
  .cab-pagina h1 { font-size: 21px; }
  .acoes .btn .txt { display: none; }
  .grade-filtros, .grade-filtros.g5, .grade-filtros.g3, .grade-form { grid-template-columns: 1fr !important; }
  .ops-rapido, .meus-cli, .perfis-ajuda, .perm-lista, .equipe-lista, .fin-detalhe, .opcoes-modo, .mapa-grade { grid-template-columns: 1fr; }
  .card-cab { flex-wrap: wrap; gap: 8px; }
  table.tab.tab-fin { min-width: 0; }
  .mini-tab { font-size: 12.5px; }
  table.tab.tab-op { min-width: 0; }
  .tab-op td.td-esc { flex-wrap: wrap; }
  .tab-op td[data-r=""] { padding-top: 8px !important; }
  .tab-op td[data-r=""] .btn { width: 100%; }
  .tab-op td[data-r=""]::before { display: none; }
  .grade-filtros.g5 .busca { grid-column: auto; }
  .grade-form .c2 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 19px; }
  .chip-status { font-size: 14px; padding: 7px 12px; }
  .chip-status b { font-size: 16px; }
  .ordenar { margin-left: 0; width: 100%; }
  .ordenar select { flex: 1; min-width: 0; }
  .card-cab, .card-corpo, .filtros { padding-left: 16px; padding-right: 16px; }
  /* tabela vira cartões */
  table.tab { min-width: 0; }
  .tab thead { display: none; }
  .tab, .tab tbody, .tab tr, .tab td { display: block; width: 100%; }
  .tab tr { padding: 14px 16px; border-bottom: 1px solid var(--borda); position: relative; }
  .tab td { border: none; padding: 3px 0 !important; display: flex; gap: 10px; align-items: center; min-height: 26px; }
  .tab td::before { content: attr(data-r); min-width: 104px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
  .tab td.td-check { position: absolute; right: 14px; top: 14px; width: auto; }
  .tab td.td-check::before, .tab td.td-esc::before { display: none; }
  .tab td.td-esc { padding-right: 34px !important; margin-bottom: 4px; }
  .tab td.td-vazio { display: none; }
  .tab .esc { max-width: none; font-size: 15px; }
  .tab .proj { max-width: none; }
  .status-cel { flex-direction: row; flex-wrap: wrap; }
  .op-nums { grid-template-columns: repeat(2, 1fr); }
  .grade-ops { grid-template-columns: 1fr; }
  .cal-dia { min-height: 74px; padding: 4px; }
  .evento { font-size: 0; height: 7px; padding: 0; margin-bottom: 3px; border-left-width: 0; }
  .fundo-modal { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .modal-cab, .modal-corpo, .modal-rodape { padding-left: 18px; padding-right: 18px; }
  .abas { padding: 12px 18px 0; }
  #toasts { left: 16px; right: 16px; bottom: 16px; }
}
.tab-fin td b { white-space: nowrap; }
.tab .mini-tab td:first-child, .tab .mini-tab th:first-child { width: auto; padding-left: 8px; }
