/* ============================================================================
   ChainForge — Corporate Blockchain Services
   Linguagem visual: fintech-enterprise. Quase-preto, hairlines, ouro como
   acento, numeros em monospace. Restraint = premium.
   ============================================================================ */
:root {
  --bg:        #06080d;
  --bg-2:      #080b11;
  --panel:     #0b0e15;
  --panel-2:   #0e131c;
  --line:      #181d28;          /* hairline */
  --line-2:    #222837;
  --text:      #e8eaf0;
  --muted:     #828a9a;
  --faint:     #59616f;
  --gold:      #c8a24b;
  --gold-2:    #e7d49a;
  --gold-soft: rgba(200,162,75,.10);
  --silver-1:  #eef1f6;
  --silver-2:  #aeb7c6;
  --green:     #4cc38a;
  --red:       #e5675f;
  --radius:    12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 78% -8%, #0f1622 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--gold); }
.mono, .num, .hash { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.mono { font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hash { color: var(--silver-2); font-weight: 500; }

/* Marca --------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { height: 34px; width: auto; filter: drop-shadow(0 1px 4px rgba(0,0,0,.5)); }
.wordmark {
  font-weight: 700; font-size: 17px; line-height: 1; letter-spacing: .02em;
  background: linear-gradient(180deg, var(--silver-1), var(--silver-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark small {
  display: block; margin-top: 4px;
  -webkit-text-fill-color: initial; color: var(--gold);
  font-size: 8.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
}

/* Navbar -------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 26px; height: 62px; padding: 0 28px;
  background: rgba(7, 9, 14, .82);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; height: 100%; }
.nav-link {
  appearance: none; background: none; border: none; cursor: pointer; height: 100%;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 500;
  letter-spacing: .02em; padding: 0 15px; position: relative;
  transition: color .15s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ''; position: absolute; left: 15px; right: 15px; bottom: -1px; height: 2px;
  background: var(--gold); border-radius: 2px 2px 0 0;
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.lang-sel { padding: 6px 8px; font-size: 11.5px; font-weight: 600; border-radius: 7px; background: var(--bg); border: 1px solid var(--line-2); color: var(--text); letter-spacing: .04em; }
.nav-user { color: var(--muted); font-size: 13px; }
.nav-user b { color: var(--text); font-weight: 600; }

/* Layout -------------------------------------------------------------------- */
main { max-width: 1180px; margin: 0 auto; padding: 34px 28px 64px; }
.view { display: none; }
.view.active { display: block; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head { margin: 0 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.view-head .eyebrow { color: var(--gold); font-size: 10.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; }
.view-head h2 { margin: 9px 0 0; font-weight: 600; font-size: 23px; letter-spacing: -.2px; }
.view-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 680px; }

/* Cards --------------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card > h3 {
  margin: 0 0 18px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .16em; font-weight: 600;
}

/* KPI strip (hairline dividers) --------------------------------------------- */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 22px;
}
.kpi { background: var(--panel); padding: 20px 22px; position: relative; }
.kpi .k-label { color: var(--muted); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.kpi .k-value { font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 500; margin-top: 10px; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-value.gold { color: var(--gold-2); }
.kpi .k-sub { color: var(--faint); font-size: 11.5px; margin-top: 5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; }
.stat .value { font-size: 19px; font-weight: 600; }
.stat .label { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }

/* Badges -------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em; border: 1px solid transparent; }
.badge.live { background: rgba(229,103,95,.10); color: var(--red); border-color: rgba(229,103,95,.35); }
.badge.dry  { background: rgba(76,195,138,.10); color: var(--green); border-color: rgba(76,195,138,.30); }
.badge.net  { background: var(--gold-soft); color: var(--gold-2); border-color: rgba(200,162,75,.28); }
.badge.ok   { background: rgba(76,195,138,.10); color: var(--green); }
.badge.off  { background: rgba(229,103,95,.10); color: var(--red); }
.badge.ok::before, .badge.off::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Tabelas ------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--faint); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.015); }
td.num, th.num { text-align: right; }

/* Forms / botoes ------------------------------------------------------------ */
input, button, select { font: inherit; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); padding: 10px 12px; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
button { background: linear-gradient(180deg, #d8b864, var(--gold)); color: #20180a; border: none; font-weight: 600; cursor: pointer; transition: filter .15s, transform .04s; }
button:hover { filter: brightness(1.07); }
button:active { transform: translateY(1px); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
button.secondary:hover { filter: none; border-color: var(--gold); color: var(--gold-2); }
button.danger { background: transparent; color: var(--red); border: 1px solid rgba(229,103,95,.4); padding: 7px 11px; font-weight: 500; }
button.danger:hover { background: rgba(229,103,95,.08); filter: none; }
button.link { background: transparent; border: none; color: var(--gold-2); padding: 0; font-size: 12px; cursor: pointer; text-decoration: underline; font-weight: 500; }
button:disabled { opacity: .45; cursor: not-allowed; }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row input[name="address"] { flex: 2; min-width: 240px; }
.form-row input[name="label"] { flex: 1; min-width: 130px; }
.form-row input[name="percent"] { width: 90px; }

.total-ok { color: var(--green); font-weight: 600; }
.total-bad { color: var(--red); font-weight: 600; }

.alert { padding: 13px 15px; border-radius: 9px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid var(--line-2); }
.alert.warn { background: var(--gold-soft); border-color: rgba(200,162,75,.35); }
.alert.err  { background: rgba(229,103,95,.08); border-color: rgba(229,103,95,.4); }

/* Wallet sub-cards (Definicoes) --------------------------------------------- */
.wallet { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.wallet-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.wallet-title strong { font-size: 14.5px; font-weight: 600; }
.wallet-title .mono { margin-left: 8px; font-size: 11.5px; color: var(--faint); }
.wallet-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wallet-actions .toggle { font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.wallet-addr { margin: 12px 0 6px; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
table.clients th, table.clients td { padding: 9px 10px; font-size: 12.5px; }
table.clients select, table.clients input[data-workers] { padding: 6px 8px; font-size: 12.5px; }
.add-client input[name="label"] { flex: 1; min-width: 110px; }
.add-client input[name="address"] { flex: 2; min-width: 220px; }
.add-client input[name="percent"] { width: 80px; }
.wallet-pool { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.wallet-pool > [data-pool] { margin-top: 8px; font-size: 12.5px; }

/* Login --------------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; text-align: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 44px 38px 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.login-card .logo-emblem { width: 92px; height: auto; margin: 0 auto 18px; display: block; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.login-card .lc-word { font-weight: 700; font-size: 25px; letter-spacing: .01em; background: linear-gradient(180deg, var(--silver-1), var(--silver-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card .lc-tag { color: var(--gold); font-size: 9.5px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; margin: 8px 0 6px; }
.login-card .lc-portal { color: var(--silver-2); font-size: 13px; font-weight: 600; letter-spacing: .03em; margin-bottom: 26px; }
.login-card input { width: 100%; margin-bottom: 12px; padding: 12px 14px; }
.login-card button { width: 100%; padding: 12px; }
.login-card .err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; }

/* Navbar: logo maior + nome do portal -------------------------------------- */
.brand-logo-lg { height: 44px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.portal-title { font-weight: 600; font-size: 16px; letter-spacing: .01em; color: var(--text); white-space: nowrap; }

/* Toggle switch (auto-distribuicao) ----------------------------------------- */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 21px; border-radius: 999px; background: var(--line-2); border: 1px solid var(--line-2); transition: background .15s, border-color .15s; flex: none; }
.switch .track::after { content: ''; display: block; width: 15px; height: 15px; border-radius: 50%; background: #8a93a6; margin: 2px; transition: transform .16s; }
.switch input:checked + .track { background: rgba(76,195,138,.25); border-color: var(--green); }
.switch input:checked + .track::after { transform: translateX(17px); background: var(--green); }

/* Pagina Clientes ----------------------------------------------------------- */
.clients-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.clients-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.client-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.client-row:last-child { border-bottom: none; }
.client-row:hover { background: rgba(255,255,255,.02); }
.client-row.active { background: var(--gold-soft); box-shadow: inset 2px 0 0 var(--gold); }
.client-row .cr-name { font-weight: 600; font-size: 13.5px; }
.client-row .cr-meta { color: var(--faint); font-size: 11px; margin-top: 2px; }
.client-detail .empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* Bloco de cliente nas Definicoes ------------------------------------------- */
.client-block { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.client-block > .cb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--panel-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.client-block .cb-name { font-weight: 600; font-size: 14.5px; }
.client-block .cb-body { padding: 16px 18px; }

/* KPIs compactos (detalhe de cliente) --------------------------------------- */
.kpis.compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpis.compact .kpi { padding: 14px 15px; }
.kpis.compact .k-value { font-size: 16px; }
.kpis.compact .k-label { font-size: 10px; }
.kpis.compact .k-sub { font-size: 10.5px; }

/* Carteira colapsavel (vista de cliente) ------------------------------------ */
details.wcol { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
details.wcol > summary { list-style: none; cursor: pointer; padding: 15px 18px; border-radius: 10px; }
details.wcol > summary::-webkit-details-marker { display: none; }
details.wcol > summary:hover { background: rgba(255,255,255,.015); }
.wcol-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wcol-top .wallet-title strong { font-size: 14.5px; }
.wcol .chev { display: inline-block; color: var(--gold); font-size: 11px; transition: transform .15s; }
details.wcol[open] > summary .chev { transform: rotate(90deg); }
.wcol-meta { margin-top: 7px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wcol-body { padding: 4px 18px 16px; }

/* Sub-tabs (Definicoes) ----------------------------------------------------- */
.subnav { display: flex; gap: 2px; margin-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtab { appearance: none; background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; padding: 11px 15px; position: relative; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--gold-2); }
.subtab.active::after { content: ''; position: absolute; left: 15px; right: 15px; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px 2px 0 0; }
.subview { display: none; }
.subview.active { display: block; }

/* Paginacao ----------------------------------------------------------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager .p-info { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Histórico de transferências (detalhe) ------------------------------------- */
.txh { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.txh > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.txh > summary::-webkit-details-marker { display: none; }
.txh > summary:hover { background: rgba(255,255,255,.015); }
.txh .txh-when { color: var(--muted); font-size: 12px; min-width: 140px; }
.txh .txh-body { padding: 0 16px 14px; border-top: 1px solid var(--line); margin-top: 2px; }
.txh .chev2 { color: var(--gold); font-size: 11px; transition: transform .15s; }
.txh[open] .chev2 { transform: rotate(90deg); }

/* Definicoes: carteira colapsavel ------------------------------------------- */
.wcol2-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; padding: 2px; flex-wrap: wrap; }
.wcol2-summary .wallet-title { display: flex; align-items: center; gap: 8px; }
.wcol2-summary .wallet-title strong { font-size: 14.5px; }
.wcol2 .chev { color: var(--gold); font-size: 11px; display: inline-block; transition: transform .15s; }
.wallet.open .chev { transform: rotate(90deg); }
.wcol2-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wcol2-body { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wallet.open .wcol2-body { display: block; }
.wallet-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* Separador de fonte (pool vs atlas) na vista de cliente -------------------- */
.src-head { display: flex; align-items: baseline; gap: 9px; margin: 20px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.src-head::before { content: ''; align-self: center; width: 3px; height: 14px; border-radius: 2px; background: var(--gold); }
.src-head.atlas::before { background: var(--silver-2); }
.src-head .src-sub { color: var(--faint); font-weight: 500; letter-spacing: .03em; text-transform: none; }
.dl-btn { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; text-decoration: none; }
.dl-btn svg { width: 14px; height: 14px; }

/* Hashrate chart + estatisticas da pool ------------------------------------- */
.chart-wrap { position: relative; margin-top: 12px; }
.hr-chart { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 9px; font-size: 11.5px; color: var(--text); display: none; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; z-index: 5; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.chart-tip .t-time { color: var(--faint); font-size: 10px; margin-bottom: 4px; }
.chart-tip .t-row { display: flex; gap: 14px; justify-content: space-between; }
.pool-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.pool-stats .ps { background: var(--panel); padding: 11px 13px; }
.pool-stats .ps .l { color: var(--faint); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.pool-stats .ps .v { font-family: 'IBM Plex Mono', monospace; font-size: 14px; margin-top: 5px; color: var(--text); }
.pool-stats .ps .v.gold { color: var(--gold-2); }
.pool-stats .ps .e { color: var(--faint); font-size: 11px; margin-top: 1px; }
.chart-legend { display: flex; gap: 18px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.chart-legend .lg::before { content: ''; display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.chart-legend .lg.gold::before { background: #c8a24b; }
.chart-legend .lg.silver::before { background: #8aa0c0; }

/* Footer -------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); margin-top: 48px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 26px 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-logo { height: 36px; width: auto; opacity: .92; }
.footer-brand { color: var(--silver-2); font-weight: 600; font-size: 13px; }
.footer-sub { color: var(--faint); font-size: 11px; letter-spacing: .04em; margin-top: 2px; }
.footer-copy { margin-left: auto; color: var(--faint); font-size: 12px; }
.footer-copy a { color: var(--muted); }

@media (max-width: 860px) { .clients-layout { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  body { font-size: 13.5px; }
  main { padding: 16px 12px 44px; }

  /* Navbar ------------------------------------------------------------------ */
  .navbar { gap: 8px; padding: 8px 12px; height: auto; flex-wrap: wrap; }
  .brand { flex: 1; min-width: 0; }
  .brand-logo-lg { height: 34px; }
  .portal-title { font-size: 13.5px; white-space: normal; }
  .nav-right { gap: 8px; }
  .nav-user { display: none; }
  .lang-sel { padding: 5px 6px; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; height: 44px; gap: 0; }
  .nav-link { padding: 0 13px; white-space: nowrap; }
  .nav-link.active::after { left: 13px; right: 13px; }

  /* Cabeçalhos de vista ----------------------------------------------------- */
  .view-head { margin-bottom: 18px; padding-bottom: 14px; }
  .view-head h2 { font-size: 20px; }
  .view-head p { font-size: 13px; }

  /* Cartões + tabelas: a tabela faz scroll horizontal dentro do contentor --- */
  .card { padding: 16px 14px; }
  .card, .wallet, .wcol-body, .wcol2-body, .txh-body, .client-detail, .clients-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12px; }
  th, td { padding: 8px 9px; }

  /* KPIs: 2 colunas ---------------------------------------------------------- */
  .kpis, .kpis.compact { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 13px 14px; }
  .kpi .k-value { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Formulários: campos a toda a largura, sem larguras mínimas grandes ------ */
  .form-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .form-row input, .form-row select, .form-row button { width: 100%; min-width: 0; flex: none; }

  /* Carteira (Definições) --------------------------------------------------- */
  .wcol2-summary { gap: 8px; }
  .wcol2-right { gap: 8px; width: 100%; }
  .wallet-toolbar { gap: 8px; }
  .wallet-toolbar select { max-width: 100%; flex: 1; }
  .wallet-addr { font-size: 11.5px; }

  /* Sub-tabs: scroll horizontal estável (sem tremer na vertical) ------------ */
  .subnav { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; margin-bottom: 18px; }
  .subtab { white-space: nowrap; flex: 0 0 auto; padding: 11px 13px; }
  .subtab.active::after { bottom: 0; }

  /* Estatísticas da pool: 2 colunas ----------------------------------------- */
  .pool-stats { grid-template-columns: repeat(2, 1fr); }

  /* Histórico de transferências (summary) ----------------------------------- */
  .txh > summary { gap: 8px; }
  .txh .txh-when { min-width: 0; }

  /* Cliente: lista compacta ------------------------------------------------- */
  .clients-layout { gap: 14px; }

  /* Login ------------------------------------------------------------------- */
  .login-card { padding: 34px 22px 28px; }

  /* Footer ------------------------------------------------------------------ */
  .footer-inner { padding: 20px 14px; }
  .footer-copy { margin-left: 0; width: 100%; }
  .pager { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .kpis, .kpis.compact, .grid, .pool-stats { grid-template-columns: 1fr; }
  .portal-title { display: none; }
}
