/* FLUX FINANCE — fresh layout (v2) */

:root {
  --fx-dock-max: 440px;
  --fx-pad: max(16px, env(safe-area-inset-left));
  --fx-pad-r: max(16px, env(safe-area-inset-right));
  --fx-top: calc(8px + env(safe-area-inset-top, 0px));
}

body.tff-dash,
body.tff-body {
  background: #ffffff !important;
}

.tff-phone {
  width: 100%;
  max-width: var(--fx-dock-max, 440px);
  margin: 0 auto;
  box-sizing: border-box;
}

.fx-dash {
  padding:
    var(--fx-top)
    var(--fx-pad-r)
    calc(12px + env(safe-area-inset-bottom, 0px))
    var(--fx-pad);
}

/* —— Top bar —— */
.fx-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.fx-topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fx-topbar__logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.fx-topbar__text {
  min-width: 0;
}

.fx-topbar__greet {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fx-topbar__title {
  margin: 2px 0 0;
  font-family: var(--fx-display, "Plus Jakarta Sans", sans-serif);
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-topbar__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.fx-icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #2563eb;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.1s ease, background 0.12s ease;
}

.fx-icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.fx-icon-btn:active {
  transform: scale(0.94);
}

/* —— Balance hero —— */
.fx-balance {
  position: relative;
  margin-bottom: 20px;
  padding: 22px 20px 20px;
  border-radius: 24px;
  background: linear-gradient(145deg, #1e40af 0%, #2563eb 42%, #3b82f6 100%);
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
}

.fx-balance::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -30px;
  top: -40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.fx-balance__label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.88;
}

.fx-balance__amount {
  margin: 8px 0 0;
  font-family: var(--fx-display, "Plus Jakarta Sans", sans-serif);
  font-size: clamp(32px, 9vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.fx-balance__chip {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.fx-balance__mark {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* —— Quick actions strip —— */
.fx-actions {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin: 0 -2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.fx-actions::-webkit-scrollbar {
  display: none;
}

.fx-action {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  text-decoration: none;
  color: #0f172a;
}

.fx-action__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: none;
  color: #2563eb;
}

.fx-action__icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.fx-action__icon--violet { color: #7c3aed; }
.fx-action__icon--teal { color: #0d9488; }
.fx-action__icon--amber { color: #d97706; }
.fx-action__icon--rose { color: #e11d48; }
.fx-action__icon--indigo { color: #4f46e5; }

.fx-action__label {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  color: #475569;
}

/* —— Section —— */
.fx-section {
  margin-bottom: 20px;
}

.fx-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.fx-section__title {
  margin: 0;
  font-family: var(--fx-display, "Plus Jakarta Sans", sans-serif);
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.fx-section__sub {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

/* —— Plan cards (new stack) —— */
.fx-plan-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fx-plan {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 0;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.fx-plan__accent {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.fx-plan__body {
  padding: 14px 14px 14px 12px;
  min-width: 0;
}

.fx-plan__row1 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.fx-plan__name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.fx-plan__price {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  color: #2563eb;
}

.fx-plan__badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #eff6ff;
  color: #1d4ed8;
}

.fx-plan__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 12px;
}

.fx-plan__cell span:first-child {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.fx-plan__cell span:last-child {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.fx-plan__cell--full {
  grid-column: 1 / -1;
}

.fx-plan__cell--full span:last-child {
  color: #059669;
  font-size: 15px;
}

.fx-plan__cta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.fx-plan__cta:disabled,
.fx-plan__cta.fx-plan__cta--muted {
  background: #f1f5f9;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

/* Portfolio pulse */
.fx-pulse {
  margin-bottom: 16px;
  padding: 18px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.fx-pulse__kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
}

.fx-pulse__pay {
  margin: 0;
  font-family: var(--fx-display, "Plus Jakarta Sans", sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.fx-pulse__sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

/* Position cards */
.fx-position {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.fx-position__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.fx-position__name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.fx-position__daily {
  font-size: 13px;
  font-weight: 800;
  color: #2563eb;
}

.fx-position__bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 10px;
}

.fx-position__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

.fx-position__meta {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.fx-position__rows {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.fx-position__rows div {
  display: flex;
  justify-content: space-between;
  color: #475569;
  font-weight: 600;
}

.fx-position__rows strong {
  color: #0f172a;
  font-weight: 800;
}

/* Auth fresh */
body.tff-body.tff-page--login,
body.tff-body.tff-page--register {
  background: #ffffff !important;
}

.fx-auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 18px;
}

.fx-auth-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 28px 22px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.fx-auth-brand {
  text-align: center;
  margin-bottom: 20px;
}

.fx-auth-brand img {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

/* Force readable text on legacy wallet/team/my */
.tff--wallet,
.tff--wallet *:not(.tff-btn):not(button) {
  color: inherit;
}

.team-tab,
.team-member,
.team-rules,
.team-invite__code,
.team-stat__val,
.my-earn__val,
.my-menu__link,
.dash-plans__title,
.cow-card__name,
.cow-row span {
  text-shadow: none !important;
}

/* Legacy cow cards visible */
.cow-card {
  display: flex !important;
  gap: 12px !important;
  padding: 14px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

.cow-card__media,
.cow-card__media.dash-emblem {
  display: block !important;
  flex: 0 0 56px !important;
  width: 56px !important;
  height: 56px !important;
}

.cow-card__media img {
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px;
  object-fit: cover;
}

/* Wallet / standalone pages — readable on light gray */
body.tff-body.tff-page--wallet,
body.tff-dash.tff-page--wallet {
  background: #ffffff !important;
}

.tff--wallet .tff-wal-head__title,
.tff--wallet .tff-wal-head__sub,
.tff--wallet label,
.tff--wallet p,
.tff--wallet span,
.tff--wallet h2 {
  color: #0f172a !important;
  text-shadow: none !important;
}

.tff--wallet .tff-wal-back,
.tff--wallet .tff-wal-side {
  color: #2563eb !important;
}

.cow-empty {
  color: #64748b !important;
  text-align: center;
  font-weight: 600;
  padding: 16px 8px;
}

