/* =========================
   ABA 02 - N DA PARCELA
   ========================= */

#panel-2 .ph-eyebrow {
  color: #7c3aed;
}

#panel-2 .kpi-val.c-pu,
#panel-2 .kpi-val[style],
#panel-2 td[style*="color:#7c3aed"] {
  color: #7c3aed;
}

/* =========================
   GRID / CARDS / CHARTS
   ========================= */

#panel-2 .chart-col {
  gap: 16px;
}

#panel-2 .chart-card {
  padding: 18px;
  background: #fff;
  border: 1px solid #ebf1f7;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

#panel-2 .chart-card .cc-title {
  color: #1a2332;
}

#panel-2 .chart-card .cc-sub {
  color: #94a3b8;
}

#panel-2 .chart-area {
  position: relative;
  min-width: 0;
}

#panel-2 .parcela-chart-main {
  height: 260px;
}

#panel-2 #chart-2-parcelas {
  width: 100% !important;
  height: 320px !important;
  display: block;
}

/* =========================
   DONUT / COMPOSIÇÃO
   ========================= */

#panel-2 .parcela-donut-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
}

#panel-2 .parcela-chart-donut {
  height: 240px;
}

#panel-2 #chart-2-donut-leg {
  min-height: 240px;
  display: flex;
  align-items: center;
}

/* =========================
   PROGRESS / RANKING
   ========================= */

#panel-2 .prog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

#panel-2 .prog-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#panel-2 .prog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#panel-2 .prog-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

#panel-2 .prog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

#panel-2 .prog-val {
  font-size: 12px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: #0f172a;
}

#panel-2 .prog-pct {
  font-size: 11px;
  color: #94a3b8;
}

#panel-2 .prog-track {
  height: 8px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

#panel-2 .prog-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
}

/* =========================
   KPI STRIP
   ========================= */

#panel-2 .kstrip {
  gap: 11px;
}

/* =========================
   TABELA - CONTRATOS ATIVOS POR PARCELA
   COMPATÍVEL COM .tbl-card-parcelas
   ========================= */

#panel-2 .tbl-card-parcelas {
  margin-top: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #dde7f3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.05),
    0 2px 8px rgba(15, 23, 42, 0.03);
}

/* topo */
#panel-2 .tbl-card-parcelas .tbl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid #e8eef6;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f7ff 100%);
}

#panel-2 .tbl-card-parcelas .tbl-head-left {
  min-width: 0;
}

#panel-2 .tbl-card-parcelas .tbl-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#panel-2 .tbl-card-parcelas .tbl-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #0f172a;
}

#panel-2 .tbl-card-parcelas .tbl-subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
}

/* lado direito */
#panel-2 .tbl-card-parcelas .tbl-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#panel-2 .tbl-card-parcelas .tbl-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

#panel-2 .tbl-card-parcelas .tbl-search {
  width: 260px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  outline: none;
  transition: all .2s ease;
}

#panel-2 .tbl-card-parcelas .tbl-search::placeholder {
  color: #94a3b8;
}

#panel-2 .tbl-card-parcelas .tbl-search:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

#panel-2 .tbl-card-parcelas .tbl-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* scroll */
#panel-2 .tbl-card-parcelas .tbl-scroll {
  overflow: auto;
  max-height: 560px;
  background: #fff;
}

/* tabela */
#panel-2 .tbl-card-parcelas .dt {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

#panel-2 .tbl-card-parcelas .dt thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f8fc;
  color: #8fa1b5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  padding: 15px 18px;
  border-bottom: 1px solid #e6edf5;
}

#panel-2 .tbl-card-parcelas .dt tbody td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  color: #334155;
  vertical-align: middle;
  background: #ffffff;
  transition: background .18s ease;
}

#panel-2 .tbl-card-parcelas .dt tbody tr:nth-child(even) td {
  background: #fbfdff;
}

#panel-2 .tbl-card-parcelas .dt tbody tr:hover td {
  background: #f3f8ff;
}

/* primeira coluna fixa */
#panel-2 .tbl-card-parcelas .dt thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f4f8fc;
  box-shadow: 1px 0 0 #e6edf5;
}

#panel-2 .tbl-card-parcelas .dt tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  box-shadow: 1px 0 0 #eef2f7;
  font-weight: 800;
  color: #1d4ed8;
  font-family: 'DM Mono', monospace;
}

/* hierarquia visual das colunas */
#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(2) {
  font-weight: 700;
  color: #0f172a;
}

#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(4) {
  font-weight: 800;
  color: #7c3aed;
}

#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(5),
#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(6),
#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(7),
#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(8) {
  white-space: nowrap;
}

#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(5) {
  color: #94a3b8;
}

#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(6) {
  color: #0f172a;
  font-weight: 600;
}

#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(7) {
  color: #94a3b8;
  font-family: 'DM Mono', monospace;
}

#panel-2 .tbl-card-parcelas .dt tbody td:nth-child(8) {
  color: #1d4ed8;
  font-family: 'DM Mono', monospace;
  font-weight: 800;
}

/* footer */
#panel-2 .tbl-card-parcelas .tbl-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f7fafc 100%);
  border-top: 1px solid #e8eef6;
  font-size: 12px;
  color: #7c8aa0;
}

#panel-2 .tbl-card-parcelas .tbl-footer code {
  font-size: 11px;
  background: #eef4fb;
  color: #475569;
  padding: 4px 8px;
  border-radius: 8px;
}

#panel-2 .tbl-card-parcelas .tbl-footer-dot {
  color: #cbd5e1;
}

/* badges */
#panel-2 .tbl-card-parcelas .bdg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

#panel-2 .tbl-card-parcelas .bdg-b {
  background: linear-gradient(180deg, #eef5ff 0%, #e4efff 100%);
  color: #2563eb;
  border-color: #d7e7ff;
}

#panel-2 .tbl-card-parcelas .bdg-v {
  background: linear-gradient(180deg, #f5efff 0%, #efe6ff 100%);
  color: #7c3aed;
  border-color: #e7d8ff;
}

#panel-2 .tbl-card-parcelas .bdg-g {
  background: linear-gradient(180deg, #ebfaf1 0%, #def5e8 100%);
  color: #0d7a4e;
  border-color: #cbeedc;
}

#panel-2 .tbl-card-parcelas .bdg-r {
  background: linear-gradient(180deg, #fff1f1 0%, #ffe7e7 100%);
  color: #c62828;
  border-color: #ffd4d4;
}

#panel-2 .tbl-card-parcelas .bdg-y {
  background: linear-gradient(180deg, #fff8e7 0%, #fff2cf 100%);
  color: #b7791f;
  border-color: #f8e2a7;
}

/* =========================
   RESPONSIVO
   ========================= */

@media (max-width: 1100px) {
  #panel-2 #chart-2-parcelas {
    height: 260px !important;
  }
}

@media (max-width: 900px) {
  #panel-2 .parcela-donut-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #panel-2 .parcela-chart-donut,
  #panel-2 #chart-2-donut-leg {
    min-height: auto;
    height: 220px;
  }

  #panel-2 .tbl-card-parcelas .tbl-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #panel-2 .tbl-card-parcelas .tbl-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  #panel-2 .tbl-card-parcelas .tbl-search-wrap {
    width: 100%;
  }

  #panel-2 .tbl-card-parcelas .tbl-search {
    width: 100%;
  }

  #panel-2 .tbl-card-parcelas .tbl-count {
    width: fit-content;
  }
}

@media (max-width: 700px) {
  #panel-2 #chart-2-parcelas {
    height: 220px !important;
  }

  #panel-2 .prog-label,
  #panel-2 .prog-val,
  #panel-2 .prog-pct {
    font-size: 10px;
  }

  #panel-2 .chart-card {
    padding: 16px;
  }

  #panel-2 .tbl-card-parcelas .tbl-head {
    padding: 16px;
  }

  #panel-2 .tbl-card-parcelas .tbl-title {
    font-size: 18px;
  }

  #panel-2 .tbl-card-parcelas .tbl-footer {
    padding: 12px 16px;
  }

  #panel-2 .tbl-card-parcelas .dt thead th,
  #panel-2 .tbl-card-parcelas .dt tbody td {
    padding: 12px 14px;
  }
}