/* DEEP Ops 대시보드 바닐라 이식본 — 소스 진실원천: MLOps-frontend/src/app/panels/DashboardPanel.tsx */
.pd-hub {
  --pd-primary: #2970ff;
  --pd-primary-deep: #1d5ae6;
  --pd-primary-weak: #eaf1ff;
  --pd-surface: #fff;
  --pd-bg: #f5f5f5;
  --pd-line: #e5e7eb;
  --pd-border: #d4d4d4;
  --pd-text: #1f2937;
  --pd-muted: #64748b;
  --pd-good: #166534;
  --pd-warn: #b45309;
  --pd-bad: #b91c1c;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--pd-bg);
  color: var(--pd-text);
}
.pd-hub *, .pd-hub *::before, .pd-hub *::after { box-sizing: border-box; }
.pd-hub button { font: inherit; border-radius: 0 !important; }   /* vlmops 모듈 공통: font 리셋에 밀리지 않게 명시 */
.pd-hub button:focus-visible { outline: 2px solid var(--pd-primary); outline-offset: 1px; }

.pd-hub-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pd-hub-body > * { min-height: 0; }

/* ── 대시보드 본문 ── */
.pd-scroll { height: 100%; overflow-y: scroll; }
.pd-content { width: min(100%, 1720px); margin: 0 auto; padding: 32px 40px 64px; }
.pd-page-head { margin-bottom: 24px; }
.pd-page-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--pd-text); }
.pd-page-head p { margin: 8px 0 0; max-width: 760px; color: var(--pd-muted); font-size: 14px; line-height: 1.6; }

.pd-card { border: 1px solid var(--pd-line); background: var(--pd-surface); padding: 20px; }
.pd-grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.pd-grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.pd-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1279px) {
  .pd-grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .pd-grid-main { grid-template-columns: 1fr; }
}

/* KPI 타일 */
.pd-stat { text-align: left; width: 100%; border: 1px solid var(--pd-line); background: var(--pd-surface); padding: 20px; cursor: default; }
button.pd-stat { cursor: pointer; }
button.pd-stat:hover { border-color: var(--pd-primary); }
.pd-stat-label { display: flex; align-items: center; gap: 6px; color: var(--pd-muted); font-size: 12px; font-weight: 500; }
.pd-stat-value { margin-top: 10px; display: flex; align-items: baseline; gap: 4px; }
.pd-stat-value strong { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--pd-text); }
.pd-stat-value span { color: var(--pd-muted); font-size: 13px; font-weight: 500; }
.pd-stat-note { margin: 10px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgba(100,116,139,.85); font-size: 11px; }

/* 카드 머리 */
.pd-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pd-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--pd-text); }
.pd-card-head p { margin: 4px 0 0; color: var(--pd-muted); font-size: 11px; }
.pd-card-head-sm { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pd-card-head-sm h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--pd-text); }
.pd-icon-box { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; background: var(--pd-primary-weak); color: var(--pd-primary); }

/* 차트 모드 토글 */
.pd-mode { display: flex; flex: 0 0 auto; border: 1px solid var(--pd-border); }
.pd-mode button { border: 0; background: var(--pd-surface); padding: 5px 12px; color: var(--pd-muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.pd-mode button.is-active { background: #1a1a1a; color: #fff; }
.pd-mode button:hover:not(.is-active) { color: var(--pd-primary); }

/* 추이 차트 */
.pd-trend { flex: 1; min-height: 0; display: flex; align-items: center; }
.pd-trend svg { display: block; width: 100%; height: auto; }
.pd-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; border-top: 1px solid var(--pd-line); margin-top: 14px; padding-top: 12px; }
.pd-legend button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 2px 0; font-size: 12px; cursor: pointer; }
.pd-legend button.is-off { opacity: .4; }
.pd-legend .pd-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; }   /* 원은 기능용 표식 */
.pd-legend .pd-legend-name { color: var(--pd-muted); }
.pd-legend .pd-legend-total { color: var(--pd-text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 작은 카드 — 평가량·도넛 */
.pd-big { display: flex; align-items: baseline; gap: 4px; }
.pd-big strong { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--pd-text); }
.pd-big span { color: var(--pd-muted); font-size: 12px; }
.pd-sub { margin: 4px 0 0; color: var(--pd-muted); font-size: 11px; }
.pd-spark { margin-top: 8px; }
.pd-spark svg { display: block; width: 100%; }
.pd-spark-axis { display: flex; justify-content: space-between; color: rgba(100,116,139,.7); font-size: 10px; }
.pd-detail-link { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--pd-border); background: var(--pd-surface); padding: 4px 8px; color: var(--pd-muted); font-size: 11px; cursor: pointer; }
.pd-detail-link:hover { border-color: var(--pd-primary); color: var(--pd-primary); }

.pd-donut-wrap { display: flex; justify-content: center; padding: 12px 0; }
.pd-donut { position: relative; flex: 0 0 auto; }
.pd-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pd-donut-center strong { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pd-text); }
.pd-donut-center span { margin-top: 2px; color: var(--pd-muted); font-size: 11px; }
.pd-donut-legend { display: flex; flex-direction: column; gap: 6px; }
.pd-donut-legend > div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pd-donut-legend .pd-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; }
.pd-donut-legend .pd-name { flex: 1; color: var(--pd-muted); }
.pd-donut-legend .pd-count { color: var(--pd-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pd-donut-legend .pd-pct { width: 36px; text-align: right; color: var(--pd-muted); font-variant-numeric: tabular-nums; }
.pd-empty-line { margin: 0; padding: 40px 0; color: var(--pd-muted); font-size: 12px; text-align: center; }

/* 최근 평가 목록 */
.pd-recent { display: flex; flex-direction: column; }
.pd-recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f1f2f4; }
.pd-recent-row:first-child { border-top: 0; }
.pd-recent-main { flex: 1; min-width: 0; }
.pd-recent-main strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 500; color: var(--pd-text); }
.pd-recent-main span { display: block; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--pd-muted); font-size: 11px; }
.pd-recent-time { flex: 0 0 auto; color: rgba(100,116,139,.7); font-size: 10px; font-variant-numeric: tabular-nums; }
.pd-recent-score { flex: 0 0 128px; }
.pd-goto { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; padding: 0; color: var(--pd-primary); font-size: 11px; font-weight: 500; cursor: pointer; }
.pd-goto:hover { color: var(--pd-primary-deep); }

/* 정확도 막대 — 버전 비교 화면과 같은 기준색(85 / 65) */
.pd-accbar { display: flex; align-items: center; gap: 8px; }
.pd-accbar .pd-accbar-track { flex: 1; height: 6px; background: #eef0f3; overflow: hidden; }
.pd-accbar .pd-accbar-fill { height: 100%; }
.pd-accbar .pd-accbar-num { flex: 0 0 auto; width: 44px; text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pd-badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 11px; font-weight: 500; }
.pd-badge.is-gray { background: #f1f2f4; color: var(--pd-muted); }
.pd-badge.is-red { background: #fee2e2; color: var(--pd-bad); }
.pd-recent-score .pd-badge-right { display: flex; justify-content: flex-end; }

/* 점검 목록 */
.pd-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pd-checks button { display: flex; width: 100%; align-items: flex-start; gap: 8px; border: 0; background: transparent; padding: 4px 0; text-align: left; cursor: pointer; }
.pd-checks button:disabled { cursor: default; }
.pd-checks svg { flex: 0 0 auto; margin-top: 2px; }
.pd-checks .is-red svg { color: #e34d59; }
.pd-checks .is-amber svg { color: #d97706; }
.pd-checks span { font-size: 12px; line-height: 1.6; color: var(--pd-text); }
.pd-checks button:not(:disabled):hover span { color: var(--pd-primary); }
.pd-ok { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 0; color: #047857; font-size: 12px; }

/* 추출 엔진 연동 */
.pd-engine-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pd-engine-head h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--pd-text); }
.pd-engine-head span { display: inline-flex; align-items: center; gap: 4px; color: rgba(100,116,139,.7); font-size: 10px; font-variant-numeric: tabular-nums; }
.pd-engine-status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pd-engine-status .pd-engine-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; background: #ecfdf5; color: #047857; }
.pd-engine-status strong { display: block; font-size: 13px; font-weight: 600; color: var(--pd-text); }
.pd-engine-status span { display: block; color: var(--pd-muted); font-size: 10px; }
.pd-kv { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 11px; }
.pd-kv span { flex: 0 0 auto; color: var(--pd-muted); }
.pd-kv strong { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; font-weight: 500; color: var(--pd-text); }
.pd-refresh { margin-top: 12px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 1px solid var(--pd-border); background: var(--pd-surface); padding: 7px 12px; color: #334155; font-size: 12px; font-weight: 650; cursor: pointer; }
.pd-refresh:hover { background: var(--pd-bg); }
