:root {
  --background: #0f172a;
  --surface: #1e293b;
  --surface-strong: #111827;
  --surface-soft: rgba(30, 41, 59, 0.72);
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f87171;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 28%),
    radial-gradient(circle at right center, rgba(14, 165, 233, 0.12), transparent 24%),
    linear-gradient(160deg, #020617 0%, var(--background) 48%, #111827 100%);
}

button,
input,
textarea {
  font: inherit;
}

.background-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.24;
  pointer-events: none;
}

.background-glow-left {
  top: -120px;
  left: -100px;
  background: #0ea5e9;
}

.background-glow-right {
  right: -140px;
  bottom: -120px;
  background: #22d3ee;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1364px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  gap: 20px;
}

.top-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tab-button {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.tab-button.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #082f49;
  border-color: transparent;
  font-weight: 700;
}

.tab-panel {
  display: none;
  gap: 20px;
}

.tab-panel.is-active {
  display: grid;
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-status {
  margin: 0;
  min-height: 24px;
  color: var(--muted);
}

.auth-status.is-error {
  color: #fecaca;
}

.auth-status.is-success {
  color: #bbf7d0;
}

.hero-card,
.panel-card,
.status-strip {
  background: var(--surface-soft);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  padding: 22px 24px;
  animation: rise-in 0.55s ease;
}

.hero-copy-block {
  display: grid;
  align-content: start;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero-card h1,
.panel-head h2 {
  margin: 0;
}

.hero-copy,
.panel-head span,
.metric-label,
.status-strip {
  color: var(--muted);
}

.hero-copy {
  max-width: 560px;
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 15px 16px;
  display: grid;
  gap: 6px;
}

.metric-card strong {
  font-size: 1.05rem;
  word-break: break-word;
}

.metric-card-actions {
  align-content: start;
}

.metric-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-actions-inline {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-action-button {
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.18);
  font-size: 0.78rem;
  line-height: 1;
}

.address-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.panel-card {
  padding: 22px;
  animation: rise-in 0.65s ease;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-tools {
  min-width: min(320px, 100%);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
  padding: 12px 14px;
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.accent-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #082f49;
  font-weight: 700;
}

.secondary-button {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.ghost-button,
.row-button {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.copy-button {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.18);
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.copy-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.copy-button.is-copied {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.42);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.button-row,
.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-panel {
  padding: 22px;
}

.security-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.security-card h3 {
  margin: 0 0 8px;
}

.security-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 760px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal-card {
  width: min(540px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-head {
  margin-bottom: 0;
}

.modal-close {
  align-self: start;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
}

td.address-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.address-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

.status-strip {
  padding: 14px 18px;
}

.status-strip.is-success {
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
}

.status-strip.is-error {
  border-color: rgba(248, 113, 113, 0.24);
  color: #fecaca;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1040px) {
  .hero-card,
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    margin: 18px auto;
  }

  .panel-card,
  .hero-card {
    padding: 18px;
  }

  .top-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .metric-head-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-actions-inline {
    justify-content: flex-start;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .button-row,
  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .security-card {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-tools {
    min-width: 100%;
  }
}