:root {
  --bg: #0b0e14;
  --bg-elev: #121722;
  --bg-elev2: #171d2b;
  --border: #232b3a;
  --border-strong: #2f3a4f;
  --text: #e6ebf5;
  --text-dim: #8b97ad;
  --text-faint: #5c677d;
  --accent: #5b8cff;
  --accent-dim: #2a4488;
  --accent-2: #6ee7b7;
  --danger: #ff6b6b;
  --warn: #ffcf5c;
  --ok: #37d67a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91,140,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(110,231,183,.07), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.5;
}
a { color: var(--accent); }
code, .mono { font-family: var(--mono); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.brand {
  display: flex; align-items: center; gap: 11px; margin-bottom: 6px;
}
.brand .diamond {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8a6bff);
  display: grid; place-items: center; color: #fff; font-size: 15px;
  box-shadow: 0 4px 16px rgba(91,140,255,.4);
}
.brand h1 { font-size: 17px; margin: 0; letter-spacing: .2px; }
.login-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 22px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }
input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.18); }
input.mono { font-family: var(--mono); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, var(--accent), #4a78ec);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 11px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--bg-elev2); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.banner { padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.banner.err { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.35); color: #ffb4b4; }
.banner.ok  { background: rgba(55,214,122,.12); border: 1px solid rgba(55,214,122,.35); color: #97e9b8; }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: rgba(11,14,20,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { margin: 0; flex: 1; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-elev2); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; color: var(--text-dim);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(55,214,122,.2); }
.dot.down { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,107,107,.2); }
.user-tag { color: var(--text-dim); font-size: 13px; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 22px 60px; }
.grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .grid.cols-2 { grid-template-columns: 1.05fr .95fr; } }

.card {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h2 { font-size: 14px; margin: 0 0 3px; letter-spacing: .2px; }
.card .hint { color: var(--text-dim); font-size: 12.5px; margin: 0 0 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

/* status strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px;
}
.stat .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); }
.stat .v { font-size: 19px; font-weight: 650; margin-top: 3px; font-family: var(--mono); }
.stat .v small { font-size: 12px; color: var(--text-dim); font-weight: 400; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.inline { display: flex; gap: 10px; align-items: flex-end; }

/* balance table */
.balances { width: 100%; border-collapse: collapse; }
.balances th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.balances td { padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.balances tr:last-child td { border-bottom: none; }
.asset { display: flex; align-items: center; gap: 10px; }
.badge {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.asset .nm { font-weight: 600; }
.asset .sub { font-size: 11.5px; color: var(--text-faint); }
.amount { font-family: var(--mono); text-align: right; }
.amount.zero { color: var(--text-faint); }
.amount.has { color: var(--ok); font-weight: 600; }
.tag-na { font-size: 11px; color: var(--warn); }

.empty { color: var(--text-dim); font-size: 13px; padding: 26px 6px; text-align: center; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

.muted { color: var(--text-dim); }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; }
.addr { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); word-break: break-all; }
.copy { cursor: pointer; color: var(--text-faint); background: none; border: none; padding: 2px 5px; font-size: 12px; }
.copy:hover { color: var(--accent); }

.audit { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.audit li { padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; display: flex; gap: 9px; align-items: baseline; }
.audit li:last-child { border-bottom: none; }
.audit .t { color: var(--text-faint); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.audit .a { font-weight: 600; }
.audit .a.send { color: var(--ok); }
.audit .a.fail { color: var(--danger); }
.audit .a.login { color: var(--accent); }

.notice {
  background: rgba(255,207,92,.08); border: 1px solid rgba(255,207,92,.28);
  color: #ffe09a; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 12.5px; margin-bottom: 18px;
}
.footer { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 34px; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast { background: var(--bg-elev2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 15px; font-size: 13px; box-shadow: var(--shadow); max-width: 340px; animation: slide .2s ease; }
.toast.ok { border-color: rgba(55,214,122,.5); }
.toast.err { border-color: rgba(255,107,107,.5); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }
