:root {
  color-scheme: dark;
  --background: #07110e;
  --surface: #0d1b17;
  --surface-strong: #12241e;
  --border: #243b33;
  --text: #f1f7f4;
  --muted: #91a59d;
  --green: #50e3a4;
  --red: #ff7b7b;
  --yellow: #f5c76b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgb(45 113 85 / 22%), transparent 35rem),
    var(--background);
}

button, input, select { font: inherit; }

button {
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: #03120c;
  background: var(--green);
  font-weight: 750;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: 0.65; }
button.secondary { color: var(--text); background: transparent; border-color: var(--border); }
button.danger { min-height: 2.2rem; padding: 0.4rem 0.65rem; color: #ffd0d0; background: transparent; border-color: rgb(255 123 123 / 45%); }
button.icon-button { min-width: 2.25rem; min-height: 2.2rem; padding: 0.35rem; }

.account-actions { display: flex; align-items: center; gap: 0.8rem; }
.current-user { max-width: 18rem; overflow: hidden; color: var(--muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--border);
  background: rgb(7 17 14 / 82%);
  backdrop-filter: blur(14px);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
h2 { margin-bottom: 0; font-size: 1.35rem; }

.eyebrow {
  margin-bottom: 0.3rem;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }
.container { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 4rem; }

.status-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0.8rem var(--green); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card, .panel, .auth-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgb(18 36 30 / 95%), rgb(10 24 19 / 96%));
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 18%);
}

.summary-card { padding: 1.25rem; }
.summary-card span { display: block; margin-bottom: 0.7rem; color: var(--muted); }
.summary-card strong { font-size: clamp(1.45rem, 4vw, 2.1rem); }
.summary-card.incoming strong { color: var(--green); }
.summary-card.outgoing strong { color: var(--red); }

.panel { margin-top: 1rem; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.25rem; border-bottom: 1px solid var(--border); }
.collapsible-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.25rem; cursor: pointer; list-style: none; }
.collapsible-panel > summary::-webkit-details-marker { display: none; }
.collapsible-panel[open] > summary { border-bottom: 1px solid var(--border); }
.wallet-form { display: flex; align-items: end; gap: 0.8rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: rgb(7 17 14 / 35%); }
.field-group { display: grid; min-width: 10rem; gap: 0.35rem; }
.field-grow { flex: 1; min-width: 18rem; }
.form-message { flex-basis: 100%; margin: 0; }
.message.success { color: #caffea; border: 1px solid rgb(80 227 164 / 35%); background: rgb(80 227 164 / 10%); }
.counter { color: var(--muted); font-size: 0.85rem; }
.table-scroll { overflow-x: auto; }
.transaction-toolbar { display: flex; align-items: end; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.pagination-controls { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.row-actions { display: flex; align-items: center; gap: 0.45rem; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 0.9rem 1rem; border-bottom: 1px solid rgb(36 59 51 / 68%); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
td { font-size: 0.9rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgb(80 227 164 / 4%); }

.network, .badge { display: inline-flex; padding: 0.25rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 750; }
.network { color: var(--yellow); background: rgb(245 199 107 / 10%); }
.badge.incoming { color: var(--green); background: rgb(80 227 164 / 10%); }
.badge.outgoing { color: var(--red); background: rgb(255 123 123 / 10%); }
.transaction-link { color: var(--green); text-decoration: none; }
.transaction-link:hover { text-decoration: underline; }
.empty { color: var(--muted); text-align: center; padding: 2rem; }
.metric-failure { color: var(--red); font-weight: 750; }

dialog {
  width: min(720px, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 2rem 6rem rgb(0 0 0 / 55%);
}
dialog::backdrop { background: rgb(0 0 0 / 65%); backdrop-filter: blur(4px); }
.dialog-form { display: grid; gap: 1rem; padding: 1.25rem; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.dialog-grid label { display: grid; gap: 0.35rem; }
.dialog-actions { justify-content: flex-end; }

.auth-page { display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(430px, 100%); padding: clamp(1.5rem, 5vw, 2.5rem); }
.auth-card form { display: grid; gap: 0.7rem; margin-top: 1.5rem; }
label { color: var(--muted); font-size: 0.85rem; }
input, select { width: 100%; min-height: 2.9rem; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: 0.65rem; color: var(--text); background: #07110e; }
input:focus, select:focus { outline: 2px solid rgb(80 227 164 / 35%); border-color: var(--green); }
.message { padding: 0.8rem 1rem; border-radius: 0.7rem; }
.message.error { color: #ffd0d0; border: 1px solid rgb(255 123 123 / 35%); background: rgb(255 123 123 / 10%); }

@media (max-width: 760px) {
  .summary-grid { grid-template-columns: 1fr; }
  .navbar { align-items: flex-start; }
  .account-actions { align-items: flex-end; flex-direction: column; }
  .current-user { max-width: 12rem; }
  .wallet-form { align-items: stretch; flex-direction: column; }
  .field-group, .field-grow { width: 100%; min-width: 0; }
  .transaction-toolbar { align-items: stretch; flex-direction: column; }
  .pagination-controls { width: 100%; justify-content: space-between; margin-left: 0; }
  .dialog-grid { grid-template-columns: 1fr; }
}
