:root {
  --navy: #0a1628;
  --navy-2: #12213a;
  --navy-3: #1b2e4d;
  --accent: #19c6b3;
  --accent-2: #3b82f6;
  --bg: #f3f6fa;
  --card: #ffffff;
  --line: #e3e9f1;
  --text: #0f1b2d;
  --muted: #66758a;
  --soft: #f6f8fb;
  --ok: #0f9f74;
  --warn: #c27a06;
  --bad: #d14343;
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Manrope, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 11px 16px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; transition: .15s; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #19c6b355; outline-offset: 2px; }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; padding: 30px 20px; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, #163257 0%, transparent 60%), var(--navy); color: #c9d5e6; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 0 6px; }
.mark { width: 40px; height: 40px; color: var(--accent); stroke-width: 0; }
.mark path[stroke] { stroke-width: 2; }
.mark path:last-child { stroke-width: 2.6; }
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.6px; }
.wordmark b { color: var(--accent); font-weight: 800; }
.slogan { margin: 14px 6px 0; font-size: 12px; font-style: italic; color: #8ea0ba; line-height: 1.5; }
nav { margin-top: 38px; display: grid; gap: 4px; }
nav button { background: none; color: #a8b6cb; justify-content: flex-start; padding: 12px 14px; font-weight: 600; }
nav button:hover { background: #ffffff0d; color: #fff; }
nav button.active { background: linear-gradient(90deg, #19c6b326, #19c6b30a); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
nav button.active svg { color: var(--accent); }
.sidefoot { margin-top: auto; display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 14px; background: #ffffff0a; border: 1px solid #ffffff12; }
.sidefoot svg { width: 26px; height: 26px; color: var(--accent); }
.sidefoot strong { display: block; color: #fff; font-size: 13px; }
.sidefoot small { color: #8ea0ba; font-size: 11px; }

/* Main */
main { margin-left: 264px; padding: 0 40px; max-width: 1640px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs b { color: var(--text); }
.topright { display: flex; gap: 10px; align-items: center; }
.ticker, .status { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.ticker span { color: var(--muted); font-weight: 600; }
.status { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #a6b2c3; }
.status.ok { color: var(--ok); } .status.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px #0f9f7422; }
.status.bad { color: var(--bad); } .status.bad .dot { background: var(--bad); }

.banner { margin-top: 22px; padding: 14px 18px; border-radius: 12px; background: #fff7ec; border: 1px solid #f6dfbd; color: #7a4d06; font-size: 13px; }
.banner b { margin-right: 8px; }
.banner code { background: #fde9cc; padding: 1px 6px; border-radius: 5px; }

.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 30px 0 24px; }
h1 { font-size: 30px; letter-spacing: -1px; margin: 0; font-weight: 800; }
.heading p { margin: 6px 0 0; color: var(--muted); }
p { color: var(--muted); }
.primary { background: linear-gradient(135deg, var(--navy-3), var(--navy)); color: #fff; box-shadow: 0 6px 18px #0a162833; }
.primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 24px #0a162844; }
.primary svg { color: var(--accent); }
.ghost { background: var(--soft); color: var(--navy-3); border: 1px solid var(--line); padding: 8px 12px; font-size: 13px; }
.ghost:not(:disabled):hover { border-color: #c8d3e2; }

/* Stats */
.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; }
.stat, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 2px #0a16280a; }
.stat label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat h2 { font-size: 28px; letter-spacing: -.8px; margin: 14px 0 8px; font-weight: 800; }
.stat small { font-size: 12px; color: var(--muted); }
.stat.hero { position: relative; overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(90% 120% at 100% 0%, #19c6b355, transparent 60%), linear-gradient(135deg, var(--navy-3), var(--navy)); }
.stat.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; border: 28px solid #ffffff08; }
.stat.hero label, .stat.hero small { color: #a9bad2; }
.stat.hero h2 { font-size: 32px; }

/* Panels */
.grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin: 22px 0; }
.spaced { margin: 22px 0; }
.panelhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
h2 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }

.wallet { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-top: 10px; transition: .15s; }
.wallet:hover { border-color: #c8d3e2; background: var(--soft); }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: var(--navy-3); background: linear-gradient(135deg, #e3f8f5, #e6efff); }
.details { flex: 1; min-width: 0; }
.wallet strong { display: block; font-size: 14px; }
.wallet small { color: var(--muted); display: block; font-size: 12px; }
.balance { text-align: right; }
.icon { padding: 9px; background: var(--soft); color: var(--navy-3); border: 1px solid var(--line); }

.empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: #b4c1d3; margin-bottom: 6px; }
.empty strong { color: var(--text); font-size: 14px; }
.empty span { font-size: 13px; max-width: 340px; }

/* Convert */
.field { display: block; margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
select, input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
select:disabled, input:disabled { background: var(--soft); color: #9aa7b8; }
.box { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
.box label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; font-weight: 600; }
.box small { color: var(--muted); font-size: 12px; }
.currency { display: flex; align-items: center; gap: 10px; }
.currency input, .currency strong { width: 100%; min-width: 0; font-size: 26px; font-weight: 800; border: 0; padding: 0; outline: 0; background: transparent; color: var(--text); letter-spacing: -.5px; }
.currency input:disabled { background: transparent; }
.currency b { white-space: nowrap; font-size: 13px; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.swap { width: 34px; height: 34px; margin: -8px auto -20px; position: relative; z-index: 1; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: var(--accent); font-weight: 800; border: 3px solid #fff; }
.rate { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin: 16px 2px; }
.wide { width: 100%; justify-content: center; padding: 14px; }
.hint { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

.steps h2 { margin: 10px 0 18px; font-size: 20px; }
.steps ol { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; }
.steps li::before { content: '0' counter(s); grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e3f8f5; color: #0b8a7c; font-weight: 800; }
.steps li span { color: var(--muted); font-size: 13px; }

/* Table */
.toolbar { display: flex; gap: 10px; align-items: center; }
.toolbar select { padding: 8px 10px; font-size: 13px; width: auto; }
.tablewrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 12px 10px; border-bottom: 1px solid var(--line); }
td { padding: 14px 10px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
td:first-child { display: flex; align-items: center; gap: 12px; }
td[colspan] { display: table-cell; }
td small { display: block; color: var(--muted); font-size: 11px; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.op { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; }
.op.in { background: #e3f8f1; color: var(--ok); } .op.cv { background: #e6efff; color: var(--accent-2); }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--soft); color: var(--muted); }
.pill.ok { background: #e3f8f1; color: var(--ok); } .pill.warn { background: #fff4e0; color: var(--warn); } .pill.bad { background: #fdeaea; color: var(--bad); }

footer { margin: 28px 0; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; }
footer b { color: var(--text); }

/* Dialog */
dialog { border: 0; border-radius: 20px; width: min(460px, calc(100vw - 32px)); padding: 26px; box-shadow: 0 30px 90px #0a162840; }
dialog::backdrop { background: #0a162888; backdrop-filter: blur(4px); }
.dialogtop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.dialogtop button { background: none; font-size: 24px; padding: 0 6px; color: var(--muted); }
dialog .field { margin-top: 14px; }
.address { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.address code { flex: 1; word-break: break-all; font-size: 12px; }
.review { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.review dt { color: var(--muted); } .review dd { margin: 0; text-align: right; font-weight: 600; }
.review .big { font-size: 20px; font-weight: 800; }
.error { color: var(--bad); font-size: 13px; min-height: 1em; }
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff; padding: 14px 20px; border-radius: 12px; box-shadow: 0 12px 30px #0a162840; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
#toast.show { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  main { margin-left: 220px; padding: 0 24px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.hero { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: auto; padding: 18px 16px 0; }
  .slogan { margin: 8px 6px 0; font-size: 11px; }
  .sidefoot { display: none; }
  nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--navy); border-top: 1px solid #ffffff14; }
  nav button { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 11px; justify-content: center; }
  nav button.active { box-shadow: inset 0 3px 0 var(--accent); }
  main { margin: 0; padding: 0 16px 90px; }
  .topbar { height: auto; padding: 14px 0; flex-wrap: wrap; }
  .crumbs { display: none; }
  .topright { width: 100%; justify-content: space-between; }
  .heading { flex-direction: column; align-items: stretch; margin: 22px 0 18px; }
  h1 { font-size: 26px; }
  .heading .primary { justify-content: center; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .panel, .stat { padding: 18px; }
  .panelhead { flex-wrap: wrap; }
  footer { flex-direction: column; }
}
@media (max-width: 700px) {
  .wallet { flex-wrap: wrap; row-gap: 8px; }
  .details { flex: 1 1 calc(100% - 110px); }
  .balance { order: 3; width: 100%; text-align: left; padding-left: 56px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
}

/* ---------- Acceso ---------- */
body.booting > * { visibility: hidden; }
[hidden] { display: none !important; }
.auth { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px 16px;
  background: radial-gradient(70% 60% at 15% 0%, #163257 0%, transparent 60%), radial-gradient(50% 50% at 100% 100%, #19c6b322, transparent 60%), var(--navy); }
.authcard { width: min(420px, 100%); background: var(--card); border-radius: 22px; padding: 34px 32px; box-shadow: 0 30px 80px #0006; }
.authbrand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.authbrand .mark { color: var(--accent); }
.authbrand .wordmark { color: var(--navy); }
.authcard .slogan { color: var(--muted); margin: 10px 0 0; }
.authcard h1 { font-size: 24px; margin: 28px 0 6px; }
.authcard form > p { margin: 0 0 6px; }
.authcard .field { margin-top: 16px; }
.authcard .wide { margin-top: 18px; }
.authfoot { color: #8ea0ba; font-size: 12px; margin: 0; }
.center { text-align: center; }
.linkbtn { background: none; color: var(--navy-3); padding: 4px 6px; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.authcard .linkbtn { display: block; margin: 12px auto 0; }

/* ---------- Usuario ---------- */
.userchip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.avatar.sm { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; }
.who { display: grid; line-height: 1.2; }
.who b { font-size: 13px; }
.who small { font-size: 11px; color: var(--muted); }
.userchip .icon { border-radius: 50%; padding: 7px; }

/* ---------- Cuenta ---------- */
.wallet.main { background: linear-gradient(135deg, #f1fbfa, #f2f6ff); border-color: #cdeee9; }
.wallet.main .avatar { background: var(--navy); color: var(--accent); }
.wallet.main .avatar svg { width: 22px; height: 22px; }
.sublabel { margin: 22px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.op.tr { background: #f1ecff; color: #7046d6; }
.box small .linkbtn { padding: 0 0 0 6px; font-size: 12px; }
td small { white-space: nowrap; }

/* ---------- Recibir ---------- */
.lead { margin: 0 0 14px; color: var(--text); }
.networks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.netopt { position: relative; cursor: pointer; }
.netopt input { position: absolute; opacity: 0; width: 0; height: 0; }
.netopt span { display: grid; gap: 2px; text-align: center; padding: 14px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--soft); transition: .15s; }
.netopt b { font-size: 15px; }
.netopt small { font-size: 11px; color: var(--muted); }
.netopt input:checked + span { border-color: var(--accent); background: #effbf9; box-shadow: 0 0 0 3px #19c6b322; }
.netopt input:focus-visible + span { outline: 3px solid #19c6b355; outline-offset: 2px; }
.address.pending { justify-content: center; text-align: center; color: var(--muted); font-size: 13px; padding: 18px; border-style: dashed; }
.warnline { color: #7a4d06; }

/* ---------- Admin ---------- */
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.narrow { max-width: 640px; }
.narrow .field { margin-top: 16px; }
.narrow .primary { margin-top: 18px; }

@media (max-width: 700px) {
  .userchip .who { display: none; }
  .authcard { padding: 26px 20px; }
  .networks { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
}

.op.wd { background: #fff4e0; color: var(--warn); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.alertbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin: 0 0 16px; border-radius: 12px; background: #fff4e0; color: #7a4d06; font-weight: 600; }
.alertbar button { white-space: nowrap; }
.actions.stack { flex-direction: column; align-items: stretch; min-width: 150px; }
.convert .networks + .field { margin-top: 16px; }
.grid > * { min-width: 0; }
@media (max-width: 900px) { nav button { position: relative; } nav .count { position: absolute; top: 2px; right: 18%; margin: 0; } }
