/* ===================== TEMA ESCURO (v1.5.0) =====================
   Ativado por data-theme="dark" no <html>. Sobrescreve o tema claro. */
html[data-theme="dark"]{ color-scheme:dark; }
html[data-theme="dark"], html[data-theme="dark"] body{
  background:#0b1120 !important; color:#e8ecf6 !important;
}
html[data-theme="dark"] body.modo-app,
html[data-theme="dark"] body.modo-admin,
html[data-theme="dark"] body.modo-publico,
html[data-theme="dark"] body.modo-claro{
  background:#0b1120 !important; color:#e8ecf6 !important;
}
html[data-theme="dark"] .bg-wrap{ display:block !important; }
html[data-theme="dark"] .bg-gradient{ display:block !important; }
html[data-theme="dark"] .bg-orb, html[data-theme="dark"] .bg-orb-1, html[data-theme="dark"] .bg-orb-2{ display:block !important; opacity:.17; }
html[data-theme="dark"] .bg-grid{ display:block !important; }

/* texto */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] strong, html[data-theme="dark"] b{ color:#f1f5fb !important; }
html[data-theme="dark"] p, html[data-theme="dark"] small, html[data-theme="dark"] label,
html[data-theme="dark"] .mut, html[data-theme="dark"] .hint, html[data-theme="dark"] .pg-sub,
html[data-theme="dark"] .hub-sub, html[data-theme="dark"] .dash-p, html[data-theme="dark"] .vazio{ color:#a9b6ca !important; }
html[data-theme="dark"] .hub-hi h1, html[data-theme="dark"] .dash-h,
html[data-theme="dark"] .pg-title, html[data-theme="dark"] .login-title{ color:#f4f7fc !important; }
html[data-theme="dark"] .hub-hi h1 span, html[data-theme="dark"] .brand-name span,
html[data-theme="dark"] .login-title span, html[data-theme="dark"] .adm-brand-t strong span,
html[data-theme="dark"] .pg-title span{ color:#fb7185 !important; }
html[data-theme="dark"] .brand-name, html[data-theme="dark"] .adm-brand-t strong{ color:#f4f7fc !important; }
html[data-theme="dark"] .brand-sub, html[data-theme="dark"] .adm-brand-t small,
html[data-theme="dark"] .topbar-sub{ color:#93a3ba !important; }
html[data-theme="dark"] a{ color:#fb7185; }
html[data-theme="dark"] .hub-foot{ border-top:1px solid #22304a !important; color:#93a3ba !important; }
html[data-theme="dark"] .hub-foot a{ color:#fb7185 !important; }

/* cartões e blocos */
html[data-theme="dark"] .card, html[data-theme="dark"] .kpi, html[data-theme="dark"] .atalho,
html[data-theme="dark"] .dash-card, html[data-theme="dark"] .dash-item, html[data-theme="dark"] .login-card,
html[data-theme="dark"] .carga-opt, html[data-theme="dark"] .cep-box, html[data-theme="dark"] .exp-row,
html[data-theme="dark"] .orc-line, html[data-theme="dark"] .tbl-wrap, html[data-theme="dark"] .hub-card,
html[data-theme="dark"] .form, html[data-theme="dark"] .pf-box{
  background:rgba(17,24,42,.92) !important;
  border:1px solid #22304a !important;
  box-shadow:0 10px 26px rgba(0,0,0,.35) !important;
}
html[data-theme="dark"] .atalho:hover{ background:rgba(251,113,133,.12) !important; border-color:rgba(251,113,133,.45) !important; }
html[data-theme="dark"] .atalho-t strong, html[data-theme="dark"] .kpi strong,
html[data-theme="dark"] .dash-item strong, html[data-theme="dark"] .card-h,
html[data-theme="dark"] .card-h *, html[data-theme="dark"] .tot, html[data-theme="dark"] .valor,
html[data-theme="dark"] .orc-line b, html[data-theme="dark"] .orc-line span{ color:#e8ecf6 !important; }
html[data-theme="dark"] .kpi small, html[data-theme="dark"] .kpi em,
html[data-theme="dark"] .atalho-t small, html[data-theme="dark"] .dash-item small{ color:#93a3ba !important; }
html[data-theme="dark"] .atalho-go{ color:#fb7185 !important; }
html[data-theme="dark"] .login-eyebrow{ background:rgba(225,29,72,.16) !important; color:#fda4af !important; border-color:rgba(225,29,72,.4) !important; }
html[data-theme="dark"] .login-sub{ color:#a9b6ca !important; }
html[data-theme="dark"] .sec-t{ color:#8b9ab1 !important; }

/* topo / navegação / tabbar */
html[data-theme="dark"] .topbar, html[data-theme="dark"] .adm-top,
html[data-theme="dark"] .adm-nav, html[data-theme="dark"] .app-tabbar{
  background:rgba(12,19,34,.94) !important; border-color:#22304a !important;
}
html[data-theme="dark"] .topbar *, html[data-theme="dark"] .adm-top *,
html[data-theme="dark"] .adm-nav *, html[data-theme="dark"] .app-tab *{ color:#e2e8f0 !important; }
html[data-theme="dark"] .adm-nav-i.on, html[data-theme="dark"] .app-tab.on,
html[data-theme="dark"] .app-tab.on *{ color:#fb7185 !important; }
html[data-theme="dark"] .adm-chip{ background:#152036 !important; border:1px solid #2b3a55 !important; color:#dbe4f0 !important; }
html[data-theme="dark"] .topbar-badge{ background:#152036 !important; border:1px solid #2b3a55 !important; color:#cbd5e1 !important; }
html[data-theme="dark"] .adm-out, html[data-theme="dark"] .btn-sair{
  background:#152036 !important; border-color:#2b3a55 !important; color:#e2e8f0 !important;
}

/* formulários */
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea{
  background:#0f1a2f !important; color:#eef2f9 !important; border-color:#2b3a55 !important;
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder{ color:#8798b0 !important; }
html[data-theme="dark"] option{ background:#0f1a2f !important; color:#eef2f9 !important; }
html[data-theme="dark"] .field-box{ background:#0f1a2f !important; border-color:#2b3a55 !important; }
html[data-theme="dark"] .field-box > i{ color:#8b9ab1 !important; }
html[data-theme="dark"] .field-box:focus-within{ border-color:#fb7185 !important; box-shadow:0 0 0 3px rgba(251,113,133,.18) !important; }
html[data-theme="dark"] .fld label, html[data-theme="dark"] .fld small, html[data-theme="dark"] .hint{ color:#93a3ba !important; }
html[data-theme="dark"] .btn-ghost{ background:#152036 !important; border-color:#2b3a55 !important; color:#e2e8f0 !important; }
html[data-theme="dark"] .btn-mini, html[data-theme="dark"] .btn-ico{ background:#1a2740 !important; border-color:#2b3a55 !important; color:#e2e8f0 !important; }

/* tabelas */
html[data-theme="dark"] table, html[data-theme="dark"] thead, html[data-theme="dark"] tbody,
html[data-theme="dark"] tr, html[data-theme="dark"] td, html[data-theme="dark"] th{
  background-color:transparent; color:#dbe4f0 !important; border-color:#1e2a41 !important;
}
html[data-theme="dark"] thead th{ background:#152036 !important; color:#c3cfe0 !important; }
html[data-theme="dark"] .tbl tbody tr:nth-child(even){ background:rgba(255,255,255,.025) !important; }
html[data-theme="dark"] .tbl tbody tr:hover{ background:rgba(251,113,133,.07) !important; }

/* avisos e etiquetas */
html[data-theme="dark"] .alert, html[data-theme="dark"] .alert *{ color:inherit !important; }
html[data-theme="dark"] .alert-ok{ background:rgba(16,185,129,.14) !important; border-color:rgba(16,185,129,.4) !important; color:#6ee7b7 !important; }
html[data-theme="dark"] .alert-erro{ background:rgba(225,29,72,.16) !important; border-color:rgba(225,29,72,.45) !important; color:#fda4af !important; }
html[data-theme="dark"] .alert-aviso{ background:rgba(245,158,11,.14) !important; border-color:rgba(245,158,11,.4) !important; color:#fcd34d !important; }
html[data-theme="dark"] .st{ border:1px solid #2b3a55; }
html[data-theme="dark"] .tagc{ background:#152036 !important; color:#cbd5e1 !important; }
html[data-theme="dark"] .chip-feriado{ background:#152036 !important; border-color:#2b3a55 !important; color:#dbe4f0 !important; }
html[data-theme="dark"] .carga-opt.on{ border-color:#fb7185 !important; background:rgba(251,113,133,.12) !important; }
html[data-theme="dark"] svg text{ fill:#dbe4f0 !important; }

/* botão de tema */
.btn-tema{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  flex:0 0 auto; height:38px; padding:0 13px; border-radius:999px;
  border:1px solid #d8e0ec; background:#ffffff; color:#0f172a;
  font:700 .78rem/1 Inter, system-ui, sans-serif; cursor:pointer;
  transition:background .15s ease, border-color .15s ease, transform .12s ease, color .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.btn-tema:hover{ background:#f1f5fb; border-color:#c3cede; }
.btn-tema:active{ transform:scale(.96); }
.btn-tema:focus-visible{ outline:2px solid #e11d48; outline-offset:2px; }
.btn-tema i{ font-size:.86rem; }
.btn-tema .ic-sol{ display:none; }
html[data-theme="dark"] .btn-tema{ background:#152036; border-color:#2f3f5c; color:#eef2f9; }
html[data-theme="dark"] .btn-tema:hover{ background:#1c2942; border-color:#42557a; }
html[data-theme="dark"] .btn-tema, html[data-theme="dark"] .btn-tema *{ color:#eef2f9 !important; }
html[data-theme="dark"] .btn-tema .ic-lua{ display:none; }
html[data-theme="dark"] .btn-tema .ic-sol{ display:inline-block; }
.topbar-acoes{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.topbar{ flex-wrap:wrap; row-gap:10px; }
@media (max-width:480px){
  .btn-tema{ width:38px; padding:0; }
  .btn-tema-txt{ display:none; }
}

@media print{
  html[data-theme="dark"], html[data-theme="dark"] body{ background:#fff !important; color:#000 !important; }
}

/* contraste reforcado (v1.5.1) */
html[data-theme="dark"] .hub-foot,
html[data-theme="dark"] .hub-foot span,
html[data-theme="dark"] .hub-foot small,
html[data-theme="dark"] .hub-foot p{ color:#b3bfd2 !important; }
html[data-theme="dark"] .hub-foot a{ color:#fb7185 !important; }
html[data-theme="dark"] .hub-sub strong,
html[data-theme="dark"] p strong, html[data-theme="dark"] small strong{ color:#e8ecf6 !important; }
html[data-theme="dark"] .mut, html[data-theme="dark"] .hint,
html[data-theme="dark"] .pg-sub, html[data-theme="dark"] .vazio{ color:#a9b6ca !important; }
html[data-theme="dark"] .sec-t{ color:#9aa8bd !important; }

/* ---- campos e rodapé do login (v1.5.2) ---- */
html[data-theme="dark"] .field-box input,
html[data-theme="dark"] .field-box input#login,
html[data-theme="dark"] .field-box input#senha,
html[data-theme="dark"] .field-box input[type="text"],
html[data-theme="dark"] .field-box input[type="password"]{
  background:transparent !important; background-color:transparent !important;
  color:#eef2f9 !important; -webkit-text-fill-color:#eef2f9 !important;
  border:0 !important; box-shadow:none !important; caret-color:#fb7185 !important;
}
html[data-theme="dark"] .field-box input::placeholder{
  color:#8798b0 !important; -webkit-text-fill-color:#8798b0 !important;
}
html[data-theme="dark"] .field-box{ background:#0f1a2f !important; border-color:#2f3f5c !important; }
html[data-theme="dark"] .field-box:focus-within{ background:#12203a !important; border-color:#fb7185 !important; }
html[data-theme="dark"] .field-label{ color:#9aa8bd !important; }
html[data-theme="dark"] .toggle-pass{ color:#9aa8bd !important; background:transparent !important; }
html[data-theme="dark"] .toggle-pass:hover{ color:#f1f5fb !important; background:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .login-foot, html[data-theme="dark"] .login-foot *,
html[data-theme="dark"] .login-nota, html[data-theme="dark"] .login-dica{ color:#a9b6ca !important; }
html[data-theme="dark"] .login-foot i{ color:#fb7185 !important; }
html[data-theme="dark"] .voltar{ color:#c3cfe0 !important; }
html[data-theme="dark"] .voltar:hover{ color:#fb7185 !important; }
html[data-theme="dark"] .page-footer, html[data-theme="dark"] .page-footer *{ color:#9aa8bd !important; }
html[data-theme="dark"] .page-footer i{ color:#93a3ba !important; }
html[data-theme="dark"] ::selection{ background:rgba(251,113,133,.35); color:#fff !important; }

/* ---- rodapé do cartão de login (v1.5.3) ---- */
html[data-theme="dark"] .card-foot, html[data-theme="dark"] .card-foot *,
html[data-theme="dark"] .card-note, html[data-theme="dark"] .card-hint{ color:#b3bfd2 !important; }
html[data-theme="dark"] .card-foot i, html[data-theme="dark"] .card-note i{ color:#fb7185 !important; }
html[data-theme="dark"] .login-head .login-sub{ color:#a9b6ca !important; }

/* ---- inputs: cobertura total no escuro (v1.5.4) ---- */
html[data-theme="dark"] body input,
html[data-theme="dark"] body textarea,
html[data-theme="dark"] body select,
html[data-theme="dark"] .cep-box input,
html[data-theme="dark"] .form input,
html[data-theme="dark"] .fld input,
html[data-theme="dark"] .fld select,
html[data-theme="dark"] .fld textarea{
  background:#0f1a2f !important;
  background-color:#0f1a2f !important;
  background-image:none !important;
  color:#eef2f9 !important;
  -webkit-text-fill-color:#eef2f9 !important;
  border:1px solid #2b3a55 !important;
  border-radius:11px !important;
  box-shadow:none !important;
}
html[data-theme="dark"] .field-box input{
  background:transparent !important; background-color:transparent !important;
  border:0 !important; border-radius:0 !important;
}
html[data-theme="dark"] body input::placeholder,
html[data-theme="dark"] body textarea::placeholder{ color:#8798b0 !important; -webkit-text-fill-color:#8798b0 !important; }
html[data-theme="dark"] .cep-btn, html[data-theme="dark"] .cep-res{ color:#fda4af !important; }
html[data-theme="dark"] .cep-btn{ background:#1a2740 !important; border:1px solid #2b3a55 !important; }

/* ---- tabelas e rodapé: sem linhas claras nem texto apagado (v1.5.6) ---- */
html[data-theme="dark"] .tbl,
html[data-theme="dark"] .tbl tbody,
html[data-theme="dark"] .tbl tbody tr,
html[data-theme="dark"] .tbl tbody tr:nth-child(odd),
html[data-theme="dark"] .tbl tbody tr:nth-child(even),
html[data-theme="dark"] .tbl tbody td,
html[data-theme="dark"] .tbl tbody th{
  background:transparent !important;
  background-color:transparent !important;
  color:#dbe4f0 !important;
  border-color:#1e2a41 !important;
}
html[data-theme="dark"] .tbl tbody tr:nth-child(even){ background:rgba(255,255,255,.035) !important; }
html[data-theme="dark"] .tbl tbody tr:hover{ background:rgba(251,113,133,.08) !important; }
html[data-theme="dark"] .tbl td b,
html[data-theme="dark"] .tbl td strong,
html[data-theme="dark"] .tbl td a{ color:#f1f5fb !important; }
html[data-theme="dark"] .tbl td small,
html[data-theme="dark"] .tbl td .mut{ color:#9fb0c6 !important; }
html[data-theme="dark"] .tbl td .btn-mini,
html[data-theme="dark"] .tbl td .btn-ico{ background:#1a2740 !important; color:#e2e8f0 !important; }
html[data-theme="dark"] footer, html[data-theme="dark"] footer *,
html[data-theme="dark"] .adm-foot, html[data-theme="dark"] .adm-foot *,
html[data-theme="dark"] .rodape, html[data-theme="dark"] .rodape *{ color:#a9b6ca !important; }
html[data-theme="dark"] footer a, html[data-theme="dark"] .adm-foot a{ color:#fb7185 !important; }

/* ===================== AUTOCOMPLETE DE ENDEREÇO (v1.6.0) ===================== */

/* lista de sugestões: não deve ocupar espaço quando vazia/fechada */
[hidden]{ display:none !important; }
.ac-list:empty{ display:none !important; border:0 !important; box-shadow:none !important; }
.ac-list{
  position:relative; z-index:40; margin-top:6px;
  background:#ffffff; border:1px solid #d8e0ec; border-radius:12px;
  box-shadow:0 12px 28px rgba(15,23,42,.14); overflow:hidden; max-height:290px; overflow-y:auto;
}
.ac-item{
  display:block; width:100%; text-align:left; background:transparent; border:0;
  border-bottom:1px solid #eef2f8; padding:11px 13px; cursor:pointer;
  font-family:inherit; color:#0f172a; -webkit-tap-highlight-color:transparent;
}
.ac-item:last-child{ border-bottom:0; }
.ac-item:hover, .ac-item:focus{ background:#fff1f4; outline:none; }
.ac-item b{ display:block; font-size:.82rem; font-weight:700; color:#0f172a; line-height:1.35; }
.ac-item small{ display:block; font-size:.7rem; color:#64748b; margin-top:3px; }
html[data-theme="dark"] .ac-list{
  background:#101c33; border-color:#2f3f5c; box-shadow:0 14px 30px rgba(0,0,0,.5);
}
html[data-theme="dark"] .ac-item{ border-bottom-color:#1e2a41; }
html[data-theme="dark"] .ac-item:hover, html[data-theme="dark"] .ac-item:focus{ background:rgba(251,113,133,.14); }
html[data-theme="dark"] .ac-item b{ color:#eef2f9 !important; }
html[data-theme="dark"] .ac-item small{ color:#9fb0c6 !important; }
.cep-res{ min-height:16px; }


/* ============ BUSCA POR BAIRRO/CIDADE (v1.6.2) ============ */
.seg{display:flex;gap:8px;margin:4px 0 10px}
.seg-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:9px 8px;border-radius:11px;border:1px solid #d7dce6;background:#fff;
  color:#334155;font-size:.8rem;font-weight:600;cursor:pointer;line-height:1.1}
.seg-btn i{font-size:.78rem;opacity:.85}
.seg-btn.on{background:#e11d48;border-color:#e11d48;color:#fff}
.seg-btn.on i{opacity:1}
.cep-btn.wide{width:100%;margin-top:2px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.ac-item small{display:block;opacity:.72;font-size:.72rem;margin-top:3px;line-height:1.25}
.ac-item-ac{display:flex;align-items:center;gap:8px;border-style:dashed;font-size:.78rem;
  color:#e11d48;background:rgba(225,29,72,.05);font-weight:600}
.ac-item-ac i{font-size:.75rem}
html[data-theme="dark"] .seg-btn{background:#131c2e;border-color:#2c3d59;color:#c7d2e2}
html[data-theme="dark"] .seg-btn.on{background:#e11d48;border-color:#e11d48;color:#fff}
html[data-theme="dark"] .ac-item small{opacity:.8;color:#9fb0c9}
html[data-theme="dark"] .ac-item-ac{color:#fda4af;background:rgba(225,29,72,.12);border-color:rgba(251,113,133,.5)}
@media (max-width:420px){.seg-btn{font-size:.75rem;padding:8px 6px;gap:5px}}
