*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;   /* center horizontally */
  align-items: center;       /* center vertically */
  background: linear-gradient(135deg, #e8f0ff 0%, #f0e8ff 40%, #e8f8ff 100%);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow-x: hidden;
  position: relative;
  padding-top: 80px; /* space for topbar */
}

/* ── Soft mesh background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(59,130,246,0.10) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ── Animated grid ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridPan 24s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gridPan {
  0%   { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* ── Floating shields ── */
.shields-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shield {
  position: absolute;
  opacity: 0;
  animation: shield-float linear infinite;
}

.s1  { width: 48px;  height: 48px;  left: 5%;   animation-duration: 18s; animation-delay: 0s;    bottom: -60px; }
.s2  { width: 32px;  height: 32px;  left: 15%;  animation-duration: 14s; animation-delay: 3s;    bottom: -60px; }
.s3  { width: 64px;  height: 64px;  left: 25%;  animation-duration: 20s; animation-delay: 1s;    bottom: -60px; }
.s4  { width: 28px;  height: 28px;  left: 35%;  animation-duration: 13s; animation-delay: 6s;    bottom: -60px; }
.s5  { width: 56px;  height: 56px;  left: 45%;  animation-duration: 17s; animation-delay: 2s;    bottom: -60px; }
.s6  { width: 36px;  height: 36px;  left: 55%;  animation-duration: 15s; animation-delay: 5s;    bottom: -60px; }
.s7  { width: 72px;  height: 72px;  left: 65%;  animation-duration: 22s; animation-delay: 0.5s;  bottom: -60px; }
.s8  { width: 30px;  height: 30px;  left: 72%;  animation-duration: 12s; animation-delay: 4s;    bottom: -60px; }
.s9  { width: 52px;  height: 52px;  left: 80%;  animation-duration: 19s; animation-delay: 7s;    bottom: -60px; }
.s10 { width: 40px;  height: 40px;  left: 88%;  animation-duration: 16s; animation-delay: 2.5s;  bottom: -60px; }
.s11 { width: 24px;  height: 24px;  left: 93%;  animation-duration: 11s; animation-delay: 8s;    bottom: -60px; }
.s12 { width: 60px;  height: 60px;  left: 50%;  animation-duration: 21s; animation-delay: 9s;    bottom: -60px; }

@keyframes shield-float {
  0%   { transform: translateY(0)      rotate(-15deg); opacity: 0; }
  8%   { opacity: 0.55; }
  85%  { opacity: 0.3; }
  100% { transform: translateY(-110vh) rotate(25deg);  opacity: 0; }
}

/* ── Top bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: 270px; /* sidebar width */
  right: 0;
  z-index: 1000;
}

.logo-right {
  height: 100px;
  width: auto;
  object-fit: contain;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-date {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.topbar-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 270px;
  height: 100vh;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px);
  border-right: 1px solid rgba(99,102,241,0.12);
  box-shadow: 4px 0 32px rgba(99,102,241,0.10);
  z-index: 2000; /* above topbar */
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  /* remove these */
  transform: none;
  transition: none;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(99,102,241,0.1);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #4f46e5;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-close:hover { background: rgba(99,102,241,0.08); color: #4f46e5; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 24px;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { flex-shrink: 0; color: #818cf8; }

.nav-item:hover { background: rgba(99,102,241,0.08); color: #4f46e5; }
.nav-item.active { background: rgba(99,102,241,0.12); color: #4f46e5; font-weight: 700; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(79,70,229,0.08);
  backdrop-filter: blur(2px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active { opacity: 1; pointer-events: all; }

/* ── Dashboard layout ── */
.dashboard {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dash-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e1b4b;
  letter-spacing: -0.4px;
}

.dash-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 2px;
  display: block;
}

/* ── Stat row ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.07);
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }

.stat-info { display: flex; flex-direction: column; flex: 1; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: #1e1b4b; }
.stat-label { font-size: 0.75rem; color: #94a3b8; font-weight: 500; margin-top: 1px; }

.stat-trend { font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.stat-trend.up   { background: #dcfce7; color: #15803d; }
.stat-trend.down { background: #fee2e2; color: #dc2626; }

/* ── Middle row ── */
.middle-row {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

.side-panels { display: flex; flex-direction: column; gap: 16px; }

/* ── Panel base ── */
.panel {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.07);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Health list ── */
.health-list { display: flex; flex-direction: column; gap: 10px; }

.health-item { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; }

.health-label { width: 90px; color: #374151; font-weight: 500; flex-shrink: 0; }

.health-bar-wrap {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.health-bar { display: block; height: 100%; border-radius: 999px; }

.health-status { font-size: 0.75rem; font-weight: 600; width: 64px; text-align: right; }
.green-text  { color: #16a34a; }
.orange-text { color: #d97706; }
.red-text    { color: #dc2626; }

/* ── Alert list ── */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; align-items: flex-start; gap: 10px; }

.alert-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.alert-dot.red    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.alert-dot.orange { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.alert-dot.green2 { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }

.alert-info { display: flex; flex-direction: column; }
.alert-name { font-size: 0.82rem; font-weight: 600; color: #1e1b4b; }
.alert-time { font-size: 0.72rem; color: #94a3b8; margin-top: 1px; }

/* ── Bottom row ── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

/* ── Compliance circles ── */
.compliance-grid {
  display: flex;
  gap: 24px;
  justify-content: space-around;
  flex-wrap: wrap;
}

.compliance-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.c-circle {
  position: relative;
  width: 76px; height: 76px;
}

.c-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.c-circle span {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e1b4b;
}

.c-label { font-size: 0.75rem; font-weight: 600; color: #64748b; }

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Info list ── */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(99,102,241,0.07);
}

.info-list li:last-child { border-bottom: none; padding-bottom: 0; }

.info-key { color: #64748b; font-weight: 500; }
.info-val { color: #1e1b4b; font-weight: 700; }

/* ── Main card (download) ── */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: 110px;
  padding: 52px 64px 44px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 32px;
  backdrop-filter: blur(32px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 24px 64px rgba(99,102,241,0.14),
    0 4px 16px rgba(99,102,241,0.08);
  z-index: 2;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #a78bfa, #60a5fa, #a78bfa, #818cf8);
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.card-header { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.logo-glow {
  padding: 10px;
  border-radius: 20px;
  background: rgba(99,102,241,0.07);
  box-shadow: 0 0 24px rgba(99,102,241,0.15);
}

.card-logo { height: 72px; width: auto; object-fit: contain; display: block; }

.card-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), transparent);
}

/* ── Orb ── */
.orb-wrapper {
  position: relative;
  width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
}

.orb-bg {
  position: absolute;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.18), transparent 70%);
  animation: orb-breathe 3s ease-in-out infinite;
}

.orb {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #4f46e5, #7c3aed);
  box-shadow: 0 0 20px rgba(99,102,241,0.5), 0 0 48px rgba(99,102,241,0.2), 0 4px 16px rgba(99,102,241,0.4);
  animation: orb-breathe 3s ease-in-out infinite;
  z-index: 2;
}

@keyframes orb-breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(99,102,241,0.25);
  animation: ring-expand 3s ease-out infinite;
}

.r1 { width: 80px;  height: 80px;  animation-delay: 0s; }
.r2 { width: 115px; height: 115px; animation-delay: 1s; }
.r3 { width: 150px; height: 150px; animation-delay: 2s; }

@keyframes ring-expand {
  0%   { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0;   transform: scale(1.1); }
}

.pulse-dot {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 10px #818cf8, 0 0 20px rgba(129,140,248,0.4);
}

.d1 { animation: orbit 5s linear infinite; }
.d2 { animation: orbit 5s linear infinite; animation-delay: -1.66s; }
.d3 { animation: orbit 5s linear infinite; animation-delay: -3.33s; }

@keyframes orbit {
  0%   { transform: rotate(0deg)   translateX(62px); }
  100% { transform: rotate(360deg) translateX(62px); }
}

/* ── Button ── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 16px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(79,70,229,0.4), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { left: -100%; }
  60%  { left: 150%; }
  100% { left: 150%; }
}

.btn-download:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(79,70,229,0.5), 0 1px 0 rgba(255,255,255,0.2) inset; }
.btn-download:active  { transform: scale(0.97); }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Hint ── */
.hint { font-size: 0.82rem; min-height: 18px; color: #94a3b8; letter-spacing: 0.2px; }
.hint.success { color: #059669; font-weight: 600; }
.hint.error   { color: #dc2626; font-weight: 600; }

/* ── Popup ── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(79,70,229,0.15);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup-overlay.active { opacity: 1; pointer-events: all; }

.popup-card {
  background: #fff;
  border-radius: 28px;
  padding: 48px 52px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(22,163,74,0.15), 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(22,163,74,0.15);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  text-align: center;
  max-width: 360px;
  width: 90%;
}

.popup-overlay.active .popup-card { transform: scale(1); }

.popup-icon { animation: pop-in 0.5s cubic-bezier(0.34,1.56,0.64,1) both; animation-delay: 0.2s; }

@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.popup-title { font-size: 1.6rem; font-weight: 800; color: #14532d; letter-spacing: -0.4px; }
.popup-msg   { font-size: 1.05rem; color: #374151; font-weight: 500; }
.popup-highlight { color: #16a34a; font-weight: 700; }

.popup-close {
  margin-top: 8px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 36px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(22,163,74,0.35);
}

.popup-close:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(22,163,74,0.45); }
.popup-close:active { transform: scale(0.97); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .middle-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .card { padding: 36px 28px 32px; }
}