
:root{--red:#c90016;--red2:#e30613;--bg:#f7f7f8;--text:#171717;--muted:#666b74;--line:#e8e0dc;--green:#25d366}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Segoe UI,Arial,sans-serif;padding-bottom:86px}
.header{background:linear-gradient(135deg,#b50012,#e30613);color:#fff;padding:14px 18px 16px;box-shadow:0 8px 26px rgba(120,0,0,.22)}
.headerRow{display:flex;align-items:center;gap:15px;justify-content:space-between;max-width:1120px;margin:auto}.logoBox{display:flex;align-items:center;gap:14px}.logo{height:58px;max-width:180px;object-fit:contain}.vline{height:48px;width:1px;background:rgba(255,255,255,.38)}.headText h1{font-size:19px;line-height:1.1;margin:0;text-transform:uppercase;letter-spacing:.7px}.headText p{margin:5px 0 0;font-weight:700;font-size:13px;letter-spacing:.4px}.refresh{font-size:12px;text-align:left}.refreshIcon{background:rgba(255,255,255,.15);border-radius:14px;width:54px;height:54px;display:flex;align-items:center;justify-content:center;font-size:25px}
#offlineStatus,#appVersion{display:inline-block;margin-top:4px;padding:3px 8px;border-radius:999px;background:rgba(255,255,255,.18);font-size:11px;font-weight:900}#offlineStatus.offline{background:#222;color:#fff}
.page{display:none;padding:18px;max-width:1120px;margin:auto}.page.active{display:block}
.homeSubtitle{text-align:center;color:#666b74;font-size:14px;margin:18px 0 4px}
.homeGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:22px}
.homeCard{background:#fff;border:1px solid #eadfdb;border-radius:22px;padding:24px 18px;text-align:center;min-height:230px;box-shadow:0 8px 24px rgba(74,40,20,.08);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:space-between}
.homeIcon{width:82px;height:82px;border-radius:20px;background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;display:flex;align-items:center;justify-content:center;font-size:40px;box-shadow:0 12px 20px rgba(227,6,19,.18)}
.homeIcon svg{width:42px;height:42px;fill:#fff}.homeCard h2{font-size:19px;margin:14px 0 5px}.homeCard .red{color:var(--red);font-weight:900}.homeCard p{font-size:13px;line-height:1.42;color:#3d4147;margin:6px 0 12px}.access{width:100%;background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;border:0;border-radius:11px;padding:11px 8px;font-weight:900;font-size:14px}
.globalSearchBox{background:#fff;border:1px solid #eadfdb;border-radius:22px;padding:14px;margin:14px 0 4px;box-shadow:0 8px 24px rgba(74,40,20,.06)}.globalSearchTitle{font-weight:950;color:var(--red);font-size:15px;text-transform:uppercase;margin-bottom:8px}.globalSearchRow{display:flex;gap:8px}.globalResultType{display:inline-block;font-size:11px;font-weight:900;color:#fff;background:var(--red);border-radius:999px;padding:4px 8px;margin-bottom:6px}
.installBox{display:none;align-items:center;justify-content:space-between;gap:12px;background:linear-gradient(135deg,#fff,#fff6f4);border:1px solid #efd3cd;border-radius:18px;padding:13px 14px;margin:14px 0;box-shadow:0 6px 18px rgba(74,40,20,.06)}.installBox.mobileVisible{display:flex}.installBox span{font-size:12px;color:#666}.installBtn{background:var(--red);color:#fff;border:0;border-radius:11px;padding:10px 14px;font-weight:900}.installHelp{font-size:11.5px;color:#666;margin-top:4px;line-height:1.35}
.screenHead{background:linear-gradient(135deg,#b50012,#e30613);color:#fff;border-radius:18px 18px 0 0;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;margin-top:10px}.screenHead h2{font-size:16px;margin:0}.backBtn,.searchBtn{background:transparent;border:0;color:#fff;font-size:20px}.contentBox{background:#fff;border:1px solid #eadfdb;border-top:0;border-radius:0 0 18px 18px;padding:14px;box-shadow:0 8px 22px rgba(74,40,20,.08)}
.searchRow{display:flex;gap:9px;margin-bottom:10px}.search{flex:1;border:1px solid var(--line);border-radius:10px;padding:12px 13px;font-size:14px;outline:none;min-width:0}.filterBtn{background:var(--red);color:#fff;border:0;border-radius:10px;padding:0 14px;font-weight:900;display:flex;align-items:center;gap:7px}.filterPanel{display:none;background:#fff6f4;border:1px solid #efd3cd;border-radius:14px;padding:12px;margin-bottom:10px}.filterPanel.show{display:block}.filterGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}select{width:100%;border:1px solid var(--line);border-radius:10px;padding:11px;background:#fff}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:9px;margin-bottom:5px}.chip{border:0;border-bottom:3px solid transparent;background:transparent;padding:10px 12px;white-space:nowrap;font-weight:850;color:#444}.chip.active{color:var(--red);border-bottom-color:var(--red)}
.list{display:grid;gap:10px}.item{background:#fff;border:1px solid #eee0dc;border-radius:14px;padding:13px;box-shadow:0 5px 16px rgba(74,40,20,.05)}.itemTop{display:flex;gap:12px;align-items:center}.avatar{width:44px;height:44px;border-radius:50%;background:#e7e8eb;color:#333;display:flex;align-items:center;justify-content:center;font-weight:900;flex-shrink:0}.tag{color:var(--red);font-weight:950;font-size:13px}.name{font-size:14px;font-weight:900;text-transform:uppercase;margin:3px 0;line-height:1.25}.muted{color:var(--muted);font-size:12.5px;line-height:1.38}.tel{font-size:15px;font-weight:800;margin-top:3px}
.actions{display:flex;gap:8px;margin-top:10px}.actions a,.actions button{border:1px solid #eee;text-decoration:none;display:flex;align-items:center;justify-content:center;gap:5px;border-radius:10px;padding:8px 4px;font-size:12px;font-weight:850;min-height:38px;flex:1}.call{background:#fff;color:#050505}.wa{background:#fff;color:#00a63f}.copy{background:#fff;color:#222}.maps{background:var(--red);color:#fff!important}.waIcon{width:18px;height:18px;display:inline-block}.copySvg{width:18px;height:18px;fill:#666}
.nav{position:fixed;bottom:0;left:0;right:0;background:#fff;box-shadow:0 -7px 22px rgba(15,23,42,.12);display:grid;grid-template-columns:repeat(6,1fr);z-index:30;padding:7px 4px 8px}.nav button{border:0;background:transparent;font-size:10px;color:#667085;font-weight:850;padding:3px 2px;display:flex;flex-direction:column;align-items:center;gap:3px}.navIcon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:.22s}.navIcon svg{width:19px;height:19px;fill:#6b7280}.nav button.active .navIcon{background:var(--red);box-shadow:0 8px 16px rgba(227,6,19,.28);transform:translateY(-6px)}.nav button.active .navIcon svg{fill:#fff}.nav button.active{color:var(--red)}
.pill{display:inline-block;background:#f2f4f7;border-radius:999px;padding:5px 9px;margin:4px 4px 0 0;font-size:12px;font-weight:850}.toast{position:fixed;left:50%;bottom:88px;transform:translateX(-50%);background:#111827;color:#fff;padding:10px 15px;border-radius:999px;font-weight:850;opacity:0;transition:.25s;z-index:5000}.toast.show{opacity:1}.countLine{font-size:13px;color:#666;margin:8px 0 12px}.empty{text-align:center;color:var(--muted);padding:20px}
.kpiGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.kpiBox{background:linear-gradient(135deg,#fff,#fff7f5);border:1px solid #efd9d4;border-radius:16px;padding:14px;box-shadow:0 6px 18px rgba(74,40,20,.06)}.kpiNum{font-size:24px;font-weight:950;color:var(--red);line-height:1}.kpiLbl{font-size:12px;color:#555;margin-top:4px;font-weight:750}.indicatorNote{background:#fff6f4;border:1px solid #efd3cd;border-radius:14px;padding:11px 12px;margin-bottom:10px;color:#4b5563;font-size:12.5px;line-height:1.35}.infoTitle{font-size:15px;font-weight:950;margin:4px 0 10px;text-transform:uppercase;color:#171717}.barRow{margin:10px 0}.barTop{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12.5px;margin-bottom:5px}.barName{font-weight:850;color:#222}.barVal{font-weight:900;color:var(--red);white-space:nowrap}.barTrack{height:8px;background:#f0e8e5;border-radius:999px;overflow:hidden}.barFill{height:100%;background:linear-gradient(90deg,var(--red),var(--red2));border-radius:999px}
.suggestBox{display:none;background:#fff;border:1px solid #eadfdb;border-radius:14px;margin:-4px 0 10px;box-shadow:0 8px 22px rgba(74,40,20,.08);overflow:hidden;z-index:10;position:relative}.suggestBox.show{display:block}.suggestItem{padding:11px 12px;border-bottom:1px solid #f1eeee;cursor:pointer;background:#fff}.suggestItem:active,.suggestItem:hover{background:#fff6f4}.suggestType{display:inline-block;background:#fff1f2;color:var(--red);border:1px solid #ffd2d8;border-radius:999px;padding:3px 8px;font-size:10.5px;font-weight:950;margin-bottom:4px}.suggestTitle{font-size:13px;font-weight:950;color:#171717;text-transform:uppercase}.suggestSub{font-size:12px;color:#666;margin-top:2px;line-height:1.35}
.equipBadge{display:inline-block;background:#fff1f2;color:var(--red);border:1px solid #ffd2d8;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:900;margin:2px 4px 4px 0}.equipGrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.equipInfo{background:#f8f8f8;border-radius:10px;padding:8px;font-size:12px;color:#444}.equipInfo b{display:block;color:#111;font-size:12px;margin-bottom:2px}
.profileOverlay{position:fixed;inset:0;background:rgba(0,0,0,.52);z-index:2000;display:none;align-items:flex-end;justify-content:center}.profileOverlay.show{display:flex}.profileSheet{background:#fff;width:100%;max-width:820px;max-height:92vh;overflow:auto;border-radius:24px 24px 0 0;box-shadow:0 -12px 34px rgba(0,0,0,.20)}.profileHead{background:linear-gradient(135deg,#b50012,#e30613);color:#fff;padding:16px;border-radius:24px 24px 0 0;position:sticky;top:0;z-index:2}.profileHeadTop{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.profileHead h2{font-size:17px;line-height:1.2;margin:0;text-transform:uppercase}.profileHead p{margin:6px 0 0;font-size:12px;opacity:.9}.closeProfile{background:rgba(255,255,255,.18);border:0;color:#fff;border-radius:50%;width:36px;height:36px;font-size:22px;font-weight:900}.profileBody{padding:14px}.profileGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.profileInfo{background:#f8f8f8;border:1px solid #eee;border-radius:14px;padding:11px;font-size:12.5px;color:#444;min-height:58px}.profileInfo b{display:block;color:#111;font-size:11.5px;margin-bottom:3px;text-transform:uppercase}.profileSectionTitle{font-size:14px;font-weight:950;color:var(--red);text-transform:uppercase;margin:16px 2px 8px}.clientClickable{cursor:pointer}.profileEquip{background:#fff;border:1px solid #eee0dc;border-radius:14px;padding:11px;margin-bottom:8px}.profileEquip .tag{font-size:12px}.profileHint{font-size:12px;color:#666;margin:6px 0 0}
.sellerCard{background:linear-gradient(135deg,#fff,#fff7f5);border:1px solid #efd9d4;border-radius:18px;padding:14px;box-shadow:0 6px 18px rgba(74,40,20,.06);margin-bottom:12px}.sellerTop{display:flex;align-items:center;gap:12px;margin-bottom:10px}.sellerAvatar{width:48px;height:48px;border-radius:50%;background:var(--red);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:950;font-size:18px;flex-shrink:0}.sellerTitle{font-size:12px;color:var(--red);font-weight:950;text-transform:uppercase;margin-bottom:2px}.sellerName{font-size:15px;font-weight:950;color:#171717;text-transform:uppercase;line-height:1.2}.sellerMeta{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.sellerMeta div{background:#fff;border:1px solid #eee;border-radius:12px;padding:9px;font-size:12px;color:#555}.sellerMeta b{display:block;color:#111;font-size:11px;text-transform:uppercase;margin-bottom:2px}.sellerActions{display:flex;gap:8px;margin-top:12px}.sellerActions a,.sellerActions button{border:1px solid #eee;text-decoration:none;display:flex;align-items:center;justify-content:center;gap:5px;border-radius:10px;padding:9px 8px;font-size:13px;font-weight:850;min-height:40px;flex:1}.sellerPhoneLine{display:flex;align-items:center;justify-content:space-between;gap:8px}.sellerMiniWa{background:#fff;color:#00a63f;border:1px solid #eee;border-radius:10px;padding:7px 9px;text-decoration:none;font-size:12px;font-weight:900;display:flex;align-items:center;gap:4px}.sellerMiniWa .waIcon{width:15px;height:15px}.profileTopActions{display:flex;gap:8px;margin-top:12px}.shareClientBtn{background:#fff;color:var(--red);border:0;border-radius:12px;padding:10px 12px;font-weight:950;display:flex;align-items:center;justify-content:center;gap:6px;width:100%}
#splash{position:fixed;inset:0;z-index:1000;background:#e30613;display:flex;align-items:center;justify-content:center;transition:.4s}#splash img{width:220px;max-width:70vw;border-radius:16px}#splash.hide{opacity:0;pointer-events:none}
@media(max-width:850px){.headerRow{align-items:center}.logo{height:48px;max-width:145px}.vline{height:40px}.headText h1{font-size:15px}.headText p{font-size:12px}.refresh{display:none}.page{padding:12px}.homeGrid{grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.homeCard{min-height:178px;padding:16px 9px}.homeIcon{width:62px;height:62px;font-size:29px;border-radius:16px}.homeIcon svg{width:36px;height:36px}.homeCard h2{font-size:15px;margin:10px 0 3px}.homeCard p{font-size:11.5px;line-height:1.33;margin:5px 0 8px}.access{padding:9px 6px;font-size:13px}.filterGrid{grid-template-columns:1fr}.kpiGrid{grid-template-columns:1fr 1fr}.globalSearchRow{flex-direction:column}.installBox{display:flex}.equipGrid{grid-template-columns:1fr}}
@media(max-width:650px){.profileGrid{grid-template-columns:1fr 1fr!important;gap:8px}.profileInfo{padding:9px;font-size:11.5px;min-height:54px}.profileInfo b{font-size:10.5px}.sellerMeta{grid-template-columns:1fr 1fr!important}.sellerMeta div{padding:8px;font-size:11.5px}.sellerActions a,.sellerActions button{font-size:12px;padding:8px 5px}}

/* ===== V15.1: Compartilhar corrigido ===== */
.shareClientBtn{
  background:linear-gradient(135deg,var(--red),var(--red2))!important;
  color:#fff!important;
  border:0!important;
  border-radius:14px!important;
  padding:12px 14px!important;
  font-weight:950!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:100%!important;
  box-shadow:0 8px 18px rgba(227,6,19,.22)!important;
}
.shareClientBtn img{
  width:22px;
  height:22px;
  object-fit:contain;
  filter:brightness(0) invert(1);
}

.shareClientBtn svg{
 width:20px;
 height:20px;
 fill:#fff;
 flex-shrink:0;
}
.shareClientBtn img{display:none!important;}

/* ===== Correção final: botão Compartilhar sem imagem quebrada ===== */
.shareClientBtn img,
.shareClientBtn svg{
  display:none!important;
}
.shareClientBtn .shareGlyph{
  width:22px;
  height:22px;
  border:2px solid #fff;
  border-radius:7px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:18px;
  font-weight:950;
  line-height:1;
  flex-shrink:0;
}

/* ===== V15 FINAL 3: Compartilhar com SVG inline definitivo ===== */
.shareClientBtn img,
.shareClientBtn .shareGlyph{
  display:none!important;
}
.shareClientBtn .shareIconInline{
  width:22px!important;
  height:22px!important;
  fill:#fff!important;
  display:inline-block!important;
  flex-shrink:0!important;
}
.shareClientBtn{
  background:linear-gradient(135deg,var(--red),var(--red2))!important;
  color:#fff!important;
  border:0!important;
}

/* ===== V15.7: filtros de clientes corrigidos ===== */
#clientFilters .filterGrid{grid-template-columns:repeat(3,1fr)}
@media(max-width:850px){#clientFilters .filterGrid{grid-template-columns:1fr 1fr}}

/* ===== V15 FINAL 9: filtros completos em Indicadores ===== */
#indicatorFilters .filterGrid{grid-template-columns:repeat(3,1fr)}
@media(max-width:850px){#indicatorFilters .filterGrid{grid-template-columns:1fr 1fr}}

/* ===== V16: Clientes Próximos por coordenadas ===== */
.nav{grid-template-columns:repeat(7,1fr)}
.nearbyIntro{background:linear-gradient(135deg,#fff,#fff7f5);border:1px solid #efd9d4;border-radius:16px;padding:13px;margin-bottom:12px;color:#444;font-size:13px;line-height:1.35}.nearbyIntro b{color:#111;font-size:14px}.nearbyControls{display:flex;gap:8px;margin-bottom:10px}.locBtn{background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;border:0;border-radius:12px;padding:12px 14px;font-weight:950;box-shadow:0 8px 18px rgba(227,6,19,.20);flex:1}.nearbyFilters{margin-bottom:10px}.nearbyToggle{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #eee;border-radius:12px;padding:11px 12px;font-size:12.5px;font-weight:800;color:#333}.nearbyToggle input{width:17px;height:17px;accent-color:var(--red)}.nearbyStatus{font-size:12.5px;color:#555;background:#f8f8f8;border:1px solid #eee;border-radius:12px;padding:10px 12px;margin:8px 0 10px}.mapBox{height:260px;border-radius:18px;overflow:hidden;border:1px solid #eadfdb;background:#f8f8f8;margin:10px 0 12px;box-shadow:0 6px 18px rgba(74,40,20,.06)}.mapBox iframe{width:100%;height:100%;border:0}.mapPlaceholder{height:100%;display:flex;align-items:center;justify-content:center;text-align:center;color:#777;font-size:13px;padding:18px}.nearbyItem{position:relative;padding-left:54px}.nearbyRank{position:absolute;left:13px;top:16px;width:28px;height:28px;background:var(--red);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:950;font-size:13px}.nearbyItem .actions a{text-decoration:none}.nearbyItem .actions .maps,.nearbyItem .actions .wa{min-height:38px}
@media(max-width:850px){.nav button{font-size:9px}.navIcon{width:29px;height:29px}.nearbyControls{flex-direction:column}.mapBox{height:220px}.nearbyItem{padding-left:48px}.nearbyRank{left:10px}}


/* ===== V16.2: Portfólios GDM ===== */
.portfolioIntro{background:linear-gradient(135deg,#fff,#fff7f5);border:1px solid #efd9d4;border-radius:16px;padding:13px;margin-bottom:14px;color:#444;font-size:13px;line-height:1.35}.portfolioIntro b{color:#111;font-size:14px}.portfolioGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.portfolioCard{background:#fff;border:1px solid #eee;border-radius:20px;padding:16px;box-shadow:0 8px 22px rgba(74,40,20,.08);display:flex;gap:13px;align-items:flex-start}.portfolioIcon{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;box-shadow:0 8px 18px rgba(227,6,19,.18);flex-shrink:0}.portfolioBody h3{margin:3px 0 5px;font-size:18px;color:#111}.portfolioBody p{margin:0 0 12px;color:#666;font-size:13px;line-height:1.35}.portfolioActions{display:flex;gap:8px;flex-wrap:wrap}.downloadBtn{border:0;border-radius:12px;background:#2f343b;color:#fff;text-decoration:none;font-weight:950;padding:10px 12px;font-size:12px;display:inline-flex;align-items:center;justify-content:center;min-height:38px}.portfolioOverlay{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:999;display:none;align-items:center;justify-content:center;padding:16px}.portfolioOverlay.show{display:flex}.portfolioViewer{width:min(1040px,100%);height:min(92vh,860px);background:#fff;border-radius:22px;overflow:hidden;box-shadow:0 24px 80px rgba(0,0,0,.35);display:flex;flex-direction:column}.portfolioViewerHead{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #eee}.portfolioViewerHead h2{margin:0;font-size:18px}.portfolioViewerHead p{margin:3px 0 0;color:#666;font-size:12px}.portfolioViewer iframe{flex:1;width:100%;border:0;background:#f6f6f6}.portfolioViewerActions{display:flex;gap:10px;justify-content:flex-end;padding:12px 16px;border-top:1px solid #eee;background:#fafafa}
@media(max-width:900px){.portfolioGrid{grid-template-columns:1fr}.portfolioCard{border-radius:17px}.portfolioViewer{height:88vh;border-radius:18px}.portfolioViewerActions{justify-content:stretch}.portfolioViewerActions .downloadBtn,.portfolioViewerActions .filterBtn{flex:1}.portfolioIcon{width:44px;height:44px;font-size:22px}}

/* Correção V16.3: portfólios abrem em nova aba, sem modal solto */
.portfolioActions a.maps{background:linear-gradient(135deg,var(--red),var(--red2));color:#fff;text-decoration:none;border:0;border-radius:12px;font-weight:950;padding:10px 12px;font-size:12px;display:inline-flex;align-items:center;justify-content:center;min-height:38px}
#portfolioOverlay{display:none!important}

/* ===== V16.3: Correção botões Portfólios ===== */
.portfolioActions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.portfolioBtn{appearance:none;-webkit-appearance:none;border:0!important;border-radius:14px!important;text-decoration:none!important;font-weight:950;padding:10px 14px;font-size:12px;display:inline-flex;align-items:center;justify-content:center;min-height:40px;line-height:1;cursor:pointer;font-family:inherit;box-shadow:0 8px 16px rgba(227,6,19,.14)}
.portfolioViewBtn{background:linear-gradient(135deg,var(--red),var(--red2))!important;color:#fff!important}
.portfolioDownloadBtn{background:#2f343b!important;color:#fff!important}
.portfolioActions a,.portfolioActions button{border-radius:14px!important}
@media(max-width:650px){.portfolioActions{display:grid;grid-template-columns:1fr 1fr;width:100%}.portfolioBtn{width:100%;min-height:42px}}
