/* Dashboard v4 */

/* Welcome */
.dash-welcome { margin-bottom: var(--space-10); animation: fadeInUp var(--duration-enter) var(--ease-out) both; }
.dash-welcome-text h1 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); color: var(--text-primary); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.dash-welcome-text p { font-size: var(--fs-base); color: var(--text-tertiary); margin-top: var(--space-1_5); font-weight: var(--fw-regular); }

/* Stats */
.dash-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-4); margin-bottom: var(--space-10); }
.dash-stat-card {
  background: var(--bg-elevated); border-radius: var(--radius-xl); padding: var(--space-5);
  border: 0.5px solid var(--border-color); box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: var(--space-4);
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative; overflow: hidden;
  animation: fadeInUp var(--duration-enter) var(--ease-out) both;
}
.dash-stat-card:nth-child(1) { animation-delay: 0ms; }
.dash-stat-card:nth-child(2) { animation-delay: 60ms; }
.dash-stat-card:nth-child(3) { animation-delay: 120ms; }
.dash-stat-card:nth-child(4) { animation-delay: 180ms; }
.dash-stat-card::before { content:''; position:absolute; inset:0; background:linear-gradient(135deg,transparent 50%,rgba(0,113,227,0.02) 100%); opacity:0; transition:opacity var(--duration-normal); pointer-events:none; }
.dash-stat-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.dash-stat-card:hover::before { opacity: 1; }
.dash-stat-card:active { transform: translateY(0) scale(0.99); }
.dash-stat-icon { width:48px; height:48px; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:center; font-size:var(--icon-lg); flex-shrink:0; position:relative; }
.dash-stat-icon::after { content:''; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 1px 0 rgba(255,255,255,0.3); pointer-events:none; }
.dash-stat-body { display:flex; flex-direction:column; gap:2px; }
.dash-stat-value { font-size:28px; font-weight:var(--fw-bold); color:var(--text-primary); letter-spacing:var(--tracking-tight); line-height:var(--lh-tight); font-variant-numeric:tabular-nums; }
.dash-stat-label { font-size:var(--fs-xs); color:var(--text-tertiary); font-weight:var(--fw-medium); letter-spacing:0.01em; }

/* Section Title */
.dash-section-title { font-size:var(--fs-lg); font-weight:var(--fw-bold); color:var(--text-primary); letter-spacing:var(--tracking-snug); margin-bottom:var(--space-4); }

/* Modules */
.dash-modules { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--space-3); margin-bottom:var(--space-10); }
.dash-module-card {
  background:var(--bg-elevated); border-radius:var(--radius-lg); padding:var(--space-4) var(--space-5);
  border:0.5px solid var(--border-color); box-shadow:var(--shadow-xs);
  display:flex; align-items:center; gap:var(--space-3);
  text-decoration:none; color:inherit;
  transition:all var(--duration-normal) var(--ease-spring);
  position:relative; overflow:hidden;
  animation: fadeInUp var(--duration-enter) var(--ease-out) both;
}
.dash-module-card:nth-child(1) { animation-delay: 100ms; }
.dash-module-card:nth-child(2) { animation-delay: 140ms; }
.dash-module-card:nth-child(3) { animation-delay: 180ms; }
.dash-module-card:nth-child(4) { animation-delay: 220ms; }
.dash-module-card:nth-child(5) { animation-delay: 260ms; }
.dash-module-card:nth-child(6) { animation-delay: 300ms; }
.dash-module-card:nth-child(7) { animation-delay: 340ms; }
.dash-module-card:nth-child(8) { animation-delay: 380ms; }
.dash-module-card:nth-child(9) { animation-delay: 420ms; }
.dash-module-card::before { content:''; position:absolute; inset:0; opacity:0; transition:opacity var(--duration-normal); pointer-events:none; }
.dash-module-card:nth-child(1)::before { background:linear-gradient(135deg,rgba(0,113,227,0.04),transparent 60%); }
.dash-module-card:nth-child(2)::before { background:linear-gradient(135deg,rgba(255,149,0,0.04),transparent 60%); }
.dash-module-card:nth-child(3)::before { background:linear-gradient(135deg,rgba(48,209,88,0.04),transparent 60%); }
.dash-module-card:nth-child(4)::before { background:linear-gradient(135deg,rgba(88,86,214,0.04),transparent 60%); }
.dash-module-card:nth-child(5)::before { background:linear-gradient(135deg,rgba(255,69,58,0.04),transparent 60%); }
.dash-module-card:nth-child(6)::before { background:linear-gradient(135deg,rgba(100,210,255,0.04),transparent 60%); }
.dash-module-card:nth-child(7)::before { background:linear-gradient(135deg,rgba(255,149,0,0.03),transparent 60%); }
.dash-module-card:nth-child(8)::before { background:linear-gradient(135deg,rgba(48,209,88,0.03),transparent 60%); }
.dash-module-card:nth-child(9)::before { background:linear-gradient(135deg,rgba(175,82,222,0.04),transparent 60%); }
.dash-module-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); border-color:rgba(0,0,0,0.08); }
.dash-module-card:hover::before { opacity:1; }
.dash-module-card:active { transform:scale(0.98) translateY(0); transition-duration:80ms; }
[data-theme="dark"] .dash-module-card:hover { border-color:rgba(255,255,255,0.12); }
.dash-module-icon { width:42px; height:42px; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:center; font-size:var(--fs-md); color:#fff; flex-shrink:0; position:relative; }
.dash-module-icon::after { content:''; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 3px rgba(0,0,0,0.12); pointer-events:none; }
.dash-module-info { flex:1; min-width:0; }
.dash-module-info h3 { font-size:var(--fs-sm); font-weight:var(--fw-semi); color:var(--text-primary); letter-spacing:-0.01em; }
.dash-module-info p { font-size:var(--fs-xs); color:var(--text-tertiary); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:var(--fw-regular); }
.dash-module-arrow { color:var(--gray-300); font-size:var(--icon-xs); flex-shrink:0; transition:all var(--duration-fast); }
.dash-module-card:hover .dash-module-arrow { color:var(--primary-color); transform:translateX(3px); }

/* Activity */
.dash-activity-card { background:var(--bg-elevated); border-radius:var(--radius-xl); border:0.5px solid var(--border-color); box-shadow:var(--shadow-card); overflow:hidden; animation: fadeInUp var(--duration-enter) var(--ease-out) 500ms both; }
.dash-activity-list { max-height:380px; overflow-y:auto; }
.dash-activity-list::-webkit-scrollbar { width:3px; }
.dash-activity-list::-webkit-scrollbar-track { background:transparent; }
.dash-activity-list::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.06); border-radius:100px; }
.dash-activity-loading { padding:var(--space-10); text-align:center; color:var(--text-tertiary); font-size:var(--fs-sm); }
.dash-activity-item { display:flex; align-items:flex-start; gap:var(--space-3); padding:var(--space-4) var(--space-5); border-bottom:0.5px solid var(--divider); transition:background var(--duration-fast); }
.dash-activity-item:last-child { border-bottom:none; }
.dash-activity-item:hover { background:rgba(0,0,0,0.015); }
[data-theme="dark"] .dash-activity-item:hover { background:rgba(255,255,255,0.03); }
.dash-activity-dot { width:8px; height:8px; border-radius:var(--radius-full); margin-top:6px; flex-shrink:0; box-shadow:0 0 0 2.5px var(--bg-elevated); }
.dash-activity-dot.blue { background:var(--primary-color); }
.dash-activity-dot.green { background:var(--success-color); }
.dash-activity-dot.orange { background:var(--warning-color); }
.dash-activity-dot.purple { background:var(--secondary-color); }
.dash-activity-body { flex:1; min-width:0; }
.dash-activity-text { font-size:var(--fs-sm); color:var(--text-primary); line-height:var(--lh-snug); }
.dash-activity-text strong { font-weight:var(--fw-semi); }
.dash-activity-time { font-size:var(--fs-xs); color:var(--text-tertiary); margin-top:3px; font-variant-numeric:tabular-nums; }
.dash-activity-empty { padding:var(--space-12); text-align:center; color:var(--text-tertiary); font-size:var(--fs-sm); }

/* Responsive */
@media(max-width:1280px) { .dash-stats{grid-template-columns:repeat(2,1fr)} }
@media(max-width:1100px) { .dash-modules{grid-template-columns:repeat(2,1fr)} }
@media(max-width:640px) { .dash-stats{grid-template-columns:1fr} .dash-modules{grid-template-columns:1fr} .dash-welcome-text h1{font-size:var(--fs-xl)} }

/* Dark Mode */
.maint-body[data-theme="dark"] .dash-stat-card { box-shadow:var(--shadow-card); }
.maint-body[data-theme="dark"] .dash-stat-card:hover { box-shadow:var(--shadow-card-hover); }
.maint-body[data-theme="dark"] .dash-module-card { box-shadow:var(--shadow-card); }
.maint-body[data-theme="dark"] .dash-module-card:hover { box-shadow:var(--shadow-card-hover); }
.maint-body[data-theme="dark"] .dash-activity-card { box-shadow:var(--shadow-card); }
.maint-body[data-theme="dark"] .dash-activity-dot { box-shadow:0 0 0 2.5px var(--bg-elevated); }
