:root {
  --bg: #08090d;
  --bg-secondary: #11131b;

  --card: rgba(22, 22, 28, 0.72);

  --border: rgba(255, 255, 255, 0.08);

  --text: #ffffff;

  --muted: #9ca3af;

  --purple: #7c3aed;

  --purple2: #9333ea;

  --green: #22c55e;

  --yellow: #facc15;

  --danger: #ef4444;

  --radius: 24px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, sans-serif;

  color: var(--text);

  background: var(--bg);

  overflow-x: hidden;

  min-height: 100vh;
}

/* ---------------- Background ---------------- */

.background {
  position: fixed;

  inset: 0;

  z-index: -2;

  overflow: hidden;

  background: #07080c;
}

.grid {
  position: absolute;

  inset: 0;

  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);

  background-size: 36px 36px;

  mask-image: radial-gradient(circle at center, black 30%, transparent 95%);
}

.blob {
  position: absolute;

  border-radius: 50%;

  filter: blur(140px);

  opacity: 0.45;

  animation: float 16s ease-in-out infinite;
}

.blob1 {
  width: 550px;

  height: 550px;

  background: #7c3aed;

  top: -180px;

  left: -150px;
}

.blob2 {
  width: 500px;

  height: 500px;

  background: #2563eb;

  bottom: -180px;

  right: -140px;

  animation-delay: 6s;
}

@keyframes float {
  0% {
    transform: translateY(0px) translateX(0px);
  }

  50% {
    transform: translateY(-35px) translateX(35px);
  }

  100% {
    transform: translateY(0px) translateX(0px);
  }
}

/* ---------------- Container ---------------- */

.container {
  width: min(1700px, 95%);
  margin: auto;
  padding: 34px 0 24px;
}

/* ---------------- Header ---------------- */

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 26px;
  gap: 24px;
}

.badge {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 8px 18px;

  border-radius: 999px;

  background: rgba(124, 58, 237, 0.15);

  color: #d8b4fe;

  border: 1px solid rgba(124, 58, 237, 0.25);

  font-size: 14px;

  margin-bottom: 12px;
}

h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 8px;
}

header p {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 0;
}

.header-actions {
  display: flex;

  flex-direction: column;

  align-items: flex-end;

  gap: 18px;
}

/* ---------- live status ---------- */

.live {
  display: flex;

  align-items: center;

  gap: 10px;

  color: #cbd5e1;

  font-size: 15px;
}

.live-dot {
  width: 10px;

  height: 10px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow: 0 0 12px #22c55e;

  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

/* ---------- refresh button ---------- */

#refresh {
  border: none;

  cursor: pointer;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 16px 28px;

  color: white;

  font-weight: 700;

  font-size: 15px;

  border-radius: 16px;

  background: linear-gradient(135deg, #7c3aed, #9333ea);

  transition: 0.3s;

  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.35);
}

#refresh:hover {
  transform: translateY(-3px);

  box-shadow: 0 25px 45px rgba(124, 58, 237, 0.45);
}

#refresh svg {
  transition: 0.4s;
}

#refresh:hover svg {
  transform: rotate(180deg);
}

/* ---------------- cards grid ---------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

/* ---------------- glass cards ---------------- */

.stat-card,
.panel {
  position: relative;

  overflow: hidden;

  border-radius: var(--radius);

  background: var(--card);

  border: 1px solid var(--border);

  backdrop-filter: blur(18px);

  -webkit-backdrop-filter: blur(18px);

  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 30px 80px rgba(0, 0, 0, 0.35);

  transition: 0.35s;
}

.stat-card:hover,
.panel:hover {
  transform: translateY(-6px);

  border-color: rgba(124, 58, 237, 0.4);
}

.stat-card {
  padding: 20px;
  min-height: 185px;
}

.panel {
  padding: 24px;
}

/* =======================================================
   Dashboard Layout
======================================================= */

.content-grid {
  display: grid;

  grid-template-columns: 1.6fr 1fr;

  gap: 24px;

  align-items: start;
}

/* =======================================================
   Statistics Cards
======================================================= */

.stat-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 18px;
}

.stat-icon {
  width: 56px;

  height: 56px;

  border-radius: 18px;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 22px;

  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.28),
    rgba(147, 51, 234, 0.12)
  );

  border: 1px solid rgba(124, 58, 237, 0.25);

  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.18);
}

.stat-title {
  font-size: 15px;

  font-weight: 600;

  color: #cbd5e1;
}

.stat-value {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  margin: 14px 0 8px;
}

.stat-subtitle {
  font-size: 14px;
  line-height: 1.45;
}

.stat-success {
  color: var(--green);

  font-weight: 700;
}

.stat-warning {
  color: var(--yellow);

  font-weight: 700;
}

.stat-danger {
  color: var(--danger);

  font-weight: 700;
}

/* =======================================================
   Panel Titles
======================================================= */

.panel h2 {
  display: flex;

  align-items: center;

  gap: 12px;

  font-size: 28px;

  font-weight: 700;

  margin-bottom: 22px;
}

.panel h2::before {
  content: "";

  width: 5px;

  height: 28px;

  border-radius: 999px;

  background: linear-gradient(180deg, var(--purple), var(--purple2));
}

/* =======================================================
   Smooth Fade Animation
======================================================= */

.fade-in {
  animation: fade 0.45s ease;
}

@keyframes fade {
  from {
    opacity: 0;

    transform: translateY(16px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* =======================================================
   Responsive
======================================================= */

@media (max-width: 1300px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 18px;
    align-items: start;
  }
}

@media (max-width: 900px) {
  header {
    flex-direction: column;

    align-items: flex-start;
  }

  .header-actions {
    width: 100%;

    align-items: flex-start;
  }

  h1 {
    font-size: 42px;
  }
}

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .container {
    width: 94%;

    padding: 30px 0;
  }

  .panel {
    padding: 24px;
  }

  .stat-card {
    padding: 24px;
  }

  .stat-value {
    font-size: 42px;
  }
}

/* =======================================================
   Rating Distribution
======================================================= */

.rating-row {
  display: grid;

  grid-template-columns: 70px 1fr 90px;

  align-items: center;

  gap: 14px;

  margin-bottom: 12px;
}

.rating-row:last-child {
  margin-bottom: 0;
}

.rating-label {
  color: #e5e7eb;

  font-weight: 600;

  font-size: 15px;
}

.rating-footer {
  margin-top: 28px;

  padding-top: 20px;

  border-top: 1px solid rgba(255, 255, 255, 0.08);

  color: var(--muted);

  font-size: 15px;
}

.rating-footer strong {
  color: white;
}

.bar {
  height: 11px;

  background: rgba(255, 255, 255, 0.06);

  border-radius: 999px;

  overflow: hidden;

  position: relative;

  border: 1px solid rgba(255, 255, 255, 0.04);
}

.fill {
  height: 100%;

  width: 0;

  border-radius: inherit;

  background: linear-gradient(90deg, #f59e0b, #fbbf24);

  transition: width 0.9s ease;

  box-shadow: 0 0 20px rgba(251, 191, 36, 0.45);
}

.rating-count {
  text-align: right;

  color: var(--muted);

  font-size: 14px;

  font-weight: 600;
}

/* =======================================================
   Recent Feedback
======================================================= */

.feedback {
  display: flex;

  gap: 14px;

  padding: 14px 0;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);

  transition: 0.25s;
}

.feedback:last-child {
  border-bottom: none;
}

.feedback:hover {
  transform: translateX(6px);
}

.feedback-avatar {
  width: 42px;

  height: 42px;

  font-size: 15px;

  border-radius: 50%;

  flex-shrink: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  font-weight: 700;

  background: linear-gradient(135deg, var(--purple), var(--purple2));

  color: white;

  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}

.feedback-body {
  flex: 1;
}

.feedback-top {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 8px;
}

.feedback-stars {
  color: #fbbf24;

  letter-spacing: 2px;

  font-size: 15px;
}

.feedback-time {
  color: var(--muted);

  font-size: 13px;
}

.feedback-comment {
  color: #f3f4f6;

  line-height: 1.45;

  font-size: 14px;
}

.feedback-empty {
  padding: 60px 20px;

  text-align: center;

  color: var(--muted);
}

/* =======================================================
   Scrollbar
======================================================= */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);

  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}
