/* ==========================================================================
   Verteron Data Center — Dashboard Comercial (v0.5.0)
   Design System: White Executive UI & Gestão à Vista por Exceção (7d vs 7d ant.)
   ========================================================================== */

:root {
  /* Paleta Base Light / White Mode (Alta Legibilidade em TV e Monitor) */
  --bg-screen: #f1f5f9;
  --bg-monitor: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-card-hover: #f1f5f9;

  /* Bordas Neutras Limpas */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Tipografia Escura de Alto Contraste */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  /* Cores de Gestão por Exceção (Destacar SOMENTE o que precisa de atenção) */
  --att-crimson: #be123c;
  --att-border: #f43f5e;
  --att-bg-soft: #fff1f2;
  --att-pill-bg: #ffe4e6;
  --att-pill-border: #fda4af;

  --att-amber: #b45309;
  --att-amber-border: #f59e0b;
  --att-amber-bg: #fffbeb;

  /* Indicador Discreto de Avanço (7d vs 7d ant.) */
  --ok-green: #15803d;
  --ok-bg: #f0fdf4;
  --ok-border: #bbf7d0;

  /* Tons Neutros para Gráficos Secundários */
  --bar-orc: #64748b;
  --bar-neg: #334155;
  --bar-won: #0f172a;
  --bar-lost: #e11d48;

  /* Fontes */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Geometria */
  --radius-card: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-screen);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==========================================================================
   Barra de Controle Superior (Minimalista White)
   ========================================================================== */
.proto-toolbar {
  height: 42px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

body.tv-fullscreen .proto-toolbar {
  display: none;
}

.proto-toolbar-left,
.proto-toolbar-center,
.proto-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.proto-badge {
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: 0.4px;
}

.proto-security-pill {
  font-size: 11px;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: 5px;
  font-weight: 600;
}

.view-btn,
.action-btn {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn:hover,
.action-btn:hover {
  color: var(--text-primary);
  background: #f8fafc;
  border-color: var(--border-strong);
}

.view-btn.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.action-btn.primary {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.proto-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.proto-switch input {
  accent-color: var(--text-primary);
}

/* ==========================================================================
   Palco dos Monitores
   ========================================================================== */
.monitors-stage {
  width: 100%;
  height: calc(100vh - 42px);
  overflow: hidden;
}

body.tv-fullscreen .monitors-stage {
  height: 100vh;
}

body[data-view="monitor1"] #monitor1 { display: flex; }
body[data-view="monitor1"] #monitor2 { display: none; }
body[data-view="monitor2"] #monitor1 { display: none; }
body[data-view="monitor2"] #monitor2 { display: flex; }

body[data-view="dual"] .monitors-stage {
  height: auto;
  min-height: calc(100vh - 42px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 14px;
}

body[data-view="dual"] .tv-monitor {
  display: flex !important;
  height: 94vh;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  flex-shrink: 0;
}

/* ==========================================================================
   Estrutura Base de Cada Monitor (100% Fit Sem Rolagem)
   ========================================================================== */
.tv-monitor {
  width: 100%;
  height: 100%;
  background: var(--bg-monitor);
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

/* Cabeçalho Limpo */
.tv-header {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verteron-dots {
  display: grid;
  grid-template-columns: repeat(4, 5px);
  grid-template-rows: repeat(2, 5px);
  gap: 3px;
}

.verteron-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-primary);
}

.verteron-dots span.dot-dim {
  background: #cbd5e1;
}

.brand-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-verteron {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-primary);
}

.brand-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.brand-screen-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.header-meta-inline {
  font-size: 11px;
  color: var(--text-muted);
}

.clock-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.soon-header-pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 2px 9px;
  border-radius: 999px;
}

.clock-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  background: #ffffff;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Card Padrão (Limpo, Branco, Silencioso quando Saudável)
   ========================================================================== */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-height: 0;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* ==========================================================================
   GESTÃO POR EXCEÇÃO: Destaque EXCLUSIVO para o que Precisa de Atenção
   ========================================================================== */
.kpi-card.needs-attention {
  background: linear-gradient(180deg, var(--att-bg-soft) 0%, #ffffff 65%) !important;
  border-color: var(--att-pill-border) !important;
  border-top: 3px solid var(--att-border) !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.08);
}

.kpi-card.needs-attention .kpi-val-strategic,
.kpi-card.needs-attention .kpi-val-op {
  color: var(--att-crimson) !important;
}

/* ==========================================================================
   MONITOR 1 — FAIXA 1 (TOPO · 21%): ATIVAÇÕES + 3 CARDS ESTRATÉGICOS (7d)
   ========================================================================== */
.m1-row-strategic {
  flex: 0 0 21%;
  min-height: 126px;
  max-height: 154px;
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr 1fr;
  gap: 10px;
}

.kpi-label-strategic {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-val-strategic {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.kpi-unit-strategic {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-unit-strategic.light {
  color: var(--text-muted);
}

.kpi-delta-lg {
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  width: fit-content;
}

.kpi-delta-lg.positive,
.kpi-delta-lg.light {
  color: var(--ok-green);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
}

.kpi-delta-lg.attention-delta,
.kpi-delta-md.attention-delta {
  color: var(--att-crimson) !important;
  background: var(--att-pill-bg) !important;
  border: 1px solid var(--att-pill-border) !important;
  font-weight: 700;
}

/* Card 1: Novas Ativações no Mês */
.card-strategic-activations {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.85fr;
  align-items: center;
  gap: 12px;
}

.act-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.act-center-spark {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 4px;
}

.act-center-spark svg {
  width: 100%;
  height: 50px;
  overflow: visible;
}

.spark-caption {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.act-right-goal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  height: 100%;
}

.goal-percent-lg {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.goal-caption-lg {
  font-size: 10px;
  color: var(--text-muted);
  margin: 4px 0 6px;
  text-align: right;
}

.goal-progress-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  background: var(--text-primary);
  border-radius: 999px;
}

/* Cards 2, 3 e 4: Funil Estratégico (Todos brancos por padrão; só destaca se needs-attention) */
.card-strategic-funnel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.strategic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.funnel-tag,
.funnel-tag.light {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 4px;
}

.funnel-tag.ok-tag {
  color: var(--ok-green);
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

.funnel-tag.att-tag {
  color: var(--att-crimson);
  background: var(--att-pill-bg);
  border-color: var(--att-pill-border);
}

.strategic-mid {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0;
}

.card-highlight-orange {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   MONITOR 1 — FAIXA 2 (MEIO · 20%): CHURN, TICKETS, REPS E CONVERSÃO (7d)
   ========================================================================== */
.m1-row-operational {
  flex: 0 0 20%;
  min-height: 118px;
  max-height: 145px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr 1.35fr 1.05fr;
  gap: 10px;
}

.card-header-inline,
.card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label-md {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-sub-hint {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
}

.kpi-val-op {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-val-op.orange {
  color: var(--text-primary);
}

.kpi-delta-md {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}

.kpi-delta-md.positive {
  color: var(--ok-green);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
}

.kpi-foot-md {
  font-size: 11px;
  color: var(--text-muted);
}

/* A. Churn Operacional */
.churn-main-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: auto 0;
}

.churn-meta-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* B. Tickets Comercial */
.live-pill-md {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 999px;
}

.tickets-op-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  margin-bottom: auto;
}

.ticket-op-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ticket-op-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.15;
}

.ticket-op-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

.ticket-op-solved {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

/* C. Pipeline por Responsável (7d vs 7d ant.) */
.reps-legend-md {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.dot-leg {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 3px;
}

.dot-leg.orc { background: #94a3b8; }
.dot-leg.neg { background: #475569; }
.dot-leg.won { background: #0f172a; }

.reps-list-compact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: 1;
  margin-top: 4px;
}

.rep-row {
  display: grid;
  grid-template-columns: 105px 1fr 122px;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  padding: 1px 4px;
  border-radius: 4px;
}

.rep-row.rep-row-attention {
  background: var(--att-bg-soft);
}

.rep-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-bar-track {
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  display: flex;
  overflow: hidden;
  gap: 1px;
}

.rep-seg-orc { background: #94a3b8; height: 100%; }
.rep-seg-neg { background: #475569; height: 100%; }
.rep-seg-won { background: #0f172a; height: 100%; }

.rep-stats {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.rep-stats strong {
  color: var(--text-primary);
  font-weight: 700;
}

.rep-diff-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.rep-diff-pill.rep-delta-ok {
  color: var(--ok-green);
  background: var(--ok-bg);
}

.rep-diff-pill.rep-delta-neutral {
  color: var(--text-muted);
  background: #f1f5f9;
}

.rep-diff-pill.rep-delta-att {
  color: var(--att-crimson);
  background: var(--att-pill-bg);
  border: 1px solid var(--att-pill-border);
}

/* D. Taxa de Conversão Compacta (7d vs 7d ant.) */
.conv-compact-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  height: 100%;
  gap: 8px;
}

.conv-left-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.conv-counts-md {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}

.conv-won { color: var(--text-secondary); }
.conv-lost { color: var(--att-crimson); font-weight: 700; }

.conv-right-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 6px 4px;
}

.conv-6m-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  gap: 4px;
}

.conv-m-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.conv-m-pair {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
}

.bar-won {
  width: 5px;
  background: #334155;
  border-radius: 2px 2px 0 0;
}

.bar-lost {
  width: 5px;
  background: var(--att-border);
  border-radius: 2px 2px 0 0;
}

.conv-m-label {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.conv-6m-caption {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   MONITOR 1 — FAIXA 3 (BASE · 56%): VISÃO SEMANAL 100% LARGURA
   ========================================================================== */
.rd-calendar-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rd-calendar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-lg {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-primary);
}

.api-source-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ok-green);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  padding: 2px 8px;
  border-radius: 4px;
}

/* 4 KPIs de Reuniões/Tarefas em Linha (Brancos por padrão; Vermelho/Âmbar se needs-attention) */
.meetings-inline-kpis {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-kpi-pill {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.inline-kpi-pill.needs-attention {
  background: var(--att-bg-soft);
  border-color: var(--att-pill-border);
  border-left: 3px solid var(--att-border);
}

.inline-kpi-pill.needs-attention .ik-val {
  color: var(--att-crimson) !important;
}

.ik-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.ik-val {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.ik-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.ik-sub.ok-sub {
  color: var(--ok-green);
}

.ik-sub.att-sub {
  color: var(--att-crimson);
  font-weight: 700;
}

/* Filtros do Calendário */
.calendar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pills {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
}

.filter-pill:hover {
  color: var(--text-primary);
  background: #f1f5f9;
}

.filter-pill.active {
  background: var(--text-primary);
  color: #ffffff;
}

.rep-filter-select {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* Container Principal da Semana */
.week-calendar-fullwidth {
  flex: 1;
  min-height: 0;
  padding: 8px;
  background: #ffffff;
}

.week-days-grid-full {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
}

/* Coluna de Cada Dia da Semana */
.day-col-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.day-col-card.is-today {
  border-color: var(--att-amber-border);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.day-col-header {
  padding: 7px 10px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.day-col-card.is-today .day-col-header {
  background: var(--att-amber-bg);
  border-bottom-color: #fde68a;
}

.day-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-short-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.4px;
}

.day-date-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.today-pill {
  background: var(--att-amber-border);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

/* Pilhas de 3 Grupos dentro de Cada Dia */
.day-header-badges {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dh-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.day-groups-stack {
  flex: 1;
  min-height: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.day-groups-stack::-webkit-scrollbar {
  width: 4px;
}

.day-groups-stack::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.cal-group-box {
  border-radius: 6px;
  padding: 5px 7px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.cal-group-box.is-empty {
  padding: 3px 7px;
  opacity: 0.65;
  background: transparent;
}

.cal-group-Box.group-tarefa,
.cal-group-box.group-tarefa {
  flex: 1;
  min-height: 90px;
}

.cal-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cg-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
}

.cg-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-primary);
}

.cg-empty-line {
  font-size: 10px;
  color: var(--text-muted);
}

.cg-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tar-scroll-list {
  flex: 1;
  max-height: 155px;
  overflow-y: auto;
  padding-right: 2px;
}

.tar-scroll-list::-webkit-scrollbar {
  width: 3px;
}

.tar-scroll-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Barra de Progresso e Chips do Bloco de Tarefas */
.tar-summary-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border-subtle);
}

.tar-progress-track {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.tar-progress-fill {
  height: 100%;
  background: #64748b;
  border-radius: 999px;
}

.tar-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.t-chip {
  font-size: 9.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
  background: #f8fafc;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* SOMENTE pendências ganham destaque vermelho na barra de chips */
.t-chip.pend {
  color: var(--att-crimson);
  border-color: var(--att-pill-border);
  background: var(--att-pill-bg);
  font-weight: 700;
}

/* Linha Compacta de 1 Linha: Feitas ficam neutras/discretas; Pendentes saltam aos olhos */
.compact-act-row {
  display: grid;
  grid-template-columns: 34px 15px 1fr auto auto;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-left: 2px solid #cbd5e1;
  font-size: 10.5px;
  cursor: default;
}

.compact-act-row.card-done {
  border-left-color: #cbd5e1;
  opacity: 0.72;
}

.compact-act-row.card-today-next {
  border-left: 3px solid var(--att-amber-border);
  background: var(--att-amber-bg);
}

.compact-act-row.card-overdue {
  border-left: 3px solid var(--att-border);
  background: var(--att-bg-soft);
  border-color: var(--att-pill-border);
}

.ca-time {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ca-icon {
  font-size: 10px;
  text-align: center;
}

.ca-org {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-rep {
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.mc-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Feitas e Agendadas: neutras para não poluir */
.mc-status-badge.done {
  color: var(--text-muted);
  background: #e2e8f0;
}

.mc-status-badge.upcoming {
  color: var(--text-secondary);
  background: #e2e8f0;
}

/* Hoje / Agora e Pendentes: destacados para atenção imediata */
.mc-status-badge.today-next {
  color: var(--att-amber);
  background: #fef3c7;
}

.mc-status-badge.overdue {
  color: var(--att-crimson);
  background: var(--att-pill-bg);
}

/* ==========================================================================
   MONITOR 2 — SITE AO VIVO & JORNADA DE LEADS (White Mode)
   ========================================================================== */
.m2-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 27% 1fr;
  gap: 10px;
}

.m2-top-kpis {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr 1fr;
  gap: 10px;
}

.card-m2-visitors {
  background: #ffffff;
}

.m2-vis-split {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
}

.m2-vis-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
}

.kpi-value-xl {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.kpi-value-xl.muted {
  color: var(--text-muted);
}

.kpi-value-lg {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
  color: var(--text-primary);
}

.kpi-value-lg.cyan,
.kpi-value-lg.orange,
.kpi-value-lg.green {
  color: var(--text-primary);
}

.kpi-sub-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-footnote {
  font-size: 11px;
  color: var(--text-secondary);
}

.ads-vs-other-bar {
  margin-top: auto;
}

.avo-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.avo-track {
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.avo-fill-ads {
  height: 100%;
  background: var(--text-primary);
}

.m2-bottom-panels {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.15fr;
  gap: 10px;
  min-height: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hourly-chart-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 6px;
  padding-top: 10px;
}

.sources-table-wrap {
  flex: 1;
  overflow-y: auto;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.sources-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.sources-table td {
  padding: 6px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.journey-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

/* ==========================================================================
   ESTADO `#` (DADOS NÃO RESGATADOS — Discreto em Cinza Claro)
   ========================================================================== */
.val-hash {
  color: #cbd5e1 !important;
  font-family: var(--font-mono);
  font-weight: 700;
  user-select: none;
}

.kpi-card.is-unfetched {
  border-color: #e2e8f0 !important;
  border-top: 1px dashed #cbd5e1 !important;
  background: #f8fafc !important;
  box-shadow: none !important;
}

.err-msg,
.err-msg-light {
  color: #94a3b8 !important;
  font-weight: 500;
}

.err-pill,
.err-tag {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}

.unfetched-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  text-align: center;
}

.unfetched-hash {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1;
}

.unfetched-text {
  font-size: 10.5px;
  font-weight: 500;
  color: #94a3b8;
}

.unfetched-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

/* Botões de Status OAuth e DB na Toolbar */
.oauth-status-btn {
  background: #fff1f2;
  color: var(--att-crimson);
  border: 1px solid var(--att-pill-border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.oauth-status-btn.connected {
  background: var(--ok-bg);
  color: var(--ok-green);
  border-color: var(--ok-border);
}

.db-status-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

.db-status-pill.err {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.db-status-pill.ok {
  background: var(--ok-bg);
  color: var(--ok-green);
  border: 1px solid var(--ok-border);
}

/* Modal OAuth 2.0 (White Mode) */
.rd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.rd-modal-card {
  width: 92%;
  max-width: 540px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.rd-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.rd-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.rd-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.rd-step-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rd-code-input-row {
  display: flex;
  gap: 8px;
}

.rd-code-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.rd-feedback {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
}

.rd-feedback.ok {
  background: var(--ok-bg);
  color: var(--ok-green);
}

.rd-feedback.err {
  background: var(--att-bg-soft);
  color: var(--att-crimson);
}
