/* Barueri Digital: estilos compartilhados */
:root {
  --marinho: #0B2545;
  --marinho-2: #13315C;
  --azul: #1D4ED8;
  --azul-claro: #DBEAFE;
  --verde: #10B981;
  --verde-claro: #D1FAE5;
  --ambar: #F59E0B;
  --ambar-claro: #FEF3C7;
  --vermelho: #EF4444;
  --vermelho-claro: #FEE2E2;
  --fundo: #F5F7FB;
  --cartao: #FFFFFF;
  --texto: #0F172A;
  --texto-2: #475569;
  --texto-3: #94A3B8;
  --borda: #E2E8F0;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --sombra-forte: 0 10px 40px rgba(11, 37, 69, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* Ícones: 20px por padrão; contextos específicos ampliam com classes próprias */
.ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; }
.ic svg { width: 100%; height: 100%; flex-shrink: 0; }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: inherit; }
.marca:hover { text-decoration: none; }
.marca-simbolo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--azul), var(--verde)); display: grid; place-items: center; color: #fff; }
.marca-simbolo .ic { width: 20px; height: 20px; }
.marca small { display: block; font-weight: 500; font-size: 11px; opacity: .7; letter-spacing: 0; }

/* Cartões */
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px; position: relative; min-width: 0; }
.cartao-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cartao-topo h2, .cartao-topo h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.cartao-topo h2 .ic, .cartao-topo h3 .ic { width: 18px; height: 18px; }
.cartao-topo .selos { flex-shrink: 0; }
.cartao-topo .sub { color: var(--texto-2); font-size: 13px; }

/* Selos */
.selo { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: lowercase; border-radius: 999px; padding: 2px 8px; white-space: nowrap; position: relative; vertical-align: middle; line-height: 1.5; }
.selo.sim { background: #F1F5F9; color: #64748B; border: 1px dashed #CBD5E1; }
.selo.real { background: var(--verde-claro); color: #047857; cursor: help; }
.selo.real::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--verde); }
.selo.real[data-tip]:hover::after, .selo.real[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--marinho); color: #fff; font-weight: 500; text-transform: none; letter-spacing: 0;
  font-size: 12px; padding: 8px 10px; border-radius: 8px; width: max-content; max-width: 260px; white-space: normal;
  box-shadow: var(--sombra-forte); z-index: 1000; line-height: 1.4;
}
.selos { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Pílulas de status */
.pilula { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pilula::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pilula.ok { background: var(--verde-claro); color: #047857; }
.pilula.alerta { background: var(--ambar-claro); color: #B45309; }
.pilula.critico { background: var(--vermelho-claro); color: #B91C1C; }
.pilula.info { background: var(--azul-claro); color: #1E40AF; }
.pilula.neutro { background: #F1F5F9; color: #475569; }
.pilula.sem-ponto::before { display: none; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 14px; background: var(--azul); color: #fff; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { text-decoration: none; background: #1E40AF; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.sec { background: #EEF2FF; color: var(--azul); }
.btn.sec:hover { background: #E0E7FF; }
.btn.verde { background: var(--verde); }
.btn.verde:hover { background: #059669; }
.btn.fantasma { background: transparent; color: var(--texto-2); border: 1px solid var(--borda); }
.btn.fantasma:hover { background: #F8FAFC; }
.btn.peq { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.bloco { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }

/* Campos */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.entrada, .campo input, .campo select, .campo textarea { border: 1px solid var(--borda); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; width: 100%; }
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }

/* Tabelas */
.tabela-barra { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.tabela-barra .entrada { max-width: 260px; padding: 7px 12px; font-size: 13.5px; }
.tabela-barra select.entrada { max-width: 200px; }
.tabela-barra .contagem { margin-left: auto; font-size: 12.5px; color: var(--texto-2); }
.tabela-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--borda); border-radius: 10px; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { position: sticky; top: 0; background: #F8FAFC; text-align: left; font-weight: 600; color: var(--texto-2); padding: 9px 12px; border-bottom: 1px solid var(--borda); white-space: nowrap; cursor: pointer; user-select: none; z-index: 1; }
.tabela th:hover { color: var(--azul); }
.tabela th .seta { opacity: .35; font-size: 10px; margin-left: 4px; }
.tabela th.ord .seta { opacity: 1; color: var(--azul); }
.tabela td { padding: 9px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.tabela tr:hover td { background: #F8FAFC; }
.tabela td.dir, .tabela th.dir { text-align: right; }
.tabela .vazio { text-align: center; color: var(--texto-3); padding: 24px; }

/* Barras de progresso */
.barra { height: 8px; background: #EEF2F7; border-radius: 99px; overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: 99px; background: var(--azul); }

/* Feed */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; background: #F8FAFC; font-size: 13px; animation: entra .4s ease; }
.feed-item .ic { width: 30px; height: 30px; border-radius: 8px; padding: 6px; background: #fff; color: var(--azul); box-shadow: var(--sombra); }
.feed-item > div:not(.acoes) { flex: 1; min-width: 0; }
.feed-item .meta { color: var(--texto-3); font-size: 11.5px; }
.feed-item strong { font-weight: 600; }
.feed-item .acoes { margin-left: auto; display: flex; gap: 6px; align-items: center; }
@keyframes entra { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Ao vivo */
.ao-vivo { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--vermelho); text-transform: uppercase; letter-spacing: .04em; }
.ao-vivo::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--vermelho); animation: pulsa 1.4s infinite; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* Toast */
.toast-area { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 5000; pointer-events: none; }
.toast { background: var(--marinho); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--sombra-forte); animation: entra .3s ease; display: flex; align-items: center; gap: 8px; }
.toast .ic { width: 18px; height: 18px; color: var(--verde); }

/* Modal */
.modal-fundo { position: fixed; inset: 0; background: rgba(11, 37, 69, .45); display: grid; place-items: center; z-index: 4000; padding: 16px; animation: entra .2s ease; }
.modal { background: #fff; border-radius: var(--raio); max-width: 460px; width: 100%; padding: 22px; box-shadow: var(--sombra-forte); max-height: 90vh; overflow: auto; }
.modal h3 { display: flex; justify-content: space-between; align-items: center; }
.modal .fechar { border: 0; background: #F1F5F9; width: 30px; height: 30px; border-radius: 8px; padding: 6px; }

/* Leaflet */
.mapa { height: 360px; min-height: 200px; border-radius: 10px; overflow: hidden; z-index: 0; background: #E5E7EB; }
.leaflet-container { font-family: inherit; }
.leaflet-popup-content { font-size: 13px; line-height: 1.45; margin: 10px 14px; }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.legenda-mapa { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.camada { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--borda); background: #fff; color: var(--texto-2); cursor: pointer; }
.camada .ponto { width: 10px; height: 10px; border-radius: 50%; }
.camada.on { border-color: var(--azul); color: var(--azul); background: #EFF6FF; }
.camada:not(.on) .ponto { opacity: .3; }
.aviso-dedos { background: rgba(255,255,255,.9); color: var(--texto-2); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; box-shadow: var(--sombra); pointer-events: none; }

/* Rodapé */
.rodape { text-align: center; font-size: 12.5px; color: var(--texto-2); padding: 18px 16px 24px; }
.rodape strong { color: var(--texto); }
.rodape .assinatura { display: block; margin: 8px 0 0; font-size: 12px; letter-spacing: .02em; color: var(--texto-2); overflow-wrap: anywhere; }
.rodape .assinatura strong { color: inherit; font-weight: 700; }
.rodape .agendar { margin-top: 10px; }
.rodape .assinatura a { color: inherit; border-bottom: 1px solid currentColor; }
.rodape .assinatura a:hover { color: var(--azul); text-decoration: none; }

/* Utilitários */
.grade { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.linha { display: flex; align-items: center; gap: 10px; }
.entre { justify-content: space-between; }
.mut { color: var(--texto-2); }
.peq { font-size: 12.5px; }
.forte { font-weight: 700; }
.verde-t { color: #047857; }
.vermelho-t { color: #B91C1C; }
.ambar-t { color: #B45309; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
