/* =========================
   Afterschool KPI Cards
========================= */
.afterschool-kpi-section {
  margin-top: 14px;
}

.afterschool-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.afterschool-kpi-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #131722;
}

.afterschool-kpi-year {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.95);
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  box-shadow: var(--shadow-soft-sm);
}

.afterschool-kpi-status {
  margin: 0 0 10px;
  font-size: 12px;
  color: #6b7280;
}
.afterschool-kpi-status.is-loading { color: #64748b; }
.afterschool-kpi-status.is-ok { color: #0f766e; }
.afterschool-kpi-status.is-warn { color: #a16207; }
.afterschool-kpi-status.is-error { color: #b91c1c; }

.afterschool-kpi-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .afterschool-kpi-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.afterschool-card {
  --card-bg-1: #fff;
  --card-bg-2: #f7f8fb;
  --card-accent: #8aa0b8;
  --card-accent-soft: rgba(138,160,184,.14);

  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.88);
  background: linear-gradient(180deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
  box-shadow: var(--shadow-soft-sm);
  padding: 10px;
  overflow: hidden;
}

.afterschool-card::before {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.92), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.afterschool-card.is-waiting {
  --card-bg-1: #fff1f4;
  --card-bg-2: #ffe8ee;
  --card-accent: #ef7da0;
  --card-accent-soft: rgba(239,125,160,.16);
}
.afterschool-card.is-club {
  --card-bg-1: #eef6ff;
  --card-bg-2: #e7f1ff;
  --card-accent: #69a7ff;
  --card-accent-soft: rgba(105,167,255,.16);
}
.afterschool-card.is-registered {
  --card-bg-1: #fff8ef;
  --card-bg-2: #fff1e4;
  --card-accent: #f3a35b;
  --card-accent-soft: rgba(243,163,91,.16);
}
.afterschool-card.is-density {
  --card-bg-1: #f3fbf9;
  --card-bg-2: #eaf8f4;
  --card-accent: #46b3a9;
  --card-accent-soft: rgba(70,179,169,.14);
}

.afterschool-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.afterschool-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.afterschool-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 2px 8px rgba(18,24,38,.05);
  font-size: 13px;
}

.afterschool-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afterschool-card-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.9);
  color: #6b7280;
  font-size: 10px;
  font-weight: 800;
}

.afterschool-main {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(20,24,34,.04);
  padding: 8px 9px;
}

.afterschool-main-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.afterschool-main-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}
.afterschool-main-sub {
  font-size: 10px;
  color: #8a93a4;
  font-weight: 700;
}

.afterschool-main-value-row {
  margin-top: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.afterschool-main-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: #111827;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.afterschool-main-unit {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  margin-left: 4px;
}

.afterschool-main-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--card-accent);
  box-shadow: 0 0 0 4px var(--card-accent-soft);
  margin-bottom: 3px;
}

.afterschool-pill-grid {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 6px;
}

.afterschool-pill {
  border-radius: 12px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(20,24,34,.04);
  padding: 7px 8px 6px;
  min-width: 0;
  grid-column: 1 / -1; /* デフォルトは横幅いっぱい */
}

.afterschool-pill.is-half { grid-column: span 1; }
.afterschool-pill.is-full { grid-column: 1 / -1; }

@media (max-width: 520px) {
  .afterschool-pill-grid {
    grid-template-columns: 1fr;
  }
  .afterschool-pill,
  .afterschool-pill.is-half,
  .afterschool-pill.is-full {
    grid-column: 1 / -1;
  }
}

.afterschool-pill-label {
  display: block;
  font-size: 9px;
  color: #7b8494;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afterschool-pill-value {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.afterschool-pill-value.is-good { color: #1f9f77; }
.afterschool-pill-value.is-bad  { color: #d65873; }
.afterschool-pill-value.is-flat { color: #6b7280; }

.afterschool-pill-sub {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #7b8494;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afterschool-card-foot {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(20,24,34,.05);
  font-size: 9px;
  color: #9aa3b2;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afterschool-empty {
  border: 1px dashed #d8dde7;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.5);
  color: #6b7280;
  font-size: 13px;
}
.afterschool-empty p { margin: 0; }

.afterschool-card--skeleton .sk {
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: afterschoolShimmer 1.2s ease infinite;
}
.afterschool-card--skeleton .sk1 { height: 14px; width: 48%; margin-bottom: 8px; }
.afterschool-card--skeleton .sk2 { height: 46px; width: 100%; margin-bottom: 7px; }
.afterschool-card--skeleton .sk3 { height: 34px; width: 100%; margin-bottom: 6px; }
.afterschool-card--skeleton .sk4 { height: 10px; width: 68%; }

@keyframes afterschoolShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}