/* ============================================================
   COMMAND CENTER — extensão visual sobre o design system Nexus.
   Tudo prefixado .cc-* pra não colidir.
   ============================================================ */

/* ===== Layout base do Command Center ===== */
.cc {
  --cc-bg-grad: radial-gradient(ellipse 1200px 600px at 50% -100px, #fbfbfb 0%, #f4f4f4 60%, #efefef 100%);
  --cc-elev:   0 1px 2px rgba(15,23,41,.04), 0 4px 16px rgba(15,23,41,.06);
  --cc-elev-h: 0 1px 2px rgba(15,23,41,.06), 0 12px 32px rgba(15,23,41,.10);
  --cc-pulse:  rgba(220,38,38,.45);
  background: var(--cc-bg-grad);
  min-height: 100%;
  padding: 0 0 80px;
}

/* ===== Header sticky do CC ===== */
.cc-head {
  position: sticky;
  top: 56px;
  z-index: 9;
  background: #f8f8f8;
  border-bottom: 1px solid var(--g200);
  padding: 18px 32px 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.cc-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cc-head-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cc-head-orb {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--red) 60%, var(--red-d) 100%);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12), 0 4px 12px rgba(220,38,38,0.25);
  position: relative;
  flex-shrink: 0;
  animation: cc-orb-pulse 3s ease-in-out infinite;
}
.cc-head-orb::after {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(220,38,38,0.3);
  animation: cc-orb-ring 3s ease-out infinite;
}
@keyframes cc-orb-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220,38,38,0.12), 0 4px 12px rgba(220,38,38,0.25); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0.06), 0 4px 16px rgba(220,38,38,0.35); }
}
@keyframes cc-orb-ring {
  0%   { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1.4);  opacity: 0; }
}
.cc-head-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--g500);
  margin-bottom: 2px;
}
.cc-head h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin: 0;
  color: var(--g900);
}
.cc-head-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--g500);
  font-family: var(--mono);
}
.cc-head-meta .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.cc-head-meta .live-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: cc-live 1.6s ease-in-out infinite;
}
@keyframes cc-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 4px rgba(22,163,74,0); }
}

/* ===== Tabs do CC ===== */
.cc-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
}
.cc-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--g500);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}
.cc-tabs { overflow-x: auto; scrollbar-width: none; }
.cc-tabs::-webkit-scrollbar { display: none; }
.cc-tab:hover { color: var(--g800); background: var(--g100); }
.cc-tab.active {
  color: var(--g900);
  background: var(--card);
  border-color: var(--g200);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.cc-tab .icon { width: 14px; height: 14px; }
.cc-tab .crit-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  margin-left: 2px;
  animation: cc-pulse-dot 1.4s ease-in-out infinite;
}
@keyframes cc-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--cc-pulse); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}
.cc-tab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cc-tab.disabled:hover { background: transparent; color: var(--g500); }

/* ===== Ticker live ===== */
.cc-ticker {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--g200);
  padding-top: 12px;
  overflow: hidden;
  position: relative;
}
.cc-ticker-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--g500);
  text-transform: uppercase;
  padding-right: 14px;
  margin-right: 14px;
  border-right: 1px solid var(--g200);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: #f8f8f8;
}
.cc-ticker-label .live-pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: cc-live-r 1.4s ease-in-out infinite;
}
@keyframes cc-live-r {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.cc-ticker-track {
  display: flex;
  gap: 28px;
  animation: cc-ticker-scroll 60s linear infinite;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 32px), transparent 100%);
}
@keyframes cc-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.cc-ticker:hover .cc-ticker-track { animation-play-state: paused; }
.cc-ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.cc-ticker-item .k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--g500);
  text-transform: uppercase;
}
.cc-ticker-item .v {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--g800);
  font-size: 12.5px;
}
.cc-ticker-item .d {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.cc-ticker-item .d.up   { color: var(--green); }
.cc-ticker-item .d.down { color: var(--red); }
.cc-ticker-item .d.flat { color: var(--g400); }

/* ===== Body do CC ===== */
.cc-body {
  padding: 28px 32px;
  max-width: 1480px;
  margin: 0 auto;
}

/* ===== Grids Overview ===== */
.cc-overview {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
.cc-overview-main { display: flex; flex-direction: column; gap: 20px; }
.cc-overview-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 200px; }

/* ===== Card de seção (overview) ===== */
.cc-section-card {
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 14px;
  box-shadow: var(--cc-elev);
  padding: 20px 22px;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .2s;
  position: relative;
  overflow: hidden;
  text-align: left;
  width: 100%;
  display: block;
}
.cc-section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cc-elev-h);
  border-color: var(--g300);
}
.cc-section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 100%);
  opacity: 0;
  transition: opacity .2s;
}
.cc-section-card:hover::before { opacity: 1; }
.cc-section-card.gated { cursor: not-allowed; opacity: 0.78; }
.cc-section-card.gated:hover { transform: none; }

.cc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.cc-section-head h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
  color: var(--g900);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-section-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--g100);
  color: var(--g700);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.cc-section-icon.red    { background: var(--red-l);    color: var(--red); }
.cc-section-icon.amber  { background: var(--amber-bg); color: var(--amber-t); }
.cc-section-icon.green  { background: var(--green-bg); color: var(--green-t); }
.cc-section-icon.blue   { background: var(--blue-bg);  color: var(--blue-t); }
.cc-section-icon.purple { background: var(--purple-bg);color: var(--purple); }
.cc-section-arrow {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--g400);
  transition: transform .2s, color .2s;
}
.cc-section-card:hover .cc-section-arrow { color: var(--g700); transform: translateX(3px); }

.cc-section-stats {
  display: flex;
  gap: 22px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cc-section-stat .v {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--g900);
  line-height: 1;
}
.cc-section-stat .v.crit { color: var(--red); }
.cc-section-stat .l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--g500);
  text-transform: uppercase;
  margin-top: 4px;
}
.cc-section-foot {
  font-size: 12px;
  color: var(--g600);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--g100);
}
.cc-section-foot .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: cc-pulse-dot 1.4s ease-in-out infinite;
}
.cc-section-foot.green .pulse { background: var(--green); }
.cc-section-foot.amber .pulse { background: var(--amber); }

/* Mosaic / Grid 2x3 / Stream variants pra tweaks */
.cc-overview.layout-mosaic {
  grid-template-columns: 1fr;
}
.cc-overview.layout-mosaic .cc-overview-side {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.cc-overview.layout-grid {
  grid-template-columns: 1fr 1fr;
}
.cc-overview.layout-grid .cc-overview-main { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cc-overview.layout-grid .cc-overview-side { position: static; }

/* ===== Mensagens & menções (topo do overview) ===== */
.cc-msgs {
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 14px;
  box-shadow: var(--cc-elev);
  overflow: hidden;
}
.cc-msgs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--g100);
}
.cc-msgs-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--g900);
  letter-spacing: -0.1px;
}
.cc-msgs-head h3 svg { color: var(--g500); }
.cc-msgs-count {
  font-size: 9.5px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--mono);
  letter-spacing: 0.4px;
  margin-left: 4px;
}
.cc-msgs-list { display: flex; flex-direction: column; }
.cc-msg {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--g100);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.cc-msg:last-child { border-bottom: none; }
.cc-msg:hover { background: var(--g50); }
.cc-msg.lida { opacity: 0.62; }
.cc-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.2px;
}
.cc-msg-body { flex: 1; min-width: 0; }
.cc-msg-line {
  font-size: 12.5px;
  color: var(--g700);
  line-height: 1.5;
  margin-bottom: 4px;
}
.cc-msg-line b { color: var(--g900); font-weight: 600; }
.cc-msg-action { color: var(--g500); }
.cc-msg-ctx {
  color: var(--g900);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--g300);
  text-underline-offset: 2px;
}
.cc-msg-when {
  font-size: 11px;
  color: var(--g400);
  font-family: var(--mono);
  margin-left: 8px;
}
.cc-msg-text {
  font-size: 13px;
  color: var(--g600);
  font-style: italic;
  line-height: 1.45;
}
.cc-msg-dot {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

/* ===== Insight do dia (AI) — versão clara ===== */
.cc-insight {
  background: var(--card);
  border: 1px solid var(--g200);
  border-left: 3px solid var(--purple);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: var(--cc-elev);
  position: relative;
}
.cc-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cc-insight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--purple);
  text-transform: uppercase;
  background: var(--purple-bg);
  padding: 4px 9px;
  border-radius: 20px;
}
.cc-insight-when {
  font-size: 11px;
  color: var(--g400);
  font-family: var(--mono);
}
.cc-insight h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--g900);
}
.cc-insight-text {
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--g600);
}
.cc-insight-action {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  background: var(--g50);
  border: 1px solid var(--g100);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--g700);
  line-height: 1.5;
  margin-bottom: 14px;
}
.cc-insight-action svg { color: var(--amber); margin-top: 1px; flex-shrink: 0; }
.cc-insight-action b { color: var(--g900); font-weight: 600; }
.cc-insight-foot {
  display: flex;
  gap: 8px;
}

/* ===== Sinais críticos peek ===== */
.cc-crit-list {
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--cc-elev);
}
.cc-crit-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--g100);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-crit-head h3 {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.cc-crit-head .pill {
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cc-crit-head .pill .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: cc-pulse-dot-w 1.4s ease-in-out infinite;
}
@keyframes cc-pulse-dot-w {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.6); }
  50%      { box-shadow: 0 0 0 4px rgba(255,255,255,0); }
}
.cc-crit-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--g100);
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cc-crit-item:hover { background: var(--g50); }
.cc-crit-item:last-child { border-bottom: none; }
.cc-crit-item .sev {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--red-l);
  color: var(--red);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
}
.cc-crit-item .sev::after {
  content: '';
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--card);
  animation: cc-pulse-dot 1.4s ease-in-out infinite;
}
.cc-crit-item .body { flex: 1; min-width: 0; }
.cc-crit-item .titulo { font-size: 12.5px; font-weight: 600; color: var(--g900); line-height: 1.35; margin-bottom: 3px; }
.cc-crit-item .sub { font-size: 11.5px; color: var(--g500); line-height: 1.4; }
.cc-crit-item .when { font-size: 10.5px; color: var(--g400); font-family: var(--mono); white-space: nowrap; }

/* ===== Animação de entrada em stagger ===== */
.cc-stagger > * {
  opacity: 0;
  transform: translateY(8px);
  animation: cc-rise .5s cubic-bezier(.2,.8,.2,1) forwards;
}
.cc-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.cc-stagger > *:nth-child(2) { animation-delay: 0.10s; }
.cc-stagger > *:nth-child(3) { animation-delay: 0.16s; }
.cc-stagger > *:nth-child(4) { animation-delay: 0.22s; }
.cc-stagger > *:nth-child(5) { animation-delay: 0.28s; }
.cc-stagger > *:nth-child(6) { animation-delay: 0.34s; }
.cc-stagger > *:nth-child(7) { animation-delay: 0.40s; }
.cc-stagger > *:nth-child(8) { animation-delay: 0.46s; }
@keyframes cc-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Análise de Clientes ===== */
.cc-clientes { display: flex; flex-direction: column; gap: 20px; }

.cc-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.cc-kpi {
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--cc-elev);
  position: relative;
  overflow: hidden;
}
.cc-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cc-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--g500);
  text-transform: uppercase;
}
.cc-kpi-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--g100);
  color: var(--g500);
}
.cc-kpi-icon.red   { background: var(--red-l);    color: var(--red); }
.cc-kpi-icon.amber { background: var(--amber-bg); color: var(--amber-t); }
.cc-kpi-icon.green { background: var(--green-bg); color: var(--green-t); }
.cc-kpi-icon.blue  { background: var(--blue-bg);  color: var(--blue-t); }
.cc-kpi-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--g900);
  line-height: 1.05;
}
.cc-kpi-value.red { color: var(--red); }
.cc-kpi-sub {
  font-size: 11.5px;
  color: var(--g500);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cc-kpi-sub.up   { color: var(--green); }
.cc-kpi-sub.down { color: var(--red); }

/* ===== Heatmap container ===== */
.cc-map {
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--cc-elev);
}
.cc-map-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--g100);
  flex-wrap: wrap;
}
.cc-map-head h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cc-mode-rail {
  display: flex;
  background: var(--g100);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}
.cc-mode-rail button {
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--g600);
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.cc-mode-rail button:hover { color: var(--g800); }
.cc-mode-rail button.active {
  background: var(--card);
  color: var(--g900);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.cc-mode-rail button .swatch {
  width: 10px; height: 10px;
  border-radius: 3px;
}

.cc-map-body {
  position: relative;
  height: 520px;
  background: #0f1729;
  overflow: hidden;
}
.cc-map-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.cc-map-overlay {
  position: absolute;
  bottom: 14px; left: 14px;
  background: rgba(15, 23, 41, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  color: #e4e4e7;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
.cc-map-overlay .k {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #71717a;
  text-transform: uppercase;
}
.cc-map-overlay .v {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: #fafafa;
}
.cc-map-overlay .legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cc-map-overlay .legend .grad {
  flex: 1;
  height: 8px;
  border-radius: 4px;
}
.cc-map-overlay .legend .lbl {
  font-size: 10px;
  color: #a1a1aa;
  font-family: var(--mono);
}

.cc-map-controls {
  position: absolute;
  top: 14px; right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cc-map-controls button {
  width: 32px; height: 32px;
  background: rgba(15, 23, 41, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #e4e4e7;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s;
}
.cc-map-controls button:hover { background: rgba(15, 23, 41, 1); }

.cc-bubble {
  cursor: pointer;
  transition: transform .15s;
  transform-origin: center;
}
.cc-bubble:hover { transform: scale(1.15); }
.cc-bubble-label {
  fill: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.cc-tooltip {
  position: absolute;
  background: rgba(15, 23, 41, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fafafa;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.cc-tooltip .t { font-weight: 600; margin-bottom: 4px; font-size: 12px; }
.cc-tooltip .r { font-family: var(--mono); color: #d4d4d8; font-size: 11px; }
.cc-tooltip .r b { color: #fff; }

/* ===== Sinais area ===== */
.cc-signals-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 12px;
  box-shadow: var(--cc-elev);
}
.cc-signals-bar h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 8px 0 0;
}
.cc-signals-bar .grow { flex: 1; }
.cc-signals-bar .input { padding: 5px 10px; font-size: 12px; min-width: 180px; }

.cc-signals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cc-signal {
  background: var(--card);
  border: 1px solid var(--g200);
  border-left: 3px solid var(--g300);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s;
  position: relative;
  text-align: left;
  width: 100%;
}
.cc-signal:hover {
  transform: translateY(-2px);
  box-shadow: var(--cc-elev-h);
}
.cc-signal.red    { border-left-color: var(--red); }
.cc-signal.amber  { border-left-color: var(--amber); }
.cc-signal.green  { border-left-color: var(--green); }
.cc-signal.red.pulso::before {
  content: '';
  position: absolute;
  top: 14px; right: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: cc-pulse-dot 1.4s ease-in-out infinite;
}
.cc-signal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cc-signal-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--g500);
  text-transform: uppercase;
}
.cc-signal.red   .cc-signal-tag { color: var(--red-t); }
.cc-signal.amber .cc-signal-tag { color: var(--amber-t); }
.cc-signal.green .cc-signal-tag { color: var(--green-t); }
.cc-signal-when {
  font-size: 10.5px;
  color: var(--g400);
  font-family: var(--mono);
  margin-left: auto;
  padding-right: 16px;
}
.cc-signal-titulo {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--g900);
  line-height: 1.35;
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}
.cc-signal-sub {
  font-size: 12px;
  color: var(--g600);
  line-height: 1.45;
}
.cc-signal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--g100);
  font-size: 11px;
  color: var(--g500);
}
.cc-signal-foot .who {
  display: inline-flex; align-items: center; gap: 4px;
}

/* ===== Right drawer (drill cliente / anotar AI) ===== */
.cc-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,41,0.45);
  z-index: 110;
  animation: fade .18s ease;
}
.cc-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 100%;
  max-width: 520px;
  background: var(--card);
  z-index: 120;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.18);
  animation: cc-slide-r .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes cc-slide-r {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.cc-drawer-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--g100);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
}
.cc-drawer-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  letter-spacing: -0.2px;
}
.cc-drawer-head .crumb {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--g500);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.cc-drawer-head .close {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--g500);
  cursor: pointer;
}
.cc-drawer-head .close:hover { background: var(--g100); color: var(--g800); }
.cc-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.cc-drawer-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--g100);
}
.cc-drawer-section:last-child { border-bottom: none; }
.cc-drawer-section h4 {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--g500);
  margin: 0 0 10px;
}
.cc-drawer-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--g100);
  background: var(--g50);
  display: flex;
  gap: 8px;
}

/* Chat com IA dentro do drawer */
.cc-chat {
  border-top: 1px solid var(--g200);
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
  display: flex;
  flex-direction: column;
  max-height: 360px;
  animation: cc-chat-in .2s ease;
}
@keyframes cc-chat-in {
  from { max-height: 0; opacity: 0; }
  to   { max-height: 360px; opacity: 1; }
}
.cc-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cc-chat-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.cc-chat-bubble.ai {
  background: var(--card);
  border: 1px solid var(--g200);
  color: var(--g700);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.cc-chat-bubble.user {
  background: var(--g900);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.cc-chat-from {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--purple);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cc-chat-from svg { color: var(--purple); }
.cc-chat-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 12px;
}
.cc-chat-sug {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--g200);
  color: var(--g700);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.cc-chat-sug:hover {
  background: var(--purple-bg);
  border-color: var(--purple);
  color: var(--purple);
}
.cc-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--g200);
  background: var(--card);
}

/* Sparkbar histórico cliente */
.cc-sparkbar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding: 8px 0;
}
.cc-sparkbar-col {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cc-sparkbar-bar {
  width: 100%;
  background: var(--g200);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: background .2s;
  position: relative;
}
.cc-sparkbar-bar.crit { background: var(--red); }
.cc-sparkbar-bar.warn { background: var(--amber); }
.cc-sparkbar-col .lbl {
  font-size: 9.5px;
  font-family: var(--mono);
  color: var(--g400);
  font-weight: 600;
}
.cc-sparkbar-col .val {
  position: absolute;
  bottom: 100%;
  font-size: 9.5px;
  font-family: var(--mono);
  color: var(--g500);
  white-space: nowrap;
  margin-bottom: 2px;
  font-weight: 600;
}

/* Hipóteses AI */
.cc-hipo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cc-hipo-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--g50);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--g700);
}
.cc-hipo-peso {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--g700);
  background: var(--card);
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 38px;
  text-align: center;
  flex-shrink: 0;
  border: 1px solid var(--g200);
}

/* Annotation textarea */
.cc-annot {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--g200);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--card);
}
.cc-annot:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.cc-annot-meta {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  color: var(--g500);
  margin-top: 8px;
  flex-wrap: wrap;
}
.cc-annot-meta .scope-pill {
  background: var(--g100);
  border: 1px solid var(--g200);
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
}
.cc-annot-meta .scope-pill.active {
  background: var(--g900);
  color: #fff;
  border-color: var(--g900);
}
.cc-annot-existing {
  background: var(--g50);
  border-left: 3px solid var(--purple);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--g700);
  margin-bottom: 8px;
}
.cc-annot-existing .meta {
  font-size: 10.5px;
  color: var(--g500);
  font-family: var(--mono);
  margin-bottom: 4px;
}

/* Lista compacta de clientes */
.cc-cli-list { display: flex; flex-direction: column; gap: 0; }
.cc-cli-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--g100);
  cursor: pointer;
  transition: background .12s;
}
.cc-cli-row:last-child { border-bottom: none; }
.cc-cli-row:hover { background: var(--g50); }
.cc-cli-score {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  width: 38px;
  text-align: center;
  padding: 4px 0;
  border-radius: 6px;
  color: var(--g700);
  background: var(--g100);
}
.cc-cli-score.red   { color: #fff; background: var(--red); }
.cc-cli-score.amber { color: var(--amber-t); background: var(--amber-bg); }
.cc-cli-score.green { color: var(--green-t); background: var(--green-bg); }
.cc-cli-row .nome { font-weight: 600; color: var(--g900); font-size: 13px; }
.cc-cli-row .meta { font-size: 11.5px; color: var(--g500); margin-top: 1px; }
.cc-cli-row .ticket {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--g800);
  text-align: right;
}
.cc-cli-row .delta {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  width: 56px;
  text-align: right;
}
.cc-cli-row .delta.up   { color: var(--green); }
.cc-cli-row .delta.down { color: var(--red); }

/* ===== Tweaks panel personalizado pro CC ===== */
.cc-tweaks {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 280px;
  background: var(--card);
  border: 1px solid var(--g200);
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  z-index: 90;
  font-size: 13px;
  animation: cc-slide-r .25s ease;
}
.cc-tweaks-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--g100);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-tweaks-head h4 { margin: 0; font-size: 13px; font-weight: 600; flex: 1; }
.cc-tweaks-head .close {
  width: 24px; height: 24px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: var(--g500);
}
.cc-tweaks-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}
.cc-tweak-group { display: flex; flex-direction: column; gap: 6px; }
.cc-tweak-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--g500);
  text-transform: uppercase;
}
.cc-tweak-row { display: flex; gap: 4px; flex-wrap: wrap; }
.cc-tweak-row button {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--g100);
  border: 1px solid transparent;
  color: var(--g700);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.cc-tweak-row button:hover { background: var(--g200); }
.cc-tweak-row button.active {
  background: var(--g900);
  color: #fff;
  border-color: var(--g900);
}

/* Mobile fallback (não é foco da fase 1, mas básico) */
@media (max-width: 1100px) {
  .cc-overview { grid-template-columns: 1fr; }
  .cc-overview-side { position: static; }
}
@media (max-width: 900px) {
  .cc-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .cc-signals-grid { grid-template-columns: 1fr; }
  .cc-body { padding: 20px 16px; }
  .cc-head { padding: 16px 16px 12px; }
  .cc-drawer { max-width: 100%; }
  .cc-tweaks { left: 12px; right: 12px; width: auto; bottom: 12px; }
}
