/* =============================================================
   dashboard-creditos.css
   Scope: #fc-dash-cred
   Mismas medidas que los otros dashboards.
   ============================================================= */

#fc-dash-cred {
  --dc-apr: #95de76;
  --dc-neg: #a62a45;
  --dc-accent: #ff7b56;
  --dc-center: #ff9d3b;
  --dc-min-w: 308px;
  --dc-max-w: 500px;
  font-family: 'Roboto', sans-serif;
  min-width: var(--dc-min-w);
  max-width: var(--dc-max-w);
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border: 2px solid var(--dc-accent);
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-sizing: border-box;
  height: 328px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────────────── */

#dc-header {
  text-align: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

#dc-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--dc-accent);
  margin: 0 0 2px;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

#dc-product {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ff4f1e;
  line-height: 1.2;
}

/* ─── Cuerpo: donut + leyenda centrados ─────────────────── */

#dc-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

/* ─── Donut con etiqueta central ────────────────────────── */

#dc-chart-wrap {
  position: relative;
  flex-shrink: 0;
  width: 190px;
  height: 190px;
}

#dc-canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Texto flotante en el centro del donut */

#dc-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  width: 80px;
}

#dc-center-number {
  font-family: 'Roboto', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--dc-center);
  line-height: 1;
}

#dc-center-text {
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--dc-center);
  line-height: 1.3;
  margin-top: 3px;
}

/* ─── Leyenda ────────────────────────────────────────────── */

#dc-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.dc-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-legend-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 26px;
  border-radius: 5px;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

#dc-badge-apr {
  background-color: var(--dc-apr);
}

#dc-badge-neg {
  background-color: var(--dc-neg);
}

.dc-legend-label {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  color: #444;
  white-space: nowrap;
}

/* ─── Mobile: donut arriba, leyenda abajo ────────────────── */

@media (max-width: 480px) {
  #fc-dash-cred {
    height: auto;
    min-height: 328px;
  }
}

@media (max-width: 480px) {
  #dc-body {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  #dc-chart-wrap {
    width: min(200px, 80vw);
    height: min(200px, 80vw);
  }
}

@media (max-width: 480px) {
  #dc-legend {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .dc-legend-item {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .dc-legend-label {
    font-size: 11px;
    text-align: center;
  }
}

