/* ==========================================================================
   The Growth Hub | Performance de Midia Paga
   Light theme, leitura de 5 segundos. Tokens do design "Executive Scan".
   ========================================================================== */

:root {
  --bg: #F7F8F7;
  --surface: #FFFFFF;
  --surface-alt: #F1F3F1;
  --border: #E4E7E4;
  --border-strong: #D3D8D3;
  --text-primary: #0F1511;
  --text-secondary: #6B7269;
  --text-muted: #9AA39B;
  --accent: #1F8A4C;
  --accent-soft: rgba(31, 138, 76, 0.08);
  --accent-fill: #7CF249;
  --positive: #1F8A4C;
  --negative: #C2453B;
  --neutral: #6B7269;
  --shadow: 0 1px 2px rgba(15, 21, 17, 0.04), 0 1px 3px rgba(15, 21, 17, 0.03);
  --shadow-card: 0 1px 2px rgba(15, 21, 17, 0.05), 0 4px 16px rgba(15, 21, 17, 0.04);
  --radius: 14px;
  --radius-sm: 9px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---- Eyebrow / rotulos em mono uppercase --------------------------------- */
.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---- Barra de carregamento ---------------------------------------------- */
.loadbar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 50;
  transition: width 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}
body.is-loading .loadbar { width: 75%; opacity: 1; }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.app-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.range-resolved {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---- Segmented control --------------------------------------------------- */
.seg {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button:hover { color: var(--text-primary); }
.seg button.active {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.seg-sm button { font-size: 12px; padding: 5px 11px; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.3s ease;
}
.btn-icon:hover { color: var(--accent); border-color: var(--border-strong); }
body.is-loading .btn-icon svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Container ----------------------------------------------------------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

/* ---- Contexto ------------------------------------------------------------ */
.context-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.period-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.period-sub {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* ---- Secoes (blocos) ----------------------------------------------------- */
.block { display: flex; flex-direction: column; gap: 20px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.section-sub { margin: 5px 0 0; font-size: 12.5px; color: var(--text-secondary); }

.control-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---- Filtro de contas ---------------------------------------------------- */
.account-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.chip.active .dot { background: var(--accent-fill); }
.chip.is-empty .dot { background: var(--text-muted); }

/* ---- Banners ------------------------------------------------------------- */
.banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: -20px;
}
.banner-error { background: #FBEDEC; color: #8C2F27; border: 1px solid #F0D2CF; }
.banner-warn { background: #FBF6E9; color: #7A5E1E; border: 1px solid #EFE3C2; }

/* ---- KPIs ---------------------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
/* 2 cards na linha de cima (3 colunas cada) e 3 na de baixo (2 colunas cada). */
.kpi:nth-child(1), .kpi:nth-child(2) { grid-column: span 3; }
.kpi:nth-child(3), .kpi:nth-child(4), .kpi:nth-child(5) { grid-column: span 2; }
.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.kpi.kpi-accent::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-fill);
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 33px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 12px 0 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi-delta .arrow { font-size: 11px; }
.kpi-delta.up { color: var(--positive); }
.kpi-delta.down { color: var(--negative); }
.kpi-delta.flat { color: var(--neutral); }
.kpi-delta-note { color: var(--text-muted); font-weight: 500; }
.kpi-sub { display: block; margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-title { font-size: 16px; font-weight: 600; }

.hero .chart-wrap { height: 320px; }
.chart-wrap { position: relative; width: 100%; }
.chart-bar { height: 240px; margin-top: 14px; }

/* ---- Layout duas colunas ------------------------------------------------- */
/* Card unico sobrevivente numa .two-col (o vizinho foi escondido por nao existir
   na conta do cliente) ocupa a largura inteira em vez de ficar comprimido. */
.two-col.is-single { grid-template-columns: 1fr; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
}

/* ---- Tabela de eficiencia ------------------------------------------------ */
.table-wrap { margin-top: 14px; overflow-x: auto; }
.eff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.eff-table th, .eff-table td {
  padding: 11px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.eff-table th.th-text, .eff-table td.td-text { text-align: left; }
.eff-table thead th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.eff-table thead th:hover { color: var(--text-primary); }
.eff-table thead th.sorted-asc::after { content: " \2191"; color: var(--accent); }
.eff-table thead th.sorted-desc::after { content: " \2193"; color: var(--accent); }
.eff-table tbody td { border-bottom: 1px solid var(--border); color: var(--text-primary); }
.eff-table tbody tr:last-child td { border-bottom: 0; }
.eff-table tbody tr.is-empty td { color: var(--text-muted); }
.acct-name { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.acct-name .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-active { background: var(--accent); }
.dot-idle { background: var(--text-muted); }
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
}
.na { color: var(--text-muted); }

/* ---- Conversoes ---------------------------------------------------------- */
.conv-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.conv-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 16px 14px;
  background: var(--surface);
}
.conv-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.conv-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.conv-cost { font-size: 12px; color: var(--text-secondary); }
.conv-note { margin: 16px 0 0; font-size: 11.5px; color: var(--text-muted); }

/* ---- Metas (planejado x realizado) --------------------------------------- */
.metas-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.metas-month { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-left: 4px; }
.metas-sub { margin: 5px 0 0; font-size: 12px; color: var(--text-muted); }
.metas-body { min-height: 60px; }
.metas-grid { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: center; }

.gauge-wrap { position: relative; width: 200px; height: 224px; margin: 0 auto; }
.gauge { width: 200px; height: 200px; display: block; }
.gauge-center { position: absolute; top: 0; left: 0; right: 0; height: 200px; display: flex; align-items: center; justify-content: center; }
.gauge-pct { font-family: var(--font-display); font-weight: 700; font-size: 36px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gauge-caption { text-align: center; margin-top: 2px; font-size: 13px; color: var(--text-secondary); }
.gauge-caption strong { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }

.metas-breakdown { display: flex; flex-direction: column; gap: 11px; }
.mb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 14px; }
.mb-label { color: var(--text-secondary); }
.mb-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.mb-val.pos { color: var(--positive); }
.mb-soft { color: var(--text-muted); font-weight: 400; }
.mb-div { height: 1px; background: var(--border); margin: 3px 0; }
.alvo { font-family: var(--font-mono); font-size: 11px; font-weight: 600; margin-left: 6px; }
.alvo.pos { color: var(--positive); }
.alvo.neg { color: var(--negative); }

.badge-pace { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 13px; border-radius: 999px; }
.badge-pace::before { content: "\25CF"; font-size: 9px; }
.pace-good { background: rgba(31, 138, 76, 0.10); color: var(--positive); }
.pace-warn { background: rgba(194, 138, 30, 0.13); color: #946410; }
.pace-bad { background: rgba(194, 69, 59, 0.10); color: var(--negative); }
.pace-none { background: var(--surface-alt); color: var(--text-secondary); }

.metas-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }
.metas-empty { text-align: center; padding: 24px 10px; color: var(--text-secondary); }
.metas-empty p { margin: 0 0 14px; }
.metas-loading { text-align: center; padding: 28px; color: var(--text-muted); font-size: 13px; }

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: #1a7642; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

/* ---- Pagina de configuracao de metas ------------------------------------- */
.metas-config-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  width: 100%;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.save-hint { font-size: 12.5px; color: var(--text-muted); }

.cfg-list { display: flex; flex-direction: column; gap: 16px; }
.cfg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-card); }
.cfg-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cfg-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.cfg-name .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cfg-fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: end; }
.cfg-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.cfg-status { font-size: 12.5px; font-weight: 500; }
.cfg-status.ok { color: var(--positive); }
.cfg-status.err { color: var(--negative); }

/* ---- Analise em cascata -------------------------------------------------- */
.cascade-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7269' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 34px 8px 13px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  max-width: 260px;
}
.select:hover { border-color: var(--border-strong); }
.select-account { font-weight: 600; max-width: 240px; padding-top: 7px; padding-bottom: 7px; }
.btn-text {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
}
.btn-text:hover { text-decoration: underline; }
.cascade-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--text-secondary); }

.cascade-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cascade-table thead th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 10px;
  text-align: right;
  white-space: nowrap;
}
.cascade-table thead th.th-text { text-align: left; }
.cascade-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cascade-table td.td-text { text-align: left; }
.cascade-table tbody tr:last-child td { border-bottom: 0; }

.crow.lvl-0 { background: var(--surface); }
.crow.lvl-0 td { font-weight: 600; }
.crow.lvl-1 td { background: #FCFDFC; }
.crow.lvl-2 td { background: var(--surface); color: var(--text-secondary); }
.crow.lvl-2 .tree-name { font-weight: 400; }
.crow[data-haskids="1"] .tree { cursor: pointer; }

.tree { display: inline-flex; align-items: center; gap: 8px; max-width: 460px; }
.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}
.twisty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
  font-size: 10px;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: background 0.12s ease;
}
.crow[data-haskids="1"] .tree:hover .twisty { background: var(--surface-alt); color: var(--text-primary); }
.twisty.leaf { visibility: hidden; }

.spend-cell { position: relative; }
.spend-bar {
  position: absolute;
  left: 10px;
  bottom: 5px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-soft);
  pointer-events: none;
}
.crow.lvl-0 .spend-bar { background: rgba(31, 138, 76, 0.22); }
.crow.lvl-1 .spend-bar { background: rgba(31, 138, 76, 0.14); }
.spend-v { position: relative; }
.cascade-empty, .cascade-loading {
  text-align: center !important;
  color: var(--text-muted);
  padding: 26px 10px !important;
  font-size: 13px;
}

/* ---- CRM: navegacao e componentes ---------------------------------------- */
/* Grid de KPIs em 4 colunas (sobrepoe o layout 2+3 padrao). */
.kpis-4 { grid-template-columns: repeat(4, 1fr); }
.kpis-4 .kpi { grid-column: auto !important; }
@media (max-width: 1080px) { .kpis-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .kpis-4 { grid-template-columns: 1fr; } }

.nav-tabs { display: inline-flex; gap: 2px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.nav-tabs a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
}
.nav-tabs a:hover { color: var(--text-primary); }
.nav-tabs a.active { background: var(--surface); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow); }

/* Identificacao e saida na linha do kicker (templates/_nav.html) */
.brand-user { color: var(--text-muted); }
.logout-form { display: inline; margin-left: 10px; }
.logout-form button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
}
.logout-form button:hover { color: var(--accent); }

/* tabela de dados generica (origens, vendedores, qualidade) */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 10px;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table thead th.th-text { text-align: left; }
.data-table thead th.sorted-asc::after { content: " \2191"; color: var(--accent); }
.data-table thead th.sorted-desc::after { content: " \2193"; color: var(--accent); }
.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table td.td-text { text-align: left; font-weight: 500; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #FBFCFB; }
.src-name { display: inline-flex; align-items: center; gap: 8px; }
.src-name .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.rate-pill { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.rate-pill.hi { color: var(--positive); }
.rate-pill.mid { color: #946410; }
.rate-pill.lo { color: var(--text-muted); }

/* funil (barras horizontais por etapa) */
.funnel { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.funnel-row { display: grid; grid-template-columns: 180px 1fr 70px; align-items: center; gap: 12px; font-size: 13px; }
.funnel-name { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-bar-wrap { background: var(--surface-alt); border-radius: 6px; height: 22px; overflow: hidden; }
.funnel-bar { height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.funnel-count { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* chips de tier / distribuicoes */
.tier-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tier-chip { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; min-width: 84px; }
.tier-chip .t-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.04em; }
.tier-chip .t-val { font-family: var(--font-display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }

/* Funil Completo (Sankey) */
.jstats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.jstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-card); }
.jstat-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.jstat-val { font-family: var(--font-display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; margin-top: 6px; }
.jstat-val.pos { color: var(--positive); }
.jstat-val.neg { color: var(--negative); }

.sankey-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 16px; }
.stg { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.stg-dot { width: 9px; height: 9px; border-radius: 2px; }
.stg-arrow { color: var(--border-strong); font-size: 14px; }
.stg-plain { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.channel-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 12px 14px; background: var(--surface-alt); border-radius: var(--radius-sm); }
.legend-title { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.legend-chip { cursor: pointer; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; transition: background 0.12s ease, border-color 0.12s ease; }
.legend-chip:hover { background: var(--surface); border-color: var(--border); }
.legend-chip.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.sankey-wrap { position: relative; width: 100%; height: 660px; overflow-x: auto; overflow-y: hidden; }
#sankeyChart { width: 100%; height: 100%; }
/* Pagina do funil em largura total para o Sankey ter mais espaco entre colunas. */
.container-wide { max-width: none; }

/* Jornada comercial: comparativo de motores (funis) e mapa de etapas com pulos. */
.engines { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.engine { flex: 1 1 300px; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow-card); cursor: pointer; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.engine:hover { border-color: var(--border-strong); }
.engine.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.engine-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.engine-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.engine-share { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.engine-stats { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.engine-stat .k { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.engine-stat .v { font-family: var(--font-display); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.engine-hist { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-secondary); }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 2px 0 12px; padding: 10px 14px; background: var(--surface-alt); border-radius: var(--radius-sm); }
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-secondary); }
.map-legend .sw { width: 11px; height: 11px; border-radius: 3px; }
.map-legend .ln { display: inline-block; width: 18px; border-top: 3px solid; }
.stagemap-wrap { position: relative; width: 100%; height: 500px; overflow-x: auto; overflow-y: hidden; }
#stageMapChart, #rdStageMap { width: 100%; height: 100%; }

/* Seletor de evento de resultado e controles auxiliares (Midia Paga). */
.control-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.control-hint { font-size: 11.5px; color: var(--text-muted); }
.select-sm { padding: 6px 30px 6px 10px; font-size: 12.5px; }
.weekstart { display: inline-flex; align-items: center; gap: 8px; }
.weekstart .control-label { margin: 0; }
.weekly-controls { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
/* O atributo hidden deve sempre ocultar, mesmo em elementos com display proprio
   (ex.: .seg, .select). Sem isso, o toggle/seletor do Google vazam quando ocultos. */
[hidden] { display: none !important; }

/* ---- Painel Comercial (funil snapshot/cohort) ---------------------------- */
.comm-controls { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
/* Linha própria dos filtros de período do cohort, alinhada sob os controles do cabeçalho */
.comm-filter-row { display: flex; justify-content: flex-end; margin-top: -8px; }

.cfunnel-legend { display: flex; gap: 16px; align-items: center; }
.cfunnel-legend span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-secondary); }
.cfunnel-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cfunnel-legend .lg-open { background: var(--accent); }
.cfunnel-legend .lg-lost { background: var(--negative); }

.cfunnel { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cstage { border-radius: var(--radius-sm); }
.cstage.is-open { background: var(--surface-alt); }
.cstage-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 5px 8px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; border-radius: var(--radius-sm); }
.cstage-row:hover { background: var(--surface-alt); }
.cstage.is-open .cstage-row:hover { background: transparent; }
/* zona da barra com largura fixa: a info nunca colapsa nem sobrepoe */
.cstage-track { flex: 0 0 50%; position: relative; height: 44px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); }
.cstage.is-open .cstage-track { background: var(--surface); }
.cstage-fill { position: absolute; inset: 0 auto 0 0; display: flex; height: 100%; min-width: 36px; border-radius: var(--radius-sm); overflow: hidden; transition: width .3s; }
.cstage-fill-alive { background: var(--accent); height: 100%; }
.cstage-fill-lost { background: var(--negative); height: 100%; }
.cstage-val { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(15,21,17,.32); z-index: 1; }
.cstage-info { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cstage-name { font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; min-width: 0; }
.cstage-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cstage-e { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--surface-alt); padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
.cstage.is-open .cstage-e { background: var(--surface); }
.cstage-lost { font-size: 11px; color: var(--negative); white-space: nowrap; flex-shrink: 0; }
.cstage-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cstage-meta { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }
.cstage-meta b { color: var(--text-primary); font-weight: 600; }
.cstage-chev { font-size: 12px; color: var(--text-muted); transition: transform .2s; }
.cstage.is-open .cstage-chev { transform: rotate(180deg); color: var(--text-secondary); }

/* painel de detalhe da etapa (conteudo muda entre snapshot e cohort) */
.cstage-detail { padding: 2px 12px 16px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.dgrid-col { grid-template-columns: 1fr; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; }
.dcard-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.dcard-value { font-family: var(--font-mono); font-size: 19px; font-weight: 600; color: var(--text-primary); margin-top: 4px; }
.dcard-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.dnote { font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.ddetail { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.dcascade { display: flex; flex-direction: column; gap: 9px; }
.dbar { display: flex; flex-direction: column; gap: 3px; }
.dbar.is-base { margin-bottom: 2px; }
.dbar-track { height: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.dbar-fill { height: 100%; border-radius: 6px; min-width: 2px; }
.dbar-reached { background: var(--accent); }
.dbar-adv { background: #2F9E5A; }
.dbar-stuck { background: var(--text-muted); }
.dbar-lost { background: var(--negative); }
.dbar-lab { font-size: 11.5px; color: var(--text-secondary); display: flex; align-items: baseline; gap: 6px; }
.dbar-lab b { font-family: var(--font-mono); color: var(--text-primary); font-size: 13px; }
.dbar-pct { color: var(--text-muted); font-size: 11px; }
@media (max-width: 680px) {
  .cstage-track { flex-basis: 58%; }
  .ddetail { grid-template-columns: 1fr; }
}

.lost-item { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.lost-name { flex: 0 0 38%; font-size: 12.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lost-bar { flex: 1; height: 14px; background: var(--surface-alt); border-radius: 7px; overflow: hidden; }
.lost-fill { display: block; height: 100%; background: var(--negative); border-radius: 7px; }
.lost-count { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text-primary); min-width: 44px; text-align: right; }

.chart-wrap.chart-mid { height: 260px; }
.donut-wrap { position: relative; height: 240px; }
.muted-note { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; }

/* ---- Compartilhar Visao: botao, modal e slides --------------------------- */
.btn-share { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn-share:hover { background: var(--surface-alt); border-color: var(--text-muted); }
.btn-share svg { color: var(--accent); }
.btn-share:disabled { opacity: .5; cursor: not-allowed; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15,21,17,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); width: min(520px, 100%); padding: 28px 26px; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.modal-close:hover { color: var(--text-primary); }
.modal-title { font-size: 20px; color: var(--text-primary); margin: 2px 0 6px; }
.modal-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.share-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.share-choice { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 24px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; font-family: inherit; }
.share-choice:hover { border-color: var(--accent); background: var(--surface-alt); }
.share-choice-ico { display: block; border: 2.5px solid var(--text-secondary); border-radius: 5px; }
.share-ico-mobile { width: 30px; height: 50px; }
.share-ico-desktop { width: 58px; height: 38px; }
.share-choice:hover .share-choice-ico { border-color: var(--accent); }
.share-choice-name { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.share-choice-dim { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.share-progress { display: flex; align-items: center; gap: 12px; padding: 16px 4px 4px; font-size: 13.5px; color: var(--text-secondary); }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--surface-alt); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-err { font-size: 13px; color: var(--negative); margin-bottom: 14px; }
/* O visual das telas compartilhaveis fica embutido em SLIDE_CSS (comercial.js), pois
   sao renderizadas isoladas via SVG foreignObject e nao enxergam este stylesheet. */

/* ---- Rodape -------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.foot span { white-space: nowrap; }
.foot .sep { color: var(--border-strong); }

/* ---- Skeleton ------------------------------------------------------------ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, #E9ECE9 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 6px;
  color: transparent !important;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- Responsivo ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
  .conv-grid { grid-template-columns: repeat(3, 1fr); }
  .cfg-fields { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .metas-grid { grid-template-columns: 1fr; gap: 16px; }
  .cfg-fields { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 18px; }
  .container { padding: 24px 18px 48px; gap: 32px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(1), .kpi:nth-child(2), .kpi:nth-child(3), .kpi:nth-child(4), .kpi:nth-child(5) { grid-column: auto; }
  .conv-grid { grid-template-columns: repeat(2, 1fr); }
  .range-resolved { display: none; }
  .context-head { align-items: flex-start; }
  .controls { width: 100%; }
  /* seletor de periodo rola na horizontal para nao cortar a ultima opcao */
  .seg {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { padding: 6px 11px; }
}
@media (max-width: 460px) {
  .kpis { grid-template-columns: 1fr; }
  .conv-grid { grid-template-columns: 1fr; }
}

/* ---- Produtividade SDR --------------------------------------------------- */
.prod-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-delta { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.kpi-delta.pos { color: var(--accent); }
.kpi-delta.neg { color: var(--negative); }
.kpi-delta.flat { color: var(--text-muted); }

/* filtro multi-SDR */
.sdr-filter { position: relative; }
.sdr-filter-btn { display: inline-flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 150px; cursor: pointer; }
.sdr-filter-btn.on { border-color: var(--accent); color: var(--accent); }
.sdr-filter-caret { font-size: 10px; opacity: .5; }
.sdr-filter-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 200; min-width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); padding: 4px 0; max-height: 360px; overflow-y: auto; }
.sdr-opt { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.sdr-opt:hover { background: var(--surface-alt); }
.sdr-opt.on { color: var(--accent); }
.sdr-sep { border-top: 1px solid var(--border); margin: 3px 0; }
.sdr-check { width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; flex-shrink: 0; }
.sdr-check.on { background: var(--accent); border-color: var(--accent); }

/* tabelas */
.ptable-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); font-size: 13px; }
.ptable th { padding: 8px 12px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; text-align: right; }
.ptable td { padding: 9px 12px; color: var(--text-primary); border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.ptable tbody tr:last-child td { border-bottom: none; }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; }
.ptable .b { font-weight: 700; }
.ptable .muted { color: var(--text-muted); }
.ptable .accent { color: var(--accent); }
.ptable .sdr-name { text-align: left; min-width: 150px; }
.sdr-nm { font-weight: 600; }
.sdr-emp { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.g-pos { color: var(--accent); font-weight: 600; }
.g-warn { color: #B7791F; font-weight: 600; }
.g-neg { color: var(--negative); font-weight: 600; }

/* grupos de coluna da tabela de SDR */
.sdr-table th.grp, .sdr-table tr.grp th { border-bottom: none; }
.g-canal { color: #2563EB; background: rgba(37,99,235,.08); text-align: center !important; }
.g-lig { color: #B7791F; background: rgba(183,121,31,.10); text-align: center !important; }
.g-venda { color: var(--accent); background: rgba(31,138,76,.10); text-align: center !important; }
.sdr-table th.c-canal, .sdr-table td.c-canal { background: rgba(37,99,235,.05); }
.sdr-table th.c-lig, .sdr-table td.c-lig { background: rgba(183,121,31,.05); }
.sdr-table th.c-venda, .sdr-table td.c-venda { background: rgba(31,138,76,.05); }
.sdr-table td.c-canal:first-of-type, .sdr-table th.c-canal:first-of-type { border-left: 2px solid rgba(37,99,235,.25); }
.sdr-table td.c-lig:first-of-type, .sdr-table th.c-lig:first-of-type { border-left: 2px solid rgba(183,121,31,.30); }
.sdr-table td.c-venda:first-of-type, .sdr-table th.c-venda:first-of-type { border-left: 2px solid rgba(31,138,76,.30); }
.ptable tr.sdr-total td { background: var(--surface-alt); border-top: 1px solid var(--border-strong); border-bottom: none; font-weight: 700; }
.ptable tr.sdr-total .sdr-name { color: var(--accent); text-transform: uppercase; font-size: 12px; }

/* barra de pace */
.pace { min-width: 90px; }
.pbar { display: block; height: 8px; width: 84px; background: var(--surface-alt); border-radius: 5px; overflow: hidden; margin-left: auto; }
.pbar-fill { display: block; height: 100%; border-radius: 5px; }
.pbar-fill.ok { background: var(--accent); }
.pbar-fill.mid { background: #C99A2E; }
.pbar-fill.low { background: var(--negative); }

/* histórico: célula colorida por % da meta */
.h0 { color: var(--text-muted); }
.h-ok { background: rgba(31,138,76,.16); color: var(--accent); font-weight: 600; }
.h-mid { background: rgba(31,138,76,.06); color: var(--text-primary); font-weight: 600; }
.h-warn { background: rgba(183,121,31,.12); color: #B7791F; font-weight: 600; }
.h-low { background: rgba(194,69,59,.10); color: var(--negative); font-weight: 600; }

/* abas de SDR do heatmap */
.seg-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; padding: 0; background: none; }
.seg-tabs button { padding: 8px 15px; font-size: 13px; border: none; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); cursor: pointer; margin-bottom: -1px; font-family: inherit; border-radius: 0; }
.seg-tabs button:hover { color: var(--text-secondary); }
.seg-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* heatmap */
.heat-block { margin-top: 22px; }
.heat-block:first-of-type { margin-top: 4px; }
.heat-cap { margin: 0 0 8px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.ptable.heatmap { table-layout: fixed; font-size: 11px; }
.ptable.heatmap th, .ptable.heatmap td { padding: 5px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.ptable.heatmap .hm-hora { text-align: left; padding-left: 12px; width: 46px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ptable.heatmap th.hm-today { color: var(--accent); }
.hm-now { font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.hm-cell.x0 { color: var(--text-muted); }
.hm-cell.x1 { background: rgba(31,138,76,.08); color: #6f7d3f; }
.hm-cell.x2 { background: rgba(31,138,76,.18); color: var(--text-primary); }
.hm-cell.x3 { background: rgba(31,138,76,.36); color: var(--text-primary); font-weight: 600; }
.hm-cell.x4 { background: rgba(31,138,76,.62); color: #fff; font-weight: 700; }
.hm-cell.x5 { background: var(--accent); color: #fff; font-weight: 700; }
.hm-cell.hm-current { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* drawer de análise IA */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,21,17,.40); z-index: 1000; }
.drawer { position: fixed; top: 0; right: 0; width: min(640px, 96vw); height: 100vh; background: var(--surface); border-left: 1px solid var(--border); z-index: 1001; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0; }
.drawer-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.drawer-actions { display: flex; gap: 8px; align-items: center; }
.btn-mini { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-secondary); border-radius: 6px; padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: inherit; line-height: 1.2; }
.btn-mini:hover { background: var(--surface-alt); }
.drawer-body { padding: 20px 24px; flex: 1; overflow-y: auto; }
.ai-loading { color: var(--text-muted); font-style: italic; font-size: 13px; }
.ai-error { color: var(--negative); font-size: 13px; }
.ai-md { font-size: 13px; color: var(--text-primary); line-height: 1.65; }
.ai-md h2 { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin: 20px 0 7px; }
.ai-md h3 { font-size: 12.5px; font-weight: 700; margin: 14px 0 4px; }
.ai-md p { margin: 0 0 9px; }
.ai-md ul, .ai-md ol { margin: 0 0 10px; padding-left: 18px; }
.ai-md li { margin-bottom: 5px; }
.ai-md strong { font-weight: 700; }
.ai-md table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.ai-md th, .ai-md td { padding: 6px 9px; border: 1px solid var(--border); text-align: left; }
.ai-md th { background: var(--surface-alt); color: var(--text-primary); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.ai-md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.ai-md code { background: var(--surface-alt); border-radius: 4px; padding: 1px 5px; font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 640px) {
  .prod-controls { width: 100%; }
}

/* ---- Produtividade: redesign "Comando do dia" ---------------------------- */
.prod-head { align-items: flex-start; }
.prod-title-sub { color: var(--text-muted); font-weight: 600; font-size: 0.56em; letter-spacing: -0.01em; white-space: nowrap; }

/* Seções (divisão dia x semana) e controles por seção */
.prod-controls-label, .prod-tool-label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.prod-sec { display: flex; flex-direction: column; gap: 20px; }
.prod-sec-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Navegador de semana (anterior / próxima) */
.prod-week-nav { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); padding: 3px; }
.wk-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 7px; font-family: inherit; }
.wk-btn:hover:not(:disabled) { background: var(--surface-alt); color: var(--text-primary); }
.wk-btn:disabled { opacity: .35; cursor: not-allowed; }
.wk-label { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; padding: 0 8px; min-width: 96px; text-align: center; }

/* Ritmo do time */
.prod-pace { display: flex; align-items: center; gap: 20px; }
.prod-pace-cap { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); text-align: right; }
.prod-pace-row { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.prod-pace-val { font-family: var(--font-display); font-weight: 700; font-size: 42px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.prod-pace-val.pos { color: var(--accent); }
.prod-pace-val.warn { color: #B7791F; }
.prod-pace-val.neg { color: var(--negative); }
.prod-pace-delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prod-pace-delta.pos { color: var(--accent); }
.prod-pace-delta.neg { color: var(--negative); }
.prod-pace-delta.flat { color: var(--text-muted); }
.prod-pace-bar-wrap { width: 130px; }
.prod-pace-bar { height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.prod-pace-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-fill)); border-radius: 999px; transition: width .4s ease; }
.prod-pace-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .prod-pace { width: 100%; justify-content: space-between; } }

/* KPI rail compacto (6 cartões) */
.kpi-rail { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi-rail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px; box-shadow: var(--shadow-card); }
.krl-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.krl-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.krl-delta { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.krl-delta.pos { color: var(--accent); }
.krl-delta.neg { color: var(--negative); }
.krl-delta.flat { color: var(--text-muted); }
.krl-value { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; margin: 10px 0 3px; font-variant-numeric: tabular-nums; }
.krl-sub { font-size: 10.5px; color: var(--text-muted); }
@media (max-width: 1080px) { .kpi-rail { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .kpi-rail { grid-template-columns: repeat(2, 1fr); } }

/* Grid do comando: ranking + coluna lateral */
.prod-command { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.prod-aside { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 940px) { .prod-command { grid-template-columns: 1fr; } }

/* Ranking do dia */
.lead-card { padding: 22px 24px; }
.lead-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lead-head-note { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.lead-list { display: flex; flex-direction: column; gap: 8px; }
.lead-row { display: grid; grid-template-columns: 24px 1.3fr 1.6fr auto; align-items: center; gap: 14px; padding: 11px 13px; border-radius: 12px; background: #FBFBFA; border: 1px solid #F0F2EE; }
.lead-row-top { background: #F4FBF0; border-color: #D6EFC6; }
.lead-rank { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--text-muted); text-align: center; }
.lead-rank-1 { color: var(--accent); }
.lead-id { min-width: 0; }
.lead-name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lead-name { font-weight: 700; font-size: 13.5px; }
.lead-pill { font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.lead-pill-ok, .lead-pill-good { background: rgba(31,138,76,.12); color: var(--accent); }
.lead-pill-warn { background: rgba(183,121,31,.14); color: #946410; }
.lead-pill-risk { background: rgba(194,69,59,.12); color: var(--negative); }
.lead-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.lead-bar-col { min-width: 0; }
.lead-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.lead-bar-fill { display: block; height: 100%; border-radius: 999px; }
.lead-fill-ok, .lead-fill-good { background: var(--accent); }
.lead-fill-warn { background: #B7791F; }
.lead-fill-risk { background: var(--negative); }
.lead-bar-cap { font-size: 10.5px; color: var(--text-muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.lead-pace { font-family: var(--font-mono); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; text-align: right; }
.lead-pace-ok, .lead-pace-good { color: var(--accent); }
.lead-pace-warn { color: #B7791F; }
.lead-pace-risk { color: var(--negative); }

/* Atenção: com quem falar */
.atn-card { padding: 20px 22px; }
.atn-eyebrow { color: var(--negative); }
.atn-eyebrow.ok { color: var(--accent); }
.atn-list { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; }
.atn-item { display: flex; gap: 11px; padding: 12px 13px; border-radius: 11px; }
.atn-risk { background: #FCF1F0; border: 1px solid #F3D9D6; }
.atn-warn { background: #FBF6E9; border: 1px solid #EFE3C2; }
.atn-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.atn-avatar-risk { background: var(--negative); }
.atn-avatar-warn { background: #B7791F; }
.atn-name { font-weight: 700; font-size: 13px; }
.atn-desc { font-size: 11.5px; margin-top: 2px; line-height: 1.45; }
.atn-risk .atn-desc { color: #8C4A44; }
.atn-warn .atn-desc { color: #7A5E1E; }
.atn-ok { display: flex; gap: 11px; padding: 12px 13px; border-radius: 11px; background: var(--accent-soft); border: 1px solid rgba(31,138,76,.2); }
.atn-ok-mark { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.atn-ok .atn-desc { color: var(--text-secondary); }

/* Destaque */
.hl-card { background: linear-gradient(150deg, #12321E, #0F1511); border-radius: 16px; padding: 18px 22px; color: #fff; }
.hl-eyebrow { margin: 0 0 3px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-fill); }
.hl-name { font-weight: 700; font-size: 14.5px; }
.hl-desc { font-size: 11.5px; color: #9FB49F; line-height: 1.5; margin-top: 3px; }

/* Atividade por hora: heatmap em grid */
.prod-heat-head { align-items: flex-start; }
.prod-heat-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.prod-heat-legend { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.phl-scale { display: flex; gap: 3px; }
.phl-scale span { width: 12px; height: 12px; border-radius: 3px; }
.phl-scale span:nth-child(1) { background: rgba(31,138,76,.08); }
.phl-scale span:nth-child(2) { background: rgba(31,138,76,.28); }
.phl-scale span:nth-child(3) { background: rgba(31,138,76,.55); }
.phl-scale span:nth-child(4) { background: var(--accent); }
.prod-heat-scroll { overflow-x: auto; }
.prod-heat { display: grid; gap: 5px; align-items: center; }
.ph-daylabel { font-family: var(--font-mono); font-size: 10.5px; text-align: center; color: var(--text-muted); }
.ph-daylabel.today { color: var(--accent); }
.ph-tothead { font-family: var(--font-mono); font-size: 9.5px; text-align: right; color: var(--text-muted); }
.ph-hour { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ph-cell { height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-lf { background: #FAFBFA; color: transparent; }
.ph-l0 { background: #F7F8F7; color: #C4CBC2; }
.ph-l1 { background: rgba(31,138,76,.08); color: #5F7A66; }
.ph-l2 { background: rgba(31,138,76,.18); color: #2C5E3E; }
.ph-l3 { background: rgba(31,138,76,.34); color: #0F1511; }
.ph-l4 { background: rgba(31,138,76,.6); color: #fff; }
.ph-l5 { background: var(--accent); color: #fff; }
.ph-rowtot { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ph-rowtot.zero { color: #C4CBC2; }
.ph-foot-label { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 6px; }
.ph-coltot { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-primary); padding-top: 6px; }
.ph-coltot.zero { color: #C4CBC2; }
.ph-grand { font-family: var(--font-mono); font-size: 12px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; color: var(--accent); padding-top: 6px; }

/* ---- Período personalizado (calendário nos filtros de período) ----------- */
.seg .seg-custom { display: inline-flex; align-items: center; gap: 5px; }
.seg .seg-custom svg { opacity: .85; }
.range-pop { position: absolute; z-index: 1100; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.range-pop-row { display: flex; gap: 10px; }
.range-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.range-pop input[type="date"] { font-family: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text-primary); }
.rp-apply { font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.rp-apply:hover { filter: brightness(1.06); }

/* ---- Aba Ligações (estudo de ligações) ------------------------------------ */
.lig-search { min-width: 190px; }
.nota-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.nota-badge.nb-big { font-size: 14px; padding: 3px 10px; }
.nb-ok { background: #E8F8DC; color: #3D7A12; }
.nb-mid { background: #FBF6E9; color: #7A5E1E; }
.nb-low { background: #FBEDEC; color: #8C2F27; }
.chip-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.chip-status.err { background: #FBEDEC; color: #8C2F27; border-color: #F0D2CF; }
.chip-obj { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #FBF6E9; color: #7A5E1E; border: 1px solid #EFE3C2; margin-right: 6px; }
.obj-trecho { font-size: 12px; color: var(--text-muted); font-style: italic; }
.call-row { cursor: pointer; }
.call-row:hover td { background: var(--surface-alt); }
.call-drawer { width: min(760px, 96vw); }
.call-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; }
.call-audio { width: 100%; margin: 2px 0 18px; }
.call-sec { margin-bottom: 20px; }
.call-sec h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.call-sec p { font-size: 13.5px; line-height: 1.55; }
.call-coaching { background: var(--surface-alt); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.55; }
.call-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.call-lists ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.crit-row { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12.5px; }
.crit-row b { text-align: right; font-variant-numeric: tabular-nums; }
.crit-bar { height: 6px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; border: 1px solid var(--border); }
.crit-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.crit-fill.mid { background: #D9A514; }
.crit-fill.low { background: #C0392B; }
.bubbles { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.bubble-lead { align-self: flex-start; background: var(--surface-alt); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble-sdr { align-self: flex-end; background: #E8F8DC; border: 1px solid #CBEBAF; border-bottom-right-radius: 4px; }
.bubble-who { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.bubble-who b { font-size: 11.5px; }
.bubble-ts { font-size: 10.5px; color: var(--text-muted); font-family: "IBM Plex Mono", monospace; cursor: pointer; }
.bubble-ts:hover { color: var(--accent); text-decoration: underline; }
.proc-card { padding: 16px 20px; }
.proc-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.proc-msg { font-size: 13px; line-height: 1.5; max-width: 720px; }
.proc-bar { height: 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); overflow: hidden; margin-top: 12px; }
.proc-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.fone-input { min-width: 190px; }
.chart-box { position: relative; height: 300px; }
#statsBanner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
#statsBanner .btn-mini { flex-shrink: 0; }
.stat-row { display: grid; grid-template-columns: 180px 1fr 60px 44px; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 12.5px; }
.stat-label { color: var(--text-secondary); }
.stat-bar { height: 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); overflow: hidden; }
.stat-fill { display: block; height: 100%; border-radius: 999px; background: var(--text-muted); }
.stat-fill.ok { background: var(--accent); }
.stat-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.stat-pct { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 110px 1fr 48px 36px; } }
.ptable .th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.ptable .th-sort:hover { color: var(--text-primary); }
.ptable .th-sort.on { color: var(--accent); }

/* ==========================================================================
   Forecast do funil (/forecast)
   ========================================================================== */
/* KPI strip com 6 cartões iguais (sobrescreve o span 3/2 do padrão) */
.kpis-6 .kpi { grid-column: span 2 !important; }
@media (max-width: 1080px) { .kpis-6 .kpi { grid-column: span 3 !important; } }
@media (max-width: 620px) { .kpis-6 .kpi { grid-column: span 6 !important; } }

.fc-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.fc-aside { display: flex; flex-direction: column; gap: 20px; }
.fc-conv-legend { font-size: 11.5px; color: var(--text-secondary); }
.panel-loss .eyebrow { color: var(--negative); }
@media (max-width: 940px) { .fc-grid { grid-template-columns: 1fr; } }

/* ---- Funil cumulativo ---------------------------------------------------- */
.fstages { display: flex; flex-direction: column; gap: 4px; }
.fstage {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 118px;
  gap: 16px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.fstage:last-child { border-bottom: 0; }
.fstage-n { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.fstage-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fstage-mini .m-lost { color: var(--negative); }
.fstage-mini .m-won { color: var(--accent); }
.fstage-mini .m-open { color: #2C6BBF; }
.fstage-mini .m-zero { color: var(--text-muted); }

.ftrack { position: relative; display: flex; align-items: center; height: 34px; }
.fbar {
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #35567F, #26456F);
  box-shadow: 0 4px 12px -6px rgba(44, 77, 120, .55);
  min-width: 8px;
}
.fbar-in { color: #FFFFFF; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fbar-out {
  margin-left: 10px; flex-shrink: 0;
  color: var(--text-primary); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fbar-in small, .fbar-out small { font-weight: 600; font-size: 11px; opacity: .72; margin-left: 6px; }
.fbar-out small { color: var(--text-secondary); }

.fconv { text-align: right; }
.fconv-v { font-weight: 700; font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.fconv-v.first { color: var(--text-muted); font-size: 12.5px; }
.fconv-l { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
@media (max-width: 620px) {
  .fstage { grid-template-columns: 1fr; gap: 6px; }
  .ftrack { height: 28px; }
  .fbar-out { position: static; transform: none; margin-left: 8px; }
  .fconv { text-align: left; }
}

/* ---- Motivos de perda ---------------------------------------------------- */
.fc-reason { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.fc-reason:last-child { margin-bottom: 0; }
.fc-reason-top { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-reason-bar { height: 7px; border-radius: 999px; background: #F7ECE9; overflow: hidden; }
.fc-reason-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--negative), #DA8A70); }
.fc-reason-num { font-size: 12px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-reason-num b { color: var(--text-primary); font-weight: 700; font-size: 14px; }

/* ---- Ganhos realizados --------------------------------------------------- */
.won-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; }
.won-l { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.won-l b { font-weight: 700; font-size: 16px; }
.won-v { font-weight: 700; font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.won-note { font-size: 12px; color: var(--text-secondary); margin-top: 10px; line-height: 1.5; }

/* ---- Tabela de forecast -------------------------------------------------- */
.fc-row { display: grid; grid-template-columns: 1fr 56px 56px 78px; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.fc-row .f-nm { color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-row .f-a, .fc-row .f-r, .fc-row .f-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.fc-row .f-v { color: var(--text-primary); font-weight: 600; }
.fc-row.head { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.fc-row.head span { color: var(--text-muted); }
.fc-row.top3 .f-v { color: var(--accent); font-weight: 700; }
.fc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.fc-total .t-l { font-size: 11px; color: var(--text-secondary); }
.fc-total .t-v { font-weight: 700; font-size: 19px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Horizonte por ciclo -------------------------------------------------- */
.fc-hz { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 11px; }
.fc-hz:last-of-type { margin-bottom: 0; }
.fc-hz-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fc-hz-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fc-hz-range { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.fc-hz-bar { height: 7px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.fc-hz-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.fc-hz-num { text-align: right; white-space: nowrap; }
.fc-hz-num b { display: block; font-weight: 700; font-size: 14px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.fc-hz-num span { font-size: 11px; color: var(--text-muted); }

/* ---- Tooltips de ajuda (info nos cards) ----------------------------------- */
.titlerow { display: flex; align-items: center; gap: 8px; }
.info-btn {
  appearance: none; flex-shrink: 0; cursor: pointer; padding: 0;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  line-height: 16px; text-align: center;
}
.info-btn:hover { color: var(--accent); border-color: var(--accent); }
.kpi .info-btn { position: absolute; top: 14px; right: 14px; z-index: 1; }
.help-pop {
  position: fixed; z-index: 60; max-width: 320px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-card); padding: 14px 16px;
}
.help-pop h4 { margin: 0 22px 6px 0; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.help-pop p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
.help-pop-x {
  position: absolute; top: 7px; right: 9px; border: 0; background: transparent;
  font-size: 17px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0;
}
.help-pop-x:hover { color: var(--text-primary); }

/* ==========================================================================
   Forecast: redesign "Comando do funil" (2a)
   Reaproveita .kpi-rail/.kpi-rail-card/.krl-* e .atn-item/.atn-* da Produtividade.
   ========================================================================== */
.fc-title-sub { color: var(--text-muted); font-weight: 600; font-size: 0.56em; letter-spacing: -0.01em; white-space: nowrap; }
.accent-eyebrow { color: var(--accent); }

/* Hero + Leitura */
.fc-hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 940px) { .fc-hero-grid { grid-template-columns: 1fr; } }

.fc-hero { position: relative; background: #F5FBF0; border: 1px solid #DCEECB; border-radius: 20px; padding: 26px 28px; overflow: hidden; }
.fch-eyebrow { margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.fch-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 5vw, 58px); line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #14351F; }
.fch-unit { font-size: .42em; font-weight: 700; color: #6B8A6E; margin-left: .25em; letter-spacing: -.01em; }
.fch-sub { margin: 12px 0 20px; font-size: 14px; color: #5C7060; }
.fch-sub b { color: #14351F; font-weight: 700; }
.fch-barlabel { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8FA890; margin-bottom: 7px; }
.fch-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(31,138,76,.12); overflow: hidden; }
.fch-bar-weighted { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(31,138,76,.4); border-radius: 999px; }
.fch-bar-adj { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 999px; }
.fch-stats { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #DCEECB; }
.fch-stat-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #8FA890; }
.fch-stat-v { font-weight: 700; font-size: 18px; margin-top: 4px; font-variant-numeric: tabular-nums; color: #14351F; }
.fch-stat.warn .fch-stat-k, .fch-stat.warn .fch-stat-v { color: #B7791F; }

.fc-leitura.atn-card { padding: 22px 24px; display: flex; flex-direction: column; }
.fc-leitura .atn-list { flex: 1; }
.fc-leitura .eyebrow { color: var(--text-muted); }
.atn-avatar-ok { background: var(--accent); }

/* Funil + onde está o dinheiro */
.fc-mid-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 940px) { .fc-mid-grid { grid-template-columns: 1fr; } }
.fcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.fcard-head-col { margin-bottom: 18px; }
.fcard-note { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }

.fcalm-list { display: flex; flex-direction: column; gap: 14px; }
.fcalm-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.fcalm-id { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fcalm-e { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.fcalm-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcalm-conv { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.fcalm-conv-topo { background: var(--surface-alt); color: var(--text-muted); }
.fcalm-conv-ok { background: rgba(31,138,76,.12); color: var(--accent); }
.fcalm-conv-warn { background: rgba(183,121,31,.14); color: #946410; }
.fcalm-conv-risk { background: rgba(194,69,59,.12); color: var(--negative); }
.fcalm-row { display: flex; align-items: center; gap: 12px; }
.fcalm-track { flex: 1; height: 30px; border-radius: 8px; background: #F4F6F2; overflow: hidden; display: flex; align-items: center; min-width: 0; }
.fcalm-fill { height: 100%; border-radius: 8px; background: var(--accent); display: flex; align-items: center; padding-left: 12px; min-width: 4px; }
.fcalm-reached { color: #fff; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.fcalm-reached.out { color: var(--text-primary); margin-left: 10px; }
.fcalm-toppct { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); width: 52px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.fcalm-mini { display: flex; gap: 14px; margin-top: 6px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fcalm-mini .m-lost { color: var(--negative); }
.fcalm-mini .m-won { color: var(--accent); }
.fcalm-mini .m-open { color: #2C6BBF; }

.fmoney-row { margin-bottom: 14px; }
.fmoney-row:last-child { margin-bottom: 0; }
.fmoney-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.fmoney-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmoney-pond { font-family: var(--font-mono); font-weight: 700; font-size: 13.5px; color: var(--accent); white-space: nowrap; }
.fmoney-bar { height: 8px; border-radius: 999px; background: #F1F3EF; overflow: hidden; }
.fmoney-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.fmoney-sub { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fmoney-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-strong); font-size: 11px; color: var(--text-secondary); }
.fmoney-total-v { font-weight: 800; font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Horizonte em cards */
.fhz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 780px) { .fhz-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .fhz-grid { grid-template-columns: 1fr; } }
.fhz-card { border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px; background: #FBFCFA; }
.fhz-range { font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.fhz-name { font-size: 13px; font-weight: 700; margin: 3px 0 12px; }
.fhz-bar { height: 8px; border-radius: 999px; background: #F1F3EF; overflow: hidden; margin-bottom: 10px; }
.fhz-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.fhz-pond { font-weight: 800; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fhz-count { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Ganhos + perdas */
.fc-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 780px) { .fc-bottom-grid { grid-template-columns: 1fr; } }
.fwon-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-soft); border-radius: 13px; padding: 14px 16px; }
.fwon-n { font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.fwon-cap { font-size: 11.5px; color: var(--text-secondary); }
.fwon-v { font-weight: 800; font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fwon-list { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.fwon-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.fwon-row > span:first-child { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwon-row-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fwon-row-v b { font-weight: 700; }

/* ==========================================================================
   Calculadora Forecast Invertido (modo "Calculadora" da aba Forecast)
   Prefixo fcx-. Mesma linguagem visual do fc-: verde de acento, âmbar para o
   estado "ajustado", mono uppercase nos rótulos.
   ========================================================================== */
.context-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

#calcWarn { margin-top: 0; }
#calcWarn p { margin: 2px 0; }

.fcx-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 940px) { .fcx-grid { grid-template-columns: 1fr; } }
.fcx-side, .fcx-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Meta */
.fcx-meta-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fcx-meta-head .eyebrow { margin: 0; }
.fcx-meta-input {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--accent); border-radius: 12px; padding: 8px 14px;
  background: #FBFDFA; box-shadow: 0 0 0 4px rgba(31, 138, 76, 0.07);
}
.fcx-meta-prefix { font-weight: 700; font-size: 16px; color: var(--accent); }
.fcx-meta-input input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--font-body); font-weight: 800; font-size: 28px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--text-primary);
  -moz-appearance: textfield; appearance: textfield;
}
.fcx-meta-input input::-webkit-outer-spin-button, .fcx-meta-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fcx-meta-unit { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.fcx-period { margin-top: 10px; width: 100%; }
.fcx-meta-note { margin: 12px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.fcx-meta-note b { color: var(--text-primary); }

/* Taxas por transição */
.fcx-rates { display: flex; flex-direction: column; gap: 14px; }
.fcx-rate { border-radius: 11px; padding: 2px 0; }
.fcx-rate.is-adj { background: #FBF6E9; border: 1px solid #EFE3C2; padding: 10px 12px; margin: 0 -12px; }
.fcx-rate-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fcx-rate-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcx-rate.is-adj .fcx-rate-name { font-weight: 700; }
.fcx-stepper { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.fcx-step {
  width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.fcx-step:hover { color: var(--text-primary); border-color: var(--border-strong); }
.fcx-rate.is-adj .fcx-step { border-color: #E3D7B4; }
.fcx-rate-val { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; width: 40px; text-align: center; }
.fcx-rate.is-adj .fcx-rate-val { font-weight: 800; color: #B7791F; }
.fcx-track { position: relative; height: 12px; display: flex; align-items: center; }
.fcx-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 0;
  border-radius: 999px; background: var(--surface-alt); outline: none; cursor: pointer;
}
.fcx-rate.is-adj .fcx-range { background: #F1E9D2; }
.fcx-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15, 21, 17, 0.25);
}
.fcx-rate.is-adj .fcx-range::-webkit-slider-thumb { background: #B7791F; }
.fcx-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15, 21, 17, 0.25);
}
.fcx-rate.is-adj .fcx-range::-moz-range-thumb { background: #B7791F; }
.fcx-tick { position: absolute; top: -1px; width: 2px; height: 14px; background: var(--text-primary); border-radius: 2px; pointer-events: none; }
.fcx-rate-note { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); margin-top: 5px; }
.fcx-rate.is-adj .fcx-rate-note { color: #B7791F; font-weight: 600; }
.fcx-restore {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; color: var(--accent); text-decoration: underline;
}
.fcx-presets { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.fcx-presets button {
  font-family: var(--font-body); font-size: 11px; font-weight: 500; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; background: var(--surface); cursor: pointer;
}
.fcx-presets button:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border-strong); }
.fcx-presets button.active { font-weight: 600; color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.fcx-presets button:disabled { opacity: 0.5; cursor: default; }

/* CTA congelado (vira referência na Produtividade quando for habilitado) */
.fcx-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px;
  border: 0; border-radius: 12px; background: var(--text-primary); color: #fff;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.fcx-cta:disabled { opacity: 0.45; cursor: not-allowed; }
.fcx-cta-note { margin: -8px 0 0; text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* Silhueta do funil invertido */
.fcx-fun-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.fcx-cenario { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.fcx-topcap { text-align: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #B7791F; font-weight: 600; margin-bottom: 6px; }
.fcx-fun { display: flex; flex-direction: column; align-items: center; }
.fcx-block {
  min-width: 200px; max-width: 100%; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 14px;
  color: #14351F;
}
.fcx-block.is-light { color: #fff; }
.fcx-block.is-light .fcx-block-l { color: rgba(255, 255, 255, 0.85); }
.fcx-block-top { height: 72px; box-shadow: 0 10px 24px -12px rgba(31, 138, 76, 0.55); }
.fcx-block-top .fcx-block-n { font-size: 36px; }
.fcx-block-n { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fcx-block-l { font-size: 12px; font-weight: 600; line-height: 1.25; color: #2C5E3E; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcx-block-meta { height: 56px; background: var(--surface); border: 2px solid var(--accent); }
.fcx-block-meta .fcx-block-n { color: var(--accent); font-size: 24px; }
.fcx-block-meta .fcx-block-l { white-space: normal; font-weight: 700; }
.fcx-conv { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin: 7px 0; }
.fcx-conv.is-adj { color: #B7791F; font-weight: 600; }
.fcx-fun-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--border-strong);
  font-size: 12px; color: var(--text-secondary);
}
.fcx-fun-pace { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Realidade do topo */
.fcx-reality {
  background: #F5FBF0; border: 1px solid #DCEECB; border-radius: 16px; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.fcx-reality.is-risk { background: #FBF6E9; border-color: #EFE3C2; }
.fcx-real-txt { flex: 1; min-width: 220px; }
.fcx-real-eyebrow { margin: 0 0 3px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.fcx-reality.is-risk .fcx-real-eyebrow { color: #B7791F; }
.fcx-real-txt span { font-size: 13px; color: #2C5E3E; }
.fcx-reality.is-risk .fcx-real-txt span { color: #7A5E1E; }
.fcx-real-bar-wrap { flex: 1; min-width: 260px; max-width: 420px; }
.fcx-real-bar { position: relative; height: 12px; border-radius: 999px; background: #E6F0DC; overflow: hidden; }
.fcx-reality.is-risk .fcx-real-bar { background: #F1E9D2; }
.fcx-real-bar i { position: absolute; inset: 0; display: block; background: var(--accent); border-radius: 999px; }
.fcx-real-bar em { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(183, 121, 31, 0.3) 0 5px, transparent 5px 10px); }
.fcx-real-legend { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--font-mono); font-size: 10px; color: #8FA890; }
.fcx-real-badge { color: #B7791F; font-weight: 600; }

/* ---- Tela de login ------------------------------------------------------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px;
}
.login-card .brand-mark { display: inline-flex; margin-bottom: 18px; }
.login-card .eyebrow { margin-bottom: 2px; }
.login-title { font-size: 19px; margin-bottom: 22px; }
.login-erro {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(194, 69, 59, 0.08);
  border: 1px solid rgba(194, 69, 59, 0.2);
  color: var(--negative);
  font-size: 13px;
}
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.login-form label + input { margin-bottom: 14px; }
.login-form input {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-btn {
  margin-top: 6px;
  padding: 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.login-btn:hover { background: var(--accent); }

/* ==========================================================================
   Acessos (admin) — /admin
   ========================================================================== */
.page-sub { margin: 8px 0 0; font-size: 13px; color: var(--text-secondary); max-width: 640px; }
.admin-erro {
  margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(194, 69, 59, 0.08); border: 1px solid rgba(194, 69, 59, 0.2);
  color: var(--negative); font-size: 13px;
}
.section-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.admin-novo { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.fld input, .fld-row input, .scope select, .scope textarea, .nova-senha input {
  font-family: var(--font-body); font-size: 13.5px; color: var(--text-primary);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px;
}
.fld input:focus, .fld-row input:focus, .scope select:focus, .scope textarea:focus, .nova-senha input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.fld-row { display: flex; gap: 8px; }
.fld-row input { flex: 1; min-width: 0; }
.admin-hint { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }

.btn-pri { background: var(--text-primary); color: #fff; border: 0; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; padding: 10px 18px; cursor: pointer; }
.btn-pri:hover { background: var(--accent); }
.btn-pri:disabled { opacity: 0.55; cursor: default; }
.btn-sec { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13px; padding: 9px 14px; cursor: pointer; }
.btn-sec:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-del { background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; padding: 6px 12px; cursor: pointer; }
.btn-del:hover { color: var(--negative); border-color: var(--negative); }

.admin-lista { display: flex; flex-direction: column; gap: 14px; }
.acesso { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.acesso-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.acesso-id { display: flex; align-items: baseline; gap: 10px; }
.acesso-nome { font-size: 15px; font-weight: 600; }
.acesso-login { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.acesso-acoes { display: flex; align-items: center; gap: 12px; }
.acesso-papel { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
.acesso-papel.is-admin { color: var(--accent); border-color: var(--border-accent); }

.acesso-corpo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 16px; }
.acesso-corpo.bloqueado { opacity: 0.55; }
.col-titulo { margin: 0 0 10px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.views { display: flex; flex-direction: column; gap: 8px; }

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border-strong); transition: background 0.15s ease, border-color 0.15s ease; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform 0.15s ease, background 0.15s ease; }
.toggle input:checked + .track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(14px); background: #fff; }
.toggle input:disabled + .track { opacity: 0.6; }
.toggle .tlabel { font-size: 13.5px; }

.scopes { display: flex; flex-direction: column; gap: 12px; }
.scope { display: flex; flex-direction: column; gap: 5px; }
.scope span { font-size: 12px; color: var(--text-secondary); }
.scope select, .scope textarea { width: 100%; resize: vertical; }

.acesso-rodape { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.nova-senha { flex: 1; min-width: 200px; max-width: 360px; }

@media (max-width: 720px) { .acesso-corpo { grid-template-columns: 1fr; gap: 18px; } }
