/* Area agenzie di bsdhq: stesso linguaggio visivo di bsdhq.com (Poppins, fondo #0F0F0F, pill e card a gradiente)
   con gli schemi di una neobank. Colori dei soldi come in OFM Bank: verde entra, rosso esce, giallo in attesa. */

:root {
  --bg: #0f0f0f;
  --surface: #171717;
  --surface-2: #202020;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.62);
  --faint: rgba(245, 245, 245, 0.4);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.1);
  --yellow: #facc15;
  --yellow-bg: rgba(250, 204, 21, 0.1);
  --blue: #93c5fd;
  --blue-bg: rgba(147, 197, 253, 0.12);
  --violet: linear-gradient(135deg, #3b82f6, #4f46e5 55%, #6d28d9);
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  --radius: 28px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: #0f0f0f;
  --muted: rgba(15, 15, 15, 0.62);
  --faint: rgba(15, 15, 15, 0.42);
  --green: #059669;
  --green-bg: #d1fae5;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --yellow: #a16207;
  --yellow-bg: #fef9c3;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --shadow: 0 30px 80px -50px rgba(0, 0, 0, 0.35);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

h1,
h2,
p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

/* Logo bsdhq: lo stesso file del sito, colorato con il testo. */
.logo {
  display: inline-block;
  width: 84px;
  height: 29px;
  background: currentColor;
  -webkit-mask: url(logo.svg) no-repeat left center / contain;
  mask: url(logo.svg) no-repeat left center / contain;
}

.logo-lg {
  width: 112px;
  height: 39px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-sm {
  height: 24px;
  padding: 0 10px;
  font-size: 9px;
}

.pill-glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* Etichetta "Crypto Wallet": scritta così (non in maiuscolo), con il logo di Trust Wallet al posto del pallino. */
.pill-wallet {
  gap: 8px;
  padding: 0 14px 0 5px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.tw-logo {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
}

.tw-logo svg {
  width: 12px;
  height: 13px;
  stroke: none;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dot-green {
  background: #6ee7b7;
  box-shadow: 0 0 10px #6ee7b7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.icon-btn.round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
}

:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* --- Accesso ------------------------------------------------------------- */

.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  inset: auto;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: var(--violet);
  filter: blur(140px);
  opacity: 0.28;
  top: -260px;
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 36px 32px 28px;
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.login-card > p {
  font-size: 14px;
  line-height: 1.6;
  margin-top: -8px;
}

.field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--faint);
  transition: border-color 0.15s ease;
}

.input:focus-within {
  border-color: #818cf8;
  color: var(--text);
}

.input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}

.form-error {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
}

.login-help {
  width: 100%;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.demo-note {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  color: var(--muted);
}

.demo-note strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
}

/* --- Struttura della dashboard ------------------------------------------ */

.app {
  display: flex;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 248px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.side-nav a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.side-action:hover {
  color: var(--text);
  background: var(--surface);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.side-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.side-user-text strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-text small {
  font-size: 11px;
  color: var(--faint);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px 40px;
  max-width: 1240px;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.top-brand {
  display: none;
}

.top-title h1 {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.top-actions {
  display: flex;
  gap: 8px;
}

/* --- Saldo e stadi -------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  scroll-margin-top: 24px;
}

/* Crypto Wallet: tutto al centro della scheda, in orizzontale e in verticale. */
.balance-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 28px;
  border-radius: 32px;
  background: var(--violet);
  color: #fff;
  box-shadow: 0 40px 120px -40px rgba(79, 70, 229, 0.6);
}

.balance-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(50px);
  pointer-events: none;
}

.balance-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.balance-asset {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

.balance-amount {
  position: relative;
  margin-top: 4px;
  font-size: 60px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-amount .cents {
  font-size: 28px;
  font-weight: 700;
  opacity: 0.7;
}

.quick {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: background 0.15s ease;
}

.quick-btn:hover .quick-icon {
  background: rgba(255, 255, 255, 0.28);
}

.stages {
  display: grid;
  gap: 12px;
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.stage-step {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.stage-cur {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.stage-amount {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stage-pending {
  background: var(--yellow-bg);
  border-color: transparent;
}

.stage-pending .stage-step,
.stage-pending .stage-amount,
.stage-pending .stage-label {
  color: var(--yellow);
}

.stage-pending .stage-step {
  background: var(--yellow-bg);
  border: 1px solid currentColor;
}

.stage-main .stage-step {
  background: var(--blue-bg);
  color: var(--blue);
}

.stage-available .stage-step {
  background: var(--green-bg);
  color: var(--green);
}

.stage-available .stage-amount {
  color: var(--green);
}

/* --- Pannelli ---------------------------------------------------------------- */

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  scroll-margin-top: 24px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin-top: 4px;
  font-size: 13px;
}

/* Stesse colonne di .hero: in Home la seconda colonna parte sulla linea degli stadi. */
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 0 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  white-space: nowrap;
}

.table td {
  padding: 14px 8px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

.table tfoot td {
  font-weight: 700;
}

.num {
  text-align: right !important;
}

.creator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.creator .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.creator small {
  display: block;
  font-size: 11px;
  color: var(--faint);
}

.creator strong {
  font-weight: 600;
}

.amount-pending {
  color: var(--yellow);
  font-weight: 600;
}

.amount-out {
  color: var(--red);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-new {
  background: var(--blue-bg);
  color: var(--blue);
}

.table th small {
  font-weight: 500;
  opacity: 0.7;
}

.table td small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.amount-in {
  color: var(--green);
  font-weight: 600;
}

.c-who .split {
  margin-top: 10px;
  max-width: 220px;
}

/* --- Viste, intestazioni, admin ------------------------------------------- */

.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -6px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.see-all {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.see-all:hover {
  text-decoration: underline;
}

.admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 6px 6px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  font-size: 13px;
}

.admin-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--yellow-bg);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-text {
  color: var(--muted);
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.select svg {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.icon-btn.is-spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  padding: 18px 4px;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}

.more-btn {
  align-self: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.more-btn:hover {
  background: var(--surface-2);
}

/* --- Conti Slash -------------------------------------------------------------- */

.accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* In Home, Slash Debit parte sulla linea degli stadi (stesse colonne e spazio di .hero). */
#home-accounts {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
}

.acct {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.acct:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.acct::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}

.acct-cash::after {
  background: #10b981;
}

.acct-debit::after {
  background: #6366f1;
}

.acct-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.acct-head strong {
  font-weight: 700;
}

.acct-logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--surface-2);
}

.acct-cash .acct-logo {
  color: var(--green);
  background: var(--green-bg);
}

.acct-debit .acct-logo {
  color: var(--blue);
  background: var(--blue-bg);
}

.acct-logo svg {
  width: 16px;
  height: 16px;
}

.acct-cur {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.acct-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.acct-amount .cents {
  font-size: 18px;
  opacity: 0.6;
}

.accounts-lg .acct-amount {
  font-size: 36px;
}

.acct-sub {
  font-size: 12px;
  color: var(--muted);
}

.acct-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--faint);
}

.columns-slash {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.cardlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.carditem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.carditem:first-child {
  border-top: 0;
}

.carditem.is-paused {
  opacity: 0.55;
}

.carditem-chip {
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
}

.carditem-chip.acct-cash {
  background: var(--green-bg);
  color: var(--green);
}

.carditem-chip.acct-debit {
  background: var(--blue-bg);
  color: var(--blue);
}

.carditem-chip svg {
  width: 18px;
  height: 18px;
}

.carditem-text {
  min-width: 0;
}

.carditem-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carditem-text small,
.carditem-right small {
  font-size: 12px;
  color: var(--muted);
}

.carditem-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.carditem-right strong {
  font-size: 14px;
  font-weight: 700;
}

.carditem-right .tag {
  height: 20px;
  margin-top: 2px;
  font-size: 10px;
}

.tag-declined {
  background: var(--red-bg);
  color: var(--red);
}

/* --- Creator: elenco in Home, riquadri, barra prelevato / pending ------------ */

.crew {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.crew-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "who nums"
    "bar bar";
  align-items: center;
  gap: 10px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.crew-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.crew-row .creator {
  grid-area: who;
  min-width: 0;
}

.crew-nums {
  grid-area: nums;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
}

.crew-row .split {
  grid-area: bar;
}

.crew-legend {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--faint);
}

.crew-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crew-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-w {
  background: var(--green);
}

.dot-p {
  background: var(--yellow);
}

.split {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--yellow);
}

.split-w {
  display: block;
  background: var(--green);
}

.split-p {
  display: block;
  flex: 1;
  background: var(--yellow);
}

.split-empty {
  background: var(--surface-2);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.tile-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.tile-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile-sub {
  font-size: 12px;
  color: var(--muted);
}

.tile-in .tile-value {
  color: var(--green);
}

.tile-pending {
  background: var(--yellow-bg);
  border-color: transparent;
}

.tile-pending .tile-value,
.tile-pending .tile-label {
  color: var(--yellow);
}

/* --- Movimenti ------------------------------------------------------------ */

.feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.day h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.day ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mov {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon text amount"
    "icon text extra";
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  padding: 12px 14px;
  border-radius: 18px;
  font-variant-numeric: tabular-nums;
}

.mov-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mov-text {
  grid-area: text;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mov-text strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mov-text small {
  font-size: 12px;
  opacity: 0.8;
}

.mov-amount {
  grid-area: amount;
  align-self: end;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.mov-extra {
  grid-area: extra;
  align-self: start;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  white-space: nowrap;
}

/* Prelievo: la parte dell'agenzia, una riga per creator sotto il movimento. */
.mov-has-detail {
  grid-template-areas:
    "icon text amount"
    "icon text extra"
    ". detail detail";
}

.mov-detail {
  grid-area: detail;
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  list-style: none;
  border-top: 1px dashed var(--line-strong);
  color: var(--text);
  font-size: 12px;
}

.mov-detail li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mov-detail li span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mov-detail li span:last-child {
  font-weight: 600;
  white-space: nowrap;
}

.mov-detail small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
}

.mov-in {
  color: var(--green);
}

.mov-in .mov-icon {
  background: var(--green-bg);
}

.mov-out {
  color: var(--red);
}

.mov-out .mov-icon {
  background: var(--red-bg);
}

.mov-pending {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.mov-pending .mov-icon {
  background: rgba(250, 204, 21, 0.16);
}

.mov-move .mov-icon {
  background: var(--blue-bg);
  color: var(--blue);
}

.mov-move .mov-amount {
  color: var(--muted);
}

.mov-spend .mov-icon {
  background: var(--surface-2);
  color: var(--muted);
}

.mov-spend .mov-text small,
.mov-spend .mov-extra {
  color: var(--muted);
}

.mov-declined {
  color: var(--muted);
}

.mov-declined .mov-icon {
  background: var(--surface-2);
}

.mov-declined .mov-amount {
  text-decoration: line-through;
}

.mov-extra .tag {
  height: 20px;
  padding: 0 8px;
  font-size: 10px;
}

/* --- Trasferimenti ------------------------------------------------------- */

.transfers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.transfer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.transfer:first-child {
  border-top: 0;
}

.transfer-date {
  width: 48px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  line-height: 1.3;
}

.transfer-date b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.transfer-who strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.transfer-who small {
  font-size: 12px;
  color: var(--muted);
}

.transfer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.tag-main {
  background: var(--blue-bg);
  color: var(--blue);
}

.tag-done {
  background: var(--green-bg);
  color: var(--green);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  font-size: 11px;
  color: var(--faint);
}

.demo-tag {
  color: var(--yellow);
}

.tabbar {
  display: none;
}

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.loading[hidden] {
  display: none;
}

.loading-bar {
  width: 120px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent) 0 0 / 50% 100% no-repeat, var(--line);
  animation: loading 1.1s ease-in-out infinite;
}

@keyframes loading {
  from {
    background-position: -60px 0, 0 0;
  }
  to {
    background-position: 180px 0, 0 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* --- Valute, come in Trust Wallet: dollari con il $, USDC con il logo del token ---------- */

.usdc-logo {
  flex-shrink: 0;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  stroke: none; /* le icone del sito hanno il contorno: i loghi no */
}

/* Logo USDC con il badge di Ethereum in basso a destra. */
.token-icon {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.token-icon .usdc-logo {
  display: block;
  width: 100%;
  height: 100%;
}

.net-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  stroke: none;
  box-shadow: 0 0 0 2px var(--surface);
}

/* Loghi delle piattaforme (OnlyFans sui payout), a tutto cerchio. */
.token-icon .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  stroke: none;
}

/* Cosmo Payment: simbolo bianco sul gradiente viola della loro icona. */
.cosmo-logo {
  background: linear-gradient(135deg, #8000ff, #dd00ff);
}

.cosmo-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
}

/* Icona b+q di bsdhq: nera con il simbolo bianco nel tema chiaro, bianca con il simbolo nero nel tema scuro. */
.bsdhq-mark {
  background: var(--text);
  color: var(--surface);
}

.bsdhq-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
}

/* Al posto dei numeri degli stadi: logo di Cosmo (1 e 2) e di bsdhq (3). */
.stage .stage-step[data-step-logo] {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: none;
}

.stage-step .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Pallino informativo (ⓘ) in alto a destra: la spiegazione appare al passaggio del mouse o al tocco. */
.info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: -3px -4px -3px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.info svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.info:hover,
.info:focus-visible,
.info.is-open {
  color: var(--text);
}

.tip {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  z-index: 40;
  width: 260px;
  max-width: calc(100vw - 48px);
  padding: 12px 14px;
  border-radius: 10px;
  background: #202124;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 11px;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: inherit;
  transform: rotate(45deg);
}

.info:hover .tip,
.info:focus-visible .tip,
.info.is-open .tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Nel tema scuro il fumetto ha un bordo, così si stacca dalle schede scure. */
:root:not([data-theme="light"]) .tip {
  border: 1px solid var(--line-strong);
}

/* Nella scheda Crypto Wallet il pallino sta nell'angolo, in bianco. */
.info-corner {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
}

.info-corner .info {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.info-corner .info:hover,
.info-corner .info.is-open {
  color: #fff;
}

/* Payout ancora in pending: orologio piccolo sul logo. */
.icon-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
}

.icon-badge svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.token-sm {
  width: 34px;
  height: 34px;
}

/* Nei movimenti in USDC l'icona è il token, senza il cerchio colorato. */
.mov.mov-logo .mov-icon {
  background: none;
}

.mov-logo .mov-icon .token-icon {
  width: 100%;
  height: 100%;
}

/* Etichetta "USDC" con il logo piccolo (stadi, schede). */
.cur-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cur-token .usdc-logo,
.cur-token .brand-logo {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

/* Saldo Available: è solo USDC, quindi logo del token davanti e "USDC" piccolo dopo le cifre. */
.balance-amount {
  display: flex;
  align-items: center;
  gap: 0.24em;
}

.balance-amount .token-icon {
  width: 0.82em;
  height: 0.82em;
}

.balance-amount .net-badge {
  box-shadow: 0 0 0 2px #4f46e5;
}

.balance-unit {
  margin-left: 0.22em;
  font-size: 0.4em;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

/* --- Tablet e telefono ------------------------------------------------- */

@media (max-width: 1100px) {
  .hero,
  .columns,
  .columns-slash {
    grid-template-columns: minmax(0, 1fr);
  }

  .stages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #home-accounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .side {
    display: none;
  }

  .main {
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
    gap: 16px;
  }

  .top {
    flex-wrap: wrap;
    align-items: center;
  }

  .top-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .top-title {
    order: 3;
    width: 100%;
  }

  .top-title h1 {
    font-size: 24px;
  }

  .stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage {
    padding: 16px;
  }

  .stage-amount {
    font-size: 20px;
  }

  /* Available è il totale crypto + fiat, diverso dalla scheda Crypto Wallet: su telefono resta, su tutta la riga. */
  .stage-available {
    grid-column: 1 / -1;
  }

  .balance-card {
    padding: 22px;
    border-radius: 28px;
  }

  .balance-amount {
    font-size: 40px;
  }

  .balance-amount .cents {
    font-size: 22px;
  }

  /* Su telefono i quattro pulsanti stanno su una riga sola, ognuno in un quarto della scheda. */
  .quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .quick-btn {
    min-width: 0;
  }

  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  /* Movimenti: fee e netto vanno sotto il titolo, così il titolo non viene tagliato. */
  .mov {
    grid-template-areas:
      "icon text amount"
      "icon extra extra";
    padding: 10px 12px;
    column-gap: 10px;
    row-gap: 4px;
  }

  .mov-has-detail {
    grid-template-areas:
      "icon text amount"
      "icon extra extra"
      "detail detail detail";
  }

  .mov-amount {
    align-self: start;
  }

  .mov-extra {
    text-align: left;
    white-space: normal;
  }

  .mov-text strong {
    white-space: normal;
  }

  /* Creator: una scheda per riga, con "In attesa" in alto a destra. */
  .table-wrap {
    overflow: visible;
    margin: 0;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tfoot {
    display: block;
  }

  .table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "who who"
      "withdrawn pending"
      "month last";
    gap: 12px 10px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
  }

  .table tbody tr:first-child {
    border-top: 0;
    padding-top: 4px;
  }

  .table td {
    padding: 0;
    border: 0;
    text-align: left !important;
    white-space: normal;
  }

  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--faint);
  }

  .c-who {
    grid-area: who;
    align-self: center;
  }

  .c-who .split {
    max-width: none;
  }

  .c-withdrawn {
    grid-area: withdrawn;
    font-size: 15px;
  }

  .c-pending {
    grid-area: pending;
    text-align: right !important;
    font-size: 15px;
  }

  .c-month {
    grid-area: month;
  }

  .c-last {
    grid-area: last;
    text-align: right !important;
  }

  .c-last .tag {
    white-space: normal;
    height: auto;
    padding: 3px 8px;
    text-align: right;
  }

  .table tfoot tr {
    grid-template-areas:
      "who who"
      "withdrawn pending";
  }

  .table tfoot .c-month,
  .table tfoot .c-last {
    display: none;
  }

  .table tfoot tr {
    border-top: 1px solid var(--line-strong);
  }

  .accounts,
  .tiles {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #home-accounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #home-accounts .acct {
    padding: 16px;
    gap: 6px;
  }

  #home-accounts .acct-amount {
    font-size: 22px;
  }

  #home-accounts .acct-amount .cents {
    font-size: 14px;
  }

  #home-accounts .acct-cur {
    display: none;
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tiles .tile:last-child {
    grid-column: 1 / -1;
  }

  .acct {
    padding: 18px;
  }

  .accounts-lg .acct-amount {
    font-size: 30px;
  }

  .admin-bar {
    align-self: stretch;
  }

  .admin-bar .select {
    flex: 1;
  }

  .admin-bar select {
    width: 100%;
  }

  .tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px;
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }

  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    border-radius: 18px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
  }

  .tabbar a.is-active {
    color: var(--text);
    background: var(--surface-2);
  }

  .toast {
    bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .login-card {
    padding: 28px 20px 22px;
    border-radius: 28px;
  }

  .mov-text small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
