/* Isolated Networks Stargate Fleet MVP */
:root {
  --ink-950: #070d14;
  --ink-900: #0b1320;
  --ink-850: #0d1a2a;
  --ink-800: #102238;
  --panel: rgba(15, 29, 48, 0.88);
  --panel-strong: rgba(18, 35, 58, 0.96);
  --line: rgba(92, 133, 191, 0.24);
  --line-strong: rgba(61, 134, 255, 0.62);
  --text: #f4f8ff;
  --muted: #9fb0c8;
  --faint: #61708a;
  --blue: #2f73ff;
  --blue-2: #05a9ff;
  --cyan: #39dcff;
  --violet: #24206f;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #fb7185;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 52% 16%, rgba(46, 112, 255, 0.20), transparent 30rem),
    radial-gradient(circle at 80% 72%, rgba(0, 168, 255, 0.12), transparent 34rem),
    linear-gradient(135deg, #07101a 0%, #0a1a2c 44%, #092543 100%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.20;
  background-image:
    linear-gradient(30deg, transparent 47%, rgba(66, 153, 255, 0.18) 49%, transparent 51%),
    linear-gradient(150deg, transparent 47%, rgba(66, 153, 255, 0.14) 49%, transparent 51%);
  background-size: 84px 48px;
  mask-image: radial-gradient(circle at 50% 18%, black, transparent 72%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.brand-logo {
  width: 166px;
  height: auto;
  display: block;
  object-fit: contain;
}
.brand-logo.small { width: 118px; }

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}
.login-shell::after {
  content: "";
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  border: 1px solid rgba(47, 115, 255, 0.18);
  box-shadow: 0 0 80px rgba(47, 115, 255, 0.12);
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(388px, 100%);
  padding: 34px 34px 30px;
  background: linear-gradient(180deg, rgba(18, 34, 55, 0.94), rgba(10, 20, 34, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 196px;
  height: 196px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(47, 115, 255, 0.58);
  box-shadow: inset 0 0 34px rgba(47, 115, 255, 0.10), 0 0 34px rgba(47, 115, 255, 0.10);
  opacity: 0.85;
}
.login-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 54px;
  width: 132px;
  height: 132px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid rgba(57, 220, 255, 0.20);
}
.brand {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 172px;
  margin-bottom: 10px;
}
.brand-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}
.brand-name { font-weight: 800; color: var(--text); }
.login-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 22px;
  line-height: 1.24;
  text-align: center;
  letter-spacing: -0.03em;
}
.login-sub {
  position: relative;
  z-index: 1;
  margin: 8px 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.field { position: relative; z-index: 1; margin-bottom: 17px; }
.field label {
  display: block;
  margin-bottom: 7px;
  color: #c8d4e7;
  font-size: 12px;
  font-weight: 800;
}
.field label::after { content: " *"; color: #ff5f7c; }
.field input, .field select {
  width: 100%;
  min-height: 43px;
  color: var(--text);
  background: rgba(7, 13, 20, 0.82);
  border: 1px solid rgba(97, 112, 138, 0.56);
  border-radius: 7px;
  padding: 0 13px;
  outline: none;
  transition: border 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.field input:focus, .field select:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 2px rgba(47, 115, 255, 0.30), 0 0 22px rgba(47, 115, 255, 0.22);
  background: rgba(10, 21, 36, 0.96);
}
.btn {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #3177ff, #0755cb);
  color: white;
  font-weight: 800;
  min-height: 44px;
  padding: 0 16px;
  box-shadow: 0 12px 30px rgba(6, 83, 207, 0.30);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 16px 36px rgba(6, 83, 207, 0.42); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: progress; }
.login-card .btn { width: 100%; margin-top: 8px; }
.btn-ghost {
  min-height: 34px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: none;
}
.btn-secondary {
  background: rgba(47,115,255,0.12);
  border: 1px solid rgba(47,115,255,0.45);
  color: #d9e7ff;
  box-shadow: none;
}
.alert {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.10);
  color: #ffd5dc;
  font-size: 12px;
}
.hidden { display: none !important; }
.login-foot {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  text-align: center;
  color: var(--faint);
  font-size: 11px;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 262px 1fr;
}
.sidebar {
  background: linear-gradient(180deg, rgba(9, 18, 32, 0.96), rgba(7, 13, 20, 0.98));
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  min-height: 92px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.nav-section {
  margin: 18px 8px 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: rgba(47, 115, 255, 0.12);
  border-color: rgba(47, 115, 255, 0.24);
}
.nav-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}
.nav-item.active .dot { background: var(--blue-2); box-shadow: 0 0 18px var(--blue-2); }
main { min-width: 0; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.70);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.crumbs {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.user { display: flex; gap: 10px; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: #d7e3f7;
  font-size: 12px;
}
.content { padding: 28px; max-width: 1400px; }
.banner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(47, 115, 255, 0.30);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(47, 115, 255, 0.14), rgba(5, 169, 255, 0.06)),
    rgba(11, 26, 44, 0.84);
  box-shadow: var(--shadow);
}
.pulse {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 8px rgba(74, 222, 128, 0.10), 0 0 24px rgba(74, 222, 128, 0.42);
}
.label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.text { color: var(--text); font-weight: 800; }
.spacer { flex: 1; }
.status-line { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }
.page-head {
  margin: 28px 0 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.14;
  letter-spacing: -0.04em;
}
p { color: var(--muted); margin: 6px 0 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card, .panel {
  background: linear-gradient(180deg, rgba(18, 34, 55, 0.90), rgba(10, 20, 34, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  position: relative;
  min-height: 172px;
  padding: 18px;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -44px;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(47, 115, 255, 0.22);
  border-radius: 50%;
}
.card-head, .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-weight: 900; letter-spacing: -0.02em; }
.card-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  border: 1px solid rgba(57, 220, 255, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
}
.metric { margin: 20px 0 10px; font-size: 34px; font-weight: 900; letter-spacing: -0.05em; }
.metric small { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.desc { min-height: 42px; }
.footer { margin-top: 14px; display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  color: #d8e6ff;
  background: rgba(47, 115, 255, 0.14);
  border: 1px solid rgba(47, 115, 255, 0.28);
  font-family: var(--mono);
  font-size: 11px;
}
.badge.placeholder { color: var(--warn); border-color: rgba(251,191,36,0.34); background: rgba(251,191,36,0.10); }
.stack { display: grid; gap: 16px; }
.panel { padding: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -0.02em; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.table th { color: var(--faint); font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }
.mono { font-family: var(--mono); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-grid .field { margin: 0; }
.empty { color: var(--faint); padding: 16px 8px; }
.actionbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(8,16,28,0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  color: #dce8fb;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head, .topbar { align-items: flex-start; flex-direction: column; height: auto; padding: 18px; }
  .content { padding: 18px; }
}
