/* ============================================================
   S5 KPI 画面  (mobile-s5-kpi.css)
   prefix: s5k-
   ============================================================ */

/* ─── ルート ─────────────────────────────────────────────── */
.s5k-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-bg, #f5f5f7);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── ページヘッダー ──────────────────────────────────────── */
.s5k-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  background: var(--color-bg, #f5f5f7);
  position: sticky;
  top: 0;
  z-index: 10;
}

.s5k-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
  margin: 0;
  line-height: 1.2;
}

.s5k-page-date {
  font-size: 13px;
  color: var(--color-text-sub, #6b7280);
  margin-top: 2px;
}

.s5k-refresh {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-sub, #6b7280);
  flex-shrink: 0;
}
.s5k-refresh:active { background: rgba(0,0,0,.06); }
.s5k-refresh svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── エラー / ローディング ───────────────────────────────── */
.s5k-error {
  margin: 8px 16px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
}

.s5k-loading {
  text-align: center;
  color: var(--color-text-sub, #6b7280);
  font-size: 14px;
  padding: 40px 16px;
}

/* ─── ボディ ────────────────────────────────────────────── */
.s5k-body {
  flex: 1;
  padding: 0 0 24px;
}

/* ─── セクション ────────────────────────────────────────── */
.s5k-section {
  margin: 12px 16px 0;
}

.s5k-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.s5k-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-sub, #6b7280);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── カード ─────────────────────────────────────────────── */
.s5k-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ─── ペースバッジ ────────────────────────────────────────── */
.s5k-pace-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.s5k-pace-badge.is-pace-good   { background: #dcfce7; color: #166534; }
.s5k-pace-badge.is-pace-warn   { background: #fef9c3; color: #854d0e; }
.s5k-pace-badge.is-pace-danger { background: #fee2e2; color: #991b1b; }

/* ─── メトリック ──────────────────────────────────────────── */
.s5k-metric {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.s5k-metric:last-child { border-bottom: none; }

.s5k-metric-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.s5k-metric-label {
  font-size: 13px;
  color: var(--color-text-sub, #6b7280);
  min-width: 70px;
}

.s5k-metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
  line-height: 1;
}

.s5k-metric-target {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-sub, #6b7280);
}

.s5k-metric-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-sub, #6b7280);
}

.s5k-metric-rate {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
  margin-left: auto;
}

.s5k-metric-pt {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.s5k-metric-pt.is-positive { background: #dcfce7; color: #166534; }
.s5k-metric-pt.is-negative { background: #fee2e2; color: #991b1b; }

.s5k-metric-visit .s5k-metric-value {
  font-size: 18px;
}

/* ─── プログレスバー ──────────────────────────────────────── */
.s5k-bar {
  height: 6px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}
.s5k-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}
.s5k-bar-fill.is-empty    { width: 0; }
.s5k-bar-fill.is-low      { background: #f87171; }
.s5k-bar-fill.is-mid      { background: #fb923c; }
.s5k-bar-fill.is-high     { background: #4ade80; }
.s5k-bar-fill.is-complete { background: #22c55e; }
.s5k-bar-fill.is-bizday   { background: var(--color-primary, #ab271d); opacity: .7; }

/* ─── ペース詳細カード ────────────────────────────────────── */
.s5k-pace-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s5k-pace-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.s5k-pace-label {
  font-size: 13px;
  color: var(--color-text-sub, #6b7280);
  min-width: 80px;
}

.s5k-pace-val {
  font-size: 16px;
  font-weight: 700;
  min-width: 72px;
}
.s5k-pace-val.is-positive { color: #16a34a; }
.s5k-pace-val.is-negative { color: #dc2626; }

.s5k-pace-row span:last-child {
  font-size: 12px;
  color: var(--color-text-sub, #6b7280);
  margin-left: auto;
}
.s5k-pace-row span:last-child strong {
  color: var(--color-text, #1a1a1a);
  font-weight: 700;
}

/* ─── 営業日進捗カード ────────────────────────────────────── */
.s5k-bizday-nums {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 8px;
}

.s5k-bizday-elapsed {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
}

.s5k-bizday-sep,
.s5k-bizday-total,
.s5k-bizday-unit {
  font-size: 16px;
  color: var(--color-text-sub, #6b7280);
}

.s5k-bizday-pct {
  font-size: 13px;
  color: var(--color-text-sub, #6b7280);
  margin-left: auto;
}

/* ─── チーム表示ノート ────────────────────────────────────── */
.s5k-team-note {
  margin: 12px 16px 0;
  font-size: 12px;
  color: var(--color-text-sub, #6b7280);
  background: #f0f9ff;
  border-radius: 8px;
  padding: 8px 12px;
}

/* ─── メンバー別カード ────────────────────────────────────── */
.s5k-member-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 10px;
}

.s5k-member-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.s5k-member-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
}

.s5k-member-footer {
  font-size: 12px;
  color: var(--color-text-sub, #6b7280);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
