:root {
  --bg: #05070d;
  --bg-2: #090d18;
  --panel: rgba(15, 22, 35, 0.68);
  --panel-strong: rgba(19, 28, 45, 0.86);
  --line: rgba(140, 170, 220, 0.18);
  --text: #edf4ff;
  --muted: #8e9bb0;
  --blue: #53b7ff;
  --cyan: #50f2dc;
  --green: #6df59b;
  --rose: #ff6b9c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(80, 242, 220, 0.14), transparent 32rem),
    radial-gradient(circle at 88% 2%, rgba(83, 183, 255, 0.18), transparent 36rem),
    linear-gradient(135deg, #05070d 0%, #08101f 48%, #070912 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.logout-form {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(80, 242, 220, 0.46);
  border-radius: 9px;
  background:
    radial-gradient(circle at 66% 36%, var(--cyan), transparent 21%),
    linear-gradient(135deg, rgba(83, 183, 255, 0.9), rgba(80, 242, 220, 0.12));
  box-shadow: 0 0 28px rgba(80, 242, 220, 0.35);
}

.nav {
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 10, 18, 0.58);
}

.nav a,
.logout-form button {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav a:hover,
.logout-form button:hover,
.nav .nav-cta {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav .nav-cta {
  color: #051018;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 800;
}

.glass {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 27, 43, 0.78), rgba(10, 14, 25, 0.58));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
}

.hero {
  position: relative;
  min-height: calc(100vh - 78px);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 86px 0 58px;
}

#moon-canvas {
  position: absolute;
  inset: -80px -16vw auto auto;
  z-index: -1;
  width: 62vw;
  min-width: 620px;
  height: 720px;
  opacity: 0.95;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.72fr);
  gap: 38px;
  align-items: center;
}

.eyebrow,
.sidebar-kicker,
.live-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(80, 242, 220, 0.2);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(80, 242, 220, 0.08);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  margin: 18px 0 18px;
  font-size: clamp(4rem, 10vw, 8.6rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 680px;
  color: #b6c4d8;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

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

.button.primary {
  border-color: rgba(80, 242, 220, 0.38);
  color: #031119;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 42px rgba(80, 242, 220, 0.2);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.button.full {
  width: 100%;
}

.hero-panel {
  border-radius: 18px;
  padding: 22px;
}

.panel-header,
.panel-title,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-header {
  justify-content: flex-start;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.terminal {
  margin: 28px 0;
  padding: 18px;
  border: 1px solid rgba(83, 183, 255, 0.16);
  border-radius: 14px;
  background: rgba(2, 6, 12, 0.58);
  color: #ccf7ff;
  font-family: "JetBrains Mono", monospace;
}

.terminal p {
  margin: 0 0 12px;
}

.terminal p:last-child {
  margin-bottom: 0;
}

.terminal span {
  color: var(--cyan);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.metric-row div {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.metric-row strong,
.stat-card strong {
  display: block;
  font-size: 1.7rem;
}

.metric-row span,
.stat-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 70px;
}

.feature-card,
.stat-card,
.workspace-panel,
.sidebar,
.form-card,
.auth-card {
  border-radius: 18px;
}

.feature-card,
.stat-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.feature-card {
  padding: 24px;
}

.feature-card h2 {
  margin: 18px 0 8px;
  font-size: 1.12rem;
}

.feature-card p,
.empty-state p,
.radar-card p,
.detail-head p {
  color: var(--muted);
  line-height: 1.6;
}

.icon {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(80, 242, 220, 0.95), rgba(83, 183, 255, 0.16));
  box-shadow: 0 0 26px rgba(83, 183, 255, 0.22);
}

.app-page main,
.auth-page main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}

.sidebar {
  position: sticky;
  top: 94px;
  height: fit-content;
  padding: 22px;
}

.sidebar h1 {
  margin: 12px 0 22px;
  font-size: 1.6rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.sidebar-nav span {
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
}

.sidebar-nav .active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.dashboard-main {
  min-width: 0;
}

.section-title,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-title h2,
.detail-head h1,
.form-card h1,
.auth-card h1 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.workspace-panel {
  padding: 22px;
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title h3 {
  margin: 0;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.86rem;
}

.perimeter-list,
.target-table {
  display: grid;
  gap: 10px;
}

.perimeter-item,
.target-row {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.target-row-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.target-delete-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid rgba(255, 107, 156, 0.22);
  border-radius: 50%;
  color: #ff9ab8;
  background: rgba(255, 107, 156, 0.06);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.target-delete-button:hover {
  color: #fff;
  border-color: rgba(255, 107, 156, 0.48);
  background: rgba(255, 107, 156, 0.16);
}

.perimeter-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.perimeter-item small,
.target-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.perimeter-item em,
.target-type {
  color: var(--cyan);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  padding: 28px;
  border: 1px dashed rgba(80, 242, 220, 0.24);
  border-radius: 16px;
  background: rgba(80, 242, 220, 0.04);
}

.empty-state.compact {
  padding: 20px;
}

.radar-card {
  display: grid;
  place-items: center;
  min-height: 280px;
  text-align: center;
}

.radar {
  position: relative;
  width: 178px;
  height: 178px;
  margin-bottom: 20px;
  border: 1px solid rgba(80, 242, 220, 0.36);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(80, 242, 220, 0.18), transparent 6%),
    repeating-radial-gradient(circle, rgba(80, 242, 220, 0.18) 0 1px, transparent 1px 34px);
}

.radar::after {
  position: absolute;
  inset: 50% 50% 0 50%;
  content: "";
  width: 86px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  transform-origin: left center;
  animation: sweep 3.8s linear infinite;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.form-page,
.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 170px);
}

.form-card,
.auth-card {
  width: min(560px, 100%);
  padding: 28px;
}

.stack-form,
.target-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: #c8d7ea;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid rgba(140, 170, 220, 0.22);
  border-radius: 12px;
  color: var(--text);
  background: rgba(4, 9, 18, 0.72);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(80, 242, 220, 0.58);
  box-shadow: 0 0 0 4px rgba(80, 242, 220, 0.08);
}

.errorlist {
  margin: 6px 0 0;
  padding: 0;
  color: #ff9ab8;
  list-style: none;
  font-size: 0.88rem;
}

.auth-note {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-note a {
  color: var(--cyan);
  font-weight: 800;
}

.detail-layout {
  display: grid;
  gap: 18px;
}

.target-form {
  grid-template-columns: 0.65fr 1fr;
}

.target-form label:nth-child(4),
.target-form .button {
  grid-column: 1 / -1;
}

.port-scan-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.messages {
  width: min(1180px, calc(100% - 32px));
  margin: 10px auto 0;
}

.message {
  padding: 12px 14px;
  border: 1px solid rgba(80, 242, 220, 0.22);
  border-radius: 12px;
  background: rgba(80, 242, 220, 0.08);
}

.wide-table {
  overflow: hidden;
}

.discovery-run {
  gap: 10px;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 800;
}

.tool-pill.completed {
  color: var(--green);
  border-color: rgba(109, 245, 155, 0.26);
  background: rgba(109, 245, 155, 0.08);
}

.tool-pill.skipped {
  color: #ffd27f;
  border-color: rgba(255, 190, 90, 0.3);
  background: rgba(255, 190, 90, 0.08);
}

.tool-pill.running,
.tool-pill.queued {
  color: var(--cyan);
  border-color: rgba(80, 242, 220, 0.26);
  background: rgba(80, 242, 220, 0.08);
}

.tool-pill.failed {
  color: #ff9ab8;
  border-color: rgba(255, 107, 156, 0.3);
  background: rgba(255, 107, 156, 0.08);
}

.metadata-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.asset-table,
.open-port-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.asset-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.asset-help {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.asset-help div {
  padding: 12px;
  border: 1px solid rgba(80, 242, 220, 0.14);
  border-radius: 12px;
  background: rgba(80, 242, 220, 0.045);
}

.asset-help strong {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
}

.asset-help span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.asset-head,
.asset-row {
  display: grid;
  grid-template-columns: 74px 180px 180px minmax(220px, 1fr) 140px 100px 150px;
  gap: 10px;
  min-width: 1040px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
}

.asset-head {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.asset-row {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045);
  color: #d8e8fa;
  font-size: 0.9rem;
}

.metadata-head,
.metadata-row {
  display: grid;
  grid-template-columns: 110px 180px 88px 160px minmax(220px, 1fr) 120px 80px;
  gap: 10px;
  min-width: 980px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
}

.open-port-head,
.open-port-row {
  display: grid;
  grid-template-columns: 180px 90px 100px minmax(240px, 1fr) 150px;
  gap: 10px;
  min-width: 820px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
}

.open-port-head {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.open-port-row {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045);
  color: #d8e8fa;
  font-size: 0.9rem;
}

.metadata-head {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metadata-row {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045);
  color: #d8e8fa;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .dashboard-layout,
  .content-grid,
  .feature-band {
    grid-template-columns: 1fr;
  }

  #moon-canvas {
    inset: -120px -280px auto auto;
    min-width: 620px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-title,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero-panel,
  .workspace-panel,
  .form-card,
  .auth-card {
    padding: 18px;
  }

  .stat-grid,
  .target-form,
  .port-scan-form,
  .target-row-actions {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .asset-help {
    grid-template-columns: 1fr;
  }
}
