/* dashboard.css — Progress Dashboard */
.dash-hero { padding: 2.5rem 0 2rem; background: linear-gradient(135deg, rgba(6,182,212,0.08),rgba(139,92,246,0.06)); border-bottom: 1px solid var(--color-border-subtle); text-align:center; }
.dash-hero h1 { font-family:'Cabinet Grotesk',sans-serif; font-size:clamp(1.8rem,4vw,2.6rem); font-weight:800; background:linear-gradient(135deg,#06b6d4,#8b5cf6); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; margin:0 0 0.4rem; }
.dash-hero p { color:var(--color-text-faint); font-size:0.9rem; }
.dash-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:1.25rem; padding:2rem 0; }
.dash-card { background:var(--glass-bg); backdrop-filter:blur(12px); border:1px solid var(--glass-border); border-radius:12px; padding:1.25rem; }
.dash-card h3 { font-size:0.78rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--color-text-faint); margin:0 0 1rem; }
.kpi-row { display:grid; grid-template-columns:repeat(4,1fr); gap:0.75rem; margin-bottom:1.5rem; }
.kpi-mini { background:var(--color-surface-2); border:1px solid var(--glass-border); border-radius:8px; padding:0.85rem; text-align:center; }
.kpi-mini .val { font-family:'JetBrains Mono',monospace; font-size:1.4rem; font-weight:700; }
.kpi-mini .lbl { font-size:0.7rem; color:var(--color-text-faint); text-transform:uppercase; letter-spacing:0.06em; margin-top:0.2rem; }
.kpi-mini:nth-child(1) .val{color:#06b6d4} .kpi-mini:nth-child(2) .val{color:#22c55e} .kpi-mini:nth-child(3) .val{color:#8b5cf6} .kpi-mini:nth-child(4) .val{color:#f59e0b}
/* Heatmap */
.heatmap-wrap { overflow-x:auto; }
.heatmap { display:grid; grid-template-rows:repeat(7,12px); grid-auto-flow:column; gap:3px; }
.hm-cell { width:12px; height:12px; border-radius:2px; background:var(--color-border-subtle); transition:all 0.2s; cursor:default; }
.hm-cell:hover { transform:scale(1.3); z-index:1; }
.hm-0{background:var(--color-border-subtle)} .hm-1{background:rgba(6,182,212,0.25)} .hm-2{background:rgba(6,182,212,0.5)} .hm-3{background:rgba(6,182,212,0.75)} .hm-4{background:#06b6d4}
.hm-months { display:flex; gap:0; margin-bottom:0.25rem; }
.hm-month { font-size:0.65rem; color:var(--color-text-faint); min-width:52px; }
.hm-days { display:flex; flex-direction:column; gap:3px; margin-right:4px; }
.hm-day { font-size:0.6rem; color:var(--color-text-faint); height:12px; display:flex; align-items:center; }
.heatmap-legend { display:flex; align-items:center; gap:0.3rem; margin-top:0.5rem; font-size:0.7rem; color:var(--color-text-faint); }
.hm-leg-cell { width:10px; height:10px; border-radius:2px; }
/* Charts */
canvas { max-width:100%; }
.chart-container { position:relative; height:200px; }
.chart-container-sm { position:relative; height:160px; }
/* Skill bars */
.skill-bars { display:flex; flex-direction:column; gap:0.7rem; }
.sb-row { display:flex; flex-direction:column; gap:0.3rem; }
.sb-label { display:flex; justify-content:space-between; font-size:0.82rem; color:var(--color-text-muted); }
.sb-bar-bg { height:6px; background:var(--glass-border); border-radius:3px; overflow:hidden; }
.sb-bar-fg { height:100%; border-radius:3px; transition:width 1s ease; }
@media(max-width:768px){.kpi-row{grid-template-columns:repeat(2,1fr)}}

@media(max-width:600px){
  .kpi-row{grid-template-columns:repeat(2,1fr)}
  .dash-grid{grid-template-columns:1fr}
  .chart-container{height:160px}
  .chart-container-sm{height:140px}
}
@media(max-width:400px){
  .kpi-row{grid-template-columns:1fr 1fr}
  .kpi-mini .val{font-size:1.2rem}
}

/* ─── Dynamic Handle Input ─────────────────────────────────── */
.dash-handle-wrap {
  margin: 1.25rem auto 0;
  max-width: 520px;
}
.dash-handle-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.dh-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.dh-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--color-text-faint);
  pointer-events: none;
}
#dash-handle {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 2.4rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
#dash-handle:focus { border-color: rgba(6,182,212,0.5); }
#dash-handle::placeholder { color: var(--color-text-faint); }
.dh-clear {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s;
}
.dh-clear:hover { color: var(--color-text); background: var(--glass-border); }
.dh-load-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.dh-load-btn:hover { opacity: 0.88; }
.dh-load-btn:active { opacity: 0.75; }
.dh-error {
  color: #f87171;
  font-size: 0.82rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
  text-align: left;
}

/* ─── Dash user card ──────────────────────────────────────── */
.dash-user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem auto 0;
  max-width: 520px;
  background: var(--color-surface-2);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  text-align: left;
}
.duc-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  object-fit: cover;
  flex-shrink: 0;
}
.duc-info { flex: 1; }
.duc-handle { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1rem; }
.duc-rank   { font-size: 0.78rem; opacity: 0.85; text-transform: capitalize; }
.duc-stats  { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--color-text-faint); }
.duc-stats span strong { color: var(--color-text); margin-left: 0.3rem; }

/* ─── Loading overlay ─────────────────────────────────────── */
.dash-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--color-text-faint);
  font-size: 0.9rem;
}
.dl-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(6,182,212,0.2);
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Quick stats rows ────────────────────────────────────── */
.qs-row { display: flex; justify-content: space-between; color: var(--color-text-faint); }
.qs-row strong { color: var(--color-text); }

/* ─── Card sub-title ──────────────────────────────────────── */
.dc-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dc-header h3 { margin: 0; }
.dc-sub { font-size: 0.72rem; color: var(--color-text-faint); font-weight: 400; }

@media(max-width:600px) {
  .dash-handle-input-row { flex-direction: column; align-items: stretch; }
  .dh-load-btn { width: 100%; }
  .dash-user-card { flex-direction: column; text-align: center; align-items: center; }
  .duc-stats { justify-content: center; }
}
