:root {
  --bg: #07111d;
  --panel: rgba(7, 17, 29, 0.78);
  --panel-2: rgba(12, 24, 38, 0.9);
  --border: rgba(148, 163, 184, 0.14);
  --text: #eaf2ff;
  --muted: #9fb1c8;
  --accent: #34d399;
  --accent-2: #38bdf8;
  --danger: #fb7185;
  --warning: #f59e0b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Instrument Sans", sans-serif;
  background: radial-gradient(circle at top, #12233b 0%, #09101c 45%, #05080f 100%);
}

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

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.5;
}

.blob-a {
  width: 340px;
  height: 340px;
  background: #06b6d4;
  left: -100px;
  top: 50px;
}

.blob-b {
  width: 420px;
  height: 420px;
  background: #22c55e;
  right: -120px;
  top: 200px;
}

.mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 94%);
}

.auth-shell,
.app-shell {
  position: relative;
  z-index: 1;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 24px;
}

.auth-copy,
.login-card,
.sidebar,
.topbar,
.panel-card,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.auth-copy,
.login-card,
.sidebar,
.topbar,
.panel-card {
  border-radius: 28px;
}

.auth-copy {
  padding: 40px;
}

.login-card {
  padding: 28px;
  display: grid;
  gap: 16px;
  align-self: end;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 11ch;
}

.lede {
  margin: 18px 0 0;
  max-width: 60ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.health-box {
  margin-top: 28px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.health-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.health-row:last-child {
  border-bottom: 0;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  border-color: rgba(56, 189, 248, 0.5);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #0ea5a4 100%);
  color: #042213;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.feedback {
  min-height: 1.4em;
  color: var(--muted);
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.sidebar {
  padding: 24px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-item {
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
}

.menu-item.active,
.menu-item:hover {
  color: var(--text);
  background: rgba(52, 211, 153, 0.14);
}

.sidebar-foot {
  display: grid;
  gap: 12px;
}

.user-chip {
  padding: 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
}

.user-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.section {
  display: none;
  gap: 18px;
}

.section.active {
  display: grid;
}

.stats-grid,
.content-grid,
.form-grid,
.stack-actions {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  padding: 20px;
  border-radius: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.stat-card strong {
  font-size: 1.8rem;
}

.content-grid.two {
  grid-template-columns: 1fr 1fr;
}

.panel-card {
  padding: 22px;
}

.panel-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

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

.form-grid > label:last-of-type:nth-child(odd),
.form-grid > button,
.form-grid > p {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.88rem;
}

td .btn {
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.85rem;
}

pre,
.list-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #dce8f7;
  font-size: 0.88rem;
}

.list-item {
  padding: 13px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item strong {
  display: block;
  margin-bottom: 5px;
}

.muted {
  color: var(--muted);
}

.danger {
  background: rgba(251, 113, 133, 0.16);
  color: #ffd5dc;
}

.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #ffe2a8;
}

.success {
  background: rgba(52, 211, 153, 0.16);
  color: #d6ffef;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
  }

  .menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-panel,
  .content-grid.two,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid.compact,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .menu {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .auth-shell,
  .app-shell {
    padding: 14px;
  }

  .auth-copy,
  .login-card,
  .sidebar,
  .topbar,
  .panel-card,
  .stat-card {
    border-radius: 22px;
  }

  .menu {
    grid-template-columns: 1fr;
  }
}
