:root {
  --bg: #07111f;
  --bg-soft: rgba(14, 28, 46, 0.72);
  --panel: rgba(12, 24, 40, 0.82);
  --panel-strong: rgba(11, 20, 34, 0.92);
  --line: rgba(148, 163, 184, 0.16);
  --text: #edf6ff;
  --muted: #9ab1c9;
  --accent: #61f0c5;
  --accent-strong: #0ec2a0;
  --danger: #ff7d66;
  --warning: #ffc857;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 16px;
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(97, 240, 197, 0.14), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(255, 200, 87, 0.15), transparent 22%),
    linear-gradient(160deg, #030b14 0%, #07111f 38%, #0b1d30 100%);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 52%, transparent 94%);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.panel,
.card,
.user-card,
.workspace-shell,
.domain-card,
.metric,
.chart,
.toast {
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: end;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(11, 24, 39, 0.9), rgba(7, 17, 31, 0.8));
  box-shadow: var(--shadow);
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.95;
  max-width: 10ch;
}

.hero-copy,
.panel-head p,
.card p,
.empty-state p,
.muted,
.record-meta,
#user-email {
  color: var(--muted);
}

.hero-card,
.user-card,
.panel,
.card,
.metric,
.chart,
.domain-card,
.workspace-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 22px;
}

.hero-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #bdfce8, var(--accent-strong));
  box-shadow: 0 0 18px rgba(97, 240, 197, 0.7);
}

.content {
  margin-top: 28px;
}

.panel {
  padding: 28px;
}

.hidden {
  display: none !important;
}

.auth-grid,
.app-panel {
  display: grid;
  gap: 20px;
}

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

.app-panel {
  grid-template-columns: 360px minmax(0, 1fr);
}

.sidebar {
  display: grid;
  gap: 20px;
  align-content: start;
}

.user-card,
.card {
  padding: 22px;
}

.user-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #d9e9fa;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(154, 177, 201, 0.18);
  background: rgba(6, 13, 23, 0.82);
  color: var(--text);
  transition: border-color 140ms ease, transform 140ms ease;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(97, 240, 197, 0.8);
  transform: translateY(-1px);
}

button {
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  cursor: pointer;
  color: #042118;
  font-weight: 700;
  background: linear-gradient(135deg, #aefbe7 0%, #61f0c5 50%, #0ec2a0 100%);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  box-shadow: 0 14px 30px rgba(14, 194, 160, 0.24);
}

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

button.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

button.warn {
  color: #2a1500;
  background: linear-gradient(135deg, #ffe6af 0%, #ffc857 100%);
}

button.danger {
  color: #2a0902;
  background: linear-gradient(135deg, #ffd1c8 0%, #ff7d66 100%);
}

.domain-list-wrap {
  min-height: 280px;
}

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

.panel-head.compact {
  margin-bottom: 14px;
}

.domain-list {
  display: grid;
  gap: 12px;
}

.domain-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(15, 31, 51, 0.92), rgba(7, 17, 31, 0.85));
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease;
}

.domain-card:hover,
.domain-card.active {
  transform: translateY(-1px);
  border-color: rgba(97, 240, 197, 0.52);
}

.domain-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.pill-row,
.metrics,
.security-grid,
.record-grid,
.node-grid {
  display: grid;
  gap: 16px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
}

.pill.verified {
  background: rgba(14, 194, 160, 0.18);
  color: #cffff0;
}

.pill.pending {
  background: rgba(255, 200, 87, 0.18);
  color: #ffe6af;
}

.workspace {
  min-height: 780px;
}

.workspace-shell {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: var(--panel-strong);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 480px;
  text-align: center;
  padding: 48px;
  border: 1px dashed rgba(154, 177, 201, 0.26);
  border-radius: var(--radius);
  background: rgba(8, 18, 32, 0.68);
}

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

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.split {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 0.8fr;
}

.stack {
  display: grid;
  gap: 20px;
}

.chart {
  padding: 18px;
}

.chart-bars {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  min-height: 220px;
  margin-top: 18px;
}

.bar {
  display: grid;
  gap: 4px;
  justify-items: stretch;
  align-items: end;
}

.bar-stack {
  display: grid;
  gap: 2px;
  align-items: end;
}

.bar-stack span {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 999px;
}

.bar-allow {
  background: linear-gradient(180deg, #80ffd9, #17c49d);
}

.bar-challenge {
  background: linear-gradient(180deg, #ffe7a8, #ffc857);
}

.bar-block {
  background: linear-gradient(180deg, #ffb5a8, #ff7d66);
}

.bar-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.code-box,
.table,
.node {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(5, 12, 22, 0.78);
}

.code-box {
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: auto;
}

.table {
  overflow: hidden;
}

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(154, 177, 201, 0.08);
  vertical-align: top;
}

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

tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions button {
  padding: 10px 14px;
  box-shadow: none;
}

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

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

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.toggle input {
  width: auto;
}

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

.node {
  padding: 18px;
}

.event-list {
  display: grid;
  gap: 12px;
}

.event {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.event strong {
  display: block;
  margin-bottom: 6px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 380px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.95);
}

@media (max-width: 1080px) {
  .hero,
  .app-panel,
  .split,
  .auth-grid,
  .metrics,
  .record-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    width: min(100% - 20px, 1440px);
  }
}

@media (max-width: 720px) {
  .layout {
    padding-top: 18px;
  }

  .hero,
  .panel,
  .user-card,
  .card,
  .workspace-shell {
    padding: 18px;
  }

  .chart-bars {
    min-height: 160px;
  }

  th,
  td {
    padding: 12px;
  }
}
