:root {
  color-scheme: dark;
  --bg: #030407;
  --panel: rgba(16, 18, 26, 0.86);
  --panel-2: rgba(24, 27, 38, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #a9afbe;
  --green: #a7ff3c;
  --cyan: #29d7ff;
  --pink: #ff4f91;
  --yellow: #ffd84a;
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 72% 12%, rgba(91, 75, 255, 0.22), transparent 30%),
    radial-gradient(circle at 28% 82%, rgba(167, 255, 60, 0.12), transparent 26%),
    #030407;
  color: var(--text);
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.72;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1280px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #051006;
  background: linear-gradient(135deg, var(--green), #29d7ff);
  box-shadow: 0 0 32px rgba(167, 255, 60, 0.28);
}

.brand-title {
  line-height: 1.05;
}

.brand-title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill,
.ghost,
.primary,
.danger,
.mini {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
}

.primary {
  border: 0;
  color: #061005;
  background: linear-gradient(135deg, var(--green), #62f22e);
  box-shadow: 0 18px 42px rgba(167, 255, 60, 0.2);
}

.danger {
  border-color: rgba(255, 79, 145, 0.38);
  background: rgba(255, 79, 145, 0.12);
  color: #ffd6e4;
}

.mini {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.hero {
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: 46px;
  padding: 28px 0 48px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(46px, 7vw, 106px);
  line-height: 0.9;
  font-weight: 950;
}

.hero-copy p {
  max-width: 660px;
  color: #c8cfdd;
  font-size: 18px;
  line-height: 1.65;
}

.nova-word {
  color: var(--green);
  text-shadow: 0 0 34px rgba(167, 255, 60, 0.45);
}

.planet-wrap {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.planet {
  width: min(440px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92), transparent 8%),
    radial-gradient(circle at 40% 34%, #a7ff3c, transparent 18%),
    radial-gradient(circle at 64% 55%, #29d7ff, transparent 28%),
    radial-gradient(circle at 35% 72%, #ff4f91, transparent 24%),
    #111827;
  box-shadow:
    inset -44px -50px 80px rgba(0, 0, 0, 0.58),
    0 0 88px rgba(41, 215, 255, 0.28),
    0 0 140px rgba(167, 255, 60, 0.18);
  animation: planetSpin 14s linear infinite;
}

.orbit {
  position: absolute;
  width: min(560px, 88vw);
  height: 128px;
  border: 2px solid rgba(167, 255, 60, 0.34);
  border-radius: 50%;
  transform: rotate(-18deg);
  box-shadow: 0 0 22px rgba(167, 255, 60, 0.18);
}

.burst {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: conic-gradient(from 40deg, transparent, rgba(255, 216, 74, 0.16), transparent, rgba(255, 79, 145, 0.14), transparent);
  filter: blur(16px);
  animation: pulse 3.6s ease-in-out infinite;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.product-card,
.panel,
.metric,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(27, 30, 42, 0.9), rgba(14, 16, 22, 0.9));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.product-card {
  min-height: 190px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 255, 60, 0.5);
}

.product-card h2 {
  margin: 0 0 10px;
  font-size: 25px;
}

.product-card p,
.muted {
  color: var(--muted);
}

.auth-layout {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
  align-items: start;
  padding-top: 26px;
}

.auth-card,
.panel {
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: var(--text);
  color: #06070a;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
  color: #d8dde8;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(167, 255, 60, 0.7);
  box-shadow: 0 0 0 4px rgba(167, 255, 60, 0.12);
}

.dashboard {
  display: grid;
  gap: 18px;
  padding-top: 20px;
}

.owner-dashboard {
  height: calc(100vh - 34px);
  min-height: 680px;
  overflow: hidden;
  gap: 14px;
}

.owner-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.owner-title h1 {
  margin: 6px 0 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
}

.connection-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  min-width: 220px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.connection-pill span {
  grid-row: span 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.connection-pill.online span {
  background: var(--green);
  box-shadow: 0 0 24px rgba(167, 255, 60, 0.76);
}

.connection-pill.offline span {
  background: #ff477b;
  box-shadow: 0 0 24px rgba(255, 71, 123, 0.58);
}

.connection-pill strong {
  line-height: 1;
}

.connection-pill small {
  color: var(--muted);
}

.owner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  min-height: 0;
}

.owner-main {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px;
}

.owner-metrics {
  gap: 12px;
}

.owner-metrics .metric {
  min-width: 0;
  padding: 15px;
}

.metric span {
  color: var(--muted);
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.owner-metrics .metric strong {
  overflow: hidden;
  font-size: 26px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric small {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.owner-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 14px;
  min-height: 0;
}

.panel-head.compact {
  align-items: start;
  margin-bottom: 10px;
}

.panel-head.compact p {
  margin: 4px 0 0;
}

.heartbeat-panel,
.storage-panel,
.owner-log-panel {
  min-height: 0;
}

.status-timeline {
  display: grid;
  gap: 18px;
  min-height: 285px;
  align-content: center;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    radial-gradient(circle at 18% 14%, rgba(167, 255, 60, 0.11), transparent 34%);
}

.status-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.status-summary strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}

.status-summary span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.status-summary b {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status-summary.is-operational {
  border: 1px solid rgba(167, 255, 60, 0.22);
}

.status-summary.is-operational strong {
  color: var(--green);
}

.status-summary.has-issue {
  border: 1px solid rgba(255, 79, 145, 0.28);
}

.status-summary.has-issue strong {
  color: #ff9fbd;
}

.status-bars {
  display: grid;
  grid-template-columns: repeat(16, minmax(8px, 1fr));
  gap: 5px;
  align-items: stretch;
}

.status-bars span {
  height: 62px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.status-bars span.is-up {
  background: linear-gradient(180deg, #a7ff3c, #35e878);
  box-shadow: 0 0 18px rgba(167, 255, 60, 0.2);
}

.status-bars span.is-down {
  background: linear-gradient(180deg, #ff4f91, #ff3047);
  box-shadow: 0 0 18px rgba(255, 79, 145, 0.18);
}

.status-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.storage-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.storage-ring {
  --p: calc(var(--value) * 1%);
  display: grid;
  place-items: center;
  width: min(210px, 100%);
  aspect-ratio: 1;
  margin: 4px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #10131d 0 58%, transparent 59%),
    conic-gradient(var(--green) var(--p), rgba(255, 255, 255, 0.08) 0);
}

.storage-ring strong {
  font-size: 34px;
}

.storage-ring span {
  margin-top: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.owner-log-panel {
  max-height: calc(100vh - 160px);
  overflow: hidden;
}

.owner-log-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 245px);
  overflow-y: auto;
  padding-right: 4px;
}

.owner-log-item {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.owner-log-item strong {
  line-height: 1.35;
}

.owner-log-item small {
  color: var(--muted);
}

.admin-title {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 18px;
  align-items: end;
}

.admin-title h1 {
  margin: 10px 0 0;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.search-box input {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 14px 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tabs button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 950;
}

.admin-tabs button.active {
  color: #061005;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #64f22f);
  box-shadow: 0 12px 30px rgba(167, 255, 60, 0.16);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(520px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.admin-left {
  display: grid;
  gap: 18px;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-stat-grid div {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.mini-stat-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.mini-stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.customers-panel {
  position: sticky;
  top: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0 0 4px;
}

.customer-list {
  display: grid;
  gap: 12px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
}

.customer-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.customer-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.customer-main h3 {
  margin: 0 0 5px;
}

.customer-main p {
  margin: 3px 0;
  color: var(--muted);
}

.customer-edit {
  display: grid;
  grid-template-columns: 1fr 1fr 110px;
  gap: 10px;
}

.customer-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storage-bar {
  height: 15px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.storage-bar div {
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.chart {
  height: 250px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 18px 0 0;
}

.bar {
  flex: 1;
  min-width: 22px;
  height: var(--h);
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, var(--cyan), #6d5cff);
  box-shadow: 0 0 24px rgba(41, 215, 255, 0.18);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.status.approved,
.status.success,
.status.online {
  background: rgba(167, 255, 60, 0.14);
  color: var(--green);
}

.status.pending {
  background: rgba(255, 216, 74, 0.14);
  color: var(--yellow);
}

.status.rejected,
.status.suspended,
.status.offline {
  background: rgba(255, 79, 145, 0.14);
  color: #ff9fbd;
}

.release-form {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 420px;
  padding: 13px 16px;
  border: 1px solid rgba(167, 255, 60, 0.35);
  border-radius: 14px;
  background: rgba(7, 8, 12, 0.95);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes planetSpin {
  from { filter: hue-rotate(0deg); transform: rotate(0deg); }
  to { filter: hue-rotate(24deg); transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@media (max-width: 980px) {
  .hero,
  .auth-layout,
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .product-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .admin-title,
  .admin-grid,
  .customer-edit {
    grid-template-columns: 1fr;
  }

  .customers-panel {
    position: static;
  }

  .planet-wrap {
    min-height: 360px;
  }
}
