:root {
  color-scheme: dark;
  --bg: #070b16;
  --surface: rgba(15, 22, 41, 0.88);
  --surface-strong: #11182b;
  --surface-soft: rgba(255,255,255,0.035);
  --border: rgba(255,255,255,0.08);
  --text: #f6f8ff;
  --muted: #9ca8c7;
  --primary: #6b5cff;
  --primary-2: #39a7ff;
  --success: #39d98a;
  --warning: #ffbf69;
  --shadow: 0 24px 60px rgba(0,0,0,0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf1f8;
  --surface: rgba(255,255,255,0.9);
  --surface-strong: #ffffff;
  --surface-soft: rgba(7,11,22,0.04);
  --border: rgba(7,11,22,0.09);
  --text: #101528;
  --muted: #65708a;
  --shadow: 0 24px 60px rgba(26, 41, 78, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(107,92,255,0.18), transparent 32%),
    radial-gradient(circle at 10% 100%, rgba(57,167,255,0.12), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(7,11,22,0.78);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

:root[data-theme="light"] .sidebar { background: rgba(255,255,255,0.8); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 26px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 30px rgba(107,92,255,0.32);
  font-weight: 900;
}
.brand strong, .brand span { display: block; }
.brand span { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

.nav { display: grid; gap: 7px; }
.nav-link {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  transition: 160ms ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface-soft);
  transform: translateX(2px);
}
.nav-link.active { box-shadow: inset 3px 0 0 var(--primary-2); }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 14px var(--warning); }

.main { padding: 28px clamp(20px, 4vw, 58px); min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.eyebrow { margin-bottom: 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; color: var(--primary-2); }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: clamp(30px, 5vw, 64px);
  border: 1px solid var(--border);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(107,92,255,0.13), transparent 45%), var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  align-items: center;
}
.hero > div:first-child { max-width: 720px; position: relative; z-index: 2; }
.hero h2 { font-size: clamp(2rem, 4.5vw, 4.4rem); line-height: 0.98; letter-spacing: -0.055em; margin-bottom: 22px; }
.hero-copy { max-width: 680px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.7; }
.hero-orb {
  position: absolute;
  right: -80px;
  top: -70px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.42), rgba(57,167,255,0.25) 20%, rgba(107,92,255,0.32) 55%, transparent 70%);
  filter: blur(5px);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: 160ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: 0.72; }
.button-primary { color: white; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: 0; }
.button-secondary { color: var(--text); background: var(--surface-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.card, .panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card { padding: 22px; }
.card-header, .panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card strong { display: block; margin: 18px 0 9px; font-size: 1.07rem; }
.card p { color: var(--muted); line-height: 1.6; margin-bottom: 0; }

.badge { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; }
.badge-warning { color: var(--warning); background: rgba(255,191,105,0.12); }
.badge-success { color: var(--success); background: rgba(57,217,138,0.12); }
.badge-neutral { color: var(--muted); background: var(--surface-soft); }

.panel { padding: clamp(22px, 4vw, 34px); }
.panel h3 { margin-bottom: 0; font-size: 1.45rem; }
.audit-list { display: grid; gap: 12px; margin-top: 24px; }
.audit-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-soft);
}
.audit-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(57,217,138,0.12); color: var(--success); font-weight: 900; }
.audit-item strong { display: block; margin-bottom: 5px; }
.audit-item p, .audit-item time { margin: 0; color: var(--muted); font-size: 0.88rem; }

.footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 4px 4px; color: var(--muted); font-size: 0.82rem; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sidebar-footer { display: none; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main { padding: 20px 14px; }
  .topbar { align-items: flex-start; }
  .topbar .button { padding: 10px 12px; font-size: 0.82rem; }
  .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero { padding: 28px 22px; min-height: 390px; }
  .hero h2 { font-size: 2.25rem; }
  .audit-item { grid-template-columns: auto 1fr; }
  .audit-item time { grid-column: 2; }
  .footer { flex-direction: column; }
}
