:root {
  --bg: #03050c;
  --bg-2: #0a0f22;
  --card: linear-gradient(180deg, rgba(42, 46, 64, 0.62), rgba(20, 22, 33, 0.78));
  --card-flat: rgba(30, 33, 47, 0.7);
  --card-solid: #11131d;
  --chip: rgba(52, 57, 78, 0.55);
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f4f6ff;
  --muted: #8a90a8;
  --accent: #2f6bff;
  --accent-2: #4d8bff;
  --accent-glow: rgba(47, 107, 255, 0.45);
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 24px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Lexend', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(900px 620px at 72% -8%, rgba(37, 89, 230, 0.62), transparent 62%),
    radial-gradient(700px 500px at 0% 0%, rgba(20, 50, 160, 0.35), transparent 60%),
    linear-gradient(rgba(80, 120, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 120, 255, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, #071338 0%, #040818 45%, #03050c 100%);
  background-size: auto, auto, 96px 96px, 96px 96px, auto;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.logo {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: #000 url('/assets/logo-mark.png') center / cover no-repeat;
  border: 1px solid rgba(240, 190, 80, .45);
  box-shadow: 0 6px 24px rgba(240, 180, 60, .25), 0 0 0 3px rgba(255,255,255,.04);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.08); display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background .2s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn svg { width: 20px; height: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--chip);
  padding: 12px 20px; border-radius: 999px; cursor: pointer; font-weight: 500;
  transition: transform .12s ease, background .2s ease, filter .2s ease;
}
.btn:hover { background: rgba(70, 76, 100, .7); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { border: 0; color: #fff; background: var(--accent); box-shadow: 0 10px 30px var(--accent-glow); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.12); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.btn-danger { border-color: rgba(239, 68, 68, .35); color: #fca5a5; }

/* Segmented pills (Daily / Weekly / Monthly style) */
.seg { display: flex; gap: 6px; padding: 0; }
.seg button { flex: 1; white-space: nowrap; border: 0; padding: 12px 14px; border-radius: 999px; background: var(--chip); color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 8px 24px var(--accent-glow); }

/* Square action tiles (Send / Add funds style) */
.tile { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13px; color: #d7dbef; cursor: pointer; background: none; border: 0; }
.tile .sq { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(70, 80, 120, .5), rgba(40, 46, 70, .55)); border: 1px solid var(--line); }
.tile .sq svg { width: 24px; height: 24px; }

/* Rows (Latest transaction style) */
.row-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 16px 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04); transition: transform .15s ease, border-color .2s ease; cursor: pointer;
}
.row-card:hover { border-color: rgba(77, 139, 255, .45); transform: translateY(-1px); }
.row-card .title { font-weight: 500; font-size: 16px; }
.row-card .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.row-card .end { margin-left: auto; text-align: right; font-weight: 500; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong);
  border-radius: 16px; padding: 12px 16px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.25); }
select option { background: #11131d; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 10px; background: rgba(255,255,255,.06); white-space: nowrap;
}
.s-new, .s-awaiting_payment { color: #93b4ff; background: rgba(47, 107, 255, .14); }
.s-confirming { color: #fcd34d; background: rgba(252, 211, 77, .12); }
.s-paid { color: #4ade80; background: rgba(34, 197, 94, .14); }
.s-expired { color: #f87171; background: rgba(239, 68, 68, .12); }

.coin-icon {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 19px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 18px rgba(0,0,0,.35);
}
.coin-icon.sm { width: 28px; height: 28px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #1c2030; border: 1px solid var(--line-strong); padding: 11px 18px; border-radius: 999px;
  opacity: 0; transition: all .25s ease; pointer-events: none; z-index: 50; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: var(--accent-2);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; max-width: 1200px; margin: 0 auto; gap: 12px; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: 999px; background: rgba(20, 23, 35, .6); border: 1px solid var(--line); }
.topbar nav a { color: var(--muted); padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.topbar nav a:hover { color: var(--text); background: rgba(255,255,255,.06); text-decoration: none; }
.topbar nav a.on { color: #fff; background: var(--accent); }

/* Bar chart (Statistics style) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.bars .col { width: 100%; border-radius: 14px; min-height: 14px; background: linear-gradient(180deg, rgba(70, 76, 100, .75), rgba(40, 44, 60, .6)); transition: height .5s ease; }
.bars .b.on .col { background: linear-gradient(180deg, #4d8bff, var(--accent)); box-shadow: 0 10px 30px var(--accent-glow); }
.bars .lbl { font-size: 12px; color: var(--muted); }
.bars .b.on .lbl { color: #fff; }
@media (max-width: 600px) {
  .topbar { padding: 16px; }
  .topbar nav { flex-wrap: nowrap; overflow-x: auto; padding: 4px; }
  .topbar nav a { white-space: nowrap; padding: 6px 10px; font-size: 13px; }
  .topbar .brand .muted { display: none; }
}
