/* =========================================================
   Componente: Card, KPI Card (com variacao), Progress/Frequencia
   ========================================================= */

.card-cf {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.card-cf.is-interactive {
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card-cf.is-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--indigo-200);
}
.card-cf__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.card-cf__title { font-size: var(--text-md); font-weight: var(--fw-semibold); margin: 0; }

/* ---------- KPI Card ---------- */
.kpi-cf {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.kpi-cf__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.kpi-cf__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.kpi-cf__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum' 1;
}
.kpi-cf__label { font-size: var(--text-sm); color: var(--text-secondary); }

.kpi-cf__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  width: fit-content;
}
.kpi-cf__delta.up   { color: var(--presente); background: var(--presente-soft); }
.kpi-cf__delta.down { color: var(--falta);    background: var(--falta-soft); }
.kpi-cf__delta.flat { color: var(--text-muted); background: var(--bg-muted); }

/* ---------- Barra de progresso / frequencia ---------- */
.progress-cf {
  height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-cf__bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--indigo-600);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress-cf__bar.good { background: var(--presente); }
.progress-cf__bar.warn { background: var(--justificada); }
.progress-cf__bar.bad  { background: var(--falta); }

/* Anel de frequencia (radial) */
.ring-cf {
  --val: 0;
  --size: 88px;
  --stroke: 9px;
  --color: var(--indigo-600);
  width: var(--size); height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--bg-surface) calc(100% - var(--stroke)), transparent calc(100% - var(--stroke) + 1px)),
    conic-gradient(var(--color) calc(var(--val) * 1%), var(--bg-muted) 0);
}
.ring-cf__num {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-lg);
  font-feature-settings: 'tnum' 1;
}
