/* NS HRM 프로토타입 — 평가 대시보드 (evaldash.js) · 지난 평가 펼쳐 보기. 색 토큰 · 카드 · 통계 칸 · 막대는 app.css 의 것을 그대로 쓴다.
   선 · 점: 2px 선, 점 r4 + 바탕색 테두리 2px. 눈금은 바탕에서 한 단계 떨어진 1px 실선. 글자는 늘 글자 색 (계열 색은 선 · 점 · 열쇠에만) */

.ed-toolbar .toolbar-left { flex-wrap: wrap; }
.ed-tiles .stat-value { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.ed-tile-name { font-size: 16px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.ed-sec-head { margin: 4px 2px 10px; }

/* 앞 기록 대비 — 화살표 + 숫자 (오르면 좋은 쪽) */
.ed-delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-delta.is-up { background: var(--success-weak); color: var(--success); }
.ed-delta.is-down { background: var(--danger-weak); color: var(--danger); }
.ed-delta.is-flat { background: var(--surface-2); color: var(--text-2); }

/* ========== 선 그래프 ========== */
.ed-chart { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; margin: 4px 0 8px; }
.ed-chart.is-mini { display: block; margin: 0; }
.ed-yaxis { position: relative; }
.ed-yaxis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ed-plot { position: relative; min-width: 0; }
.ed-svg { display: block; overflow: visible; }
.ed-grid { stroke: var(--border); stroke-width: 1; }
.ed-line { stroke: var(--rc, var(--primary)); stroke-width: 2; stroke-linecap: round; }
.ed-dot { fill: var(--rc, var(--primary)); stroke: var(--surface); stroke-width: 2; }
.ed-range { stroke: var(--surface-3); stroke-width: 8; stroke-linecap: round; }
.ed-ref { --rc: var(--text-3); }
.ed-end { font-size: 12.5px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.ed-cross { stroke: var(--border-strong); stroke-width: 1; pointer-events: none; }
.ed-hit { fill: transparent; cursor: default; outline: none; }
.ed-hit:focus-visible { fill: color-mix(in srgb, var(--primary) 8%, transparent); }
.ed-xaxis { position: relative; height: 22px; margin-top: 4px; }
.ed-xaxis span { position: absolute; top: 0; transform: translateX(-50%); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.is-mini .ed-svg { margin: 2px 0; }

/* 범례 · 툴팁 열쇠 — 선 모양 */
.ed-legend { flex-wrap: wrap; }
.ed-key { display: inline-block; width: 14px; height: 2px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--rc, var(--primary)); }
.ed-key.ed-range-key { height: 8px; width: 8px; border-radius: 4px; background: var(--surface-3); }
.ed-tip-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.ed-tip-row b { font-variant-numeric: tabular-nums; min-width: 30px; }
.ed-tip-row span { color: var(--text-2); }

/* ========== 항목 칸 (성과 평가) ========== */
.ed-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ed-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ed-item.is-retired { background: var(--surface-2); }
.ed-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 22px; }
.ed-item-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.ed-item-val { display: flex; align-items: baseline; gap: 6px; }
.ed-item-val b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ed-item-val small { font-size: 12.5px; color: var(--text-3); margin-right: 2px; }
.ed-item-foot { font-size: 12.5px; color: var(--text-2); }
.ed-tag { display: inline-flex; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.ed-tag.is-new { background: var(--primary-weak); color: var(--primary); }

/* ========== 문항 줄 (동료 평가) ========== */
.ed-rows { display: flex; flex-direction: column; gap: 4px; }
.ed-row { display: grid; grid-template-columns: minmax(160px, 1.5fr) minmax(80px, 1fr) 92px minmax(96px, 150px); gap: 14px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--border-faint); }
.ed-row:first-child { border-top: 0; }
.ed-row.is-retired { opacity: .75; }
.ed-row-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; min-width: 0; }
.ed-row-name b { font-weight: 600; }
.ed-row-val { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ed-row-val b { font-size: 15px; font-weight: 800; }

/* 표로 보기 */
.ed-table { margin-top: 10px; }
.ed-table summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); width: max-content; }
.ed-table summary:hover { color: var(--primary); }
.ed-table .table-wrap { margin-top: 8px; }

/* ========== 지난 평가 펼쳐 보기 (perf.js · peer.js) ========== */
.result-row.is-on { background: var(--primary-weak); }
.rr-wrap + .rr-wrap .result-row { border-top: 1px solid var(--border); }
.rr-wrap:first-child .result-row { border-top: 0; }
.rr-toggle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rr-toggle svg { transition: transform .15s; }
.rr-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.rr-detail { margin: 0 8px 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-faint); }
.rd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.rd-list { display: flex; flex-direction: column; }
.rd-item { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(0, 2fr); gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.rd-item:first-child { border-top: 0; padding-top: 2px; }
.rd-title { font-size: 14px; font-weight: 700; line-height: 1.4; }
.rd-title small { display: block; margin-top: 2px; font-weight: 600; color: var(--text-3); }
.rd-sides { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rd-side { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.rd-side > span { font-size: 12.5px; font-weight: 700; color: var(--text-2); padding-top: 2px; }
.rd-side > div { min-width: 0; }
.rd-side .sb-track { max-width: 180px; }
.rd-side p { margin: 4px 0 0; font-size: 13.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.rd-side .score-bar + p { margin-top: 4px; }
.rd-item .person { align-self: start; gap: 8px; }
.rd-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 760px) {
    .ed-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 6px 10px; }
    .ed-row-name { grid-column: 1 / -1; }
    .ed-row-spark { grid-column: 1 / -1; }
    .rd-item { grid-template-columns: 1fr; }
    .ed-chart { grid-template-columns: 22px minmax(0, 1fr); }
}
