/* =====================================================
   INSPIRIGENCE SALES COMMAND CENTER
   Premium Dashboard Styles
   ===================================================== */

/* ─── CSS Variables ─── */
:root {
  --violet: #7C3AED;
  --violet-light: #A78BFA;
  --violet-glow: rgba(124, 58, 237, 0.35);
  --gold: #FFD700;
  --gold-soft: rgba(255, 215, 0, 0.12);
  --gold-glow: rgba(255, 215, 0, 0.3);
  --bg-base: #050810;
  --bg-surface: #0F1629;
  --bg-card: rgba(15, 22, 41, 0.6);
  --bg-card-hover: rgba(20, 28, 52, 0.8);
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-glow: rgba(124, 58, 237, 0.2);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #475569;
}

html:not(.dark) {
  --bg-base: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
}

/* ─── Base ─── */
body {
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Custom Scrollbar ─── */
.scrollbar-thin::-webkit-scrollbar { width: 4px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.2); border-radius: 99px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.4); }

/* ─── Gradient Mesh Background ─── */
.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}
.mesh-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
  top: -200px; left: -100px;
  animation-delay: 0s;
}
.mesh-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
  bottom: -150px; right: -100px;
  animation-delay: -7s;
}
.mesh-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}
.noise-overlay {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.5;
}

html:not(.dark) .mesh-orb { opacity: 0.2; }
html:not(.dark) .noise-overlay { opacity: 0.02; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ─── Sidebar Glass ─── */
.sidebar-glass {
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}
html:not(.dark) .sidebar-glass {
  background: rgba(255, 255, 255, 0.85);
}

/* ─── Navigation Items ─── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.nav-item:hover {
  color: #CBD5E1;
  background: rgba(124, 58, 237, 0.06);
}
.nav-item.active {
  color: #FFFFFF;
  background: rgba(124, 58, 237, 0.12);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--violet);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--violet-glow);
}
html:not(.dark) .nav-item { color: #9CA3AF; }
html:not(.dark) .nav-item:hover { color: #374151; background: rgba(124, 58, 237, 0.05); }
html:not(.dark) .nav-item.active { color: #7C3AED; background: rgba(124, 58, 237, 0.08); }

/* ─── Glass Card ─── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.05);
}

/* ─── Metric Cards ─── */
.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: cardEntrance 0.6s ease backwards;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.1);
}
.metric-card:hover::before { opacity: 1; }
.metric-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2) { animation-delay: 0.1s; }
.metric-card:nth-child(3) { animation-delay: 0.15s; }
.metric-card:nth-child(4) { animation-delay: 0.2s; }
.metric-card:nth-child(5) { animation-delay: 0.25s; }
.metric-card:nth-child(6) { animation-delay: 0.3s; }
.metric-card:nth-child(7) { animation-delay: 0.35s; }

.metric-card.gold-glow {
  border-color: rgba(255, 215, 0, 0.15);
}
.metric-card.gold-glow:hover {
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.08);
}

.metric-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.metric-value {
  font-family: 'Manrope', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.metric-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}
.metric-trend.up { color: #10B981; background: rgba(16, 185, 129, 0.1); }
.metric-trend.down { color: #EF4444; background: rgba(239, 68, 68, 0.1); }
.metric-trend.flat { color: #94A3B8; background: rgba(148, 163, 184, 0.1); }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Chart Toggles ─── */
.chart-toggle {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s;
  border: 1px solid transparent;
}
.chart-toggle:hover { color: var(--text-secondary); }
.chart-toggle.active {
  color: var(--violet);
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.2);
}

/* ─── Period Buttons ─── */
.period-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all 0.25s;
}
.period-btn:hover { color: var(--text-secondary); border-color: var(--border-glow); }
.period-btn.active {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--violet), #6D28D9);
  border-color: transparent;
  box-shadow: 0 4px 15px var(--violet-glow);
}

/* ─── Coaching Filters ─── */
.coaching-filter {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}
.coaching-filter:hover { border-color: var(--border-glow); color: var(--text-secondary); }
.coaching-filter.active {
  color: var(--violet-light);
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
}

/* ─── Page Sections ─── */
.page-section { display: none; animation: pageFadeIn 0.4s ease; }
.page-section.active { display: block; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Podium ─── */
.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 140px;
  animation: podiumRise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.podium-slot[data-rank="1"] { animation-delay: 0.3s; }
.podium-slot[data-rank="2"] { animation-delay: 0.15s; }
.podium-slot[data-rank="3"] { animation-delay: 0.45s; }

@keyframes podiumRise {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.podium-avatar { position: relative; text-align: center; }
.crown-icon { margin-bottom: -8px; animation: crownBounce 2s ease-in-out infinite; }
@keyframes crownBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.avatar-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  margin: 0 auto;
}
.gold-ring { border-color: var(--gold); box-shadow: 0 0 20px var(--gold-glow); }
.silver-ring { border-color: #C0C0C0; box-shadow: 0 0 15px rgba(192, 192, 192, 0.3); }
.bronze-ring { border-color: #CD7F32; box-shadow: 0 0 15px rgba(205, 127, 50, 0.3); }

.avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-surface), rgba(124, 58, 237, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.podium-badge {
  position: absolute;
  bottom: -4px; right: 12px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #111;
}
.gold-badge { background: var(--gold); }
.silver-badge { background: #C0C0C0; }
.bronze-badge { background: #CD7F32; }

.podium-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); text-align: center; }
.podium-score { font-size: 0.7rem; font-weight: 700; color: var(--violet-light); }

.podium-bar {
  width: 100%;
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
}
.gold-bar { background: linear-gradient(180deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%); border: 1px solid rgba(255, 215, 0, 0.15); border-bottom: none; }
.silver-bar { background: linear-gradient(180deg, rgba(192, 192, 192, 0.15) 0%, rgba(192, 192, 192, 0.03) 100%); border: 1px solid rgba(192, 192, 192, 0.1); border-bottom: none; }
.bronze-bar { background: linear-gradient(180deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.03) 100%); border: 1px solid rgba(205, 127, 50, 0.1); border-bottom: none; }

/* ─── Funnel ─── */
.funnel-stage {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s;
  animation: funnelSlide 0.5s ease backwards;
}
.funnel-stage:nth-child(1) { animation-delay: 0.05s; }
.funnel-stage:nth-child(2) { animation-delay: 0.1s; }
.funnel-stage:nth-child(3) { animation-delay: 0.15s; }
.funnel-stage:nth-child(4) { animation-delay: 0.2s; }
.funnel-stage:nth-child(5) { animation-delay: 0.25s; }
.funnel-stage:nth-child(6) { animation-delay: 0.3s; }

.funnel-stage.bottleneck {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
  box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.03);
}
.funnel-stage.critical {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
  box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.03);
}

@keyframes funnelSlide {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.funnel-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  flex: 1;
}
.funnel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--violet), var(--violet-light));
}
.funnel-stage.bottleneck .funnel-bar-fill {
  background: linear-gradient(90deg, #F59E0B, #FCD34D);
}
.funnel-stage.critical .funnel-bar-fill {
  background: linear-gradient(90deg, #EF4444, #F87171);
}

/* ─── Pipeline Board ─── */
.pipeline-column {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  min-height: 200px;
}
.pipeline-column-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pipeline-deal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.pipeline-deal:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.pipeline-deal.aging-warning { border-left: 3px solid #F59E0B; }
.pipeline-deal.aging-critical { border-left: 3px solid #EF4444; }

/* ─── Team Cards ─── */
.team-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardEntrance 0.6s ease backwards;
  position: relative;
  overflow: hidden;
}
.team-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.1);
}
.team-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.team-card:hover::after { opacity: 1; }

/* Score Ring */
.score-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-ring svg {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.score-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 4;
}
.score-ring .ring-fill {
  fill: none;
  stroke: var(--violet);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 201;
  stroke-dashoffset: 201;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-ring .ring-value {
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  z-index: 1;
}

/* ─── Coaching Feed ─── */
.coaching-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  animation: coachingSlide 0.4s ease backwards;
  transition: border-color 0.2s;
}
.coaching-item:hover { border-color: var(--border-glow); }
.coaching-item.morning { border-left: 3px solid #F59E0B; }
.coaching-item.afternoon { border-left: 3px solid var(--violet); }
.coaching-item.achievement { border-left: 3px solid #10B981; }
.coaching-item.tip { border-left: 3px solid #3B82F6; }

@keyframes coachingSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Heatmap ─── */
.heatmap-cell {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.heatmap-cell:hover {
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.3);
  z-index: 10;
  position: relative;
}
.heat-0 { background: rgba(124, 58, 237, 0.03); color: transparent; }
.heat-1 { background: rgba(124, 58, 237, 0.1); color: rgba(167, 139, 250, 0.6); }
.heat-2 { background: rgba(124, 58, 237, 0.2); color: rgba(167, 139, 250, 0.8); }
.heat-3 { background: rgba(124, 58, 237, 0.35); color: #A78BFA; }
.heat-4 { background: rgba(124, 58, 237, 0.5); color: #FFFFFF; }
.heat-5 { background: rgba(124, 58, 237, 0.7); color: #FFFFFF; }

/* ─── Settings ─── */
.settings-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.settings-input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider {
  background: var(--violet);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Buttons ─── */
.btn-primary {
  background: linear-gradient(135deg, var(--violet), #6D28D9);
  color: white;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 15px var(--violet-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--violet-glow);
}

/* ─── Activity Feed Items ─── */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  animation: feedSlide 0.3s ease;
}
.feed-item:last-child { border-bottom: none; }
@keyframes feedSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.feed-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

/* ─── Team Status Cards ─── */
.team-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}
.team-status-card:hover {
  border-color: var(--border-glow);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online { background: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.status-dot.away { background: #F59E0B; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.status-dot.offline { background: #64748B; }

/* ─── Toast Notifications ─── */
.toast {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  animation: toastSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
}
.toast.toast-exit {
  animation: toastExit 0.3s ease forwards;
}
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastExit {
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}
.toast-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-success .toast-icon { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.toast-info .toast-icon { background: rgba(124, 58, 237, 0.1); color: #A78BFA; }

/* ─── Refresh Spin ─── */
.refresh-spin.spinning {
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Skeleton Loading ─── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Confetti ─── */
.confetti-active {
  pointer-events: auto;
}

/* ─── Responsive ─── */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    left: -288px;
    top: 0; bottom: 0;
    z-index: 50;
    transition: left 0.3s ease;
  }
  #sidebar.open { left: 0; }
}

/* ─── Ranking Table Rows ─── */
.ranking-row {
  transition: all 0.2s;
}
.ranking-row:hover {
  background: rgba(124, 58, 237, 0.05);
}
.ranking-row td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.rank-badge {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.rank-1 { background: rgba(255, 215, 0, 0.15); color: var(--gold); }
.rank-2 { background: rgba(192, 192, 192, 0.15); color: #C0C0C0; }
.rank-3 { background: rgba(205, 127, 50, 0.15); color: #CD7F32; }
.rank-default { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* ─── Streak Badge ─── */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}
.streak-fire { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.streak-cold { background: rgba(100, 116, 139, 0.1); color: #64748B; }

/* ─── Stats Mini Bar ─── */
.mini-stat-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-top: 6px;
}
.mini-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--violet);
  transition: width 1s ease;
}

/* ─── Bottleneck Alert Box ─── */
.bottleneck-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 14px;
  padding: 20px;
}
.bottleneck-box.critical-box {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

/* ─── Light Mode Overrides ─── */
html:not(.dark) .metric-value { color: #111827; }
html:not(.dark) .metric-card { background: rgba(255, 255, 255, 0.7); border-color: rgba(0, 0, 0, 0.06); }
html:not(.dark) .metric-card:hover { background: rgba(255, 255, 255, 0.9); }
html:not(.dark) .glass-card { background: rgba(255, 255, 255, 0.6); border-color: rgba(0, 0, 0, 0.06); }
html:not(.dark) .toast { background: #FFFFFF; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1); }
html:not(.dark) header { background: rgba(255, 255, 255, 0.5); }
html:not(.dark) body { color: #374151; }
html:not(.dark) .skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.03) 25%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.03) 75%);
  background-size: 200% 100%;
}
