/* ══════════════════════════════════════════
   Simple.Lab — Dashboard v3
   ══════════════════════════════════════════ */

.db-wrap { padding: 24px 28px 32px; max-width: 1440px; margin: 0 auto; }
.db-content { opacity: 0; transition: opacity .35s ease; }
.db-content.revealed { opacity: 1; }

/* ── 스켈레톤 ── */
.db-skel-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.db-skel-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.skel-kpi { height: 110px; border-radius: 12px; background: linear-gradient(90deg,#f3f4f6 25%,#e5e7eb 50%,#f3f4f6 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg,#f3f4f6 25%,#e5e7eb 50%,#f3f4f6 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── 날짜 헤더 ── */
.db-date-header {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 18px; flex-wrap: wrap;
}
.db-date-today {
    font-size: 15px; font-weight: 700; color: #111827;
    letter-spacing: -.02em;
}
.db-date-period {
    font-size: 12px; font-weight: 500; color: #9ca3af;
    padding: 2px 10px; border-radius: 6px; background: #f3f4f6;
}
.db-date-refresh {
    font-size: 11px; color: #d1d5db;
    margin-left: auto;
}

/* ═══ KPI ═══ */
.db-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.db-kpi {
    background: #fff; border: 1px solid #f0f1f3; border-radius: 12px;
    padding: 18px 20px 14px; transition: box-shadow .2s, border-color .2s;
}
.db-kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,.05); border-color: #e5e7eb; }
.db-kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.db-kpi-icon {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
}
.db-kpi-icon-pink   { background: #fdf2f8; color: #e6007e; }
.db-kpi-icon-green  { background: #ecfdf5; color: #10b981; }
.db-kpi-icon-violet { background: #f5f3ff; color: #7c3aed; }
.db-kpi-icon-amber  { background: #fffbeb; color: #f59e0b; }
.db-kpi-label { font-size: 12px; font-weight: 600; color: #9ca3af; letter-spacing: -.01em; }
.db-kpi-body { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.db-kpi-value { font-size: 28px; font-weight: 800; color: #111827; line-height: 1.1; letter-spacing: -.03em; }
.db-kpi-unit { font-size: 13px; font-weight: 500; color: #9ca3af; }
.db-kpi-delta { font-size: 11.5px; font-weight: 700; margin-left: 4px; padding: 1px 6px; border-radius: 6px; }
.db-delta-up   { color: #059669; background: #ecfdf5; }
.db-delta-down { color: #dc2626; background: #fef2f2; }
.db-kpi-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #b0b5bf; }
.db-kpi-sub strong { font-weight: 700; color: #6b7280; }
.db-progress-bar { flex: 1; height: 5px; background: #f3f4f6; border-radius: 3px; overflow: hidden; max-width: 80px; }
.db-progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg,#10b981,#34d399); transition: width .6s ease; }

/* ═══ 카드 공통 ═══ */
.db-card {
    background: #fff; border: 1px solid #f0f1f3; border-radius: 12px;
    padding: 20px; transition: box-shadow .2s; min-width: 0;
}
.db-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.db-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.db-card-title { font-size: 14px; font-weight: 700; color: #111827; }
.db-card-desc { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }

/* ═══ 섹션 그리드 ═══ */
.db-section-row { display: grid; gap: 14px; margin-bottom: 20px; }
.db-section-trend  { grid-template-columns: 2fr 1fr; }
.db-section-bottom { grid-template-columns: 1fr 1fr; }

.db-chart-wrap { position: relative; overflow: hidden; }
.db-chart-donut-wrap { position: relative; height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.db-chart-radar-wrap { position: relative; height: 220px; display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* ── 등급 도넛 범례 ── */
.db-grade-legend { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }
.db-grade-legend-item { display: flex; align-items: center; gap: 4px; }
.db-gdot { width: 8px; height: 8px; border-radius: 2px; }
.db-gdot-s { background: #e6007e; }
.db-gdot-a { background: #f59e0b; }
.db-gdot-b { background: #3b82f6; }
.db-gdot-c { background: #9ca3af; }
.db-gdot-d { background: #d1d5db; }
.db-glabel { font-size: 11px; color: #6b7280; }
.db-gcount { font-size: 11px; font-weight: 700; color: #374151; }

/* ── 레이더 범례 ── */
.db-radar-legend { display: flex; justify-content: center; gap: 18px; margin-top: 8px; }
.db-radar-leg { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #6b7280; }
.db-rleg-dot { width: 10px; height: 10px; border-radius: 3px; }
.db-rleg-this { background: rgba(230,0,126,.7); }
.db-rleg-last { background: rgba(156,163,175,.4); }

/* ═══ 히트맵 ═══ */
.db-card-heatmap { margin-bottom: 20px; }
.db-hm-scroll { overflow-x: auto; overflow-y: hidden; }
.db-hm-grid {
    display: grid;
    gap: 3px;
    min-width: 500px;
}
.db-hm-corner { }
.db-hm-month {
    font-size: 10.5px; font-weight: 600; color: #9ca3af;
    text-align: center; padding: 0 0 6px;
}
.db-hm-type {
    font-size: 11.5px; font-weight: 500; color: #4b5563;
    display: flex; align-items: center;
    padding-right: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    height: 32px;
}
.db-hm-cell {
    height: 32px;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    cursor: default;
    transition: transform .1s, box-shadow .1s;
    position: relative;
}
.db-hm-cell:hover {
    box-shadow: 0 0 0 2px #e6007e inset;
    z-index: 2;
}
.db-hm-val {
    font-size: 10px; font-weight: 700; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.2);
    pointer-events: none;
}
.db-hm-legend {
    display: flex; align-items: center; gap: 3px;
    flex-shrink: 0;
}
.db-hm-leg-box { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.04); }
.db-hm-leg-label { font-size: 10px; color: #9ca3af; margin: 0 2px; }

/* 히트맵 툴팁 */
.db-hm-tooltip {
    position: fixed;
    z-index: 999;
    background: #1f2937;
    color: #fff;
    font-size: 11.5px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ═══ 바 차트 (부서) ═══ */
.db-bar-list { display: flex; flex-direction: column; gap: 5px; }
.db-bar-row { display: flex; align-items: center; gap: 8px; height: 26px; }
.db-bar-label {
    width: 72px; font-size: 11.5px; font-weight: 500; color: #4b5563;
    text-align: right; flex-shrink: 0;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.db-bar-track { flex: 1; height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.db-bar-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg,#e6007e,#ff6b9d);
    transition: width .5s cubic-bezier(.25,.8,.25,1); min-width: 3px;
}
.db-bar-fill-dept { background: linear-gradient(90deg,#6366f1,#a78bfa); }
.db-bar-val { width: 26px; font-size: 11px; font-weight: 700; color: #374151; text-align: right; flex-shrink: 0; }

/* ═══ 고득점 제안 ═══ */
.db-card-top { margin-bottom: 0; }
.db-link-more { font-size: 12px; font-weight: 600; color: #e6007e; text-decoration: none; white-space: nowrap; }
.db-link-more:hover { text-decoration: underline; }

.db-top-list { display: flex; flex-direction: column; }
.db-top-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 8px; border-bottom: 1px solid #f5f5f7;
    text-decoration: none; color: inherit; transition: background .12s; cursor: pointer;
}
.db-top-row:last-child { border-bottom: none; }
.db-top-row:hover { background: #fafafe; }
.db-top-rank {
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; background: #f3f4f6;
    font-size: 11px; font-weight: 700; color: #6b7280; flex-shrink: 0;
}
.db-top-grade {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.db-tg-s { background: rgba(230,0,126,.1); color: #e6007e; }
.db-tg-a { background: rgba(245,158,11,.1); color: #d97706; }
.db-tg-b { background: rgba(59,130,246,.1); color: #2563eb; }
.db-tg-c { background: rgba(107,114,128,.08); color: #6b7280; }
.db-tg-d { background: rgba(209,213,219,.15); color: #9ca3af; }
.db-top-score { font-size: 12px; font-weight: 700; color: #374151; width: 44px; text-align: right; flex-shrink: 0; }
.db-top-body { flex: 1; min-width: 0; }
.db-top-tags { display: flex; gap: 4px; margin-bottom: 3px; flex-wrap: wrap; }
.db-top-tag { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: rgba(230,0,126,.06); color: #e6007e; }
.db-top-tag-muted { background: #f3f4f6; color: #6b7280; }
.db-top-text {
    font-size: 12.5px; color: #4b5563; line-height: 1.55;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.db-top-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; min-width: 50px; }
.db-top-meta span { font-size: 10.5px; color: #b0b5bf; }

.db-empty { text-align: center; font-size: 12px; color: #d1d5db; padding: 16px 0; }

/* ═══ 반응형 ═══ */
@media (max-width: 1024px) {
    .db-kpi-grid { grid-template-columns: repeat(2,1fr); }
    .db-section-trend, .db-section-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .db-wrap { padding: 16px 14px; }
    .db-kpi-grid { grid-template-columns: 1fr; }
    .db-skel-kpis { grid-template-columns: 1fr; }
    .db-skel-charts { grid-template-columns: 1fr; }
    .db-top-score { display: none; }
    .db-date-header { gap: 6px; }
    .db-date-today { font-size: 13px; }
}
