/* =========================================================
   NexusDesk — user dashboard styles
   Nile Testnet
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg:            #f6f7f9;
  --bg-elev:       #ffffff;
  --bg-sunken:     #eef0f3;
  --sidebar-bg:    #0b1220;
  --sidebar-fg:    #c7cfda;
  --sidebar-fg-dim:#7a8698;
  --sidebar-active:#ffffff;
  --sidebar-hover: #16213a;

  --fg:            #0f172a;
  --fg-muted:      #64748b;
  --fg-subtle:     #94a3b8;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --primary:       #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft:  #eff6ff;

  --ok:            #16a34a;
  --ok-soft:       #dcfce7;
  --warn:          #d97706;
  --warn-soft:     #fef3c7;
  --danger:        #dc2626;
  --danger-soft:   #fee2e2;
  --info:          #0891b2;
  --info-soft:     #cffafe;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;

  --shadow-sm:     0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.03);
  --shadow:        0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg:     0 10px 24px -10px rgba(15,23,42,.15), 0 4px 8px -4px rgba(15,23,42,.08);

  --font-sans:     'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w:     256px;
  --header-h:      64px;

  --t-fast:        .12s ease;
  --t:             .2s ease;
}

html[data-theme="dark"] {
  --bg:            #0b0f14;
  --bg-elev:       #131a24;
  --bg-sunken:     #0f1520;
  --fg:            #e6edf3;
  --fg-muted:      #94a3b8;
  --fg-subtle:     #64748b;
  --border:        #1f2a37;
  --border-strong: #2b3947;
  --primary-soft:  #0e1e3a;
  --ok-soft:       #052e1a;
  --warn-soft:     #2b1d05;
  --danger-soft:   #2b0d0d;
  --info-soft:     #072b30;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.3);
  --shadow:        0 1px 3px rgba(0,0,0,.4);
  --shadow-lg:     0 10px 24px -10px rgba(0,0,0,.6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- App shell ---------- */
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 40;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { color: #fff; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { color: var(--sidebar-fg-dim); font-size: 11px; }
.sidebar__close { display: none; margin-left: auto; color: var(--sidebar-fg); padding: 6px; border-radius: 6px; }
.sidebar__close:hover { background: var(--sidebar-hover); }

.sidebar__nav { padding: 14px 10px; flex: 1; }
.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--sidebar-fg-dim);
  padding: 14px 10px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--sidebar-fg);
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: var(--primary);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--warn);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.5;
}

.sidebar__footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.network-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(37,99,235,.15);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(37,99,235,.25);
}
.network-pill__label { color: #bfdbfe; }
.sidebar__disconnect { color: var(--sidebar-fg); }
.sidebar__disconnect:hover { background: var(--sidebar-hover); color: #fff; }

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 35;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Main column ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}

/* ---------- Header ---------- */
.header {
  height: var(--header-h);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
}
.header__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header__menu { display: none; }
.header__titles { min-width: 0; }
.header__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.header__subtitle { font-size: 12.5px; color: var(--fg-muted); margin: 1px 0 0; }
.header__right { display: flex; align-items: center; gap: 10px; position: relative; }

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  border: 1px solid rgba(22,163,74,.2);
}
html[data-theme="dark"] .network-badge { color: #4ade80; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot--live { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(22,163,74,0); } }

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  transition: border-color var(--t-fast);
  max-width: 240px;
}
.wallet-chip:hover { border-color: var(--border-strong); }
.wallet-chip__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.wallet-chip__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; text-align: left; }
.wallet-chip__label { font-size: 10.5px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.wallet-chip__addr { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--fg); }
.wallet-chip__chev { color: var(--fg-muted); flex-shrink: 0; }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  animation: menuIn .12s ease;
}
.menu__head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.menu__label { display: block; font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.menu__value { display: block; margin-top: 4px; color: var(--fg); word-break: break-all; }
.menu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg);
  text-align: left;
}
.menu__item:hover { background: var(--bg-sunken); }
.menu__item--danger { color: var(--danger); }
.menu__sep { height: 1px; background: var(--border); margin: 6px 0; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Content ---------- */
.content {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 108px;
  transition: border-color var(--t-fast);
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-card__label { font-size: 12px; color: var(--fg-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-card__icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.stat-card__value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat-card__hint { font-size: 12px; color: var(--fg-subtle); }
.stat-card.skeleton {
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg-sunken) 25%, rgba(148,163,184,.08) 37%, var(--bg-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Panels ---------- */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel__title { font-size: 15px; font-weight: 600; }
.panel__sub { font-size: 12.5px; color: var(--fg-muted); margin: 2px 0 0; }
.panel__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel__body { padding: 4px 0 0; }
.card-group { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: var(--bg-elev); color: var(--fg); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--border-strong); background: var(--bg-sunken); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--fg-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--fg); }
.icon-btn--sm { width: 26px; height: 26px; border-radius: 6px; }

/* ---------- Filters ---------- */
.filters {
  display: grid;
  grid-template-columns: 1fr 180px 200px;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.field { position: relative; display: flex; align-items: center; }
.field__icon {
  position: absolute;
  left: 12px;
  color: var(--fg-subtle);
  pointer-events: none;
}
.field--search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field--search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.field--select select {
  width: 100%;
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.field--select select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* ---------- Table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tbl thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 12px 20px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--bg-sunken); }
.cell-tx { font-family: var(--font-mono); font-size: 12.5px; }
.cell-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-time { color: var(--fg-muted); white-space: nowrap; font-size: 12.5px; }
.cell-action { text-align: right; white-space: nowrap; }
.row-link { cursor: pointer; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.pill--ok      { background: var(--ok-soft);     color: var(--ok);     border-color: rgba(22,163,74,.25); }
.pill--warn    { background: var(--warn-soft);   color: var(--warn);   border-color: rgba(217,119,6,.25); }
.pill--danger  { background: var(--danger-soft); color: var(--danger); border-color: rgba(220,38,38,.25); }
.pill--info    { background: var(--info-soft);   color: var(--info);   border-color: rgba(8,145,178,.25); }
.pill--muted   { background: var(--bg-sunken);   color: var(--fg-muted); border-color: var(--border); }
html[data-theme="dark"] .pill--ok     { color: #4ade80; }
html[data-theme="dark"] .pill--warn   { color: #fbbf24; }
html[data-theme="dark"] .pill--danger { color: #f87171; }
html[data-theme="dark"] .pill--info   { color: #22d3ee; }

/* ---------- States ---------- */
.state {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--fg-muted);
}
.state p { margin: 0; font-size: 13.5px; }
.state--error { color: var(--danger); }
.state--error .btn { margin-top: 4px; }

.spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty__icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.empty__title { font-size: 15px; font-weight: 600; color: var(--fg); }
.empty__text { font-size: 13px; color: var(--fg-muted); max-width: 380px; margin: 0; }
.empty .btn { margin-top: 8px; }

/* ---------- KV list ---------- */
.kv { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.kv__row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.kv__k { color: var(--fg-muted); font-size: 12.5px; font-weight: 500; }
.kv__v { display: flex; align-items: center; gap: 8px; color: var(--fg); min-width: 0; word-break: break-all; }

.check-list { list-style: none; padding: 18px 20px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.check-list li { display: flex; gap: 10px; font-size: 13px; color: var(--fg); }
.check { color: var(--ok); font-weight: 700; }

/* ---------- Form rows ---------- */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.form-row:last-child { border-bottom: 0; }
.form-row__label { font-size: 13px; font-weight: 500; color: var(--fg); }
.form-row__control { display: flex; align-items: center; gap: 10px; }
.input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  min-width: 160px;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background var(--t-fast);
  cursor: pointer;
}
.switch__slider::before {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.switch input:checked + .switch__slider { background: var(--primary); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.pagination__info { font-size: 12.5px; color: var(--fg-muted); }

/* ---------- Footer ---------- */
.footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer__dim { color: var(--fg-subtle); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.55);
  animation: fadeIn .15s ease;
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
  display: flex;
  flex-direction: column;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 15px; font-weight: 600; }
.modal__body { padding: 4px 20px; }
.modal__body .kv__row { grid-template-columns: 150px 1fr; }
.modal__foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  right: 20px; bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 11px 14px;
  min-width: 240px;
  max-width: 340px;
  font-size: 13px;
  color: var(--fg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn .18s ease;
}
.toast--ok      { border-left-color: var(--ok); }
.toast--error   { border-left-color: var(--danger); }
.toast--warn    { border-left-color: var(--warn); }
.toast__msg { flex: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .card-group { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--t);
    z-index: 45;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__close { display: inline-grid; }
  .header__menu { display: inline-grid; }
  .header__subtitle { display: none; }
  .network-badge { display: none; }
  .wallet-chip__text { display: none; }
  .wallet-chip { padding: 5px; }
  .wallet-chip__chev { display: none; }
  .filters { grid-template-columns: 1fr; padding: 12px 16px; }
  .panel__head { padding: 14px 16px; }
  table.tbl thead th { padding: 10px 14px; }
  table.tbl tbody td { padding: 12px 14px; }
  .content { padding: 16px; }
  .kv__row { grid-template-columns: 1fr; gap: 4px; }
  .kv__k { font-size: 11.5px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .header { padding: 0 14px; }
  .panel__actions .btn span { display: none; }
  .footer { font-size: 11.5px; padding: 12px 16px; }
  .toast-host { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

/* ---------- Tables → cards on very small screens ---------- */
@media (max-width: 560px) {
  table.tbl--responsive thead { display: none; }
  table.tbl--responsive,
  table.tbl--responsive tbody,
  table.tbl--responsive tr,
  table.tbl--responsive td { display: block; width: 100%; }
  table.tbl--responsive tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  table.tbl--responsive tr:last-child { border-bottom: 0; }
  table.tbl--responsive td {
    padding: 4px 0;
    border: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
  }
  table.tbl--responsive td::before {
    content: attr(data-label);
    color: var(--fg-muted);
    font-weight: 500;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
  }
  table.tbl--responsive td.cell-action { justify-content: flex-end; }
  table.tbl--responsive td.cell-action::before { content: none; }
}