
:root {
  --bg: #020617;
  --bg-alt: #020617;
  --card-bg: #020617;
  --accent: #22d3ee;
  --accent-strong: #38bdf8;
  --accent-purple: #0ea5e9;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.4);
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #020617 0, #000 70%);
  color: var(--text-main);
  min-height: 100%;
}

/* Animated grid + glow background */
body::before {
  content: "";
  position: fixed;
  inset: -40px;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(30, 64, 175, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 64, 175, 0.22) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .45;
  mix-blend-mode: soft-light;
  z-index: -3;
  animation: grid-drift 36s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(56, 189, 248, 0.24), transparent 55%),
    radial-gradient(circle at 85% 100%, rgba(15, 118, 210, 0.28), transparent 55%),
    radial-gradient(circle at 50% 110%, rgba(15, 23, 42, 0.9), transparent 60%);
  opacity: 0.9;
  z-index: -2;
  animation: glow-sway 26s ease-in-out infinite alternate;
}

/* subtle particle noise layer */
.app-frame::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.25) 0, transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(37, 99, 235, 0.22) 0, transparent 55%),
    radial-gradient(circle at 30% 80%, rgba(8, 47, 73, 0.5) 0, transparent 60%);
  opacity: 0.28;
  mix-blend-mode: screen;
  animation: particles-drift 42s linear infinite;
}

@keyframes grid-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-40px, -30px, 0);
  }
  100% {
    transform: translate3d(0, -60px, 0);
  }
}

@keyframes glow-sway {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-12px, -8px, 0) scale(1.03);
  }
  100% {
    transform: translate3d(8px, 10px, 0) scale(1.01);
  }
}

@keyframes particles-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(18px, -12px, 0);
  }
  100% {
    transform: translate3d(-12px, 10px, 0);
  }
}

.app-frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(15,23,42,.96), rgba(15,23,42,.8));
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: .7rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 0%, #22d3ee, transparent 55%),
    radial-gradient(circle at 80% 100%, #0ea5e9, transparent 55%),
    radial-gradient(circle at 50% 40%, #020617, #000 75%);
  border: 1px solid rgba(148, 163, 184, .7);
  box-shadow: 0 0 25px rgba(34, 211, 238, .5);
}

.brand-text-main {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand-text-sub {
  font-size: .75rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all .16s ease-out;
}

.nav-links a:hover {
  color: var(--accent-strong);
  border-color: rgba(56,189,248,.5);
  background: rgba(15,23,42,.9);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.3rem;
  border-radius: var(--radius-full);
  font-size: .85rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .16s ease-out;
}

.btn-primary {
  background: radial-gradient(circle at top left, var(--accent-strong), var(--accent-purple));
  color: #020617;
  box-shadow: 0 14px 30px rgba(56,189,248,.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(56,189,248,.6);
}

.btn-ghost {
  background: rgba(15,23,42,.9);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  border-color: rgba(56,189,248,.6);
  color: var(--accent-strong);
}

.main {
  flex: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.6rem 1.2rem 2.5rem;
}

.card {
  background: radial-gradient(circle at top, rgba(15,23,42,.96), rgba(15,23,42,1));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 64, 175, 0.85);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .16rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(34,211,238,.9);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 1.8rem;
}

.hero-title {
  margin: .8rem 0 .4rem;
  font-size: clamp(2rem, 3vw, 2.4rem);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero-title span {
  color: var(--accent-strong);
}

.hero-subtitle {
  font-size: .95rem;
  color: var(--text-muted);
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

.hero-meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.hero-meta strong {
  color: var(--accent-strong);
}

/* dashboard preview */
.preview-panel {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 64, 175, 0.95);
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.22), rgba(15,23,42,1));
  padding: 1rem 1.1rem;
  font-size: .8rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
  color: var(--text-muted);
  font-size: .75rem;
}

.preview-tags {
  display: flex;
  gap: .3rem;
}

.preview-pill {
  padding: .1rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.8);
}

.preview-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: .7rem;
}

.preview-sidebar {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.95);
  background: linear-gradient(to bottom, rgba(15,23,42,1), rgba(15,23,42,.96));
  padding: .5rem .45rem;
}

.preview-sidebar-item {
  padding: .25rem .45rem;
  border-radius: 999px;
  margin-bottom: .25rem;
  font-size: .75rem;
  color: var(--text-muted);
}

.preview-sidebar-item.active {
  background: rgba(15,23,42,1);
  color: var(--accent-strong);
  border: 1px solid rgba(56,189,248,.8);
}

.preview-main {
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.95);
  background: radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.32), rgba(15,23,42,1));
  padding: .65rem .75rem;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: .4rem;
  margin-bottom: .5rem;
}

.preview-metric {
  border-radius: 12px;
  background: rgba(15,23,42,1);
  border: 1px solid rgba(30, 64, 175, 0.95);
  padding: .3rem .4rem;
}

.preview-metric-label {
  font-size: .65rem;
  color: var(--text-muted);
}

.preview-metric-value {
  font-size: .8rem;
}

/* sections */
.section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: .95rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.section-sub {
  font-size: .8rem;
  color: var(--text-muted);
  max-width: 420px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1rem;
}

.feature-card {
  border-radius: 16px;
  border: 1px solid rgba(30, 64, 175, 0.9);
  background: linear-gradient(to bottom right, rgba(15,23,42,.98), rgba(15,23,42,1));
  padding: .9rem;
  font-size: .82rem;
}

.feature-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent-strong);
}

.feature-title {
  margin: .3rem 0 .25rem;
  font-size: .95rem;
}

.feature-body {
  color: var(--text-muted);
}

/* layout for dashboard-style pages */
.dashboard-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
}

.sidebar {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 64, 175, 0.95);
  background: linear-gradient(to bottom, rgba(15,23,42,1), rgba(15,23,42,.96));
  padding: 1rem .8rem;
}

.sidebar-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

.sidebar-item {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: .35rem .55rem;
  border-radius: 999px;
  font-size: .85rem;
  border: 1px solid transparent;
  margin-bottom: .25rem;
}

.sidebar-item:hover {
  color: var(--accent-strong);
  border-color: rgba(56,189,248,.6);
  background: rgba(15,23,42,.9);
}

.sidebar-item.active {
  color: var(--accent-strong);
  border-color: rgba(56,189,248,.9);
  background: radial-gradient(circle at left, rgba(37, 99, 235, 0.32), rgba(15,23,42,1));
}

.dashboard-main {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 64, 175, 0.95);
  background: linear-gradient(to bottom, rgba(15,23,42,1), rgba(15,23,42,.98));
  padding: 1.2rem 1.1rem;
}

/* tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}

.table th, .table td {
  padding: .4rem .5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.95);
}

.table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
}

.log-pill {
  display: inline-flex;
  align-items: center;
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.7);
  font-size: .68rem;
}

.log-pill.ok {
  color: #22c55e;
  border-color: rgba(34,197,94,.8);
}

.log-pill.alert {
  color: #fb7185;
  border-color: rgba(248,113,113,.9);
}

/* footer */
.footer {
  border-top: 1px solid rgba(15, 23, 42, 0.95);
  padding: 1rem 1.2rem 1.6rem;
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
}

/* responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0,1fr);
  }
  .grid-3 {
    grid-template-columns: minmax(0,1fr);
  }
  .dashboard-shell {
    grid-template-columns: minmax(0,1fr);
  }
  .sidebar {
    order: -1;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
  }
  .sidebar-title {
    width: 100%;
  }
  .sidebar-item {
    margin-bottom: 0;
  }
}
