/* ============================================
   APP PAGES — Login, Onboarding, Dashboard
   ============================================ */

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── OTP Input ── */
.otp-input-group {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 20px;
}
.otp-box {
  width: 48px; height: 56px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 1.4rem; font-weight: 700;
  color: var(--navy);
  outline: none;
  transition: var(--transition);
  background: var(--white);
}
.otp-box:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(12,35,64,0.08); }
.otp-dash { color: var(--text-muted); font-size: 1.2rem; }

/* ── MFA / 2FA ── */
.mfa-icon { color: var(--navy); text-align: center; margin-bottom: 16px; }
.mfa-resend { text-align: center; margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }
.mfa-resend .form-link { background: none; border: none; cursor: pointer; }
.mfa-timer { margin-top: 8px; font-size: 0.78rem; }

/* ── Password Strength ── */
.pw-strength {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.pw-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pw-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.3s, background 0.3s; }
#pwLabel { font-size: 0.72rem; font-weight: 600; min-width: 70px; }

/* ── Phone Input ── */
.phone-input-row { display: flex; gap: 8px; }
.phone-country {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 8px; font-size: 0.82rem; background: var(--off-white);
}

/* ── Form Error ── */
.form-error {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: #dc2626;
  margin-top: 4px;
}

/* ── Email Preview ── */
.email-preview-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--green);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.82rem; font-weight: 600;
}
.epb-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.epb-close {
  margin-left: auto; background: none; border: none;
  color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.email-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ============================================
   LOGIN / AUTH
   ============================================ */
.auth-body {
  background: var(--off-white);
  min-height: 100vh;
}

.auth-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 100vh;
}

.auth-sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 40px;
  display: flex;
  flex-direction: column;
}

.auth-sidebar .logo-mark { color: rgba(255,255,255,0.6); }
.auth-sidebar .logo-name { color: #fff; }
.auth-sidebar .logo-sub { color: rgba(255,255,255,0.4); }

.auth-sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.auth-sidebar-hero {
  margin-top: 60px;
  flex: 1;
}
.auth-sidebar-hero h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 16px;
}
.auth-sidebar-hero p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}

.auth-sidebar-features {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 40px;
}
.auth-feature {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}
.auth-feature svg { color: rgba(255,255,255,0.4); flex-shrink: 0; }

.auth-sidebar-footer {
  margin-top: 32px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card-header {
  margin-bottom: 32px;
}
.auth-card-header h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.auth-card-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.form-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-link {
  font-size: 0.78rem;
  color: var(--blue);
  font-weight: 500;
}

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-icon-wrap input {
  padding-left: 40px !important;
}
.input-icon-wrap.right svg.input-icon-right {
  left: auto;
  right: 14px;
  cursor: pointer;
  pointer-events: all;
}
.input-icon-wrap.right input {
  padding-left: 14px !important;
  padding-right: 40px !important;
}

.form-check-row {
  display: flex;
  align-items: center;
}

.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-wrap input { display: none; }
.checkmark {
  width: 18px; height: 18px; min-width: 18px;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
}
.checkbox-wrap input:checked + .checkmark {
  background: var(--navy);
  border-color: var(--navy);
}
.checkbox-wrap input:checked + .checkmark::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.auth-divider {
  text-align: center;
  position: relative;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.auth-divider::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.auth-divider span {
  background: var(--off-white);
  padding: 0 12px;
  position: relative;
}

.auth-card-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.auth-card-footer a { color: var(--navy); font-weight: 600; }

.auth-bottom-links {
  display: flex;
  gap: 20px;
  margin-top: auto;
  padding-top: 40px;
}
.auth-bottom-links a {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   ONBOARDING / REGISTER
   ============================================ */
.onboard-body { background: var(--off-white); }

.onboard-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
}
.onboard-header-inner {
  display: flex; justify-content: space-between; align-items: center;
}
.onboard-help {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted);
}
.onboard-help a { color: var(--navy); font-weight: 600; }

/* Progress */
.onboard-progress {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 0 16px;
}
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.progress-steps {
  display: flex;
  justify-content: space-between;
}
.progress-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; color: var(--text-muted);
}
.progress-step.active { color: var(--navy); font-weight: 600; }
.progress-step.done { color: var(--green); }
.ps-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  transition: var(--transition);
}
.progress-step.active .ps-num {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}
.progress-step.done .ps-num {
  background: var(--green); color: var(--white); border-color: var(--green);
}

/* Steps */
.onboard-main {
  padding: 40px 0 80px;
}

.onboard-step {
  display: none;
  max-width: 680px;
  margin: 0 auto;
  animation: fadeSlideUp 0.4s ease;
}
.onboard-step.active { display: block; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  margin-bottom: 32px;
}
.step-header h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.step-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}

/* Account Type Cards */
.account-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.account-type-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  text-align: center;
}
.account-type-card input { display: none; }
.account-type-card:hover { border-color: var(--border-dark); }
.account-type-card.selected {
  border-color: var(--navy);
  background: var(--navy-faint);
}
.atc-check {
  position: absolute; top: 12px; right: 12px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-dark);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: var(--transition);
}
.account-type-card.selected .atc-check {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.atc-icon { color: var(--navy); margin: 0 auto 12px; }
.account-type-card h3 { font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.account-type-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.atc-rate {
  font-size: 0.82rem; font-weight: 700; color: var(--green);
  background: var(--green-bg); padding: 4px 12px; border-radius: 20px;
  display: inline-block;
}

/* ID Upload */
.id-type-selector {
  display: flex; gap: 8px; margin-bottom: 8px;
}
.id-type {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  color: var(--text-secondary);
}
.id-type input { display: none; }
.id-type.selected { border-color: var(--navy); color: var(--navy); background: var(--navy-faint); }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.upload-zone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-zone:hover { border-color: var(--navy); background: var(--navy-faint); }
.upload-zone.uploaded { border-style: solid; border-color: var(--green); background: var(--green-bg); }
.upload-zone.uploaded .upload-zone-content { display: none; }
.upload-zone.uploaded .upload-success { display: flex !important; }

.upload-icon { color: var(--text-muted); margin-bottom: 12px; }
.upload-zone h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { font-size: 0.8rem; color: var(--text-secondary); }
.upload-formats { font-size: 0.7rem; color: var(--text-muted); margin-top: 8px; display: block; }

.upload-success {
  flex-direction: column; align-items: center; gap: 8px;
  color: var(--green);
}
.upload-success h4 { font-size: 0.9rem; font-weight: 600; }
.upload-success p { font-size: 0.78rem; color: var(--text-secondary); }

.upload-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* Selfie */
.selfie-section {
  margin-top: 8px;
}
.selfie-section h3 { font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.selfie-section > p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 16px; }

.selfie-zone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.selfie-zone:hover { border-color: var(--navy); }
.selfie-zone.captured { border-style: solid; border-color: var(--green); background: var(--green-bg); }
.selfie-zone.captured .selfie-zone-content { display: none; }
.selfie-zone.captured .selfie-success { display: flex !important; }

.selfie-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border-dark);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--text-muted);
}
.selfie-zone h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.selfie-zone p { font-size: 0.8rem; color: var(--text-secondary); }

.selfie-success {
  flex-direction: column; align-items: center; gap: 8px; color: var(--green);
}

/* Review */
.review-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.review-section:last-of-type { border-bottom: none; }

.review-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.review-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.review-edit {
  font-size: 0.8rem; font-weight: 600; color: var(--blue);
  cursor: pointer; background: none; border: none;
}

.review-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 0;
  font-size: 0.85rem;
}
.review-row span { color: var(--text-muted); }
.review-row strong { color: var(--text); text-align: right; }
.text-green { color: var(--green) !important; }

.agreements {
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 8px;
}
.agreements a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }

.info-box {
  display: flex; gap: 10px;
  padding: 14px 16px;
  background: var(--navy-faint);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.info-box svg { color: var(--navy); flex-shrink: 0; margin-top: 1px; }

/* Verification Animation */
.verification-screen {
  text-align: center;
  padding: 60px 0;
}
.verification-screen h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem; color: var(--navy);
  margin-bottom: 8px;
}
.verification-screen p {
  font-size: 0.9rem; color: var(--text-secondary);
  margin-bottom: 40px;
}

.verify-animation {
  margin-bottom: 32px;
}
.verify-spinner {
  width: 64px; height: 64px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.verify-checklist {
  max-width: 380px; margin: 0 auto;
  text-align: left;
}
.verify-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.verify-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.verify-icon.pending {
  border: 1.5px solid var(--border-dark);
}
.verify-icon.loading {
  border: none;
}
.verify-icon.done {
  background: var(--green); color: #fff;
}
.verify-icon.done::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}
.mini-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* Success */
.success-screen {
  text-align: center;
  padding: 40px 0;
}
.success-icon {
  color: var(--green);
  margin-bottom: 24px;
  animation: scaleIn 0.5s ease;
}
@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.success-screen h1 {
  font-family: var(--font-serif);
  font-size: 2rem; color: var(--navy);
  margin-bottom: 12px;
}
.success-screen p {
  font-size: 0.95rem; color: var(--text-secondary);
  margin-bottom: 32px; max-width: 440px; margin-left: auto; margin-right: auto;
}

.success-details {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  max-width: 440px;
  margin: 0 auto 32px;
}
.success-detail {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.success-detail:last-child { border-bottom: none; }
.success-detail span { color: var(--text-muted); }
.success-detail strong { color: var(--navy); }

.success-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dash-body {
  background: var(--off-white);
  display: flex;
  min-height: 100vh;
}

.dash-sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s ease;
}

.dash-sidebar-top { flex: 1; padding: 20px 16px; overflow-y: auto; }
.dash-sidebar-bottom { padding: 16px; border-top: 1px solid var(--border); }

.dash-logo {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 28px; padding: 4px;
}
.dash-logo .logo-mark { width: 28px; height: 28px; color: var(--navy); }
.dash-logo .logo-name { font-size: 0.9rem; letter-spacing: 2px; color: var(--navy); }

.dash-nav {
  display: flex; flex-direction: column; gap: 2px;
}
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}
.dash-nav-item:hover { background: var(--navy-faint); color: var(--navy); }
.dash-nav-item.active {
  background: var(--navy-faint); color: var(--navy); font-weight: 600;
}
.dash-nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; background: var(--navy); border-radius: 2px;
}
.dash-nav-item.logout { color: var(--text-muted); }
.dash-nav-item.logout:hover { color: #dc2626; background: #fef2f2; }

.nav-badge {
  background: #dc2626; color: #fff;
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  margin-left: auto;
}

/* Advisor Card */
.advisor-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: var(--navy-faint);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.advisor-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
}
.advisor-info { flex: 1; }
.advisor-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.advisor-name { font-size: 0.82rem; font-weight: 600; color: var(--navy); }
.advisor-call {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  cursor: pointer;
  transition: var(--transition);
}
.advisor-call:hover { background: var(--navy); color: #fff; }

/* Main Content */
.dash-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dash-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}

.dash-menu-toggle {
  display: none;
  flex-direction: column; gap: 4px; padding: 6px;
  margin-right: 12px;
}
.dash-menu-toggle span {
  width: 18px; height: 2px; background: var(--text); border-radius: 2px;
}

.dash-page-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--navy);
}

.dash-topbar-right {
  display: flex; align-items: center; gap: 12px;
}

.dash-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.dash-icon-btn:hover { background: var(--navy-faint); color: var(--navy); }

.notif-dot {
  width: 7px; height: 7px;
  background: #dc2626;
  border-radius: 50%;
  border: 2px solid var(--white);
  position: absolute; top: 6px; right: 6px;
}

.dash-user {
  display: flex; align-items: center; gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.dash-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
}
.dash-user-name { font-size: 0.85rem; font-weight: 600; }
.dash-user-tier { font-size: 0.7rem; color: var(--text-muted); }

/* Main Content */
.dash-main-content { padding: 28px 32px; }

.dash-greeting {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.dash-greeting h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem; color: var(--navy);
  margin-bottom: 4px;
}
.dash-greeting p { font-size: 0.88rem; color: var(--text-muted); }
.dash-greeting-actions { display: flex; gap: 8px; }

/* Balance Cards */
.balance-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.balance-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.balance-card.total {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.balance-card.total .bc-label { color: rgba(255,255,255,0.6); }
.balance-card.total .bc-badge { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }

.bc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.bc-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.bc-badge {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 3px 8px;
  background: var(--navy-faint); color: var(--navy); border-radius: 20px;
}
.bc-acct { font-size: 0.72rem; color: var(--text-muted); font-family: monospace; }

.bc-amount {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.bc-change {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 500;
}
.bc-change.positive { color: var(--green); }
.balance-card.total .bc-change.positive { color: #4ADE80; }

.bc-sub { font-size: 0.75rem; color: var(--text-muted); }
.balance-card.total .bc-sub { color: rgba(255,255,255,0.5); }

/* Two Column */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.dash-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.panel-badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  background: #fef3c7; color: #92400e;
}
.panel-filter {
  font-size: 0.78rem; border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 6px;
  color: var(--text-secondary); background: var(--off-white);
  outline: none;
}

.panel-link {
  display: block;
  text-align: center;
  padding: 14px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--navy);
  border-top: 1px solid var(--border);
  transition: var(--transition);
}
.panel-link:hover { background: var(--navy-faint); }

/* Transfers */
.transfer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.transfer-item:last-child { border-bottom: none; }
.transfer-item:hover { background: var(--off-white); }
.transfer-item.completed { opacity: 0.6; }

.transfer-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.transfer-icon.incoming { background: #f0fdf4; color: var(--green); }
.transfer-icon.complete { background: #f0fdf4; color: var(--green); }

.transfer-info { flex: 1; min-width: 0; }
.transfer-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transfer-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.transfer-right { text-align: right; flex-shrink: 0; }
.transfer-amount { font-size: 0.88rem; font-weight: 600; }
.incoming-amount { color: var(--green); }

.transfer-status {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 2px;
}
.transfer-status.pending { color: #d97706; }
.transfer-status.processing { color: var(--blue); }
.transfer-status.done { color: var(--green); }

/* Transactions */
.txn-date-group {
  padding: 8px 20px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--off-white);
}

.txn-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.txn-item:hover { background: var(--off-white); }

.txn-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.txn-icon.debit { background: #fef2f2; color: #dc2626; }
.txn-icon.credit { background: #f0fdf4; color: var(--green); }

.txn-info { flex: 1; }
.txn-name { font-size: 0.85rem; font-weight: 500; }
.txn-acct { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.txn-amount { font-size: 0.88rem; font-weight: 600; flex-shrink: 0; }
.txn-amount.debit { color: var(--text); }
.txn-amount.credit { color: var(--green); }

/* Quick Actions */
.quick-actions h3 {
  font-size: 0.95rem; font-weight: 600; color: var(--navy);
  margin-bottom: 14px;
}
.qa-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.qa-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.qa-item:hover { border-color: var(--navy); background: var(--navy-faint); }
.qa-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy-faint);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.qa-item span { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); }

/* Mobile bottom nav */
.dash-mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 4px 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  justify-content: space-around;
  z-index: 300;
}
.dash-mob-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  font-size: 0.6rem; font-weight: 600;
  color: var(--text-muted);
}
.dash-mob-tab.active { color: var(--navy); }

/* ============================================
   RESPONSIVE — APP PAGES
   ============================================ */
@media (max-width: 768px) {
  /* Auth */
  .auth-layout { grid-template-columns: 1fr; }
  .auth-sidebar { display: none; }
  .auth-main { padding: 32px 20px; justify-content: flex-start; padding-top: 60px; }
  .auth-divider span { background: var(--white); }

  /* Onboarding */
  .progress-steps { overflow-x: auto; gap: 16px; padding-bottom: 4px; }
  .ps-label { display: none; }
  .account-type-grid { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .step-form { padding: 24px; }
  .id-type-selector { flex-wrap: wrap; }
  .review-row { flex-direction: column; gap: 2px; }
  .review-row strong { text-align: left; }
  .success-actions { flex-direction: column; align-items: center; }

  /* Dashboard */
  .dash-sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-content { margin-left: 0; }
  .dash-menu-toggle { display: flex; }
  .dash-topbar { padding: 12px 16px; }
  .dash-main-content { padding: 20px 16px; }
  .dash-user-info { display: none; }

  .balance-cards { grid-template-columns: 1fr 1fr; }
  .dash-two-col { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-greeting { flex-direction: column; align-items: flex-start; }
  .dash-greeting-actions { width: 100%; }
  .dash-greeting-actions .btn { flex: 1; }

  .dash-mobile-nav { display: flex; }
  .dash-body { padding-bottom: 60px; }
}

@media (max-width: 480px) {
  .balance-cards { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
  .bc-amount { font-size: 1.2rem; }
  .transfer-name { font-size: 0.78rem; }
  .page-grid-2 { grid-template-columns: 1fr !important; }
  .admin-grid-2 { grid-template-columns: 1fr !important; }
  .msg-layout { grid-template-columns: 1fr !important; }
}

/* ============================================
   SHARED — New Components
   ============================================ */

/* Page Grid */
.page-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Panel Body */
.panel-body { padding: 20px; }

/* Tab Bar */
.tab-bar {
  display: flex; gap: 4px;
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}
.tab {
  flex: 1; padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  text-align: center; border: none; background: none;
}
.tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Transfer Form */
.transfer-form {
  display: flex; flex-direction: column; gap: 14px;
}

/* Outgoing icon */
.transfer-icon.outgoing { background: #fef2f2; color: #dc2626; }

/* Empty State */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
}
.modal-lg { max-width: 520px; text-align: left; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } }
.modal-icon { margin-bottom: 16px; }
.modal-icon.success { color: var(--green); }
.modal-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem; color: var(--navy);
  margin-bottom: 8px;
}
.modal-card p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-close {
  font-size: 1.5rem; color: var(--text-muted);
  cursor: pointer; background: none; border: none;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 8px;
}
.compose-form { display: flex; flex-direction: column; gap: 14px; }

/* Data Table */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.data-table td strong { color: var(--text); }
.data-table .positive { color: var(--green); }
.data-table .negative { color: #dc2626; }

/* Trade Preview */
.trade-preview {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--navy-faint);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.trade-preview span { color: var(--text-muted); }
.trade-preview strong { color: var(--navy); }

/* Wallet Address */
.wallet-address {
  display: block;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: monospace;
  word-break: break-all;
}

/* ============================================
   MESSAGES
   ============================================ */
.msg-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  min-height: calc(100vh - 200px);
}
.msg-list-panel { overflow: hidden; }
.msg-detail-panel { min-height: 400px; }

.msg-item {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.msg-item:hover { background: var(--off-white); }
.msg-item.selected { background: var(--navy-faint); }
.msg-item.unread { background: #fffff5; }
.msg-item.unread .msg-subject { font-weight: 700; color: var(--navy); }

.msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700;
  flex-shrink: 0;
}

.msg-preview { flex: 1; min-width: 0; }
.msg-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2px;
}
.msg-from { font-size: 0.82rem; font-weight: 600; }
.msg-date { font-size: 0.7rem; color: var(--text-muted); }
.msg-subject { font-size: 0.82rem; color: var(--text); margin-bottom: 2px; }
.msg-snippet {
  font-size: 0.75rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.msg-empty-detail {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; min-height: 300px;
  color: var(--text-muted);
  text-align: center; padding: 40px;
}
.msg-empty-detail svg { margin-bottom: 12px; opacity: 0.3; }

.msg-back-btn {
  display: none;
  align-items: center; gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600;
  color: var(--navy); cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--border);
  width: 100%;
}
.msg-back-btn svg { flex-shrink: 0; }

.msg-detail-header {
  display: flex; gap: 12px; align-items: center;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.msg-detail-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.msg-detail-from { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.msg-detail-date { font-size: 0.78rem; color: var(--text-muted); }
.msg-detail-subject {
  font-family: var(--font-serif);
  font-size: 1.2rem; color: var(--navy);
  padding: 20px 20px 0;
}
.msg-detail-body {
  padding: 16px 20px;
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.7; white-space: pre-line;
}
.msg-detail-actions {
  padding: 0 20px 20px;
}

/* ============================================
   INVESTMENTS
   ============================================ */
.alloc-panel { padding: 20px; }
.alloc-row { margin-bottom: 14px; }
.alloc-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; margin-bottom: 6px;
}
.alloc-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.alloc-pct { margin-left: auto; color: var(--text-muted); font-weight: 600; }
.alloc-bar-wrap {
  height: 6px; background: var(--off-white);
  border-radius: 3px; overflow: hidden;
}
.alloc-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

.perf-chart { position: relative; }
.perf-labels {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted);
  padding-top: 8px;
}

/* ============================================
   CRYPTO
   ============================================ */
.crypto-list { }
.crypto-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.crypto-row:last-child { border-bottom: none; }
.crypto-info { display: flex; align-items: center; gap: 12px; }
.crypto-symbol-badge {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.5px;
}
.crypto-name { font-size: 0.88rem; font-weight: 600; }
.crypto-price { font-size: 0.75rem; color: var(--text-muted); }
.crypto-holding { text-align: right; }
.crypto-bal { font-size: 0.85rem; font-weight: 600; }
.crypto-val { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   ADMIN
   ============================================ */
.admin-body { background: var(--off-white); }

.admin-login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--navy);
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 400px; width: 100%;
  box-shadow: var(--shadow-xl);
}
.admin-login-header {
  text-align: center; margin-bottom: 28px;
  color: var(--navy);
}
.admin-login-header h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem; margin: 12px 0 4px;
}
.admin-login-header p {
  font-size: 0.85rem; color: var(--text-muted);
}

.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
}
.admin-badge {
  font-size: 0.6rem; font-weight: 800;
  padding: 3px 8px; border-radius: 4px;
  background: #dc2626; color: #fff;
  letter-spacing: 1px;
}

.admin-main { padding: 32px 0; }
.admin-title {
  font-family: var(--font-serif);
  font-size: 1.5rem; color: var(--navy);
  margin-bottom: 20px;
}

.admin-user-selector {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.admin-user-selector label {
  font-size: 0.88rem; font-weight: 600;
}
.admin-user-selector select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  min-width: 300px;
  background: var(--white);
}

.admin-cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.asc-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.asc-value { font-family: var(--font-serif); font-size: 1.3rem; color: var(--navy); }

.admin-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.admin-section h3 {
  font-size: 0.95rem; font-weight: 600; color: var(--navy);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.admin-action-box { }
.admin-form {
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}

.status-pill {
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  text-transform: capitalize;
}
.status-pill.pending { background: #fef3c7; color: #92400e; }
.status-pill.processing { background: #dbeafe; color: #1e40af; }
.status-pill.completed { background: #dcfce7; color: #166534; }
.status-pill.cancelled { background: #fef2f2; color: #dc2626; }
.unread-row { background: #fffff5; }

/* ============================================
   RESPONSIVE — NEW PAGES
   ============================================ */
@media (max-width: 768px) {
  .page-grid-2 { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-cards { grid-template-columns: 1fr 1fr; }
  .msg-layout { grid-template-columns: 1fr; }
  .msg-detail-panel {
    display: none;
    position: fixed; inset: 0; z-index: 500;
    background: var(--white);
    overflow-y: auto;
    padding-bottom: 70px;
  }
  .msg-detail-panel.mobile-open { display: block; }
  .msg-back-btn { display: flex !important; }
  .admin-user-selector select { min-width: auto; flex: 1; }
  .tab-bar { flex-wrap: wrap; }
}
