/* ── Welcome row ─────────────────────────────────────────────────────────── */
.welcome-row {
  padding-top: 32px;
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

.welcome-row strong {
  color: var(--primary);
  font-weight: 800;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-top: 36px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.045em;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text) 0%, #4338CA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  border-top: 3px solid var(--border);
  box-shadow: var(--shadow-card);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.stat-value {
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.05em;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-completed {
  background: var(--gradient-card-green);
  border-top-color: #10B981;
  border-left-color: rgba(16,185,129,0.15);
  border-right-color: rgba(16,185,129,0.15);
  border-bottom-color: rgba(16,185,129,0.15);
}
.stat-completed .stat-value { color: #059669; }

.stat-processing {
  background: var(--gradient-card-amber);
  border-top-color: #F59E0B;
  border-left-color: rgba(245,158,11,0.15);
  border-right-color: rgba(245,158,11,0.15);
  border-bottom-color: rgba(245,158,11,0.15);
}
.stat-processing .stat-value { color: #D97706; }

.stat-failed {
  background: var(--gradient-card-red);
  border-top-color: #EF4444;
  border-left-color: rgba(239,68,68,0.15);
  border-right-color: rgba(239,68,68,0.15);
  border-bottom-color: rgba(239,68,68,0.15);
}
.stat-failed .stat-value { color: #DC2626; }

.stat-score {
  background: var(--gradient-card-purple);
  border-top-color: var(--primary);
  border-left-color: rgba(99,91,255,0.15);
  border-right-color: rgba(99,91,255,0.15);
  border-bottom-color: rgba(99,91,255,0.15);
}
.stat-score .stat-value {
  color: var(--primary);
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-tab {
  background: var(--bg-subtle);
  border: none;
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s ease;
  letter-spacing: -0.01em;
}

.filter-tab:hover:not(.active) {
  background: var(--bg-subtle-hover);
  color: var(--text);
}

.filter-tab.active {
  background: #635BFF;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99,91,255,0.25);
}

/* ── Annotation list items ───────────────────────────────────────────────── */
.annotation-item {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
  cursor: default;
}

.annotation-item:hover {
  box-shadow: 0 8px 24px rgba(99,91,255,0.10), 0 2px 6px rgba(99,91,255,0.08);
  border-color: rgba(99,91,255,0.22);
  transform: translateY(-1px);
  background: var(--bg-hover);
}

.annotation-left  { flex: 1; min-width: 0; }
.annotation-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; position: relative; }

.annotation-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.annotation-id     { font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: 0; }

.annotation-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 600px;
  margin-bottom: 6px;
}

.annotation-meta { font-size: 12px; color: var(--text-muted); }

.annotation-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.04em;
}

.score-unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ── Type badges ─────────────────────────────────────────────────────────── */
.type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.01em;
}

.type-code        { background: #EEECFF; color: #4338CA; }
.type-translation { background: #ECFDF5; color: #065F46; }
.type-document    { background: #FFFBEB; color: #92400E; }
.type-ai          { background: #EFF6FF; color: #1D4ED8; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.01em;
}

.status-completed  { background: #ECFDF5; color: #065F46; }
.status-processing { background: #FFFBEB; color: #92400E; }
.status-failed     { background: var(--red-light); color: #991B1B; }
.status-pending    { background: var(--bg-subtle); color: var(--text-muted); }

/* ── Detail hint (hover) ─────────────────────────────────────────────────── */
.detail-hint {
  font-size: 13px;
  font-weight: 500;
  color: #635BFF;
  opacity: 0;
  transition: opacity 0.18s;
  white-space: nowrap;
  font-family: system-ui, -apple-system, sans-serif;
}

.annotation-item:hover .detail-hint { opacity: 1; }

/* ── Retry hint button (실패 항목 hover 시 표시) ───────────────────────── */
.retry-hint-btn {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #EF4444;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.annotation-item:hover .retry-hint-btn { opacity: 1; }
.retry-hint-btn:hover { background: #DC2626; }

/* ── Analytics Charts ────────────────────────────────────────────────────── */
.charts-section {
  margin-bottom: 28px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 16px;
}

.chart-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.chart-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chart-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.chart-wrap {
  height: 160px;
  position: relative;
}

.chart-wrap-sm {
  height: 180px;
}

.chart-no-data {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-msg {
  text-align: center;
  padding: 56px 0;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

/* 다크모드: 타입/상태 배지 색상 */
:root[data-theme="dark"] .type-code        { background: rgba(99,91,255,0.2);  color: #A5B4FC; }
:root[data-theme="dark"] .type-translation { background: rgba(16,185,129,0.18); color: #6EE7B7; }
:root[data-theme="dark"] .type-document    { background: rgba(245,158,11,0.18); color: #FCD34D; }
:root[data-theme="dark"] .type-ai          { background: rgba(37,99,235,0.2);   color: #93C5FD; }
:root[data-theme="dark"] .status-completed  { background: rgba(16,185,129,0.18); color: #6EE7B7; }
:root[data-theme="dark"] .status-processing { background: rgba(245,158,11,0.18); color: #FCD34D; }
:root[data-theme="dark"] .status-failed     { background: rgba(239,68,68,0.18);  color: #FCA5A5; }

/* ───────────────────────────────────────────────────────────────────────────
   반응형 — 대시보드 / 상세
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .stats-grid  { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .welcome-row { flex-wrap: wrap; gap: 10px; }
  .filter-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 4px; }
  .annotation-item { flex-wrap: wrap; row-gap: 8px; }
}
