
/* ==========================================================================
   v6.9.1 — Visitors UI Rebuild
   Camada visual segura: não altera endpoints, regras ou vínculos.
   ========================================================================== */

:root{
  --v691-bg:#f5f7fb;
  --v691-card:#fff;
  --v691-text:#0f172a;
  --v691-muted:#64748b;
  --v691-border:#e5eaf2;
  --v691-blue:#2563eb;
  --v691-purple:#7c3aed;
  --v691-green:#16a34a;
  --v691-orange:#f97316;
  --v691-red:#dc2626;
  --v691-shadow:0 14px 38px rgba(15,23,42,.07);
}

body.ip-visitors-ui-v691 .app-page,
body.ip-visitors-ui-v691 .main-content,
body.ip-visitors-ui-v691 .ip-content{
  background:
    radial-gradient(circle at 12% 0%,rgba(37,99,235,.08),transparent 34%),
    linear-gradient(180deg,#f8fbff,#f5f7fb) !important;
}

/* HERO */
.ip-v691-hero{
  background:
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.20), transparent 34%),
    linear-gradient(135deg,#0f172a 0%,#2563eb 52%,#7c3aed 100%);
  border-radius:28px;
  padding:30px;
  color:#fff;
  margin:0 0 22px;
  box-shadow:0 24px 70px rgba(37,99,235,.18);
  overflow:hidden;
  position:relative;
}

.ip-v691-hero:after{
  content:"";
  position:absolute;
  right:52px;
  top:30px;
  width:160px;
  height:112px;
  border-radius:32px;
  background:rgba(255,255,255,.13);
  transform:rotate(-14deg);
}

.ip-v691-hero-main{
  position:relative;
  z-index:2;
  display:flex;
  justify-content:space-between;
  gap:22px;
  align-items:flex-start;
}

.ip-v691-title{
  display:flex;
  align-items:center;
  gap:18px;
}

.ip-v691-icon{
  width:72px;
  height:72px;
  border-radius:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:38px;
  background:rgba(255,255,255,.16);
}

.ip-v691-title h1{
  margin:0!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:clamp(34px,4vw,52px)!important;
  line-height:1!important;
  letter-spacing:-.06em!important;
}

.ip-v691-title p{
  margin:8px 0 0;
  color:rgba(255,255,255,.82)!important;
  -webkit-text-fill-color:rgba(255,255,255,.82)!important;
  font-size:15px;
  font-weight:700;
}

.ip-v691-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  max-width:520px;
}

.ip-v691-action{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 15px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.14);
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-weight:900;
  text-decoration:none!important;
  backdrop-filter:blur(10px);
}

.ip-v691-action.primary{
  background:linear-gradient(135deg,#ffffff,#eef2ff)!important;
  color:#1d4ed8!important;
  -webkit-text-fill-color:#1d4ed8!important;
}

/* KPI */
.ip-v691-kpis{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
  margin:0 0 22px;
}

.ip-v691-kpi{
  background:rgba(255,255,255,.9);
  border:1px solid var(--v691-border);
  border-radius:20px;
  padding:18px;
  box-shadow:var(--v691-shadow);
}

.ip-v691-kpi span{
  display:block;
  color:var(--v691-muted)!important;
  -webkit-text-fill-color:var(--v691-muted)!important;
  font-size:12px;
  font-weight:900;
  margin-bottom:8px;
}

.ip-v691-kpi strong{
  display:block;
  color:var(--v691-text)!important;
  -webkit-text-fill-color:var(--v691-text)!important;
  font-size:28px;
  line-height:1;
}

.ip-v691-kpi small{
  display:block;
  margin-top:10px;
  color:#059669!important;
  -webkit-text-fill-color:#059669!important;
  font-size:12px;
  font-weight:850;
}

/* Toolbar/filtros */
body.ip-visitors-ui-v691 .filters,
body.ip-visitors-ui-v691 .ip-v690-filters{
  background:#fff!important;
  border:1px solid var(--v691-border)!important;
  border-radius:22px!important;
  box-shadow:var(--v691-shadow)!important;
  padding:16px!important;
  margin-bottom:18px!important;
}

body.ip-visitors-ui-v691 .filters form,
body.ip-visitors-ui-v691 .ip-v690-filter-form{
  display:flex!important;
  gap:10px!important;
  flex-wrap:wrap!important;
  align-items:center!important;
}

body.ip-visitors-ui-v691 .filters input,
body.ip-visitors-ui-v691 .filters select,
body.ip-visitors-ui-v691 .ip-v690-filter-form input,
body.ip-visitors-ui-v691 .ip-v690-filter-form select{
  min-height:42px!important;
  border-radius:13px!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-weight:750!important;
}

/* Cards existentes viram cards pastorais */
body.ip-visitors-ui-v691 .visitor-card,
body.ip-visitors-ui-v691 .msg-card,
body.ip-visitors-ui-v691 .card,
body.ip-visitors-ui-v691 .data-card{
  border-radius:22px!important;
  border:1px solid var(--v691-border)!important;
  box-shadow:var(--v691-shadow)!important;
  background:#fff!important;
}

/* Tabela modo clássico mais premium */
body.ip-visitors-ui-v691 table,
body.ip-visitors-ui-v691 .data-table,
body.ip-visitors-ui-v691 .wp-list-table{
  border-radius:22px!important;
  overflow:hidden!important;
  box-shadow:var(--v691-shadow)!important;
  border:1px solid var(--v691-border)!important;
}

body.ip-visitors-ui-v691 table th,
body.ip-visitors-ui-v691 .data-table th{
  background:#f8fafc!important;
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
  font-size:12px!important;
  text-transform:uppercase!important;
  letter-spacing:.06em!important;
}

body.ip-visitors-ui-v691 table td,
body.ip-visitors-ui-v691 .data-table td{
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
}

/* Tags criadas via JS */
.ip-v691-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  border-radius:999px;
  padding:6px 9px;
  font-size:11px;
  font-weight:900;
  background:#eef2ff;
  color:#4f46e5!important;
  -webkit-text-fill-color:#4f46e5!important;
  margin:2px;
}

.ip-v691-chip.green{background:#ecfdf5;color:#047857!important;-webkit-text-fill-color:#047857!important}
.ip-v691-chip.orange{background:#fff7ed;color:#c2410c!important;-webkit-text-fill-color:#c2410c!important}
.ip-v691-chip.pink{background:#fdf2f8;color:#be185d!important;-webkit-text-fill-color:#be185d!important}

.ip-v691-side-note{
  background:linear-gradient(135deg,#312e81,#7c3aed);
  color:#fff;
  border-radius:22px;
  padding:18px;
  box-shadow:0 18px 44px rgba(124,58,237,.22);
  margin-top:18px;
}
.ip-v691-side-note *{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Botões */
body.ip-visitors-ui-v691 .btn-wa-send,
body.ip-visitors-ui-v691 .btn-whatsapp,
body.ip-visitors-ui-v691 a[href*="wa.me"],
body.ip-visitors-ui-v691 a[href*="whatsapp"]{
  background:#16a34a!important;
  border-color:#16a34a!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

@media(max-width:1280px){
  .ip-v691-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .ip-v691-hero{border-radius:24px;padding:22px;margin-bottom:16px}
  .ip-v691-hero-main{flex-direction:column}
  .ip-v691-icon{width:58px;height:58px;font-size:30px}
  .ip-v691-title h1{font-size:34px!important}
  .ip-v691-actions{width:100%;justify-content:flex-start}
  .ip-v691-action{flex:1;justify-content:center}
  .ip-v691-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .ip-v691-kpi{padding:14px}
  .ip-v691-kpi strong{font-size:24px}
  body.ip-visitors-ui-v691 .filters input,
  body.ip-visitors-ui-v691 .filters select,
  body.ip-visitors-ui-v691 .filters button,
  body.ip-visitors-ui-v691 .filters a{
    width:100%!important;
  }
}


/* ==========================================================================
   v6.9.2 — Visitors UI Scope Fix
   Garante que o cabeçalho/KPIs de Visitantes não vazem para outros módulos.
   ========================================================================== */

body:not(.ip-visitors-ui-v691) .ip-v691-hero,
body:not(.ip-visitors-ui-v691) .ip-v691-kpis,
body:not(.ip-visitors-ui-v691) .ip-v691-side-note {
  display:none !important;
}

/* Só permite hero/KPIs de visitantes quando a classe correta existir no body */
body.ip-visitors-ui-v691 .ip-v691-hero,
body.ip-visitors-ui-v691 .ip-v691-kpis {
  display:grid;
}

body.ip-visitors-ui-v691 .ip-v691-hero {
  display:block;
}


/* ==========================================================================
   v6.9.3 — Timeline + Jornada
   ========================================================================== */

.ip-v693-shell{
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:20px;
  align-items:start;
}

.ip-v693-side{
  position:sticky;
  top:18px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.ip-v693-box{
  background:#fff;
  border:1px solid #e5eaf2;
  border-radius:24px;
  box-shadow:0 14px 38px rgba(15,23,42,.07);
  padding:20px;
}

.ip-v693-box h3{
  margin:0 0 16px!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-size:18px!important;
}

.ip-v693-journey{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.ip-v693-step{
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  gap:12px;
  align-items:start;
  position:relative;
}

.ip-v693-step:not(:last-child):after{
  content:"";
  position:absolute;
  left:8px;
  top:20px;
  width:3px;
  height:calc(100% + 4px);
  background:#dbeafe;
  border-radius:999px;
}

.ip-v693-ball{
  width:18px;
  height:18px;
  border-radius:999px;
  background:#cbd5e1;
  margin-top:2px;
  position:relative;
  z-index:2;
}

.ip-v693-ball.done{
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  box-shadow:0 0 0 5px rgba(37,99,235,.10);
}

.ip-v693-step strong{
  display:block;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-size:14px;
  margin-bottom:2px;
}

.ip-v693-step span{
  display:block;
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  font-size:12px;
}

.ip-v693-timeline{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.ip-v693-event{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:12px;
  align-items:start;
}

.ip-v693-event-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef2ff;
  color:#4f46e5;
  font-size:15px;
}

.ip-v693-event strong{
  display:block;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-size:13px;
}

.ip-v693-event span{
  display:block;
  margin-top:2px;
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  font-size:12px;
}

.ip-v693-card-enhanced{
  position:relative;
  overflow:hidden;
}

.ip-v693-card-enhanced:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:linear-gradient(180deg,#2563eb,#7c3aed);
  border-radius:999px;
}

.ip-v693-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.ip-v693-progress{
  margin-top:10px;
  display:flex;
  gap:6px;
}

.ip-v693-progress span{
  flex:1;
  height:6px;
  border-radius:999px;
  background:#e2e8f0;
}

.ip-v693-progress span.active{
  background:linear-gradient(135deg,#2563eb,#7c3aed);
}

.ip-v693-floating{
  position:fixed;
  right:22px;
  bottom:22px;
  width:64px;
  height:64px;
  border-radius:999px;
  border:0;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  color:#fff;
  font-size:30px;
  box-shadow:0 20px 50px rgba(37,99,235,.35);
  z-index:999;
}

@media(max-width:1100px){
  .ip-v693-shell{
    grid-template-columns:1fr;
  }

  .ip-v693-side{
    position:static;
  }
}

@media(max-width:760px){
  .ip-v693-box{
    border-radius:20px;
    padding:16px;
  }

  .ip-v693-floating{
    width:58px;
    height:58px;
    font-size:26px;
    right:16px;
    bottom:16px;
  }
}


/* ==========================================================================
   v6.9.4 — Visitors Timeline + Compact Pagination Fix
   ========================================================================== */

/* Paginação compacta */
body.ip-visitors-ui-v691 .pagination,
body.ip-visitors-ui-v691 .tablenav-pages,
body.ip-visitors-ui-v691 .page-numbers,
body.ip-visitors-ui-v691 .ip-pagination{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  align-items:center !important;
  justify-content:center !important;
  margin:24px 0 !important;
}

body.ip-visitors-ui-v691 .pagination a,
body.ip-visitors-ui-v691 .pagination span,
body.ip-visitors-ui-v691 .tablenav-pages a,
body.ip-visitors-ui-v691 .tablenav-pages span,
body.ip-visitors-ui-v691 .page-numbers a,
body.ip-visitors-ui-v691 .page-numbers span,
body.ip-visitors-ui-v691 .ip-pagination a,
body.ip-visitors-ui-v691 .ip-pagination span{
  min-width:42px !important;
  height:42px !important;
  border-radius:13px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  border:1px solid #dbe4f0 !important;
  background:#fff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  font-weight:850 !important;
  text-decoration:none !important;
  box-shadow:0 8px 20px rgba(15,23,42,.04) !important;
}

body.ip-visitors-ui-v691 .pagination .current,
body.ip-visitors-ui-v691 .tablenav-pages .current,
body.ip-visitors-ui-v691 .page-numbers .current,
body.ip-visitors-ui-v691 .ip-pagination .current{
  background:linear-gradient(135deg,#2563eb,#7c3aed) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  border-color:transparent !important;
}

/* Esconde excesso quando a paginação legada imprime páginas demais */
body.ip-visitors-ui-v691 .pagination a:nth-of-type(n+8):not(:last-child),
body.ip-visitors-ui-v691 .pagination span:nth-of-type(n+8):not(:last-child),
body.ip-visitors-ui-v691 .ip-pagination a:nth-of-type(n+8):not(:last-child),
body.ip-visitors-ui-v691 .ip-pagination span:nth-of-type(n+8):not(:last-child){
  display:none !important;
}

.ip-v694-pagination-note{
  text-align:center;
  margin:8px 0 18px;
  color:#64748b;
  font-size:13px;
  font-weight:800;
}

/* Timeline e jornada fixas dentro de Visitantes */
.ip-v694-journey-wrap{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  gap:20px;
  align-items:start;
  margin-top:20px;
}

.ip-v694-timeline-side{
  display:flex;
  flex-direction:column;
  gap:18px;
  position:sticky;
  top:18px;
}

.ip-v694-box{
  background:#fff;
  border:1px solid #e5eaf2;
  border-radius:24px;
  box-shadow:0 14px 38px rgba(15,23,42,.07);
  padding:20px;
}

.ip-v694-box h3{
  margin:0 0 16px!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-size:18px!important;
}

.ip-v694-journey{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.ip-v694-step{
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  gap:12px;
  position:relative;
}

.ip-v694-step:not(:last-child):after{
  content:"";
  position:absolute;
  left:9px;
  top:23px;
  width:3px;
  height:calc(100% + 4px);
  background:#dbeafe;
  border-radius:999px;
}

.ip-v694-dot{
  width:20px;
  height:20px;
  border-radius:999px;
  background:#cbd5e1;
  margin-top:1px;
  position:relative;
  z-index:2;
}

.ip-v694-dot.done{
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  box-shadow:0 0 0 5px rgba(37,99,235,.10);
}

.ip-v694-step strong{
  display:block;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-size:14px;
}

.ip-v694-step span{
  display:block;
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  font-size:12px;
  margin-top:2px;
}

.ip-v694-event{
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:12px;
  padding:11px 0;
  border-bottom:1px solid #edf2f7;
}

.ip-v694-event:last-child{
  border-bottom:0;
}

.ip-v694-event-icon{
  width:36px;
  height:36px;
  border-radius:13px;
  background:#eef2ff;
  color:#4f46e5;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ip-v694-event strong{
  display:block;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-size:13px;
}

.ip-v694-event span{
  display:block;
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  font-size:12px;
  margin-top:2px;
}

.ip-v694-note{
  background:linear-gradient(135deg,#312e81,#7c3aed);
  color:#fff;
}

.ip-v694-note *{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

@media(max-width:1100px){
  .ip-v694-journey-wrap{
    grid-template-columns:1fr;
  }
  .ip-v694-timeline-side{
    position:static;
  }
}

@media(max-width:760px){
  .ip-v694-box{
    border-radius:20px;
    padding:16px;
  }

  body.ip-visitors-ui-v691 .pagination,
  body.ip-visitors-ui-v691 .ip-pagination{
    justify-content:flex-start!important;
    overflow:auto!important;
    flex-wrap:nowrap!important;
    padding-bottom:8px;
  }
}
