/* ============================================================
   Dashboard BNI Traffic Light — Estilos
   ============================================================ */

:root {
  --bni-red: #CF2030;
  --bni-red-dark: #B81624;
  --bni-red-soft: #FFF1F2;
  --bg: #F7F7F7;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --green: #16A34A;
  --green-soft: #EAF8EF;
  --yellow: #F2C300;
  --yellow-soft: #FFF8D8;
  --orange: #F97316;
  --orange-soft: #FFF3E6;
  --blue: #2C7FB8;
  --blue-soft: #EEF4FF;
  --purple: #8B5FBF;
  --purple-soft: #F3E8FF;
  --red: #E63946;
  --gray: #9CA3AF;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-card: 0 8px 22px rgba(15, 23, 42, 0.06);
  --radius-lg: 18px;
  --radius-md: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
  line-height: 1.4;
}
.container { max-width: 1500px; margin: 0 auto; }

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 24px;
  flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 18px; }
.bni-logo {
  background: var(--bni-red);
  color: white;
  font-weight: 900;
  font-size: 24px;
  padding: 8px 14px;
  border-radius: 6px;
  letter-spacing: -0.5px;
  position: relative;
}
.bni-logo::after {
  content: "®";
  font-size: 9px;
  position: absolute;
  top: 4px;
  right: 2px;
}
.header-title h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.header-title p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  background: white;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--text-muted);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
}

/* Filters */
.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px;
  margin-bottom: 16px;
}
.filter {
  background: var(--card);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.filter-icon { color: var(--bni-red); font-size: 14px; }
.filter-label { color: var(--text-muted); font-weight: 500; }
.filter select {
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  margin-left: auto;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.btn-clear {
  background: var(--card);
  border: 1px solid var(--bni-red);
  color: var(--bni-red);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.btn-clear:hover { background: var(--bni-red-soft); }

/* ============================================================
   Resumo Executivo — top-grid (score/PALMS/coluna lateral) +
   lower-grid (atividade/desempenho por faixa). Cards próprios
   (não reaproveita mais .kpi) pra bater com o protótipo: cantos
   mais arredondados, sombra mais suave, PALMS em destaque.
   ============================================================ */
.exec-top-grid {
  display: grid;
  grid-template-columns: 1.05fr 2.65fr 1.85fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

/* --- Score card --- */
.score-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  overflow: hidden;
}
.score-card::before {
  content: "";
  position: absolute; left: 0; top: 0; width: 6px; height: 100%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.score-card.verde::before    { background: var(--green); }
.score-card.amarelo::before  { background: var(--yellow); }
.score-card.vermelho::before { background: var(--bni-red); }
.score-card.cinza::before    { background: var(--gray); }
.score-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px; color: var(--text);
}
.score-value { margin: 16px 0 8px; font-size: 52px; line-height: 0.9; font-weight: 800; letter-spacing: -1px; }
.score-value.verde    { color: var(--green); }
.score-value.amarelo  { color: #8A6200; }
.score-value.vermelho { color: var(--bni-red); }
.score-value.cinza    { color: var(--text-muted); }
.score-badge {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 10px; font-size: 13px; font-weight: 700;
}
.score-badge.verde    { background: var(--green-soft);  color: #15803D; }
.score-badge.amarelo  { background: var(--yellow-soft); color: #8A6200; }
.score-badge.vermelho { background: var(--bni-red-soft); color: var(--bni-red-dark); }
.score-badge.cinza    { background: #F1F5F9; color: var(--text-muted); }
.exec-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.exec-meta.up   { color: var(--green); font-weight: 700; }
.exec-meta.down { color: var(--bni-red); font-weight: 700; }
.exec-sparkline { margin-top: 16px; }
.exec-sparkline svg { display: block; }

/* --- PALMS card --- */
.palms-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
}
.palms-card .panel-title-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.palms-card h3 { font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px; margin: 0; }
.palms-card .panel-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.palms-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.palms-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 10px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px;
}
.palms-letter {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 800; flex-shrink: 0;
}
.palms-letter.green  { background: var(--green); }
.palms-letter.red    { background: #EF4444; }
.palms-letter.orange { background: var(--orange); }
.palms-letter.blue   { background: var(--blue); }
.palms-letter.purple { background: var(--purple); }
.palms-label { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--text); }
.palms-value { font-size: 28px; line-height: 1; font-weight: 800; }
.palms-value.green  { color: var(--green); }
.palms-value.red    { color: #EF4444; }
.palms-value.orange { color: var(--orange); }
.palms-value.blue   { color: var(--blue); }
.palms-value.purple { color: var(--purple); }
.palms-sub { font-size: 12px; color: var(--text-muted); line-height: 1.35; }

.exec-cta {
  align-self: flex-end;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #0047AB;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.exec-cta:hover { text-decoration: underline; }

/* --- Coluna lateral (Membros Ativos / TYFCB) --- */
.side-kpi-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.side-kpi-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  display: flex; align-items: flex-start; gap: 16px;
}
.side-icon {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 24px;
  background: var(--bni-red-soft); color: var(--bni-red);
}
.side-kpi-label { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--text); }
.side-kpi-value { margin-top: 6px; font-size: 32px; line-height: 1; font-weight: 800; color: var(--text); }
.side-kpi-value.red { color: var(--bni-red); font-size: 26px; }

/* --- Lower-grid (mini-donut Desempenho por faixa / Atividade e contributos) --- */
.exec-bottom-grid { display: grid; grid-template-columns: 0.95fr 1.55fr; align-items: stretch; gap: 16px; margin-bottom: 16px; }
.exec-bottom-grid .panel { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 24px 26px; }
.exec-bottom-grid .panel h3 { font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px; }

/* Mini donut — Desempenho por faixa */
.mini-faixa-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 22px; }
.mini-donut {
  width: 118px; height: 118px; border-radius: 50%; position: relative; flex-shrink: 0;
}
.mini-donut::after { content: ""; position: absolute; inset: 28px; border-radius: 50%; background: var(--card); }
.mini-donut-center {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center;
}
.mini-donut-center strong { display: block; color: var(--bni-red); font-size: 24px; line-height: 1; font-weight: 800; }
.mini-donut-center span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.faixa-summary { display: grid; gap: 10px; align-content: start; }
.faixa-summary-title { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--text); text-transform: uppercase; }
.faixa-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; font-size: 13px; color: var(--text-muted); }
.faixa-row strong { color: var(--text); font-size: 13px; }
.faixa-dot { width: 10px; height: 10px; border-radius: 50%; }
.faixa-dot.green  { background: var(--green); }
.faixa-dot.yellow { background: var(--yellow); }
.faixa-dot.red    { background: #EF4444; }
.faixa-dot.gray   { background: var(--gray); }

/* Atividade e contributos — linhas com divisor fino, sem caixa/borda por item
   (bate com o espaçamento do protótipo: um card só, itens separados por hairline). */
.activity-box-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.activity-box-grid.two-columns { grid-template-columns: repeat(2, 1fr); border-bottom: none; margin-top: 0; }
.activity-box {
  padding: 20px 18px 20px 0; display: flex; align-items: center; gap: 16px;
  border-right: 1px solid var(--border);
}
.activity-box-grid .activity-box:last-child,
.activity-box-grid.two-columns .activity-box:last-child { border-right: none; }
.activity-box-grid .activity-box:not(:first-child),
.activity-box-grid.two-columns .activity-box:not(:first-child) { padding-left: 18px; }
.activity-box-icon {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  background: var(--bni-red-soft); color: var(--bni-red); display: grid; place-items: center; font-size: 26px;
}
.activity-box-content { min-width: 0; }
.activity-box-label { margin: 0; font-size: 12px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: 0.2px; }
.activity-box-value { margin-top: 6px; font-size: 28px; line-height: 1; font-weight: 800; color: var(--text); }
.activity-box-trend { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.activity-box-trend.up   { color: var(--green); }
.activity-box-trend.down { color: var(--bni-red); }
.activity-box-footer { margin-top: 18px; padding-top: 16px; text-align: center; }

/* Cards do Resumo Executivo que abrem modal ao clicar (Ausências/Atrasos/Refs/ONF) */
.palms-item.clickable, .side-kpi-card.clickable, .activity-box.clickable {
  cursor: pointer; transition: background 0.12s ease, transform 0.08s ease;
}
.palms-item.clickable:hover { background: var(--bg); transform: translateY(-1px); }
.side-kpi-card.clickable:hover, .activity-box.clickable:hover { background: var(--bni-red-soft); }

/* Faixa de procedência do dado — abre o Resumo Executivo, logo abaixo dos filtros */
.exec-source {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: center;
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  font-size: 13px; color: var(--text-muted);
  padding: 14px 26px; margin-bottom: 16px;
}

/* Tabela compacta usada dentro dos modais (Novos membros etc.) */
.bt-modal-table-wrap {
  overflow-x: auto;
  margin-top: 6px;
}
table.bt-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.bt-modal-table thead th {
  background: var(--bni-red);
  color: white;
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}
table.bt-modal-table thead th.num { text-align: right; }
table.bt-modal-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
table.bt-modal-table tbody td.num   { text-align: right; font-variant-numeric: tabular-nums; }
table.bt-modal-table tbody td.money { font-weight: 600; }
table.bt-modal-table tbody tr:hover { background: #FAFAFA; }
table.bt-modal-table tbody tr.row-novo { background: #F4F8FE; }
table.bt-modal-table tbody tr.row-novo:hover { background: #E6F1FB; }

/* Pílula compacta usada nos modais "sem refs / sem ONF" para mostrar valor */
.bt-stat-val {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #F9FAFB;
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Sections grid */
.grid-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

/* Painéis full-width (Mudanças de faixa, Destaques do mês) precisam de respiro
   entre si — não estão dentro de um grid que já cuida do gap. */
#panelCoaching,
#panelBandTransitions,
#panelHighlights,
#panelEficiencia,
#panelMembros {
  margin-bottom: 12px;
}
.panel {
  background: var(--card);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.panel h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
  flex-shrink: 0;
}
.chart-box { position: relative; height: 240px; width: 100%; }

/* Funil */
.funnel { display: flex; align-items: stretch; gap: 4px; margin: 14px 0 18px; }
.funnel-step {
  flex: 1; padding: 16px 12px; text-align: center; color: white;
  font-weight: 600; position: relative;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}
.funnel-step:first-child { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.funnel-step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); }
.funnel-step .icon { font-size: 22px; }
.funnel-step .num { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.funnel-step .lab { font-size: 11px; opacity: 0.95; line-height: 1.2; }

/* Etapa do funil clicável (abre modal com a lista) */
.funnel-step.clickable {
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}
.funnel-step.clickable:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.funnel-step.clickable::after {
  content: " ↗";
  position: absolute;
  top: 6px;
  right: 22px;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.85;
}
.funnel-conv {
  text-align: center; background: var(--bg); padding: 8px 14px;
  border-radius: 6px; font-size: 13px; color: var(--text);
}
.funnel-conv strong { color: var(--bni-red); font-weight: 800; }

/* Member table */
.member-table-wrap { overflow-x: auto; max-height: 600px; overflow-y: auto; }
table.member-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.member-table thead th {
  background: var(--bni-red); color: white; text-align: left;
  padding: 10px 10px; font-weight: 600; font-size: 11px;
  position: sticky; top: 0; z-index: 1;
}
table.member-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text);
}
table.member-table tbody tr:hover { background: #FAFAFA; cursor: pointer; }
table.member-table thead th.sortable { cursor: pointer; user-select: none; }
table.member-table thead th.sortable:hover { background: var(--bni-red-dark); }
table.member-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cor-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.eff-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--bg); color: var(--text-muted);
  font-size: 12px; margin-right: 8px; flex-shrink: 0;
}
.eff-name { display: inline-flex; align-items: center; }
.eff-status { display: inline-flex; align-items: center; gap: 6px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.badge-alta { background: #FDE5E8; color: var(--red); }
.badge-media { background: #FFF6D6; color: #B88800; }
.badge-baixa { background: #E1F5E5; color: var(--green); }
.badge-recon { background: var(--bni-red-soft); color: var(--bni-red); }

/* Insights */
.insights-panel { padding: 22px; }
.insights-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.insights-icon {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bni-red-soft);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.insights-title { font-size: 17px; font-weight: 700; }
.insight-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); font-size: 12px; line-height: 1.5;
}
.insight-item:last-child { border-bottom: none; }
.insight-check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bni-red); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}

/* Modal — perfil individual */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white; border-radius: 12px;
  max-width: 720px; width: 100%; max-height: 90vh;
  overflow-y: auto; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h2 { font-size: 22px; font-weight: 800; }
.modal-close {
  background: var(--bg); border: none; width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--text-muted);
}
.modal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.modal-stat {
  background: var(--bg); padding: 12px; border-radius: 8px; text-align: center;
}
.modal-stat .lab { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.modal-stat .val { font-size: 18px; font-weight: 800; margin-top: 4px; }

.member-insights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}
.member-insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--bni-red);
  font-size: 12px;
  line-height: 1.5;
}
.member-insight-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

/* Responsive */
@media (max-width: 1280px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
  .bt-destino-grid { grid-template-columns: repeat(2, 1fr); }
  .exec-top-grid { grid-template-columns: 1fr 2fr; }
  .side-kpi-stack { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .palms-grid { grid-template-columns: repeat(3, 1fr); }
  .activity-box-grid, .activity-box-grid.two-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .grid-bottom { grid-template-columns: 1fr; }
  .header { flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr 1fr; }
  .bt-summary, .bt-destino-grid, .bt-basemove-grid { grid-template-columns: 1fr; }
  .exec-top-grid { grid-template-columns: 1fr; }
  .side-kpi-stack { grid-template-columns: 1fr; }
  .palms-grid { grid-template-columns: 1fr 1fr; }
  .exec-bottom-grid { grid-template-columns: 1fr; }
  .mini-faixa-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .faixa-row { grid-template-columns: 12px 1fr auto; justify-items: start; }
  .activity-box-grid, .activity-box-grid.two-columns { grid-template-columns: 1fr; }
}


/* ============================================================
   Mudanças de faixa (Band Transitions)
   ============================================================ */
.bt-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
.bt-summary-card {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
}
.bt-summary-card:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: var(--bni-red);
}
.bt-summary-card:active:not(:disabled) { transform: translateY(0); }
.bt-summary-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.bt-summary-card .lab {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.bt-summary-card .val {
  font-size: 36px;
  font-weight: 800;
  margin-top: 6px;
  line-height: 1;
}
.bt-summary-card.up   .val { color: var(--green); }
.bt-summary-card.down .val { color: var(--bni-red); }
.bt-summary-card.mid  .val { color: var(--text); }
.bt-summary-card.up   { border-top: 3px solid var(--green); }
.bt-summary-card.down { border-top: 3px solid var(--bni-red); }
.bt-summary-card.mid  { border-top: 3px solid var(--gray); }

.bt-card-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}
.bt-card-warn {
  font-size: 11px;
  color: var(--bni-red);
  font-weight: 600;
  margin-top: 10px;
}

.bt-extras {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.bt-extra-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.12s ease;
}
.bt-extra-pill:hover { opacity: 0.8; }
.bt-extra-pill.in  { background: #E0F2E6; color: #0E5A2A; }
.bt-extra-pill.out { background: #F3F4F6; color: #374151; }

/* Seções dentro do modal "Mantiveram" — agrupadas por cor */
.bt-mant-section {
  margin-bottom: 18px;
}
.bt-mant-section:last-child { margin-bottom: 0; }
.bt-mant-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}

.bt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid #F0F0F0;
  gap: 12px;
}
.bt-row:first-of-type { border-top: 1px solid #F0F0F0; margin-top: 6px; }
.bt-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; }
.bt-name .tag-urg,
.bt-name .tag-novo {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}
.bt-name .tag-urg  { background: #FCEBEB; color: #501313; }
.bt-name .tag-novo { background: #E6F1FB; color: #0C447C; }

/* Tags usadas DENTRO de células de tabela (não dentro de .bt-name) */
.tag-urg,
.tag-alerta,
.tag-novo {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}
.tag-urg    { background: #FCEBEB; color: #501313; }
.tag-alerta { background: #FAEEDA; color: #633806; }
.tag-novo   { background: #E6F1FB; color: #0C447C; }

table.bt-modal-table tbody td.strong-num {
  font-weight: 800;
  color: var(--bni-red);
}

.bt-pill-empty {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  white-space: nowrap;
  font-style: italic;
}

.bt-trans {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bt-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.bt-pill.verde    { background: #EAF3DE; color: #173404; }
.bt-pill.amarelo  { background: #FAEEDA; color: #633806; }
.bt-pill.vermelho { background: #FCEBEB; color: #501313; }
.bt-pill.cinza    { background: #F1EFE8; color: #2C2C2A; }
.bt-arrow { font-size: 13px; color: var(--text-muted); }
.bt-delta {
  font-size: 12px;
  font-weight: 700;
  min-width: 42px;
  text-align: right;
}
.bt-delta.up   { color: var(--green); }
.bt-delta.down { color: var(--bni-red); }

/* Bloco "Destino atual por faixa" e "Movimento da base" — reaproveitam .bt-summary-card,
   só ganham variantes de cor e um wrapper de seção com título + dica. */
.bt-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.bt-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bt-section-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.bt-destino-grid, .bt-basemove-grid {
  display: grid;
  gap: 12px;
}
.bt-destino-grid { grid-template-columns: repeat(3, 1fr); }
.bt-basemove-grid { grid-template-columns: repeat(2, 1fr); }

.bt-summary-card.cor-verde    { border-top: 3px solid var(--green); }
.bt-summary-card.cor-verde    .val { color: var(--green); }
.bt-summary-card.cor-amarelo  { border-top: 3px solid var(--yellow); }
.bt-summary-card.cor-amarelo  .val { color: #8A6200; }
.bt-summary-card.cor-vermelho { border-top: 3px solid var(--bni-red); }
.bt-summary-card.cor-vermelho .val { color: var(--bni-red); }
.bt-summary-card.cor-neutro   { border-top: 3px solid var(--gray); }

.bt-dest-lines {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.bt-dest-lines div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mini-cards de resumo por cor de destino, usados nos modais Evoluíram/Regrediram */
.bt-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.bt-mini-stat {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.bt-mini-stat.cor-verde    { border-top: 3px solid var(--green); }
.bt-mini-stat.cor-amarelo  { border-top: 3px solid var(--yellow); }
.bt-mini-stat.cor-vermelho { border-top: 3px solid var(--bni-red); }
.bt-mini-stat.cor-cinza    { border-top: 3px solid var(--gray); }
.bt-mini-stat .lab { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.bt-mini-stat .val { font-size: 20px; font-weight: 800; margin-top: 4px; }

/* Seções colapsáveis do modal "Mantiveram faixa" */
.bt-mant-section-title {
  cursor: pointer;
  user-select: none;
}
.bt-mant-toggle {
  display: inline-block;
  width: 14px;
  transition: transform 0.12s ease;
}
.bt-mant-body.collapsed { display: none; }

/* Tabs de filtro do modal "Mantiveram faixa" */
.bt-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bt-filter-tab {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.bt-filter-tab:hover { border-color: var(--bni-red); color: var(--bni-red); }
.bt-filter-tab.active { background: var(--bni-red); border-color: var(--bni-red); color: white; }

.bt-stuck {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.bt-stuck-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
.bt-stuck-pill.verde    { background: #EAF3DE; color: #173404; }
.bt-stuck-pill.amarelo  { background: #FAEEDA; color: #633806; }
.bt-stuck-pill.vermelho { background: #FCEBEB; color: #501313; }
.bt-stuck-pill.cinza    { background: #F1EFE8; color: #2C2C2A; }

.bt-stuck-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

.bt-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
}

/* ============================================================
   Destaques do mês — narrativa por membro
   ============================================================ */
.hi-secao { margin-bottom: 18px; }
.hi-secao:last-child { margin-bottom: 0; }
.hi-secao-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.hi-secao-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.hi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.hi-card {
  display: flex;
  gap: 12px;
  background: #FAFAFA;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.hi-icone {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.hi-corpo { flex: 1; min-width: 0; }
.hi-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.hi-nome {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.hi-texto {
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
  margin: 0;
}

/* Metodologia */
.methodology {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.meth-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #FAFAFA;
}
.meth-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--bni-red);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.meth-max {
  background: var(--bni-red);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
}
.meth-table { width: 100%; font-size: 11px; }
.meth-table tr td { padding: 3px 0; color: var(--text); }
.meth-table tr td:first-child { color: var(--text-muted); }
.meth-table tr td.pts {
  text-align: center;
  font-weight: 800;
  border-radius: 3px;
  width: 32px;
  color: white;
}
.pts-0 { background: var(--gray); }
.pts-2 { background: #F2C200; color: #333 !important; }
.pts-3 { background: #F2C200; color: #333 !important; }
.pts-5 { background: var(--red); }
.pts-5g { background: var(--green); }
.pts-10 { background: var(--yellow); color: #333 !important; }
.pts-15 { background: var(--green); }
.pts-20 { background: var(--green); }
.meth-foot {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}
@media (max-width: 1280px) {
  .methodology { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .methodology { grid-template-columns: 1fr; }
}

/* Glossário */
.glossary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.gloss-group strong {
  display: block;
  font-size: 12px;
  color: var(--bni-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--bni-red-soft);
}
.gloss-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gloss-group li {
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.gloss-group li b {
  display: inline-block;
  min-width: 36px;
  color: var(--bni-red);
  font-weight: 700;
  font-family: monospace;
  font-size: 11px;
}
@media (max-width: 1280px) {
  .glossary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .glossary { grid-template-columns: 1fr; }
}

/* Botão Adicionar mês (header) */
.header-right-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-upload {
  background: var(--bni-red);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: background 0.15s;
}
.btn-upload:hover { background: var(--bni-red-dark); }
.btn-upload-icon {
  font-size: 14px;
  font-weight: 800;
}

/* Modal de upload */
#uploadModal {
  max-width: 560px;
}
.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg);
}
.upload-dropzone:hover,
.upload-dropzone.drag {
  border-color: var(--bni-red);
  background: var(--bni-red-soft);
}
.upload-dropzone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.upload-dropzone-text {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.upload-dropzone-text strong { color: var(--bni-red); }
.upload-dropzone-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.upload-dropzone-hint code,
.upload-dropzone-text code {
  background: white;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.upload-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  display: none;
}
.upload-result:not(:empty) { display: block; }
.upload-result.success {
  background: #E1F5E5;
  color: #1A7A2C;
  border-left: 4px solid var(--green);
}
.upload-result.success strong { color: #1A7A2C; }
.upload-result.error {
  background: #FDE5E8;
  color: #8B1A2A;
  border-left: 4px solid var(--red);
}
.upload-result.error strong { color: var(--red); }
.upload-result code {
  background: rgba(255,255,255,0.6);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn-upload-action {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  transition: opacity 0.15s, background 0.15s;
}
.btn-upload-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-upload-primary {
  background: var(--bni-red);
  color: white;
}
.btn-upload-primary:hover:not(:disabled) { background: var(--bni-red-dark); }
.btn-upload-secondary {
  background: white;
  color: var(--bni-red);
  border-color: var(--bni-red);
}
.btn-upload-secondary:hover:not(:disabled) { background: var(--bni-red-soft); }

/* Banner de status — #appStatus (loading / erro no boot) */
.app-status {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--bni-red-soft);
  color: var(--text);
  border-left: 4px solid var(--bni-red);
  box-shadow: var(--shadow);
}
.app-status.error {
  background: #FDE5E8;
  color: #8B1A2A;
  border-left-color: var(--red);
}
.app-status.error strong { color: var(--red); }
.app-status code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
