/* AstecGeo – cores e letras do Grupo FHB AgroBoeira (as mesmas do site AstecPlace) */
:root {
  color-scheme: light;
  --bg: #F3F6F4; --bg-2: #E8EEEA; --surface: #FFFFFF; --surface-2: #F8FAF9;
  --ink: #0C2320; --ink-2: #2B4540; --muted: #586D67; --line: #D9E3DE; --line-2: #BDCCC5;
  --brand: #0A8F62; --brand-ink: #06694A; --brand-tint: #DCF2E8; --deep: #0B4F46;
  --amber: #F2A516; --amber-ink: #7A4D00; --amber-tint: #FDF0D3;
  --teal: #0F6E83; --teal-tint: #DCEEF3;
  --danger: #B3261E; --danger-tint: #FBE4E1; --cinza: #8A9A94;
  --shadow-s: 0 1px 2px rgba(12,35,32,.06);
  --shadow: 0 1px 2px rgba(12,35,32,.05), 0 10px 30px rgba(12,35,32,.07);
  --r: 16px; --r-s: 10px;
  --ff-d: "Unbounded", "Trebuchet MS", system-ui, sans-serif;
  --ff-b: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topo: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--ff-b); font-size: 15px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--brand-ink); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

/* ---------- topo ---------- */
.topo { position: sticky; top: 0; z-index: 20; height: var(--topo); display: flex; align-items: center;
        justify-content: space-between; gap: 12px; padding: 0 20px; background: var(--surface);
        border-bottom: 1px solid var(--line); }
.marca { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.marca svg { width: 34px; height: 34px; flex: none; }
.marca b { font-family: var(--ff-d); font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.marca span { color: var(--muted); font-size: 13px; border-left: 1px solid var(--line); padding-left: 10px;
              white-space: nowrap; }
.conta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.quem { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); font-size: 14px; }
.quem .ini { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink);
             display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.quem .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
       padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600;
       cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn-p { background: var(--brand-ink); color: #fff; }
.btn-p:hover:not(:disabled) { background: var(--deep); }
.btn-s { background: var(--surface); color: var(--brand-ink); border-color: var(--line-2); }
.btn-s:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); }
.btn-t { background: transparent; color: var(--ink-2); padding: 8px 10px; min-height: 40px; }
.btn-t:hover { background: var(--bg-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.largo { width: 100%; }
.btn[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border-radius: 50%;
       border: 2px solid currentColor; border-right-color: transparent; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
label.rot { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.dica { font-size: 13px; color: var(--muted); margin-top: 6px; }
input.campo, select.campo { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2);
       border-radius: 10px; font: inherit; color: var(--ink); background: var(--surface); }
input.campo:focus, select.campo:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); outline-offset: 0; }
.linha { display: flex; gap: 8px; }
.linha .campo { flex: 1; min-width: 0; }

/* ---------- boas-vindas (sem login) ---------- */
.boas-vindas { background:
      radial-gradient(900px 420px at 0% 0%, var(--brand-tint), transparent 70%),
      radial-gradient(700px 380px at 100% 100%, var(--teal-tint), transparent 70%), var(--bg);
    min-height: calc(100vh - var(--topo)); }
.bv-grade { max-width: 1140px; margin: 0 auto; padding: 56px 24px 32px; display: grid;
            grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 48px; align-items: start; }
.selo-topo { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
             color: var(--brand-ink); background: var(--surface); border: 1px solid var(--line);
             border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow-s); }
.bv h1 { font-family: var(--ff-d); font-weight: 600; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.03em;
         margin: 18px 0 14px; }
.bv h1 em { font-style: normal; color: var(--brand); }
.bv .lead { font-size: 17px; color: var(--ink-2); max-width: 600px; }
.passos { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.passos li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
             box-shadow: var(--shadow-s); }
.passos .num { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
               background: var(--brand-tint); color: var(--brand-ink); margin-bottom: 10px; }
.passos b { display: block; margin-bottom: 4px; }
.passos p { font-size: 14px; color: var(--muted); }
.publico { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
        background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.entrar { padding: 24px; }
.entrar h2 { font-family: var(--ff-d); font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.entrar .sub { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.alternar { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border-radius: 12px; padding: 4px; margin: 16px 0 4px; }
.alternar button { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted);
                   padding: 9px; border-radius: 9px; cursor: pointer; min-height: 40px; }
.alternar button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.entrar .btn { margin-top: 18px; }
.bv-rodape { max-width: 1140px; margin: 0 auto; padding: 8px 24px 32px; color: var(--muted); font-size: 12px; }

/* ---------- área logada ---------- */
.app { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; height: calc(100vh - var(--topo)); }
.app > * { min-width: 0; }
.painel { display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-right: 1px solid var(--line); }
.abas { display: flex; gap: 4px; padding: 8px 12px 0; background: var(--surface); border-bottom: 1px solid var(--line);
        overflow-x: auto; scrollbar-width: none; flex: none; }
.abas a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 12px; color: var(--muted);
          text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.abas a:hover { color: var(--ink); }
.abas a[aria-current="page"] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.abas svg.i { width: 18px; height: 18px; }
.rolagem { flex: 1; overflow-y: auto; min-height: 0; }
.aba { padding: 20px; }
.aba > header h2 { font-family: var(--ff-d); font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.aba > header p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.etapa { padding: 16px; margin-top: 14px; }
.etapa h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.etapa h3 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--deep); color: #fff; font-size: 13px;
               display: grid; place-items: center; flex: none; }
.etapa h3 .opc { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--muted); }
.acao { margin-top: 16px; }
.rodape-painel { padding: 12px 20px 20px; color: var(--muted); font-size: 12px; }

/* área de soltar o arquivo */
.soltar { position: relative; margin-top: 12px; }
.soltar input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.soltar .alvo { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
                padding: 22px 16px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--surface-2);
                color: var(--ink-2); transition: border-color .15s, background .15s; pointer-events: none; }
.soltar .alvo svg.i { width: 28px; height: 28px; color: var(--brand); }
.soltar .alvo b { font-size: 15px; }
.soltar .alvo small { color: var(--muted); font-size: 13px; }
.soltar:hover .alvo, .soltar.sobre .alvo { border-color: var(--brand); background: var(--brand-tint); }
.soltar input:focus-visible + .alvo { outline: 3px solid var(--teal); outline-offset: 2px; }
.soltar.ok .alvo { border-style: solid; border-color: var(--brand); background: var(--brand-tint); }

/* avisos */
.alerta { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
          font-size: 14px; border: 1px solid; }
.alerta svg.i { margin-top: 1px; }
.alerta.erro { background: var(--danger-tint); border-color: #F1B8B2; color: #7D1A14; }
.alerta.info { background: var(--teal-tint); border-color: #B5DCE6; color: #0B4F5E; }
.alerta.ok { background: var(--brand-tint); border-color: #A9DCC6; color: var(--brand-ink); }

/* resultado */
.resultado { margin-top: 18px; overflow: hidden; }
.selo { display: flex; gap: 14px; align-items: center; padding: 18px; color: #fff; }
.selo svg.i { width: 34px; height: 34px; stroke-width: 2.2; }
.selo b { display: block; font-family: var(--ff-d); font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.selo span { font-size: 14px; opacity: .95; }
.selo.verde { background: var(--brand-ink); }
.selo.amarelo { background: var(--amber); color: #3D2600; }
.selo.vermelho { background: var(--danger); }
.res-corpo { padding: 16px 18px 18px; }
.metas { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.metas b { color: var(--ink); font-size: 15px; }
.achados { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.achados li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 12px;
              border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.achados .ponto { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.achados .nome { font-weight: 700; }
.achados .fonte, .achados .det { font-size: 13px; color: var(--muted); }
.achados .area { text-align: right; font-weight: 700; white-space: nowrap; }
.achados .area small { display: block; font-weight: 500; color: var(--muted); }
.nada { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--brand-tint); color: var(--brand-ink); font-size: 14px; }
.cobertura { margin-top: 12px; font-size: 13px; color: var(--muted); }
.cobertura a { cursor: pointer; }
.botoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.botoes .btn { flex: 1 1 200px; white-space: nowrap; }

/* selos pequenos e tabelas */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px;
         font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.verde { background: var(--brand-tint); color: var(--brand-ink); }
.badge.amarelo { background: var(--amber-tint); color: var(--amber-ink); }
.badge.vermelho { background: var(--danger-tint); color: var(--danger); }
.badge.erro, .badge.cinza { background: var(--bg-2); color: var(--muted); }
.tabela-wrap { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; }
td .det { display: block; color: var(--muted); font-size: 12px; }
.contagem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.contagem div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.contagem b { display: block; font-family: var(--ff-d); font-size: 22px; font-weight: 600; }
.contagem span { font-size: 12px; color: var(--muted); }
.contagem .verde b { color: var(--brand-ink); } .contagem .amarelo b { color: var(--amber-ink); }
.contagem .vermelho b { color: var(--danger); }
.vazio { text-align: center; padding: 32px 16px; color: var(--muted); }
.vazio svg.i { width: 40px; height: 40px; color: var(--line-2); }
.vazio p { margin: 8px 0 14px; }
.voltar { margin-top: 10px; }

/* bases */
.bases { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.bases li { padding: 14px; }
.bases .topo-base { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.bases .nome { font-weight: 700; }
.bases .fonte { font-size: 13px; color: var(--muted); }
.bases .estado { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.bases .estado.sim { color: var(--brand-ink); }
.bases .estado.nao { color: var(--muted); }
.barra { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 8px; }
.barra i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* mapa */
.mapa-wrap { position: relative; min-height: 0; background: var(--bg-2); }
#mapa { position: absolute; inset: 0; }
.sem-mapa { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; color: var(--muted); }
.legenda { position: absolute; left: 12px; bottom: 28px; z-index: 2; background: var(--surface); border: 1px solid var(--line);
           border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.legenda b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.legenda span { display: flex; align-items: center; gap: 8px; }
.legenda i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid; }
.maplibregl-ctrl-attrib a { text-decoration: underline; }
.maplibregl-popup-content { font-family: var(--ff-b); font-size: 14px; border-radius: 10px; padding: 10px 12px; }

/* ---------- celular ---------- */
@media (max-width: 920px) {
  .bv-grade { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .app { grid-template-columns: 1fr; height: auto; }
  .painel { border-right: 0; }
  .rolagem { overflow: visible; }
  .abas { position: sticky; top: var(--topo); z-index: 15; }
  .mapa-wrap { height: 55vh; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .passos { grid-template-columns: 1fr; }
  .marca span { display: none; }
  .quem .nome { max-width: 130px; }
  .topo { padding: 0 12px; }
  .aba { padding: 16px; }
  .contagem { grid-template-columns: repeat(2, 1fr); }
  .btn-t .txt { display: none; }
  .abas { padding: 4px 6px 0; gap: 0; }
  .abas a { flex: 1; justify-content: center; gap: 4px; padding: 10px 4px 12px; font-size: 13px; }
  .abas svg.i { width: 16px; height: 16px; }
}
