:root {
  --bg-deep: #050811;
  --bg-surface: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.78);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(56, 189, 248, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --msp-primary: #38bdf8;
  --msp-accent: #a855f7;
  --emerald: #10b981;
  --gold: #f59e0b;
  --rose: #f43f5e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 14% 12%, rgba(56, 189, 248, 0.12), transparent 36%),
    radial-gradient(circle at 86% 18%, rgba(168, 85, 247, 0.14), transparent 38%),
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(5, 8, 17, 0.88);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--msp-primary), var(--msp-accent));
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #050811;
}

.brand-meta strong { display: block; font-size: 1rem; }
.brand-meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--msp-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a, .nav-links button {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav-links a:hover, .nav-links button:hover, .nav-links a.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 780px;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.14);
  color: var(--msp-primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-ok { background: rgba(16, 185, 129, 0.14); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.badge-warn { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.badge-crit { background: rgba(244, 63, 94, 0.16); color: #fb7185; border-color: rgba(244, 63, 94, 0.35); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
}

.card h2, .card h3 { margin: 0 0 10px; font-size: 1.08rem; }

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--msp-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: rgba(5, 8, 17, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--msp-primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover { border-color: var(--border-glow); }

.btn-primary {
  background: linear-gradient(135deg, var(--msp-primary), var(--msp-accent));
  color: #050811;
  border: none;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.table-wrap { overflow-x: auto; margin-top: 12px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
th {
  color: var(--text-secondary);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-banner {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.muted { color: var(--text-secondary); }
.citation-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-size: 0.84rem;
  line-height: 1.5;
}
.citation-box a { color: #34d399; }
