/* ./css/unemployment-kpi-cards.css */

/* =========================
   KPI Cards (Wage / Unemployment 共通)
========================= */
.wage-kpi-section {
  margin-top: 14px;
}

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

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

.wage-kpi-period {
  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: 0 4px 10px rgba(17,24,39,.06);
  white-space: nowrap;
}

.wage-kpi-status {
  margin: 0 0 10px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

.wage-kpi-status.is-loading { color: #64748b; }
.wage-kpi-status.is-ok { color: #0f766e; }
.wage-kpi-status.is-warn { color: #a16207; }
.wage-kpi-status.is-error { color: #b91c1c; }

/* ▼ カードリスト：1枚ずつ縦並び（ここが重要） */
.wage-kpi-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ===== Card ===== */
.wage-card {
  --card-bg-1: #eef6ff;
  --card-bg-2: #e7f1ff;
  --card-accent: #69a7ff;
  --card-accent-soft: rgba(105,167,255,.16);

  position: relative;
  width: 100%;
  min-width: 0;
  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: 0 4px 12px rgba(17,24,39,.05);
  padding: 10px;
  overflow: hidden;
}

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

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

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

.wage-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;
  flex: 0 0 auto;
}

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

.wage-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;
  white-space: nowrap;
}

/* ===== Main ===== */
.wage-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;
}

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

.wage-main-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
  min-width: 0;
}

.wage-main-sub {
  font-size: 10px;
  color: #8a93a4;
  font-weight: 700;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

.wage-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;
  flex: 0 0 auto;
}

/* ===== Pills ===== */
.wage-pill-grid {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr; /* 1列固定 */
  gap: 6px;
}

.wage-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;
}

.wage-pill.is-full { grid-column: 1 / -1; }
.wage-pill.is-half { grid-column: 1 / -1; } /* half指定でも1列に揃える */

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

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

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

.wage-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.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .wage-kpi-head {
    align-items: flex-start;
  }

  .wage-kpi-period {
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wage-main-value {
    font-size: 22px;
  }

  .wage-card-foot {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .wage-pill-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ===== Unemployment Line Chart (緑版) ===== */
.wage-card--chart {
  --card-bg-1: #f2fbf7;
  --card-bg-2: #e8f7f0;
  --card-accent: #34b27b;
  --card-accent-soft: rgba(52,178,123,.16);
}

.unemp-chart-wrap {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(20,24,34,.04);
  padding: 6px;
  overflow: hidden;
}

.unemp-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 180px;
  border-radius: 10px;
}