:root { color-scheme: dark; --grid: rgba(148,163,184,0.06); }

html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139,92,246,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(34,211,238,0.10), transparent 60%),
    linear-gradient(180deg, #07090f 0%, #05070c 100%);
}
body::before {
  content:''; position: fixed; inset:0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  pointer-events: none; z-index: 0;
}
#app { position: relative; z-index: 1; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139,92,246,.35), rgba(34,211,238,.25));
  border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(139,92,246,.6), rgba(34,211,238,.4)); background-clip: padding-box; border: 2px solid transparent; }

.card {
  position: relative; border-radius: 16px;
  background: linear-gradient(180deg, rgba(20,24,40,0.85), rgba(11,14,22,0.85));
  border: 1px solid rgba(148,163,184,0.08);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -24px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}
.card-hover:hover {
  border-color: rgba(139,92,246,0.35);
  box-shadow: 0 0 0 1px rgba(139,92,246,.22), 0 10px 40px -12px rgba(34,211,238,.25);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.hr-soft { border-color: rgba(148,163,184,0.08); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid rgba(148,163,184,0.14); background: rgba(255,255,255,0.02);
}
.badge-ok     { color: #86efac; border-color: rgba(134,239,172,.25); background: rgba(34,197,94,.08); }
.badge-warn   { color: #fcd34d; border-color: rgba(252,211,77,.25);  background: rgba(245,158,11,.08); }
.badge-err    { color: #fda4af; border-color: rgba(253,164,175,.25); background: rgba(244,63,94,.08); }
.badge-info   { color: #7dd3fc; border-color: rgba(125,211,252,.25); background: rgba(14,165,233,.08); }
.badge-muted  { color: #cbd5e1; }
.badge-accent { color: #e9d5ff; border-color: rgba(196,181,253,.25); background: rgba(139,92,246,.10); }

.dot { width:8px; height:8px; border-radius:999px; display:inline-block; }
.dot-ok   { background:#22c55e; box-shadow:0 0 10px rgba(34,197,94,.7); }
.dot-warn { background:#f59e0b; box-shadow:0 0 10px rgba(245,158,11,.6); }
.dot-err  { background:#f43f5e; box-shadow:0 0 10px rgba(244,63,94,.6); }
.dot-mute { background:#64748b; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(148,163,184,0.14);
  background: rgba(255,255,255,0.02); color: #e2e8f0;
  transition: all .18s ease; cursor: pointer; user-select: none;
}
.btn:hover { border-color: rgba(139,92,246,0.45); background: rgba(139,92,246,0.08); color:#fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, rgba(139,92,246,0.35), rgba(34,211,238,0.22));
  border-color: rgba(139,92,246,0.5); color:#fff;
  box-shadow: 0 8px 24px -12px rgba(139,92,246,.6);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.18); }
.btn-danger { background: rgba(244,63,94,0.12); border-color: rgba(244,63,94,0.35); color:#fecdd3; }
.btn-danger:hover { background: rgba(244,63,94,0.2); color:#fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.input, .select, .textarea {
  width: 100%; background: rgba(7,9,15,0.7);
  border: 1px solid rgba(148,163,184,0.14);
  color: #e2e8f0; border-radius: 10px;
  padding: 8px 12px; font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgba(139,92,246,.6); box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}
.label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; }

table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
table.tbl thead th {
  position: sticky; top: 0; background: rgba(11,14,22,0.95);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8;
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid rgba(148,163,184,0.08); z-index: 1;
}
table.tbl tbody td {
  padding: 12px 14px; font-size: 13px; color: #e2e8f0;
  border-bottom: 1px solid rgba(148,163,184,0.06);
}
table.tbl tbody tr:hover td { background: rgba(139,92,246,0.04); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #cbd5e1;
  position: relative; transition: color .15s ease, background .15s ease;
}
.nav-item:hover { color: #fff; background: rgba(148,163,184,0.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(139,92,246,0.18), rgba(34,211,238,0.06)); }
.nav-item.active::before {
  content:''; position: absolute; left:0; top:8px; bottom:8px;
  width:2px; border-radius:2px; background: linear-gradient(180deg,#8b5cf6,#22d3ee);
}

.bar { height: 6px; border-radius: 999px; background: rgba(148,163,184,0.12); overflow: hidden; position: relative; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg,#8b5cf6,#22d3ee); border-radius: inherit; }
.bar-warn > span { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.bar-err  > span { background: linear-gradient(90deg,#f43f5e,#fb7185); }

.toast {
  pointer-events: auto; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(15,19,32,0.95); border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  animation: slideIn .22s ease-out both;
  display: flex; align-items: center; gap: 10px;
}
.toast-ok { border-color: rgba(34,197,94,.35); }
.toast-err { border-color: rgba(244,63,94,.35); }

.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(11,14,22,.7); border: 1px solid rgba(148,163,184,.1); }
.tab { padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: 8px; color: #94a3b8; cursor: pointer; }
.tab.active { color: #fff; background: linear-gradient(180deg, rgba(139,92,246,.35), rgba(34,211,238,.22)); box-shadow: 0 4px 12px -4px rgba(139,92,246,.5); }
.tab:hover:not(.active) { color: #e2e8f0; background: rgba(148,163,184,.06); }

.spark path.line { filter: drop-shadow(0 0 4px rgba(34,211,238,.5)); }

.code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  background: rgba(7,9,15,0.7); border: 1px solid rgba(148,163,184,0.1);
  border-radius: 10px; padding: 12px 14px; color: #a5f3fc; overflow: auto; line-height: 1.55;
}
.code .c { color: #64748b; } .code .k { color: #c4b5fd; } .code .s { color: #86efac; }

main#view { animation: slideIn .2s ease-out both; }

.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(148,163,184,.2); transition: background .2s; cursor: pointer; }
.switch::after { content:''; position: absolute; top:2px; left:2px; width:18px; height:18px; border-radius:999px; background:#e2e8f0; transition: transform .2s; }
.switch.on { background: linear-gradient(90deg,#8b5cf6,#22d3ee); }
.switch.on::after { transform: translateX(16px); background:#fff; }

[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 6px);
  padding: 4px 8px; border-radius: 6px; font-size: 11px;
  background: #0b0e16; color: #e2e8f0; border: 1px solid rgba(148,163,184,.18);
  white-space: nowrap; z-index: 20;
}

.chip { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(148,163,184,.08); color: #cbd5e1; }

.login-bg {
  background:
    radial-gradient(600px 400px at 20% 30%, rgba(139,92,246,0.2), transparent 60%),
    radial-gradient(600px 400px at 80% 70%, rgba(34,211,238,0.15), transparent 60%),
    linear-gradient(180deg, #07090f 0%, #05070c 100%);
}
