:root {
  --background: #08111d;
  --surface: rgba(11, 22, 37, 0.82);
  --surface-strong: rgba(15, 27, 45, 0.94);
  --surface-soft: rgba(20, 34, 56, 0.88);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.24);
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --accent: #14b8a6;
  --accent-secondary: #60a5fa;
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow: 0 24px 90px rgba(2, 8, 23, 0.45);
}

html {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.10), transparent 24%),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 20%),
    linear-gradient(180deg, #020817 0%, #08111d 38%, #0b1625 100%);
}

body {
  background: transparent;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

code,
pre,
.font-mono {
  font-family: "JetBrains Mono", monospace;
}

.background-mesh {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(20, 184, 166, 0.12), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(96, 165, 250, 0.13), transparent 22%),
    radial-gradient(circle at 78% 76%, rgba(249, 115, 22, 0.08), transparent 24%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.20), rgba(2, 8, 23, 0.04));
  pointer-events: none;
}

.panel-card {
  border: 1px solid var(--border);
  border-radius: 2rem;
  background: var(--surface);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.app-shell {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar-card {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 2rem;
  background: rgba(8, 17, 29, 0.88);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0f172a, #0f766e);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.82rem 0.95rem;
  border-radius: 1rem;
  color: #cbd5e1;
  font-weight: 700;
  background: rgba(15, 27, 45, 0.78);
  border: 1px solid transparent;
  transition: all 140ms ease;
}

.nav-link:hover {
  background: rgba(20, 34, 56, 0.96);
  border-color: rgba(96, 165, 250, 0.18);
}

.nav-link-active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(29, 78, 216, 0.88));
  color: white;
  box-shadow: 0 16px 36px rgba(8, 47, 73, 0.35);
}

.source-card,
.page-hero {
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  background: rgba(11, 22, 37, 0.80);
  padding: 1.15rem;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--surface-strong);
  padding: 1.15rem;
  box-shadow: 0 16px 40px rgba(2, 8, 23, 0.25);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 0.75rem;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.metric-note {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill-ghost {
  background: rgba(15, 27, 45, 0.92);
  color: #cbd5e1;
  border: 1px solid var(--border);
}

.pill-success {
  background: rgba(20, 184, 166, 0.16);
  color: #5eead4;
}

.pill-warning {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

.pill-danger {
  background: rgba(248, 113, 113, 0.14);
  color: #fda4af;
}

.pill-dark {
  background: rgba(8, 17, 29, 0.98);
  color: white;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 9999px;
  padding: 0.72rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.22);
}

.btn-secondary {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: white;
  box-shadow: 0 16px 35px rgba(15, 118, 110, 0.18);
}

.btn-ghost {
  background: rgba(15, 27, 45, 0.88);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-danger {
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.btn-xs {
  padding: 0.42rem 0.7rem;
  font-size: 0.76rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 700;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(15, 27, 45, 0.92);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
}

.input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(6, 12, 22, 0.96);
  padding: 0.78rem 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.input-mini {
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
}

.chart-wrap {
  height: 360px;
  width: 100%;
}

.table-shell {
  overflow-x: auto;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: rgba(8, 17, 29, 0.82);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.data-table thead th {
  padding: 1rem;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  vertical-align: top;
  padding: 1rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.node-card {
  border-radius: 1.7rem;
  border: 1px solid var(--border);
  background: rgba(11, 22, 37, 0.80);
  padding: 1.15rem;
}

.deploy-card[open] {
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.06), rgba(96, 165, 250, 0.06)),
    var(--surface);
}

.deploy-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.deploy-launcher::-webkit-details-marker {
  display: none;
}

.plus-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: white;
  font-size: 1.6rem;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.code-card {
  border-radius: 1.45rem;
  border: 1px solid var(--border);
  background: rgba(11, 22, 37, 0.76);
  padding: 1rem;
}

.code-output {
  width: 100%;
  margin-top: 1rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  padding: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.65;
  resize: vertical;
}

.stat-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem;
  background: rgba(15, 27, 45, 0.90);
  padding: 0.85rem 1rem;
  color: #cbd5e1;
  font-size: 0.88rem;
}

.stat-chip span {
  color: var(--muted);
}

.alert-tile {
  border-radius: 1.35rem;
  border: 1px solid rgba(251, 191, 36, 0.20);
  background: rgba(120, 53, 15, 0.18);
  padding: 1rem 1.1rem;
  color: #fde68a;
  line-height: 1.6;
}

.notice-card {
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  background: rgba(15, 27, 45, 0.84);
  padding: 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.quick-link,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--border);
  background: rgba(11, 22, 37, 0.78);
}

.quick-link {
  font-weight: 700;
  color: var(--ink);
}

.flash {
  border-radius: 1.4rem;
  padding: 0.95rem 1.1rem;
  font-weight: 700;
}

.flash-success {
  background: rgba(20, 184, 166, 0.16);
  color: #99f6e4;
  border: 1px solid rgba(20, 184, 166, 0.20);
}

.flash-error {
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.24);
}

.clipboard-status {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.94);
  color: white;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  transition: opacity 140ms ease;
}

.theme-dark .text-slate-500,
.theme-dark .text-slate-600,
.theme-dark .text-slate-700 {
  color: var(--muted) !important;
}

.theme-dark .text-slate-900 {
  color: var(--ink) !important;
}

.theme-dark .bg-white\/92,
.theme-dark .bg-white\/85,
.theme-dark .bg-slate-50\/90,
.theme-dark .bg-slate-50 {
  background: rgba(15, 27, 45, 0.88) !important;
}

.theme-dark .border-white\/70,
.theme-dark .border-white\/80,
.theme-dark .border-slate-200,
.theme-dark .border-slate-300,
.theme-dark .border-dashed {
  border-color: var(--border) !important;
}

.theme-dark .bg-rose-50 {
  background: rgba(127, 29, 29, 0.22) !important;
}

.theme-dark .border-rose-200 {
  border-color: rgba(248, 113, 113, 0.24) !important;
}

.theme-dark .text-rose-700 {
  color: #fecaca !important;
}

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

  .sidebar-card {
    position: static;
  }

  .panel-card {
    padding: 1rem;
    border-radius: 1.5rem;
  }

  .metric-value {
    font-size: 1.55rem;
  }

  .chart-wrap {
    height: 300px;
  }
}
