:root {
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --bg: #081018;
  --bg-elev: rgba(11, 19, 29, 0.84);
  --bg-card: rgba(13, 23, 35, 0.92);
  --bg-card-strong: rgba(16, 27, 40, 0.98);
  --border: rgba(123, 156, 191, 0.18);
  --border-strong: rgba(123, 156, 191, 0.28);
  --text: #e8f0f7;
  --muted: #9bb0c4;
  --muted-2: #71859a;
  --accent: #7eb6ff;
  --accent-2: #72e6c4;
  --warning: #ffbb66;
  --danger: #ff7f9a;
  --success: #7ee2a8;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(126, 182, 255, 0.22), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(114, 230, 196, 0.12), transparent 22%),
    linear-gradient(180deg, #07101a 0%, #0a121d 32%, #081018 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.32), transparent 82%);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: #a8ccff; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background: rgba(6, 13, 20, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 0.83rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(12, 19, 28, 0.4);
  transition: 160ms ease;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(126, 182, 255, 0.12);
  border-color: rgba(126, 182, 255, 0.24);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.footer {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 26px;
  color: var(--muted-2);
}

.app {
  display: grid;
  gap: 18px;
}

.hero,
.card,
.panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 34%),
    var(--bg-card);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at right top, rgba(126, 182, 255, 0.16), transparent 26%),
    radial-gradient(circle at left bottom, rgba(114, 230, 196, 0.12), transparent 22%);
}
.hero-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-copy {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-meta,
.stat-grid {
  display: grid;
  gap: 12px;
}
.hero-meta {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.meta-chip,
.stat-card,
.pill {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(9, 15, 23, 0.62);
}
.meta-chip {
  padding: 12px 14px;
}
.meta-label {
  display: block;
  color: var(--muted-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.meta-value {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat-card {
  padding: 16px;
}
.stat-label {
  color: var(--muted-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stat-value {
  margin-top: 8px;
  font-size: 1.6rem;
  font-weight: 700;
}

.card,
.panel {
  border-radius: 20px;
  padding: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 1.05rem;
}
.section-subtitle {
  margin: -6px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(9, 15, 23, 0.7);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.quick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 182, 255, 0.34);
  background: rgba(13, 21, 31, 0.92);
}

.row-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 28%), rgba(12, 19, 28, 0.86);
  box-shadow: var(--shadow);
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(123, 156, 191, 0.10);
}
.summary-row:first-child { border-top: 0; }

.field {
  display: grid;
  gap: 8px;
}
.field-label {
  color: var(--muted-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

input, textarea, select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(123, 156, 191, 0.18);
  background: rgba(6, 11, 17, 0.96);
  color: var(--text);
  font: inherit;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(126, 182, 255, 0.44);
  box-shadow: 0 0 0 3px rgba(126, 182, 255, 0.12);
}
textarea {
  resize: vertical;
  min-height: 86px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(9, 15, 23, 0.82);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, rgba(126, 182, 255, 0.92), rgba(91, 151, 231, 0.92)); color: #081018; }
.btn.secondary { border-color: rgba(123, 156, 191, 0.20); background: rgba(12, 19, 28, 0.8); }
.btn.danger { background: linear-gradient(180deg, rgba(255, 127, 154, 0.86), rgba(219, 80, 118, 0.86)); color: #17060b; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 21, 0.8);
}
.status-banner.success { border-color: rgba(126, 226, 168, 0.28); }
.status-banner.warning { border-color: rgba(255, 187, 102, 0.28); }
.status-banner.danger { border-color: rgba(255, 127, 154, 0.28); }

.token-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(6, 10, 15, 0.96);
  border: 1px solid var(--border);
}
.token-value {
  display: block;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  overflow: auto;
  background: rgba(10, 17, 26, 0.96);
  color: #d9edff;
}

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

.inner-panel {
  background: rgba(8, 13, 20, 0.58);
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card-strong);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(123, 156, 191, 0.12);
  text-align: left;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(10, 17, 26, 0.96);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}
tbody tr:hover { background: rgba(126, 182, 255, 0.06); }
td { color: var(--text); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--text);
}
.pill.success { border-color: rgba(126, 226, 168, 0.34); color: var(--success); }
.pill.warning { border-color: rgba(255, 187, 102, 0.34); color: var(--warning); }
.pill.danger { border-color: rgba(255, 127, 154, 0.34); color: var(--danger); }
.pill.muted { color: var(--muted); }

.muted { color: var(--muted); }
.tiny { color: var(--muted-2); font-size: 0.88rem; }
.stack { display: grid; gap: 8px; }
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.grid-two {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.error {
  white-space: pre-wrap;
  color: #ffb4b4;
}
pre.code {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(6, 11, 17, 0.96);
  border: 1px solid var(--border);
  overflow: auto;
  color: #dbe8f4;
}
details {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 13, 19, 0.58);
  overflow: hidden;
}
summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
details > div {
  padding: 0 16px 16px;
}

.empty-state {
  padding: 28px;
  border-radius: 18px;
  border: 1px dashed rgba(123, 156, 191, 0.22);
  color: var(--muted);
  background: rgba(8, 14, 20, 0.48);
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .nav {
    justify-content: flex-start;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .main,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 680px) {
  .hero,
  .card,
  .panel {
    padding: 18px;
    border-radius: 18px;
  }
  .nav a {
    padding: 8px 12px;
  }
  table {
    min-width: 760px;
  }
  .form-grid,
  .detail-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }
}
