/* ============================================================
   Dashboard polish pass — welcome hero, stat pills, cards,
   sidebar active highlight, empty-state illustrations.
   Scoped under body[data-page="dashboard"] to avoid bleed.
   ============================================================ */

body[data-page="dashboard"] {
  --dp-accent: #0A84FF;
  --dp-accent-2: #5AB0FF;
  --dp-accent-soft: rgba(10, 132, 255, 0.12);
  --dp-accent-glow: rgba(10, 132, 255, 0.25);
  --dp-violet: #5E5CE6;
  --dp-violet-2: #8B89F5;
  --dp-green: #34C759;
  --dp-amber: #FF9F0A;
  --dp-radius: 20px;
}

/* ── Welcome hero upgrade ───────────────────────────────────── */
body[data-page="dashboard"] .home-welcome-v2 {
  position: relative;
  overflow: hidden;
  padding: 28px 32px;
  border: 1px solid rgba(10, 132, 255, 0.14);
  background:
    radial-gradient(900px 240px at 10% 0%, rgba(10, 132, 255, 0.14), transparent 60%),
    radial-gradient(600px 200px at 95% 100%, rgba(94, 92, 230, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    0 20px 48px rgba(17, 45, 93, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-radius: var(--dp-radius);
  isolation: isolate;
}

/* Animated dot grid in the background */
body[data-page="dashboard"] .home-welcome-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(10, 132, 255, 0.14) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
  animation: dpDotDrift 30s linear infinite;
}
@keyframes dpDotDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 18px 18px; }
}

body[data-page="dashboard"] .home-welcome-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dp-accent);
  background: var(--dp-accent-soft);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

body[data-page="dashboard"] .home-welcome-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.1;
}
body[data-page="dashboard"] #welcome-user {
  background: linear-gradient(135deg, var(--dp-accent), var(--dp-violet));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

body[data-page="dashboard"] .home-welcome-sub {
  font-size: 0.98rem;
  margin-bottom: 18px;
}

body[data-page="dashboard"] .home-welcome-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Deco icon — animated sparkle */
body[data-page="dashboard"] .home-welcome-deco {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--dp-accent), var(--dp-violet));
  box-shadow:
    0 18px 40px var(--dp-accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  animation: dpDecoFloat 5s ease-in-out infinite;
}
body[data-page="dashboard"] .home-welcome-deco::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: radial-gradient(circle, var(--dp-accent-glow) 0%, transparent 65%);
  z-index: -1;
  animation: dpDecoPulse 3s ease-in-out infinite;
}
@keyframes dpDecoFloat {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  50%      { transform: translateY(-60%) rotate(-6deg); }
}
@keyframes dpDecoPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="dashboard"] .home-welcome-deco { animation: none; }
  body[data-page="dashboard"] .home-welcome-deco::after { animation: none; }
  body[data-page="dashboard"] .home-welcome-v2::before { animation: none; }
}
@media (max-width: 640px) {
  body[data-page="dashboard"] .home-welcome-deco { display: none; }
}

/* ── Stats strip: gradient borders + hover lift + trend pill ── */
body[data-page="dashboard"] .home-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0 24px;
}

body[data-page="dashboard"] .home-stat-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.74));
  border: 1px solid rgba(10, 132, 255, 0.10);
  box-shadow: 0 10px 24px rgba(17, 45, 93, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.25s ease;
}
body[data-page="dashboard"] .home-stat-pill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--dp-accent), var(--dp-accent-2));
  opacity: 0.7;
}
body[data-page="dashboard"] .home-stat-pill::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--dp-accent-glow), transparent 70%);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}
body[data-page="dashboard"] .home-stat-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px var(--dp-accent-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.55);
  border-color: rgba(10, 132, 255, 0.24);
}
body[data-page="dashboard"] .home-stat-pill:hover::after {
  opacity: 0.8;
}

body[data-page="dashboard"] .home-stat-pill-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(10, 132, 255, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body[data-page="dashboard"] .home-stat-icon-blue {
  background: linear-gradient(135deg, var(--dp-accent), var(--dp-accent-2));
}
body[data-page="dashboard"] .home-stat-icon-purple {
  background: linear-gradient(135deg, var(--dp-violet), var(--dp-violet-2));
  box-shadow: 0 6px 16px rgba(94, 92, 230, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body[data-page="dashboard"] .home-stat-icon-amber {
  background: linear-gradient(135deg, #ff9f0a, #ffb945);
  box-shadow: 0 6px 16px rgba(255, 159, 10, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body[data-page="dashboard"] .home-stat-icon-green {
  background: linear-gradient(135deg, #34c759, #66e082);
  box-shadow: 0 6px 16px rgba(52, 199, 89, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body[data-page="dashboard"] .home-stat-pill-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

body[data-page="dashboard"] .home-stat-pill-num {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #0f1923;
}

body[data-page="dashboard"] .home-stat-pill-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Dashboard cards upgrade ────────────────────────────────── */
body[data-page="dashboard"] .dash-card {
  position: relative;
  border-radius: var(--dp-radius);
  border: 1px solid rgba(10, 132, 255, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.76));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 14px 36px rgba(17, 45, 93, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.25s ease, transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
body[data-page="dashboard"] .dash-card:hover {
  box-shadow: 0 22px 52px rgba(17, 45, 93, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border-color: rgba(10, 132, 255, 0.22);
}

body[data-page="dashboard"] .dash-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(10, 132, 255, 0.08);
}
body[data-page="dashboard"] .dash-card-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body[data-page="dashboard"] .dash-card-head-text h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body[data-page="dashboard"] .dash-card-head-text p {
  margin: 2px 0 0;
  font-size: 0.78rem;
}
body[data-page="dashboard"] .dash-card-see-all {
  margin-left: auto;
  font-size: 0.82rem;
  padding: 6px 12px;
}
body[data-page="dashboard"] .dash-card-see-all i {
  transition: transform 0.2s ease;
}
body[data-page="dashboard"] .dash-card-see-all:hover i {
  transform: translateX(3px);
}

body[data-page="dashboard"] .dash-list {
  padding: 14px 20px 18px;
}

/* ── Sidebar active state ───────────────────────────────────── */
body[data-page="dashboard"] .nav-item.active {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.14), rgba(10, 132, 255, 0.06));
  border-color: rgba(10, 132, 255, 0.22);
  color: var(--dp-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(10, 132, 255, 0.18);
}
body[data-page="dashboard"] .nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--dp-accent), var(--dp-violet));
  box-shadow: 0 0 12px var(--dp-accent-glow);
}

/* ── Quick Actions: hover arrow slide ───────────────────────── */
body[data-page="dashboard"] .action-buttons .lg-btn i {
  transition: transform 0.2s ease;
}
body[data-page="dashboard"] .action-buttons .lg-btn:hover i.fa-plus {
  transform: rotate(90deg);
}
body[data-page="dashboard"] .action-buttons .lg-btn:hover i.fa-store,
body[data-page="dashboard"] .action-buttons .lg-btn:hover i.fa-images {
  transform: scale(1.12);
}

/* ── Empty-state illustrations: use SVG via CSS mask for gallery/tickets ── */
body[data-page="dashboard"] .dash-empty-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
  color: var(--hv2-text-muted, #4a6080);
}
body[data-page="dashboard"] .dash-empty-illustration svg {
  width: 96px;
  height: 96px;
  color: rgba(10, 132, 255, 0.4);
  filter: drop-shadow(0 6px 14px rgba(10, 132, 255, 0.15));
  animation: dpEmptyFloat 4s ease-in-out infinite;
}
@keyframes dpEmptyFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="dashboard"] .dash-empty-illustration svg { animation: none; }
}
body[data-page="dashboard"] .dash-empty-illustration strong {
  font-size: 0.95rem;
  color: #0f1923;
}
body[data-page="dashboard"] .dash-empty-illustration span {
  font-size: 0.82rem;
  max-width: 280px;
  line-height: 1.4;
}

/* Upgrade the existing empty-text to include illustration if present in markup */
body[data-page="dashboard"] .dash-list .empty-text {
  text-align: center;
  padding: 24px 12px;
  color: var(--hv2-text-muted, #4a6080);
  font-size: 0.92rem;
}

/* ── Subtle page aurora (unifies with shop/home) ────────────── */
body[data-page="dashboard"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 500px at 8% 10%, rgba(10, 132, 255, 0.10), transparent 60%),
    radial-gradient(600px 500px at 95% 85%, rgba(94, 92, 230, 0.10), transparent 60%);
}
body[data-page="dashboard"] > * { position: relative; z-index: 1; }

/* ── Tab content fade / slide in (polish) ───────────────────── */
body[data-page="dashboard"] .dashboard-tab.active {
  animation: dpTabIn 0.38s cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes dpTabIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="dashboard"] .dashboard-tab.active { animation: none; }
}

/* ── Counter digit animation (uses tabular-nums for no wobble) ── */
body[data-page="dashboard"] #dash-credits-val,
body[data-page="dashboard"] #dash-stat-active,
body[data-page="dashboard"] #dash-stat-gallery {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
body[data-page="dashboard"] .home-stat-pill:hover .home-stat-pill-num {
  color: var(--dp-accent);
}
