:root {
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 20px 50px rgba(7, 10, 20, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Inter", sans-serif;
}

body {
  color: #edf2ff;
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 174, 255, 0.18), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(123, 77, 255, 0.18), transparent 42%),
    linear-gradient(170deg, #0c111d 0%, #11172a 48%, #0f1322 100%);
}

body[data-theme="light"] {
  color: #1f2432;
  background:
    radial-gradient(circle at 5% 5%, rgba(80, 160, 255, 0.14), transparent 35%),
    radial-gradient(circle at 95% 15%, rgba(120, 95, 255, 0.12), transparent 35%),
    linear-gradient(160deg, #f5f8ff 0%, #eaf1ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid rgba(166, 186, 255, 0.18);
  background: rgba(9, 14, 28, 0.78);
  backdrop-filter: blur(10px);
  padding: 24px 18px;
  position: relative;
  z-index: 3;
}

body[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.78);
  border-right-color: rgba(71, 98, 184, 0.2);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #f4f7ff;
  background: linear-gradient(140deg, #2276ff, #5f49ff);
  box-shadow: 0 12px 28px rgba(73, 106, 255, 0.35);
}

.brand-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.brand-subtitle {
  margin: 2px 0 0;
  opacity: 0.72;
  font-size: 0.82rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  opacity: 0.82;
  transition: all 160ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a[aria-current="page"] {
  opacity: 1;
  background: rgba(96, 127, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(129, 157, 255, 0.22);
}

body[data-theme="light"] .sidebar-nav a:hover,
body[data-theme="light"] .sidebar-nav a[aria-current="page"] {
  background: rgba(79, 124, 255, 0.12);
}

.content-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(170, 190, 255, 0.2);
  background: rgba(10, 16, 31, 0.55);
  backdrop-filter: blur(12px);
}

body[data-theme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.58);
  border-bottom-color: rgba(108, 134, 218, 0.2);
}

.top-nav-left,
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav h1 {
  margin: 2px 0 0;
  font-size: 1.1rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.66;
}

.ghost-button {
  border: 1px solid rgba(150, 176, 255, 0.35);
  background: rgba(16, 22, 38, 0.45);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    box-shadow 130ms ease;
}

body[data-theme="light"] .ghost-button {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(84, 126, 255, 0.35);
}

.ghost-button:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 188, 255, 0.7);
  box-shadow: 0 8px 18px rgba(74, 123, 255, 0.18);
}

.mobile-menu-toggle {
  display: none;
}

.chip {
  border: 1px solid rgba(153, 178, 255, 0.28);
  background: rgba(18, 25, 44, 0.38);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
}

body[data-theme="light"] .chip {
  background: rgba(255, 255, 255, 0.86);
}

.main-content {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.hero-card,
.panel-card,
.table-panel {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(164, 187, 255, 0.18);
  background: rgba(8, 13, 27, 0.5);
  box-shadow: var(--shadow-soft);
}

body[data-theme="light"] .hero-card,
body[data-theme="light"] .panel-card,
body[data-theme="light"] .table-panel {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(108, 146, 255, 0.18);
}

.hero-card {
  padding: 18px;
}

.hero-card h2 {
  margin: 0 0 8px;
}

.hero-card p {
  margin: 0;
  opacity: 0.82;
  max-width: 70ch;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.panel-card {
  padding: 14px;
}

.panel-label {
  margin: 0;
  opacity: 0.7;
  font-size: 0.84rem;
}

.panel-value {
  margin: 8px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.table-panel {
  padding: 16px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.table-header h3 {
  margin: 0;
}

.table-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(149, 175, 255, 0.16);
  font-size: 0.92rem;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 2;
}

.mobile-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .top-nav {
    padding: 14px;
  }

  .top-nav-right {
    gap: 8px;
  }

  .main-content {
    padding: 14px;
  }

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

  .table-row {
    flex-direction: column;
  }
}
