/* ===== GRID PRINCIPAL ===== */
.grid-kpis{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:var(--space-md);
  margin-bottom:var(--space-lg);
}

.grid-main{
  display:grid;
  grid-template-columns:1.4fr 1fr;
  gap:var(--space-lg);
  margin-bottom:var(--space-lg);
}
@media (max-width:980px){
  .grid-main{grid-template-columns:1fr}
}

.grid-secondary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--space-lg);
  margin-bottom:var(--space-lg);
}
@media (max-width:780px){
  .grid-secondary{grid-template-columns:1fr}
}

/* ===== CARDS ===== */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:var(--space-lg);
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-direction:column;
  gap:var(--space-md);
  min-height:auto;
  height:auto;
  overflow:visible;
  transition:box-shadow .2s ease, transform .2s ease;
}
.card:hover{box-shadow:var(--shadow-md)}

.card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:var(--space-sm);
  flex-wrap:wrap;
}
.card-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}
.card-title .info{
  width:16px;height:16px;border-radius:50%;
  background:var(--primary-100);color:var(--primary);
  display:inline-flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:800;cursor:help;
  position:relative;
}
.card-title .info:hover .tooltip{opacity:1;visibility:visible;transform:translateY(0)}
.tooltip{
  position:absolute;
  bottom:calc(100% + 8px);left:50%;
  transform:translateX(-50%) translateY(4px);
  background:var(--text);color:#fff;
  font-size:11px;font-weight:500;letter-spacing:0;
  padding:8px 10px;border-radius:6px;
  white-space:normal;width:200px;text-align:left;
  opacity:0;visibility:hidden;
  transition:opacity .18s ease, transform .18s ease;
  pointer-events:none;
  text-transform:none;
  z-index:30;
  box-shadow:var(--shadow-md);
}
.tooltip::after{
  content:"";position:absolute;top:100%;left:50%;
  transform:translateX(-50%);
  border:5px solid transparent;border-top-color:var(--text);
}

/* ===== KPI ===== */
.kpi .big{
  font-size:30px;
  font-weight:800;
  color:var(--text);
  line-height:1.2;
  letter-spacing:-.02em;
  margin-top:4px;
}
.kpi .delta{
  display:inline-flex;align-items:center;gap:4px;
  font-size:12px;font-weight:700;
  padding:3px 8px;border-radius:999px;
  margin-top:6px;
}
.delta.up{background:var(--success-100);color:var(--success)}
.delta.down{background:var(--danger-100);color:var(--danger)}
.delta.flat{background:var(--primary-100);color:var(--primary)}

.kpi-foot{
  display:flex;justify-content:space-between;align-items:center;
  font-size:12px;color:var(--muted);
  padding-top:var(--space-sm);
  border-top:1px solid var(--border);
}

/* ===== BADGES / CHIPS ===== */
.badge{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 10px;border-radius:999px;
  font-size:11px;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;
}
.badge.danger{background:var(--danger-100);color:var(--danger)}
.badge.success{background:var(--success-100);color:var(--success)}
.badge.warning{background:#FFF4DC;color:var(--accent-700)}
.badge.neutral{background:var(--primary-100);color:var(--primary)}

.chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 12px;border-radius:999px;
  background:var(--surface-2);border:1px solid var(--border);
  font-size:12px;font-weight:600;color:var(--text);
  cursor:pointer;transition:all .18s ease;
}
.chip:hover{background:var(--primary-100);border-color:var(--primary)}
.chip.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.chip-row{display:flex;flex-wrap:wrap;gap:8px}

/* ===== STRIKES ===== */
.strikes{display:flex;gap:6px;align-items:center}
.strike-dot{
  width:18px;height:18px;border-radius:50%;
  background:var(--success);
  box-shadow:0 0 0 2px var(--surface), 0 0 0 3px var(--success-100);
}
.strike-dot.empty{background:#E2E8F0;box-shadow:0 0 0 2px var(--surface), 0 0 0 3px var(--border)}
.strike-dot.warn{background:var(--warning);box-shadow:0 0 0 2px var(--surface), 0 0 0 3px #FFF4DC}

/* ===== FUNIL ===== */
.funnel{display:flex;flex-direction:column;gap:10px}
.funnel-row{
  display:grid;grid-template-columns:120px 1fr 60px;
  gap:var(--space-sm);align-items:center;
}
.funnel-bar{
  height:24px;border-radius:8px;
  background:var(--primary-100);
  position:relative;overflow:hidden;
}
.funnel-bar > span{
  position:absolute;left:0;top:0;bottom:0;
  background:linear-gradient(90deg,var(--primary) 0%,var(--secondary) 100%);
  border-radius:8px;
  transition:width .8s cubic-bezier(.2,.8,.2,1);
}
.funnel-row .label{font-size:13px;font-weight:600;color:var(--text)}
.funnel-row .val{font-size:13px;font-weight:700;color:var(--primary);text-align:right}

/* ===== FEED (ANDON) ===== */
.feed{display:flex;flex-direction:column;gap:10px;max-height:340px;overflow-y:auto;padding-right:4px}
.feed-item{
  display:flex;gap:12px;align-items:flex-start;
  padding:12px;border-radius:var(--radius-md);
  background:var(--surface-2);
  border:1px solid var(--border);
  transition:all .18s ease;
}
.feed-item:hover{background:var(--primary-100);border-color:var(--primary)}
.feed-dot{width:10px;height:10px;border-radius:50%;margin-top:6px;flex-shrink:0}
.feed-dot.r{background:var(--danger)}
.feed-dot.y{background:var(--accent)}
.feed-dot.g{background:var(--success)}
.feed-dot.b{background:var(--secondary)}
.feed-body{flex:1;min-width:0}
.feed-body .t{font-size:13px;font-weight:700;color:var(--text);margin-bottom:2px}
.feed-body .d{font-size:12px;color:var(--muted)}
.feed-time{font-size:11px;color:var(--muted);font-weight:600;flex-shrink:0}

/* ===== HEATMAP ===== */
.heatmap{
  display:grid;
  grid-template-columns:60px repeat(8,1fr);
  gap:4px;
}
.heat-h,.heat-d{
  font-size:11px;font-weight:700;color:var(--muted);
  text-align:center;padding:4px 0;
  text-transform:uppercase;letter-spacing:.04em;
}
.heat-cell{
  aspect-ratio:1.6/1;
  border-radius:6px;
  background:var(--primary-100);
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
  position:relative;
}
.heat-cell:hover{transform:scale(1.08);box-shadow:var(--shadow-md);z-index:2}
.heat-l1{background:#E6EEF4}
.heat-l2{background:#BFD4E3}
.heat-l3{background:#7FA4BD}
.heat-l4{background:#3D6F8F}
.heat-l5{background:var(--primary)}

/* ===== RECEITA ===== */
.revenue-bars{display:flex;align-items:flex-end;gap:8px;height:140px;padding:0 var(--space-xs)}
.rev-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}
.rev-bar{
  width:100%;
  background:linear-gradient(180deg,var(--secondary) 0%,var(--primary) 100%);
  border-radius:6px 6px 0 0;
  min-height:6px;
  transition:transform .2s ease;
  cursor:pointer;
}
.rev-bar:hover{transform:scaleY(1.05)}
.rev-bar.alt{background:linear-gradient(180deg,var(--accent) 0%,var(--accent-700) 100%)}
.rev-label{font-size:10px;color:var(--muted);font-weight:600}

.legend{display:flex;gap:var(--space-md);flex-wrap:wrap;font-size:12px}
.legend-dot{width:10px;height:10px;border-radius:3px;display:inline-block;margin-right:6px;vertical-align:middle}

/* ===== TOAST ===== */
.toast-wrap{position:fixed;right:24px;bottom:24px;display:flex;flex-direction:column;gap:10px;z-index:120}
.toast{
  background:var(--text);color:#fff;
  padding:14px 18px;border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg);
  font-size:13px;font-weight:600;
  display:flex;align-items:center;gap:10px;
  min-width:260px;max-width:360px;
  opacity:0;transform:translateY(12px);
  transition:opacity .25s ease, transform .25s ease;
}
.toast.show{opacity:1;transform:translateY(0)}
.toast.success{background:var(--success)}
.toast.danger{background:var(--danger)}
.toast.info{background:var(--primary)}

/* ===== SEÇÃO COMERCIAL EVOLUTIV ===== */
.evolutiv-pitch{
  background:linear-gradient(135deg,var(--primary) 0%,var(--primary-700) 100%);
  color:#fff;
  border-radius:var(--radius-xl);
  padding:var(--space-2xl) var(--space-xl);
  margin-bottom:var(--space-lg);
  position:relative;
  overflow:hidden;
}
.evolutiv-pitch::before{
  content:"";position:absolute;top:-80px;right:-80px;
  width:280px;height:280px;border-radius:50%;
  background:radial-gradient(circle, rgba(232,169,60,.25) 0%, transparent 70%);
}
.evolutiv-pitch h2{color:#fff;font-size:24px;margin-bottom:8px;position:relative}
.evolutiv-pitch .lead{color:rgba(255,255,255,.85);font-size:15px;max-width:680px;margin-bottom:var(--space-lg);position:relative}
.pillars{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:var(--space-md);
  margin-bottom:var(--space-lg);
  position:relative;
}
.pillar{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  border-radius:var(--radius-md);
  padding:var(--space-md);
  backdrop-filter:blur(6px);
}
.pillar-icon{
  width:40px;height:40px;border-radius:10px;
  background:var(--accent);color:var(--primary-700);
  display:inline-flex;align-items:center;justify-content:center;
  margin-bottom:10px;font-weight:800;
}
.pillar h3{color:#fff;font-size:16px;margin-bottom:6px}
.pillar p{font-size:13px;color:rgba(255,255,255,.78);line-height:1.55}

.pitch-cta{display:flex;gap:var(--space-sm);flex-wrap:wrap;position:relative}

/* ===== FOOTER ===== */
.app-footer{
  text-align:center;
  padding:var(--space-lg);
  font-size:12px;color:var(--muted);
  border-top:1px solid var(--border);
  background:var(--surface);
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce){
  *{animation:none !important;transition:none !important}
}