@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #07070b;
  --bg-soft: #0b0a11;
  --panel: rgba(15, 13, 23, 0.82);
  --panel-hover: rgba(22, 19, 34, 0.92);
  --border: rgba(170, 120, 255, 0.13);
  --border-bright: rgba(178, 115, 255, 0.3);

  --purple: #a855f7;
  --purple-bright: #c084fc;
  --purple-dark: #6d28d9;

  --text: #f5f3ff;
  --text-soft: #aaa5ba;
  --text-muted: #686375;

  --success: #72f5a2;

  --sidebar-width: 245px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 70% 0%,
      rgba(126, 34, 206, 0.14),
      transparent 32%
    ),
    radial-gradient(
      circle at 20% 80%,
      rgba(88, 28, 135, 0.09),
      transparent 30%
    ),
    var(--bg);

  color: var(--text);

  font-family: "Inter", sans-serif;

  overflow-x: hidden;
}


/* ─────────────────────────────
   BACKGROUND
───────────────────────────── */

.background-grid {
  position: fixed;
  inset: 0;

  pointer-events: none;

  opacity: 0.16;

  background-image:
    linear-gradient(rgba(168, 85, 247, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.045) 1px, transparent 1px);

  background-size: 45px 45px;

  mask-image: linear-gradient(
    to bottom,
    black,
    transparent 85%
  );

  z-index: -3;
}

.ambient {
  position: fixed;

  width: 500px;
  height: 500px;

  border-radius: 50%;

  filter: blur(120px);

  pointer-events: none;

  z-index: -2;

  opacity: 0.08;
}

.ambient-one {
  top: -250px;
  right: 50px;

  background: var(--purple);
}

.ambient-two {
  bottom: -300px;
  left: 100px;

  background: #581c87;
}


/* ─────────────────────────────
   SIDEBAR
───────────────────────────── */

.sidebar {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  width: var(--sidebar-width);

  padding: 25px 17px;

  background:
    linear-gradient(
      180deg,
      rgba(12, 10, 18, 0.98),
      rgba(7, 7, 11, 0.98)
    );

  border-right: 1px solid var(--border);

  display: flex;
  flex-direction: column;

  z-index: 100;

  backdrop-filter: blur(20px);
}


/* BRAND */

.brand {
  display: flex;
  align-items: center;

  gap: 12px;

  padding: 4px 10px 28px;
}

.brand-symbol {
  width: 37px;
  height: 37px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border-bright);

  border-radius: 10px;

  color: var(--purple-bright);

  font-size: 18px;

  background:
    radial-gradient(
      circle,
      rgba(168, 85, 247, 0.2),
      transparent 70%
    );

  box-shadow:
    0 0 25px rgba(168, 85, 247, 0.15);
}

.brand-name {
  font-family: "Space Grotesk", sans-serif;

  font-size: 18px;
  font-weight: 700;

  letter-spacing: 0.18em;
}

.brand-subtitle {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 7px;

  font-weight: 700;

  letter-spacing: 0.19em;
}


/* NAV */

nav {
  overflow-y: auto;

  padding-right: 3px;
}

nav::-webkit-scrollbar {
  width: 0;
}

.nav-section {
  margin: 19px 10px 8px;

  color: #504b5b;

  font-size: 8px;

  font-weight: 800;

  letter-spacing: 0.2em;
}

.nav-item {
  position: relative;

  display: flex;
  align-items: center;

  gap: 12px;

  height: 38px;

  margin: 2px 0;
  padding: 0 11px;

  border-radius: 8px;

  color: var(--text-muted);

  font-size: 12px;
  font-weight: 500;

  text-decoration: none;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.nav-item span {
  width: 16px;

  color: #55505f;

  font-size: 13px;

  text-align: center;

  transition: color 0.2s ease;
}

.nav-item:hover {
  color: var(--text);

  background: rgba(168, 85, 247, 0.055);

  transform: translateX(2px);
}

.nav-item:hover span {
  color: var(--purple-bright);
}

.nav-item.active {
  color: white;

  background:
    linear-gradient(
      90deg,
      rgba(168, 85, 247, 0.15),
      rgba(168, 85, 247, 0.035)
    );

  box-shadow:
    inset 1px 0 0 var(--purple);
}

.nav-item.active span {
  color: var(--purple-bright);

  text-shadow:
    0 0 12px rgba(192, 132, 252, 0.8);
}


/* SIDEBAR STATUS */

.sidebar-footer {
  margin-top: auto;

  display: flex;
  align-items: center;

  gap: 10px;

  padding: 13px 12px;

  border: 1px solid rgba(114, 245, 162, 0.08);

  border-radius: 9px;

  background: rgba(114, 245, 162, 0.025);
}

.status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--success);

  box-shadow:
    0 0 8px rgba(114, 245, 162, 0.8);

  animation: statusPulse 2s infinite;
}

.status-title {
  font-size: 9px;

  font-weight: 800;

  letter-spacing: 0.08em;
}

.status-subtitle {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 7px;

  letter-spacing: 0.08em;
}

@keyframes statusPulse {
  50% {
    opacity: 0.45;
  }
}


/* ─────────────────────────────
   MAIN
───────────────────────────── */

.main {
  min-height: 100vh;

  margin-left: var(--sidebar-width);

  padding: 35px 42px 25px;

  max-width: 1700px;
}


/* TOPBAR */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 32px;
}

.eyebrow,
.panel-label,
.hero-label {
  color: var(--purple-bright);

  font-size: 8px;

  font-weight: 800;

  letter-spacing: 0.22em;
}

.topbar h1 {
  margin-top: 5px;

  font-family: "Space Grotesk", sans-serif;

  font-size: 25px;

  letter-spacing: -0.03em;
}

.topbar-right {
  display: flex;
  align-items: center;

  gap: 18px;
}

.server-status {
  display: flex;
  align-items: center;

  gap: 8px;

  padding: 8px 11px;

  border: 1px solid rgba(114, 245, 162, 0.12);

  border-radius: 7px;

  color: var(--success);

  font-size: 8px;

  font-weight: 800;

  letter-spacing: 0.12em;

  background: rgba(114, 245, 162, 0.025);
}

.pulse {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: var(--success);

  box-shadow: 0 0 8px var(--success);
}

.server-time {
  color: var(--text-muted);

  font-size: 8px;

  font-weight: 700;

  letter-spacing: 0.14em;
}


/* ─────────────────────────────
   HERO
───────────────────────────── */

.hero {
  position: relative;

  min-height: 190px;

  margin-bottom: 18px;

  padding: 31px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  overflow: hidden;

  border: 1px solid var(--border);

  border-radius: 14px;

  background:
    radial-gradient(
      circle at 80% 50%,
      rgba(168, 85, 247, 0.13),
      transparent 32%
    ),
    linear-gradient(
      110deg,
      rgba(20, 16, 30, 0.95),
      rgba(10, 9, 15, 0.9)
    );

  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.025),
    0 20px 70px rgba(0, 0, 0, 0.18);
}

.hero::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 2px;
  height: 100%;

  background:
    linear-gradient(
      transparent,
      var(--purple),
      transparent
    );

  box-shadow:
    0 0 20px rgba(168, 85, 247, 0.7);
}

.hero h2 {
  margin-top: 8px;

  font-family: "Space Grotesk", sans-serif;

  font-size: clamp(28px, 4vw, 44px);

  font-weight: 600;

  letter-spacing: -0.045em;
}

.hero h2 span {
  color: var(--purple-bright);

  text-shadow:
    0 0 35px rgba(192, 132, 252, 0.25);
}

.hero p {
  max-width: 520px;

  margin-top: 10px;

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.7;
}

.hero-symbol {
  margin-right: 50px;

  color: rgba(192, 132, 252, 0.45);

  font-size: 100px;

  filter:
    drop-shadow(0 0 30px rgba(168, 85, 247, 0.3));

  animation: floatingSymbol 5s ease-in-out infinite;
}

@keyframes floatingSymbol {
  50% {
    transform: translateY(-8px) rotate(4deg);
  }
}


/* ─────────────────────────────
   STAT CARDS
───────────────────────────── */

.stats {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 12px;

  margin-bottom: 12px;
}

.stat-card,
.panel {
  border: 1px solid var(--border);

  background:
    linear-gradient(
      145deg,
      rgba(19, 16, 28, 0.9),
      rgba(10, 9, 15, 0.9)
    );

  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.018);

  backdrop-filter: blur(18px);
}

.stat-card {
  min-height: 135px;

  padding: 17px;

  border-radius: 11px;

  transition:
    border 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease;
}

.stat-card:hover {
  border-color: var(--border-bright);

  background: var(--panel-hover);

  transform: translateY(-3px);

  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.22),
    0 0 30px rgba(168, 85, 247, 0.045);
}

.stat-top {
  display: flex;
  justify-content: space-between;

  color: var(--text-muted);

  font-size: 7px;

  font-weight: 800;

  letter-spacing: 0.18em;
}

.stat-value {
  margin-top: 23px;

  font-family: "Space Grotesk", sans-serif;

  font-size: 27px;

  font-weight: 600;

  letter-spacing: -0.04em;
}

.stat-change {
  margin-top: 7px;

  color: var(--success);

  font-size: 9px;

  font-weight: 600;
}

.stat-change span {
  margin-left: 4px;

  color: var(--text-muted);

  font-weight: 400;
}


/* ─────────────────────────────
   PANELS
───────────────────────────── */

.dashboard-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.7fr)
    minmax(300px, 0.8fr);

  gap: 12px;

  margin-bottom: 12px;
}

.bottom-grid {
  display: grid;

  grid-template-columns:
    1fr
    1fr;

  gap: 12px;
}

.panel {
  padding: 20px;

  border-radius: 11px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel h3 {
  margin-top: 4px;

  font-family: "Space Grotesk", sans-serif;

  font-size: 17px;

  font-weight: 600;

  letter-spacing: -0.025em;
}


/* PERIOD */

.period-selector {
  display: flex;

  padding: 3px;

  border: 1px solid var(--border);

  border-radius: 6px;

  background: rgba(0, 0, 0, 0.2);
}

.period-selector button {
  border: 0;

  padding: 5px 8px;

  border-radius: 4px;

  background: transparent;

  color: var(--text-muted);

  font-size: 7px;

  font-weight: 800;

  cursor: pointer;
}

.period-selector button.selected {
  color: white;

  background: rgba(168, 85, 247, 0.18);
}


/* ─────────────────────────────
   FAKE ACTIVITY CHART
───────────────────────────── */

.fake-chart {
  position: relative;

  height: 180px;

  margin-top: 20px;

  overflow: hidden;

  border-bottom: 1px solid var(--border);

  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 44px,
      rgba(255, 255, 255, 0.025) 45px
    );
}

.chart-bars {
  position: absolute;

  inset: 0;

  display: flex;
  align-items: flex-end;
  justify-content: space-around;

  padding: 0 12px;
}

.chart-bars span {
  width: 4.5%;

  min-height: 10px;

  border-radius: 3px 3px 0 0;

  background:
    linear-gradient(
      to top,
      rgba(168, 85, 247, 0.05),
      rgba(168, 85, 247, 0.45)
    );

  box-shadow:
    0 0 15px rgba(168, 85, 247, 0.07);

  animation: barAppear 1s ease backwards;
}

.chart-bars span:nth-child(1) {
  height: 22%;
}

.chart-bars span:nth-child(2) {
  height: 35%;
}

.chart-bars span:nth-child(3) {
  height: 28%;
}

.chart-bars span:nth-child(4) {
  height: 48%;
}

.chart-bars span:nth-child(5) {
  height: 39%;
}

.chart-bars span:nth-child(6) {
  height: 62%;
}

.chart-bars span:nth-child(7) {
  height: 50%;
}

.chart-bars span:nth-child(8) {
  height: 78%;
}

.chart-bars span:nth-child(9) {
  height: 63%;
}

.chart-bars span:nth-child(10) {
  height: 90%;
}

.chart-bars span:nth-child(11) {
  height: 74%;
}

.chart-bars span:nth-child(12) {
  height: 96%;
}

@keyframes barAppear {
  from {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

.chart-line {
  position: absolute;

  left: 0;
  right: 0;

  bottom: 42%;

  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(192, 132, 252, 0.8),
      transparent
    );

  filter:
    drop-shadow(0 0 6px rgba(168, 85, 247, 0.5));

  transform:
    rotate(-2deg);
}

.chart-footer {
  display: flex;
  justify-content: space-between;

  padding-top: 8px;

  color: #514c5b;

  font-size: 7px;

  font-weight: 700;

  letter-spacing: 0.08em;
}


/* ─────────────────────────────
   ASTER CORE
───────────────────────────── */

.core-panel {
  position: relative;

  overflow: hidden;
}

.core-panel::after {
  content: "";

  position: absolute;

  width: 170px;
  height: 170px;

  right: -90px;
  top: -70px;

  border-radius: 50%;

  background: var(--purple);

  opacity: 0.04;

  filter: blur(50px);
}

.core-status {
  display: flex;
  align-items: center;

  gap: 12px;

  margin: 21px 0;

  padding: 12px;

  border: 1px solid rgba(114, 245, 162, 0.07);

  border-radius: 8px;

  background: rgba(114, 245, 162, 0.018);
}

.core-orb {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  color: var(--purple-bright);

  background:
    radial-gradient(
      circle,
      rgba(168, 85, 247, 0.22),
      rgba(168, 85, 247, 0.02)
    );

  box-shadow:
    0 0 25px rgba(168, 85, 247, 0.15);
}

.core-online {
  color: var(--success);

  font-size: 9px;

  font-weight: 800;

  letter-spacing: 0.1em;
}

.core-subtitle {
  margin-top: 3px;

  color: var(--text-muted);

  font-size: 8px;
}

.system-row {
  display: flex;
  justify-content: space-between;

  padding: 11px 0;

  border-top: 1px solid rgba(255, 255, 255, 0.035);

  color: var(--text-muted);

  font-size: 8px;

  font-weight: 700;

  letter-spacing: 0.08em;
}

.system-row strong {
  color: var(--text-soft);

  font-size: 8px;
}

.system-row .healthy {
  color: var(--success);
}


/* ─────────────────────────────
   KINGS
───────────────────────────── */

.live-badge {
  padding: 5px 7px;

  border: 1px solid rgba(114, 245, 162, 0.1);

  border-radius: 5px;

  color: var(--success);

  background: rgba(114, 245, 162, 0.025);

  font-size: 7px;

  font-weight: 800;

  letter-spacing: 0.12em;
}

.king-card {
  display: flex;
  align-items: center;

  gap: 13px;

  margin-top: 13px;

  padding: 13px;

  border: 1px solid rgba(255, 255, 255, 0.04);

  border-radius: 8px;

  background: rgba(255, 255, 255, 0.012);

  transition:
    background 0.2s ease,
    border 0.2s ease;
}

.king-card:hover {
  border-color: var(--border);

  background: rgba(168, 85, 247, 0.035);
}

.king-icon {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);

  border-radius: 7px;

  color: var(--purple-bright);

  background: rgba(168, 85, 247, 0.05);
}

.king-info {
  display: flex;
  flex-direction: column;

  flex: 1;
}

.king-info span {
  color: var(--text-muted);

  font-size: 7px;

  font-weight: 800;

  letter-spacing: 0.13em;
}

.king-info strong {
  margin-top: 4px;

  font-size: 11px;
}

.king-value {
  color: var(--purple-bright);

  font-family: "Space Grotesk", sans-serif;

  font-size: 16px;

  font-weight: 600;

  text-align: right;
}

.king-value small {
  display: block;

  margin-top: 2px;

  color: var(--text-muted);

  font-family: "Inter", sans-serif;

  font-size: 6px;

  font-weight: 700;

  letter-spacing: 0.1em;
}


/* ─────────────────────────────
   EVENTS
───────────────────────────── */

.event {
  display: flex;
  align-items: center;

  gap: 11px;

  padding: 13px 0;

  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
}

.event:last-child {
  border-bottom: 0;
}

.event-symbol {
  color: var(--purple);

  font-size: 9px;

  text-shadow:
    0 0 12px rgba(168, 85, 247, 0.7);
}

.event div {
  display: flex;
  flex-direction: column;

  flex: 1;
}

.event strong {
  font-size: 9px;

  font-weight: 600;
}

.event small {
  margin-top: 3px;

  color: var(--text-muted);

  font-size: 7px;
}

.event time {
  color: var(--text-muted);

  font-size: 7px;

  font-weight: 700;
}


/* ─────────────────────────────
   FOOTER
───────────────────────────── */

footer {
  display: flex;
  justify-content: space-between;

  padding: 22px 3px 5px;

  color: #45414d;

  font-size: 7px;

  font-weight: 700;

  letter-spacing: 0.13em;
}

footer span:first-child {
  color: #655d70;
}


/* ─────────────────────────────
   RESPONSIVE
───────────────────────────── */

@media (max-width: 1100px) {

  .stats {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 800px) {

  :root {
    --sidebar-width: 70px;
  }

  .sidebar {
    padding: 20px 9px;
  }

  .brand {
    justify-content: center;
    padding: 4px 0 25px;
  }

  .brand > div:last-child,
  .nav-section,
  .nav-item:not(.active)::after,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;

    padding: 0;
  }

  .nav-item span {
    font-size: 14px;
  }

  .brand-symbol {
    width: 35px;
    height: 35px;
  }

  .sidebar-footer {
    justify-content: center;

    padding: 12px 0;
  }

  .sidebar-footer > div:last-child {
    display: none;
  }

  .main {
    padding: 25px 20px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .hero-symbol {
    display: none;
  }

}

@media (max-width: 560px) {

  .main {
    margin-left: var(--sidebar-width);

    padding: 20px 14px;
  }

  .topbar-right {
    display: none;
  }

  .hero {
    padding: 25px 22px;
  }

  .hero h2 {
    font-size: 27px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;

    gap: 8px;
  }
}

/* =========================================================
   ASTER — FINAL PREMIUM POLISH
   ========================================================= */

/* Glass depth */
.stat-card,
.panel,
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.stat-card::before,
.panel::before,
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;

    background:
        linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.035),
            transparent 30%,
            transparent 70%,
            rgba(168, 85, 247, 0.025)
        );
}

/* Moving card shine */
.stat-card::after,
.panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.035),
            transparent
        );

    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.stat-card:hover::after,
.panel:hover::after {
    left: 140%;
}

/* Stat value glow */
.stat-value {
    text-shadow:
        0 0 18px rgba(168, 85, 247, 0.08);
    transition:
        text-shadow 0.25s ease,
        transform 0.25s ease;
}

.stat-card:hover .stat-value {
    text-shadow:
        0 0 22px rgba(192, 132, 252, 0.22);
    transform: translateX(2px);
}

/* Stronger brand symbol */
.brand-symbol {
    position: relative;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.brand:hover .brand-symbol {
    transform: rotate(8deg) scale(1.05);
    box-shadow:
        0 0 25px rgba(168, 85, 247, 0.25),
        inset 0 0 15px rgba(168, 85, 247, 0.08);
}

/* Sidebar active indicator */
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 8px;
    bottom: 8px;
    width: 2px;

    border-radius: 2px;

    background: var(--purple-bright);

    box-shadow:
        0 0 12px rgba(192, 132, 252, 0.8);
}

/* Navigation click feedback */
.nav-item:active {
    transform: translateX(3px) scale(0.985);
}

/* Period buttons */
.period-selector button {
    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.period-selector button:hover {
    color: var(--text);
    background: rgba(168, 85, 247, 0.08);
}

.period-selector button:active {
    transform: scale(0.94);
}

/* Live badge */
.live-badge {
    animation:
        liveBadgePulse 2.5s ease-in-out infinite;
}

@keyframes liveBadgePulse {
    0%,
    100% {
        box-shadow:
            0 0 0 rgba(114, 245, 162, 0);
    }

    50% {
        box-shadow:
            0 0 14px rgba(114, 245, 162, 0.08);
    }
}

/* Core orb */
.core-orb {
    animation:
        coreOrbPulse 4s ease-in-out infinite;
}

@keyframes coreOrbPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 25px rgba(168, 85, 247, 0.15);
    }

    50% {
        transform: scale(1.045);
        box-shadow:
            0 0 35px rgba(168, 85, 247, 0.25);
    }
}

/* King icons */
.king-icon {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.king-card:hover .king-icon {
    transform: rotate(-5deg) scale(1.08);
    box-shadow:
        0 0 18px rgba(168, 85, 247, 0.16);
}

/* Event rows */
.event {
    transition:
        padding-left 0.2s ease,
        background 0.2s ease;
}

.event:hover {
    padding-left: 5px;
}

.event:hover .event-symbol {
    text-shadow:
        0 0 18px rgba(192, 132, 252, 0.9);
}

/* Chart animation */
.chart-line {
    animation:
        chartScan 4s ease-in-out infinite;
}

@keyframes chartScan {
    0%,
    100% {
        opacity: 0.45;
        transform: rotate(-2deg) translateX(-2%);
    }

    50% {
        opacity: 0.9;
        transform: rotate(-2deg) translateX(2%);
    }
}

/* Staggered card entrance */
.stats .stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stats .stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stats .stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stats .stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.dashboard-grid .panel:nth-child(1) {
    animation-delay: 0.25s;
}

.dashboard-grid .panel:nth-child(2) {
    animation-delay: 0.3s;
}

.bottom-grid .panel:nth-child(1) {
    animation-delay: 0.35s;
}

.bottom-grid .panel:nth-child(2) {
    animation-delay: 0.4s;
}

/* Better mobile cards */
@media (max-width: 560px) {
    .stat-card {
        min-height: 120px;
    }

    .stat-value {
        font-size: 25px;
    }

    .panel {
        padding: 17px;
    }

    .hero {
        min-height: 165px;
    }

    .hero p {
        font-size: 11px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .live-badge,
    .core-orb,
    .chart-line {
        animation: none !important;
    }
}

/* =========================================================
   ASTER — VIEW TRANSITIONS
   ========================================================= */

.dashboard-view {
    animation: viewEnter 0.35s ease both;
}

@keyframes viewEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Smooth dashboard content */
.main {
    animation: mainEnter 0.55s ease both;
}

@keyframes mainEnter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keep animations disabled for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dashboard-view,
    .main {
        animation: none !important;
    }
}

/* =========================================================
   ASTER — SIDEBAR PREMIUM POLISH
   ========================================================= */

.sidebar {
    box-shadow:
        12px 0 40px rgba(0, 0, 0, 0.18);
}

.nav-item {
    overflow: hidden;
}

.nav-item::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(192, 132, 252, 0.055),
            transparent
        );

    transform: translateX(-110%);
    transition: transform 0.45s ease;

    pointer-events: none;
}

.nav-item:hover::after {
    transform: translateX(110%);
}

.nav-item.active {
    box-shadow:
        inset 1px 0 0 var(--purple),
        0 0 20px rgba(168, 85, 247, 0.035);
}

.nav-item.active span {
    filter:
        drop-shadow(
            0 0 5px rgba(192, 132, 252, 0.35)
        );
}

.sidebar-footer {
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.sidebar-footer:hover {
    border-color:
        rgba(114, 245, 162, 0.16);

    background:
        rgba(114, 245, 162, 0.04);

    box-shadow:
        0 0 20px rgba(114, 245, 162, 0.035);
}

@media (prefers-reduced-motion: reduce) {
    .nav-item::after {
        transition: none;
    }
}

/* =========================================================
   ASTER — STAT CARD MICRO-INTERACTIONS
   ========================================================= */

.stat-card {
    position: relative;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(168, 85, 247, 0.10),
            transparent 65%
        );

    opacity: 0;
    transition: opacity 0.3s ease;

    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);

    border-color:
        rgba(168, 85, 247, 0.24);

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.25),
        0 0 25px rgba(168, 85, 247, 0.06);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-value {
    transition:
        text-shadow 0.25s ease;
}

.stat-card:hover .stat-value {
    text-shadow:
        0 0 18px rgba(192, 132, 252, 0.28);
}

@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .stat-card::before,
    .stat-card .stat-value {
        transition: none;
    }

    .stat-card:hover {
        transform: none;
    }
}


/* =========================================================
   ASTER — ACTIVITY CHART POLISH
   ========================================================= */

.chart-bars {
    isolation: isolate;
}

.chart-bars span {
    position: relative;
    overflow: hidden;

    background:
        linear-gradient(
            to top,
            rgba(168, 85, 247, 0.10),
            rgba(192, 132, 252, 0.72)
        );

    box-shadow:
        0 0 12px rgba(168, 85, 247, 0.10);

    transform-origin: bottom;
    transition:
        height 0.45s ease,
        opacity 0.25s ease,
        filter 0.25s ease,
        transform 0.25s ease;
}

.chart-bars span::after {
    content: "";

    position: absolute;
    top: 0;
    left: -100%;

    width: 60%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.18),
            transparent
        );

    animation: chartShine 3.5s ease-in-out infinite;
}

.chart-bars span:hover {
    opacity: 1;
    filter:
        brightness(1.25)
        drop-shadow(0 0 7px rgba(192, 132, 252, 0.35));

    transform:
        scaleX(1.25);
}

@keyframes chartShine {
    0% {
        left: -100%;
    }

    45%,
    100% {
        left: 160%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chart-bars span {
        transition: none;
    }

    .chart-bars span::after {
        animation: none;
    }

    .chart-bars span:hover {
        transform: none;
    }
}

/* =========================================================
   ASTER — LIVE VALUE REFRESH
   ========================================================= */

.value-refresh {
    animation: valueRefresh 0.45s ease both;
}

@keyframes valueRefresh {
    0% {
        opacity: 0.65;
        transform: translateY(3px);
        filter: blur(1px);
    }

    55% {
        opacity: 1;
        transform: translateY(-1px);
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .value-refresh {
        animation: none;
    }
}

/* =========================================================
   ASTER — LIVE STATUS POLISH
   ========================================================= */

.live-badge {
    position: relative;
    overflow: hidden;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.live-badge::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            110deg,
            transparent 20%,
            rgba(114, 245, 162, 0.08) 50%,
            transparent 80%
        );

    transform: translateX(-120%);
    animation: liveSweep 4s ease-in-out infinite;
}

.live-badge::after {
    content: "";

    position: absolute;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #72f5a2;

    box-shadow:
        0 0 7px rgba(114, 245, 162, 0.8),
        0 0 14px rgba(114, 245, 162, 0.35);

    animation: liveDot 1.8s ease-in-out infinite;
}

@keyframes liveSweep {
    0%,
    55% {
        transform: translateX(-120%);
    }

    75%,
    100% {
        transform: translateX(120%);
    }
}

@keyframes liveDot {
    0%,
    100% {
        opacity: 0.65;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-badge::before,
    .live-badge::after {
        animation: none;
    }
}

/* =========================================================
   ASTER — CORE ENERGY POLISH
   ========================================================= */

.core-panel {
    position: relative;
    overflow: hidden;
}

.core-panel::before {
    content: "";

    position: absolute;
    width: 320px;
    height: 320px;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    background:
        radial-gradient(
            circle,
            rgba(168, 85, 247, 0.10),
            rgba(168, 85, 247, 0.035) 35%,
            transparent 70%
        );

    pointer-events: none;

    animation:
        coreAmbient 5s ease-in-out infinite;
}

.core-orb {
    animation:
        coreOrbPulse 3.5s ease-in-out infinite;
}

@keyframes coreAmbient {
    0%,
    100% {
        opacity: 0.55;
        transform: translate(-50%, -50%) scale(0.92);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
}

@keyframes coreOrbPulse {
    0%,
    100% {
        filter:
            drop-shadow(
                0 0 8px rgba(168, 85, 247, 0.18)
            );
    }

    50% {
        filter:
            drop-shadow(
                0 0 20px rgba(168, 85, 247, 0.42)
            );
    }
}

@media (prefers-reduced-motion: reduce) {
    .core-panel::before,
    .core-orb {
        animation: none;
    }
}


/* =========================================================
   ASTER — KING CARD POLISH
   ========================================================= */

.king-card {
    position: relative;
    overflow: hidden;

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.king-card::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 15% 50%,
            rgba(168, 85, 247, 0.08),
            transparent 55%
        );

    opacity: 0;
    transition: opacity 0.3s ease;

    pointer-events: none;
}

.king-card:hover {
    transform: translateY(-3px);

    border-color:
        rgba(168, 85, 247, 0.22);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.22),
        0 0 24px rgba(168, 85, 247, 0.05);
}

.king-card:hover::before {
    opacity: 1;
}

.king-card .king-icon {
    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}

.king-card:hover .king-icon {
    transform:
        scale(1.08)
        rotate(-3deg);

    filter:
        drop-shadow(
            0 0 10px rgba(192, 132, 252, 0.3)
        );
}

.king-card .king-value {
    transition:
        text-shadow 0.3s ease;
}

.king-card:hover .king-value {
    text-shadow:
        0 0 16px rgba(192, 132, 252, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    .king-card,
    .king-card::before,
    .king-card .king-icon,
    .king-card .king-value {
        transition: none;
    }

    .king-card:hover {
        transform: none;
    }

    .king-card:hover .king-icon {
        transform: none;
    }
}



/* =========================================================
   ASTER — EVENT ROW POLISH
   ========================================================= */

.event-row {
    position: relative;
    overflow: hidden;

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.event-row::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(168, 85, 247, 0.055),
            transparent
        );

    transform: translateX(-120%);
    transition: transform 0.45s ease;

    pointer-events: none;
}

.event-row:hover {
    transform: translateX(3px);

    background:
        rgba(168, 85, 247, 0.035);

    border-color:
        rgba(168, 85, 247, 0.16);
}

.event-row:hover::after {
    transform: translateX(120%);
}

.event-row .event-icon {
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.event-row:hover .event-icon {
    transform: scale(1.08);

    filter:
        drop-shadow(
            0 0 7px rgba(192, 132, 252, 0.3)
        );
}

@media (prefers-reduced-motion: reduce) {
    .event-row,
    .event-row::after,
    .event-row .event-icon {
        transition: none;
    }

    .event-row:hover {
        transform: none;
    }
}



/* =========================================================
   ASTER — BACKGROUND REFRESH STATE
   ========================================================= */

.dashboard-refreshing::after {
    content: "";

    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 2px;

    z-index: 9999;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(168, 85, 247, 0.9),
            transparent
        );

    box-shadow:
        0 0 12px rgba(168, 85, 247, 0.45);

    animation:
        refreshSweep 0.7s ease-in-out;
    pointer-events: none;
}

@keyframes refreshSweep {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-refreshing::after {
        animation: none;
    }
}


/* =========================================================
   ASTER — MOBILE DASHBOARD POLISH
   ========================================================= */

@media (max-width: 900px) {

    .sidebar {
        width: 72px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .sidebar .brand-text,
    .sidebar .nav-label,
    .sidebar-footer .status-text {
        display: none;
    }

    .sidebar .brand {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .main {
        margin-left: 72px;
        width: calc(100% - 72px);
    }

    .dashboard-header,
    .hero,
    .panel {
        border-radius: 16px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    .sidebar {
        width: 58px;
    }

    .main {
        margin-left: 58px;
        width: calc(100% - 58px);
        padding: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero {
        padding: 18px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .panel {
        padding: 14px;
    }

    .period-selector {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .period-selector::-webkit-scrollbar {
        display: none;
    }

    .period-selector button {
        flex: 0 0 auto;
    }

    .chart-bars {
        padding: 0 6px;
    }

    .chart-bars span {
        width: 3.5%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-item,
    .stat-card,
    .panel {
        transition: none;
    }
}


/* =========================================================
   ASTER — AMBIENT BACKGROUND DEPTH
   ========================================================= */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;
    z-index: -1;

    background:
        radial-gradient(
            circle at 18% 18%,
            rgba(168, 85, 247, 0.045),
            transparent 28%
        ),
        radial-gradient(
            circle at 82% 72%,
            rgba(99, 102, 241, 0.035),
            transparent 30%
        );

    animation:
        ambientDrift 14s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    from {
        transform: scale(1);
        opacity: 0.7;
    }

    to {
        transform: scale(1.08);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}


/* =========================================================
   ASTER — NAV ICON POLISH
   ========================================================= */

.nav-item span:first-child {
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.nav-item:hover span:first-child {
    transform: scale(1.08);
    filter:
        drop-shadow(
            0 0 7px rgba(192, 132, 252, 0.28)
        );
}

.nav-item.active span:first-child {
    filter:
        drop-shadow(
            0 0 9px rgba(168, 85, 247, 0.42)
        );
}

.nav-item:active span:first-child {
    transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
    .nav-item span:first-child {
        transition: none;
    }

    .nav-item:hover span:first-child,
    .nav-item:active span:first-child {
        transform: none;
    }
}

/* =========================================================
   ASTER — PANEL DEPTH POLISH
   ========================================================= */

.panel {
    position: relative;
    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.panel::before {
    content: "";

    position: absolute;
    inset: 0;

    border-radius: inherit;

    background:
        linear-gradient(
            135deg,
            rgba(192, 132, 252, 0.035),
            transparent 35%
        );

    opacity: 0;
    transition: opacity 0.3s ease;

    pointer-events: none;
}

.panel:hover {
    transform: translateY(-2px);

    border-color:
        rgba(168, 85, 247, 0.14);

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.18),
        0 0 24px rgba(168, 85, 247, 0.035);
}

.panel:hover::before {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .panel,
    .panel::before {
        transition: none;
    }

    .panel:hover {
        transform: none;
    }
}

/* =========================================================
   ASTER — INTERACTIVE GLOW
   ========================================================= */

.stat-card,
.panel,
.king-card {
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.stat-card::after,
.panel::after,
.king-card::after {
    content: "";

    position: absolute;
    inset: 0;

    border-radius: inherit;

    background:
        radial-gradient(
            220px circle at var(--mouse-x) var(--mouse-y),
            rgba(192, 132, 252, 0.08),
            transparent 65%
        );

    opacity: 0;
    transition: opacity 0.25s ease;

    pointer-events: none;
}

.stat-card:hover::after,
.panel:hover::after,
.king-card:hover::after {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .stat-card::after,
    .panel::after,
    .king-card::after {
        transition: none;
    }
}