@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --color-page: #e8edf4;
  --color-page-2: #dce4f0;
  --color-surface: #ffffff;
  --color-surface-elevated: #f8fafc;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #cbd5e1;
  --color-border-soft: #e2e8f0;
  --color-primary: #0f766e;
  --color-primary-soft: #ccfbf1;
  --color-primary-hover: #0d9488;
  --color-online: #0369a1;
  --color-online-soft: #e0f2fe;
  --color-offline: #6d28d9;
  --color-offline-soft: #ede9fe;
  --color-success: #15803d;
  --color-success-soft: #dcfce7;
  --color-danger: #b91c1c;
  --color-danger-soft: #fee2e2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 8px 30px rgba(15,23,42,0.08);
  --shadow-lg: 0 24px 48px rgba(15,23,42,0.12);
  --max-form: 520px;
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(15,118,110,0.09), transparent 50%),
    radial-gradient(ellipse 100% 60% at 0% 100%, rgba(109,40,217,0.06), transparent 45%),
    linear-gradient(165deg, var(--color-page) 0%, var(--color-page-2) 100%);
}

.app-header {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  padding: 1rem 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--color-text);
}

.app-brand__mark {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  box-shadow: var(--shadow-sm);
}

.app-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.app-brand__name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }

.text-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.text-link:hover { background: var(--color-primary-soft); color: var(--color-primary-hover); }

.container {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: var(--max-form);
  margin: 0.75rem auto 2rem;
  padding: 1.75rem 1.5rem 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: left;
}

.container > h1:first-child,
.container > h2:first-child { margin-top: 0; }

.container > h1, .container > h2, .container > h3 {
  text-align: center;
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.35rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; font-weight: 600; }

.flash {
  background: var(--color-danger-soft);
  border: 1px solid #fecaca;
  color: var(--color-danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.flash p { margin: 0.25rem 0; }
.flash p:first-child { margin-top: 0; }
.flash p:last-child { margin-bottom: 0; }

.form-wrap { text-align: left; }

.form-wrap label, label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
}
.form-wrap label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  margin: 0 0 0.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

small { color: var(--color-text-muted); font-size: 0.8rem; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.8rem 1.25rem;
  min-height: 48px;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm), 0 2px 0 rgba(0,0,0,0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-primary-soft);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover { background: var(--color-primary-soft); }

/* Login */
.login-container { text-align: center; padding-top: 0.5rem; }
.login-lead { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 1.25rem; line-height: 1.5; }

/* Protocol */
.protocol-page-title {
  text-align: center;
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--color-text);
  text-transform: uppercase;
}

.protocol-form { display: flex; flex-direction: column; gap: 1.5rem; }

.protocol-section {
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-elevated);
  border: none; margin: 0; padding: 0; min-width: 0;
}

.protocol-options { display: flex; flex-direction: column; gap: 0.5rem; }

.protocol-card {
  display: block;
  cursor: pointer;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  padding: 0;
  margin: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.protocol-card:hover { border-color: #94a3b8; }
.protocol-card input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }

.protocol-card__body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  width: 100%;
}

.protocol-card__code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.protocol-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
  text-align: right;
}

.protocol-card:has(input:checked) {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.protocol-submit-wrap { margin-top: 0.25rem; }
.protocol-mode-back { margin: 0 0 0.5rem; }

/* Mode tiles */
body.app-body--protocol-mode { align-items: stretch; }
.container.container--protocol-mode { max-width: 560px; }

.protocol-mode-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: min(52vh, 420px);
  margin-top: 0.5rem;
}

.mode-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.5rem 1rem;
  min-height: 200px;
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 0;
}
.mode-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.mode-tile:active { transform: translateY(0); }

.mode-tile--online {
  background: linear-gradient(160deg, #e0f2fe 0%, #fff 45%, #f8fafc 100%);
  color: var(--color-text);
  border: 2px solid #7dd3fc;
}
.mode-tile--offline {
  background: linear-gradient(160deg, #ede9fe 0%, #fff 45%, #f8fafc 100%);
  color: var(--color-text);
  border: 2px solid #c4b5fd;
}
.mode-tile__label { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.mode-tile__hint { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.4; max-width: 11rem; }
.mode-tile--online .mode-tile__label { color: var(--color-online); }
.mode-tile--offline .mode-tile__label { color: var(--color-offline); }

/* Dashboard */
body.app-body--dashboard { align-items: stretch; }

.container.container--dashboard {
  max-width: 100%;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 180px);
  margin-top: 0.05rem;
  margin-bottom: 0;
  padding: 0.1rem clamp(0.15rem, 0.6vw, 0.25rem) 0.2rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: min(100%, 24rem);
  max-width: 384px;
  aspect-ratio: 1;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(15,23,42,0.08);
}

.dashboard-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  padding: 0.5rem 0.45rem;
  border-radius: 0;
  transition: filter 0.15s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dashboard-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.38);
  pointer-events: none;
  z-index: 0;
}
.dashboard-tile:nth-child(odd) { border-right: 1px solid rgba(148,163,184,0.5); }
.dashboard-tile:nth-child(-n+2) { border-bottom: 1px solid rgba(148,163,184,0.5); }

.dashboard-tile__media {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.dashboard-tile__icon {
  width: clamp(72px, 58%, 120px);
  height: auto;
  max-height: 58%;
  color: #0f172a;
  display: block;
}
.dashboard-tile__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}
.dashboard-tile--sale { background: #a7f3d0; }
.dashboard-tile--history { background: #7dd3fc; }
.dashboard-tile--settings { background: #cbd5e1; }
.dashboard-tile--reports { background: #fdba74; }
.dashboard-tile:hover { filter: brightness(0.97); }
.dashboard-tile:active { filter: brightness(0.94); }
.dashboard-tile__title { font-size: 1.28rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }

/* Payout */
.payout-page .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.payout-page .row label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.payout-page .row label:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.payout-page input[type="radio"] { width: auto; margin: 0; accent-color: var(--color-primary); }
.field-group { margin-top: 1rem; }
.field-group label { margin-top: 0; }
.hidden { display: none !important; }
.input-with-btn { display: flex; gap: 8px; align-items: stretch; }
.input-with-btn input { flex: 1; }

.scan-btn {
  background: var(--color-surface-elevated) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.5rem 0.75rem !important;
  min-height: auto !important;
  width: auto !important;
  margin: 0 !important;
  box-shadow: none !important;
}
.scan-btn:hover { background: var(--color-border-soft) !important; }

#qr-reader:not(.hidden) {
  margin-top: 1rem;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

/* History */
.history-intro {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin: 0.75rem 0 0;
  line-height: 1.45;
}
.history-table-wrap {
  margin-top: 1.1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.history-grid {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.history-grid th, .history-grid td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.history-grid thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  background: var(--color-surface-elevated);
  white-space: nowrap;
}
.history-grid tbody tr:last-child td { border-bottom: none; }
.history-grid tbody tr:hover td { background: var(--color-primary-soft); }
.history-amt { font-weight: 600; color: var(--color-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-grid .mono { font-family: ui-monospace, "IBM Plex Mono", monospace; font-size: 0.8rem; }

/* Success */
.success-container { text-align: center; }
.success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: 1.75rem;
}
.success-container h2 { color: var(--color-success); font-size: 1.25rem; }
.success-meta {
  text-align: left;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  border: 1px solid var(--color-border-soft);
}
.success-meta p { margin: 0.35rem 0; }
.success-meta strong {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.success-note { font-size: 0.9rem; color: var(--color-text-muted); margin: 0.5rem 0 0; }

/* Terminal gate */
.terminal-gate-foot { margin-top: 1rem; text-align: center; font-size: 0.9rem; }

/* App body header */
body.app-body .app-header {
  max-width: 100%;
  width: 100%;
  padding: 0.65rem clamp(0.2rem, 0.8vw, 0.3rem) 0.4rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}
body.app-body .app-brand {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}
body.app-body .app-brand__mark {
  width: clamp(80px, 22vw, 128px);
  height: clamp(80px, 22vw, 128px);
}
body.app-body .app-brand__text { align-items: center; }
body.app-body .app-brand__name { font-size: clamp(1.35rem, 4.8vw, 2rem); letter-spacing: -0.03em; }

/* Card details grid */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* Visually hidden */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 600px) {
  .container { width: 94%; padding: 1.35rem 1.1rem 1.65rem; margin-top: 0.5rem; }
  body.app-body--dashboard { min-height: 100dvh; overflow-x: hidden; }
  body.app-body--dashboard > main.container--dashboard {
    flex: 1 1 auto; min-height: 0; width: 100%; max-width: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  }
  body.app-body .app-header { padding: 0.5rem clamp(0.15rem, 0.6vw, 0.25rem) 0.35rem; }
  .container.container--dashboard {
    width: 100%; max-width: 100%; padding: 0; min-height: 0;
    flex: 1 1 auto; justify-content: center; align-items: stretch;
    margin-top: 0; margin-bottom: 0;
  }
  .dashboard-grid {
    width: 100vw; max-width: 100vw; height: 80vh; max-height: 80vh;
    margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
    grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
    gap: 0; aspect-ratio: unset;
  }
  .dashboard-tile { min-height: 0; height: 100%; padding: 0.4rem 0.35rem; gap: 0.4rem; }
  .dashboard-tile__icon { width: clamp(76px, 30vw, 128px); max-height: 52%; }
  .dashboard-tile__title { font-size: clamp(1.05rem, 3.8vw, 1.35rem); line-height: 1.12; }
  .protocol-mode-split { grid-template-columns: 1fr; min-height: 0; }
  .mode-tile { min-height: 160px; }
  .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.2rem; }
}

/* ============================================================
   Payout v2 — aligned method cards (crypto + bank)
   ============================================================ */
.payout-v2 { text-align: left; }

.pay-method-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.25rem 0 1.25rem;
}
.pay-method-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pay-method-switch label { margin: 0; }
.pay-method-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pay-method-switch label:has(input:checked) .pay-method-opt {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Shared method card shell so crypto + bank align */
.pay-card {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.pay-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.pay-card__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1rem; color: var(--color-text);
}
.pay-card__title .dot {
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--color-primary); flex-shrink: 0;
}
.pay-card__badge {
  font-size: 0.72rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  background: var(--color-primary-soft); color: var(--color-primary);
}

/* Field row helpers (aligned label + control) */
.pay-field { margin-bottom: 0.85rem; }
.pay-field:last-child { margin-bottom: 0; }
.pay-field > label { margin-top: 0; }

/* Split wallet rows */
.split-list { display: flex; flex-direction: column; gap: 0.75rem; }
.split-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 0.8rem 0.85rem;
  position: relative;
}
.split-row__top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.split-row__net {
  width: auto; margin: 0; padding: 0.5rem 0.6rem;
  font-size: 0.85rem; font-weight: 600;
}
.split-row__pct {
  width: 5.5rem; margin: 0; padding: 0.5rem 0.6rem;
  text-align: right; font-variant-numeric: tabular-nums;
}
.split-row__pct-wrap { position: relative; display: inline-flex; align-items: center; }
.split-row__pct-wrap::after {
  content: "%"; position: absolute; right: 0.7rem;
  color: var(--color-text-muted); font-size: 0.85rem; pointer-events: none;
}
.split-row__pct { padding-right: 1.6rem; }
.split-remove {
  width: 2.1rem; height: 2.1rem; min-height: 0; margin: 0; padding: 0;
  border-radius: var(--radius-sm);
  background: var(--color-danger-soft); color: var(--color-danger);
  border: 1px solid #fecaca; box-shadow: none;
  font-size: 1.1rem; line-height: 1; flex-shrink: 0;
}
.split-remove:hover { filter: none; background: #fecaca; box-shadow: none; }
.split-row__addr-wrap { display: flex; gap: 8px; align-items: stretch; }
.split-row__addr { flex: 1; margin: 0; font-family: var(--font-mono); font-size: 0.82rem; }
.split-row__saved { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.split-saved-chip {
  width: auto; margin: 0; min-height: 0;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500;
  padding: 0.3rem 0.55rem; border-radius: 999px;
  background: var(--color-surface-elevated); color: var(--color-text);
  border: 1px solid var(--color-border); box-shadow: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.split-saved-chip:hover { border-color: var(--color-primary); background: var(--color-primary-soft); filter: none; box-shadow: none; }

.split-add {
  margin-top: 0.85rem;
  background: var(--color-surface); color: var(--color-primary);
  border: 2px dashed var(--color-primary-soft); box-shadow: none;
}
.split-add:hover { background: var(--color-primary-soft); filter: none; box-shadow: none; }

.split-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.9rem; padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px solid var(--color-border-soft);
  font-size: 0.9rem; font-weight: 600;
}
.split-total__value { font-variant-numeric: tabular-nums; }
.split-total.is-ok    { border-color: #bbf7d0; background: var(--color-success-soft); }
.split-total.is-ok    .split-total__value { color: var(--color-success); }
.split-total.is-bad   { border-color: #fecaca; background: var(--color-danger-soft); }
.split-total.is-bad   .split-total__value { color: var(--color-danger); }

/* Bank name preview block */
.bank-preview {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 0.6rem; padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px dashed var(--color-border);
}
.bank-preview__icon { display: inline-flex; align-items: center; color: var(--color-primary); }
.bank-preview__label { font-size: 0.72rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bank-preview__name { font-weight: 700; color: var(--color-primary); font-size: 0.95rem; }
.bank-limits {
  margin-top: 0.9rem; font-size: 0.8rem; color: var(--color-text-muted);
  line-height: 1.5; background: var(--color-surface); border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md); padding: 0.7rem 0.9rem;
}
.bank-limits strong { color: var(--color-text); }

/* card_verified — payout summary card */
.verified-summary {
  text-align: left; margin: 1.1rem 0 0;
  border: 1px solid var(--color-border-soft); border-radius: var(--radius-lg);
  background: var(--color-surface-elevated); overflow: hidden;
}
.verified-summary__head {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--color-border-soft);
  font-weight: 700; font-size: 0.95rem; background: var(--color-surface);
}
.verified-summary__body { padding: 0.4rem 1rem 0.9rem; }
.verified-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--color-border-soft);
}
.verified-row:last-child { border-bottom: none; }
.verified-row__k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.verified-row__v { font-weight: 600; text-align: right; word-break: break-all; }
.verified-row__v.mono { font-family: var(--font-mono); font-size: 0.82rem; }
.verified-pct {
  display: inline-block; margin-left: 0.4rem;
  font-size: 0.72rem; font-weight: 700; color: var(--color-primary);
  background: var(--color-primary-soft); border-radius: 999px; padding: 0.05rem 0.45rem;
}

/* ============================================================
   Dashboard v2 — card-based tiles
   ============================================================ */
body.app-body--dashboard-v2 {
  align-items: stretch;
  background: #f1f5f9;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.app-body--dashboard-v2::before { display: none; }
body.app-body--dashboard-v2 .app-header { display: none; }
.container.container--dashboard-v2 { flex: 1 1 auto; }

.container.container--dashboard-v2 {
  max-width: var(--max-form); width: 92%;
  background: transparent; border: none; box-shadow: none;
  padding: 1.25rem 0 1rem;
  margin: 0 auto;
}

/* Welcome banner */
.dash-welcome {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.35rem; margin-bottom: 1.4rem;
  border-radius: var(--radius-lg);
  background: #eaf1fb;
  border: 1px solid #dbe6f6;
}
.dash-welcome__avatar {
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #d5e3f7; color: #3b6fd4; flex-shrink: 0;
}
.dash-welcome__avatar svg { width: 1.7rem; height: 1.7rem; }
.dash-welcome__text { flex: 1; min-width: 0; }
.dash-welcome__title { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; color: #1f2b45; }
.dash-welcome__sub { font-size: 0.9rem; color: var(--color-text-muted); }
.dash-welcome__scan {
  width: 2.9rem; height: 2.9rem; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #dbe6f6; color: #64748b; flex-shrink: 0;
}
.dash-welcome__scan svg { width: 1.4rem; height: 1.4rem; }

/* Card grid */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.dash-card {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--color-text);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  padding: 1.4rem 1.25rem 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative; overflow: hidden;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dash-card:active { transform: translateY(-1px); }
.dash-card__icon {
  width: 5rem; height: 5rem; border-radius: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0.4rem 0 1rem;
  background: #fff; box-shadow: var(--shadow-sm);
}
.dash-card__icon svg { width: 2.4rem; height: 2.4rem; }
.dash-card__title { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.2; text-align: center; color: #1f2b45; }
.dash-card__sub { font-size: 0.86rem; color: var(--color-text-muted); line-height: 1.45; margin-top: 0.35rem; text-align: center; }
.dash-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; width: 100%; margin-top: 1.1rem; padding-top: 0.9rem;
  border-top: 1px solid rgba(148,163,184,0.25);
}
.dash-card__cta { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 600; }
.dash-card__cta .chip {
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.dash-card__cta .chip svg { width: 0.95rem; height: 0.95rem; }
.dash-card__meta { font-size: 0.9rem; font-weight: 700; color: #475569; font-variant-numeric: tabular-nums; }

/* Accent variants (tinted card bg + white icon + colored icon glyph) */
.dash-card--sale     { background: #eaf1fb; }
.dash-card--sale     .dash-card__icon svg { color: #3b6fd4; }
.dash-card--sale     .dash-card__cta { color: #3b6fd4; }
.dash-card--sale     .dash-card__cta .chip { background: #3b6fd4; }
.dash-card--history  { background: #e9f6ee; }
.dash-card--history  .dash-card__icon svg { color: #22a35a; }
.dash-card--history  .dash-card__cta { color: #22a35a; }
.dash-card--history  .dash-card__cta .chip { background: #22a35a; }
.dash-card--settings { background: #f1edfb; }
.dash-card--settings .dash-card__icon svg { color: #7c3aed; }
.dash-card--settings .dash-card__cta { color: #7c3aed; }
.dash-card--settings .dash-card__cta .chip { background: #7c3aed; }
.dash-card--reports  { background: #fdf0e3; }
.dash-card--reports  .dash-card__icon svg { color: #ea8a2f; }
.dash-card--reports  .dash-card__cta { color: #ea8a2f; }
.dash-card--reports  .dash-card__cta .chip { background: #ea8a2f; }

/* Bottom tab bar */
.dash-tabbar {
  position: sticky; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  width: 92%; max-width: var(--max-form);
  background: #fff;
  border: 1px solid var(--color-border-soft);
  border-radius: 1rem;
  padding: 0.55rem 0.5rem 0.65rem;
  margin: auto auto 0.75rem;
  box-shadow: 0 -4px 16px rgba(15,23,42,0.05);
}
.dash-tab {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  text-decoration: none; color: var(--color-text-muted);
  font-size: 0.72rem; font-weight: 600;
  padding: 0.35rem 0.25rem; border-radius: var(--radius-md);
}
.dash-tab svg { width: 1.35rem; height: 1.35rem; }
.dash-tab.is-active { color: #3b6fd4; }
.dash-tab.is-active .dash-tab__ico {
  background: #eaf1fb; border-radius: 999px; padding: 0.15rem 0.9rem;
}
.dash-tab__ico { display: inline-flex; align-items: center; justify-content: center; }

/* Footer strip */
.dash-footer {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0.6rem; padding: 0.7rem 1rem;
  width: 92%; max-width: var(--max-form);
  margin: 0 auto;
  background: transparent;
  font-size: 0.75rem; color: var(--color-text-muted);
}
.dash-footer .sep { color: var(--color-border); }
.dash-footer .prot { display: inline-flex; align-items: center; gap: 0.3rem; }

@media (max-width: 600px) {
  .container.container--dashboard-v2 { padding: 1rem 0.85rem 0.85rem; }
  .dash-welcome { padding: 0.9rem 1rem; margin-bottom: 1rem; gap: 0.75rem; }
  .dash-welcome__avatar { width: 2.8rem; height: 2.8rem; }
  .dash-welcome__avatar svg { width: 1.45rem; height: 1.45rem; }
  .dash-welcome__title { font-size: 1.1rem; }
  .dash-welcome__sub { font-size: 0.8rem; }
  .dash-welcome__scan { width: 2.5rem; height: 2.5rem; }

  .dash-grid { gap: 0.7rem; }
  .dash-card { padding: 1rem 0.85rem 0.8rem; border-radius: var(--radius-md); }
  .dash-card__icon { width: 3.6rem; height: 3.6rem; border-radius: 1rem; margin: 0.2rem 0 0.7rem; }
  .dash-card__icon svg { width: 1.8rem; height: 1.8rem; }
  .dash-card__title { font-size: 1rem; }
  .dash-card__sub { font-size: 0.76rem; }
  .dash-card__foot { margin-top: 0.8rem; padding-top: 0.7rem; }
  .dash-card__cta { font-size: 0.78rem; gap: 0.35rem; }
  .dash-card__cta .chip { width: 1.4rem; height: 1.4rem; }
  .dash-card__meta { font-size: 0.8rem; }

  .dash-tab { font-size: 0.62rem; padding: 0.3rem 0.15rem; }
  .dash-tab svg { width: 1.2rem; height: 1.2rem; }
  .dash-tab.is-active .dash-tab__ico { padding: 0.1rem 0.7rem; }
  .dash-footer { font-size: 0.65rem; gap: 0.4rem; padding: 0.6rem 0.7rem; }

  .split-row__top { grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
  .split-row__pct-wrap { grid-column: 1; }
  .split-remove { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; height: auto; }
}

/* Very narrow handhelds (POS CS30 portrait ~360px) */
@media (max-width: 400px) {
  .dash-card__sub { display: none; }
  .dash-card__title { font-size: 0.95rem; }
  .dash-card__icon { width: 3.2rem; height: 3.2rem; }
}
