﻿/* === progress === */
/* ════════ Progress Tab — New Design ════════ */

.pg-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ── Hero ── */
.pg-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.pg-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}
.pg-hero-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}
.pg-hero-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  color: #fff;
  min-width: 260px;
}
.pg-hero-banner-hl  { font-weight: 700; font-size: 0.95rem; }
.pg-hero-banner-sm  { font-size: 0.78rem; opacity: 0.88; margin-top: 3px; }
.pg-hero-mascot     { font-size: 2.2rem; }

/* ── 5 Stat cards ── */
.pg-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}
.pg-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}
.pg-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.pg-stat-lbl { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 2px; }
.pg-stat-val { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.pg-stat-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.pg-stat-sub.ok   { color: var(--success); }
.pg-stat-sub.warn { color: var(--warning); }

/* ── Middle row (3 cols) ── */
.pg-mid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

/* ── Bottom row (4 cols) ── */
.pg-bottom {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

/* ── Shared card base ── */
.pg-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}
.pg-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.pg-card-title { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.pg-card-sub   { font-size: 0.75rem; color: var(--text-muted); }
.pg-card-link  { font-size: 0.75rem; color: var(--primary); cursor: pointer; }
.pg-card-link:hover { text-decoration: underline; }
.pg-empty { text-align: center; padding: 20px 0; color: var(--text-muted); font-size: 0.85rem; }

/* ── Goals ── */
.pg-goal-row   { margin-bottom: var(--space-3); }
.pg-goal-lbl   { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text); margin-bottom: 6px; }
.pg-goal-track { height: 8px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.pg-goal-fill  { height: 100%; border-radius: var(--radius-pill); transition: width 0.5s; }
.pg-goal-fill.new-w  { background: #6366F1; }
.pg-goal-fill.review { background: #10B981; }
.pg-goal-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: var(--space-3);
  cursor: pointer;
  transition: var(--transition);
}
.pg-goal-tip:hover { background: #FEF3C7; }
.pg-goal-done { background: var(--success-light); border-color: var(--success); cursor: default; }
.pg-goal-done:hover { background: var(--success-light); }
.pg-goal-tip-txt { flex: 1; font-size: 0.78rem; color: var(--text); }
.pg-goal-tip-arr { color: var(--warning); font-size: 1rem; }

/* ── Heatmap ── */
.pg-hm-grid {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.pg-hm-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 0;
}
.pg-hm-lbl {
  height: 15px;
  font-size: 0.62rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.pg-hm-cols { display: flex; gap: 3px; flex: 1; }
.pg-hm-col  { display: flex; flex-direction: column; gap: 3px; }
.pg-hm-cell {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: var(--border);
  flex-shrink: 0;
}
.pg-hm-cell.l1     { background: #BBF7D0; }
.pg-hm-cell.l2     { background: #4ADE80; }
.pg-hm-cell.l3     { background: #16A34A; }
.pg-hm-cell.l4     { background: #065F46; }
.pg-hm-future      { opacity: 0.2; }
.pg-hm-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ── Donut ── */
.pg-donut-body {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.pg-donut-wrap {
  position: relative;
  flex-shrink: 0;
}
.pg-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pg-donut-val  { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.pg-donut-lbl  { font-size: 0.65rem; color: var(--text-muted); }
.pg-legend     { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.pg-legend-row { display: flex; align-items: center; gap: 7px; }
.pg-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pg-legend-name  { flex: 1; font-size: 0.76rem; color: var(--text); }
.pg-legend-count { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.pg-donut-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
  line-height: 1.4;
}

/* ── Topic progress ── */
.pg-topic-row       { margin-bottom: 10px; }
.pg-topic-row:last-child { margin-bottom: 0; }
.pg-topic-row-hd    { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pg-topic-emoji     { font-size: 0.9rem; }
.pg-topic-name      { flex: 1; font-size: 0.8rem; color: var(--text); font-weight: 500; }
.pg-topic-pct       { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.pg-topic-cnt       { font-size: 0.7rem; color: var(--text-muted); }
.pg-topic-track     { height: 6px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.pg-topic-fill      { height: 100%; border-radius: var(--radius-pill); transition: width 0.6s; }

/* ── Urgent words ── */
.pg-urgent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.pg-urgent-row:last-child { border-bottom: none; }
.pg-urgent-info  { flex: 1; min-width: 0; }
.pg-urgent-word  { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text); }
.pg-urgent-phon  { font-size: 0.7rem; color: var(--text-muted); }
.pg-urgent-fail  { font-size: 0.72rem; color: var(--danger); font-weight: 600; white-space: nowrap; }
.pg-urgent-btn {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}
.pg-urgent-btn:hover { background: var(--primary); color: #fff; }

/* ── Performance ── */
.pg-perf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.pg-perf-row:last-child { border-bottom: none; }
.pg-perf-lbl  { flex: 1; font-size: 0.8rem; color: var(--text); }
.pg-perf-ring { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pg-perf-pct  {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Badges ── */
.pg-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.pg-badge-row:last-child { border-bottom: none; }
.pg-badge-locked { opacity: 0.4; filter: grayscale(1); }
.pg-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.pg-badge-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.pg-badge-desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }

/* ── Memory Levels ── */
.pg-memlevels { grid-column: 1 / -1; }
.pg-ml-row {
  display: grid;
  grid-template-columns: 20px 90px 1fr 40px 38px;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.pg-ml-row:last-child { border-bottom: none; }
.pg-ml-icon  { font-size: 1rem; text-align: center; }
.pg-ml-name  { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.pg-ml-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.pg-ml-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}
.pg-ml-count { font-size: 0.78rem; font-weight: 700; color: var(--text); text-align: right; }
.pg-ml-pct   { font-size: 0.72rem; color: var(--text-muted); text-align: right; }

/* ── Hero CTA ── */
.pg-hero-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  min-height: 38px;
  padding: 0 18px;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.pg-hero-cta:hover         { transform: translateY(-1px); box-shadow: var(--shadow); }
.pg-hero-cta--ok           { background: rgba(255,255,255,.85); color: #059669; }

/* ── Stat enhancements ── */
.pg-stat--action { cursor: pointer; transition: var(--transition); }
.pg-stat--action:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--warning); }
.pg-stat-sub.muted    { color: var(--text-light); }
.pg-stat-nodataval    { font-size: 1.2rem; color: var(--text-muted); }

/* ── Insights card ── */
.pg-insights-list { display: flex; flex-direction: column; gap: 8px; }
.pg-insight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text);
}
.pg-insight-icon  { font-size: 1.2rem; flex-shrink: 0; }
.pg-insight-body  { flex: 1; font-size: 0.82rem; color: var(--text); }
.pg-insight-btn {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 12px;
  border: 1.5px solid var(--icolor, var(--primary));
  color: var(--icolor, var(--primary));
  background: transparent;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.pg-insight-btn:hover { opacity: .75; }

/* ── Perf chart (bar) ── */
.pg-perf-nums {
  display: flex;
  gap: var(--space-3);
  margin-bottom: 16px;
}
.pg-perf-num { flex: 1; text-align: center; }
.pg-perf-num-val { font-size: 1.3rem; font-weight: 800; color: var(--text); line-height: 1; }
.pg-perf-num-lbl { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; }
.pg-perf-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
  padding: 4px 0 0;
}
.pg-perf-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 2px;
}
.pg-perf-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
}
.pg-perf-bar-lbl  { font-size: 0.58rem; color: var(--text-muted); }
.pg-perf-chart-lbl { font-size: 0.68rem; color: var(--text-muted); text-align: center; margin-top: 4px; }
.pg-perf-empty    { font-size: 0.8rem; color: var(--text-muted); text-align: center; padding: 16px 0; }

