:root {
  --bg: #f6f8ff;
  --bg-elev: rgba(255, 255, 255, 0.74);
  --border: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.72);
  --muted-2: rgba(15, 23, 42, 0.52);
  --brand: #2b6cff;
  --brand-2: #16b9ff;
  --ok: #10b981;
  --warn: #f59e0b;
  --shadow-card: 0 14px 42px rgba(15, 23, 42, 0.1);
  --shadow-pop: 0 18px 56px rgba(15, 23, 42, 0.16);
  --radius: 16px;
  --radius-lg: 22px;
  --max: 1120px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: rgba(12, 18, 32, 0.72);
  --border: rgba(148, 163, 184, 0.16);
  --text: rgba(248, 250, 252, 0.92);
  --muted: rgba(226, 232, 240, 0.76);
  --muted-2: rgba(226, 232, 240, 0.55);
  --brand: #7aa2ff;
  --brand-2: #19d3ff;
  --shadow-card: 0 14px 48px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 18px 56px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: radial-gradient(1200px 520px at 18% -8%, rgba(43, 108, 255, 0.18), transparent 52%),
    radial-gradient(900px 520px at 92% 8%, rgba(22, 185, 255, 0.18), transparent 50%), var(--bg);
  color: var(--text);
}

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

button {
  font: inherit;
}

.btn:focus-visible,
.navlinks a:focus-visible,
input.btn:focus-visible,
select.btn:focus-visible {
  outline: 2px solid rgba(43, 108, 255, 0.6);
  outline-offset: 2px;
}

input.btn,
select.btn {
  width: 100%;
  display: block;
  text-align: left;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.3));
  border-bottom: 1px solid var(--border);
}

:root[data-theme="dark"] .topbar {
  background: linear-gradient(to bottom, rgba(12, 18, 32, 0.78), rgba(12, 18, 32, 0.25));
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand svg {
  width: 30px;
  height: 30px;
}

.navlinks {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navlinks a {
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease;
}

.navlinks a:hover {
  color: var(--text);
  background: rgba(43, 108, 255, 0.12);
}

.navlinks a[data-active="true"] {
  color: var(--text);
  background: rgba(43, 108, 255, 0.16);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop);
}

.btn.primary {
  border-color: rgba(43, 108, 255, 0.35);
  background: linear-gradient(135deg, rgba(43, 108, 255, 0.95), rgba(22, 185, 255, 0.9));
  color: white;
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  padding: 8px 10px;
  border-radius: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.muted-2 {
  color: var(--muted-2);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-card);
}

.grid {
  display: grid;
  gap: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar > * {
  min-width: 180px;
  flex: 1 1 180px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(43, 108, 255, 0.1);
  color: var(--muted);
  font-size: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 700;
  letter-spacing: 0.2px;
  background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="dark"] .table th {
  background: rgba(226, 232, 240, 0.03);
}

.table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.table tbody tr:hover {
  background: rgba(43, 108, 255, 0.08);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="dark"] .chart {
  background: rgba(226, 232, 240, 0.03);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: center;
}

.hero-illus {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(800px 260px at 20% 0%, rgba(43, 108, 255, 0.18), transparent 50%),
    radial-gradient(800px 260px at 80% 20%, rgba(22, 185, 255, 0.18), transparent 52%), var(--bg-elev);
  padding: 16px;
  overflow: hidden;
}

.code {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  overflow: auto;
}

:root[data-theme="dark"] .code {
  background: rgba(226, 232, 240, 0.06);
}

.app-layout {
  grid-template-columns: 260px 1fr;
  align-items: start;
}

.app-sidebar {
  padding: 14px;
  position: sticky;
  top: 76px;
}

@media (max-width: 860px) {
  .nav {
    flex-wrap: wrap;
  }

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

  .navlinks {
    display: none;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
  }

  :root[data-menu-open="true"] .navlinks {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  :root[data-menu-open="true"] .navlinks a {
    background: rgba(43, 108, 255, 0.08);
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    top: auto;
  }

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

  .toolbar > * {
    min-width: 100%;
    flex-basis: 100%;
  }
}

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

  .btn:hover {
    transform: none;
    box-shadow: none;
  }

  .navlinks a {
    transition: none;
  }
}
