/* Light / Dark mode toggle + theme tokens */

.theme-toggle-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.theme-toggle-wrap--fixed {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 9999px;
    transition: opacity 0.2s ease;
}

.theme-toggle:hover {
    opacity: 0.9;
}

.theme-toggle-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #f59e0b;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.theme-toggle-icon--moon {
    color: #6366f1;
}

.theme-toggle.is-dark .theme-toggle-icon--sun {
    opacity: 0.45;
}

.theme-toggle:not(.is-dark) .theme-toggle-icon--moon {
    opacity: 0.45;
}

.theme-toggle-track {
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.25s ease;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.theme-toggle.is-dark .theme-toggle-track {
    background: #1e4a7a;
}

.theme-toggle-thumb {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle.is-dark .theme-toggle-thumb {
    transform: translateX(1.25rem);
}

/* Global sticky top bar (auth & simple pages) */
.global-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.global-topbar-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.global-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.global-topbar-brand:hover {
    color: #1e4a7a;
}

.global-topbar-brand-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #1e4a7a, #3b7ab8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.auth-bg .global-topbar,
.mesh-bg .global-topbar {
    background: rgba(11, 19, 36, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.auth-bg .global-topbar-brand,
.mesh-bg .global-topbar-brand {
    color: #fff;
}

.auth-bg .global-topbar-brand:hover,
.mesh-bg .global-topbar-brand:hover {
    color: #7eb8e8;
}

.auth-bg .global-topbar .theme-toggle-icon,
.mesh-bg .global-topbar .theme-toggle-icon {
    color: #fbbf24;
}

.auth-bg .global-topbar .theme-toggle-icon--moon,
.mesh-bg .global-topbar .theme-toggle-icon--moon {
    color: #a5b4fc;
}

.auth-bg .global-topbar .theme-toggle-track,
.mesh-bg .global-topbar .theme-toggle-track {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-bg .global-topbar .theme-toggle.is-dark .theme-toggle-track,
.mesh-bg .global-topbar .theme-toggle.is-dark .theme-toggle-track {
    background: rgba(30, 74, 122, 0.85);
}

[data-theme="dark"] .global-topbar {
    background: rgba(15, 23, 42, 0.94);
    border-bottom-color: #334155;
}

[data-theme="dark"] .global-topbar-brand {
    color: #f1f5f9;
}

[data-theme="dark"] .global-topbar-brand:hover {
    color: #7eb8e8;
}

/* Nav / topbar placement */
.el-topbar .theme-toggle-wrap {
    margin-right: 0.5rem;
}

.el-topbar .theme-toggle-icon {
    color: #fbbf24;
}

.el-topbar .theme-toggle-icon--moon {
    color: #a5b4fc;
}

.el-topbar .theme-toggle-track {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.el-topbar .theme-toggle.is-dark .theme-toggle-track {
    background: rgba(30, 74, 122, 0.85);
}

.el-nav-actions .theme-toggle-wrap {
    margin-right: 0.25rem;
}

.el-nav-main.scrolled .theme-toggle-track {
    background: #cbd5e1;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.el-nav-main.scrolled .theme-toggle.is-dark .theme-toggle-track {
    background: #1e4a7a;
}

.el-nav-main.scrolled .theme-toggle-icon {
    color: #f59e0b;
}

.el-nav-main.scrolled .theme-toggle-icon--moon {
    color: #6366f1;
}

.bank-topbar .theme-toggle-wrap,
.admin-topbar .theme-toggle-wrap {
    margin-right: 0.25rem;
}

.auth-bg .theme-toggle-wrap--fixed .theme-toggle-track,
.mesh-bg .theme-toggle-wrap--fixed .theme-toggle-track {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
}

/* ─── Dark theme tokens ─── */
[data-theme="dark"] {
    --sb-surface: #0b1220;
    --sb-card: #1e293b;
    --sb-border: #334155;
    --sb-text: #e2e8f0;
    --sb-muted: #94a3b8;
    --sb-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.25);
    --sb-shadow-lg: 0 20px 40px -12px rgb(0 0 0 / 0.45);
    color-scheme: dark;
}

[data-theme="dark"] body {
    color: var(--sb-text);
}

[data-theme="dark"] .mesh-bg {
    background-color: var(--sb-surface);
    background-image:
        radial-gradient(at 0% 0%, rgba(30, 74, 122, 0.12) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(234, 179, 8, 0.08) 0, transparent 50%),
        radial-gradient(at 50% 100%, rgba(30, 74, 122, 0.06) 0, transparent 50%);
}

[data-theme="dark"] .sb-input {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .sb-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .sb-card,
[data-theme="dark"] .onboard-card,
[data-theme="dark"] .sb-auth-card {
    background: var(--sb-card);
    border-color: var(--sb-border);
    color: var(--sb-text);
}

[data-theme="dark"] .sb-alert-error { background: #450a0a; border-color: #7f1d1d; color: #fecaca; }
[data-theme="dark"] .sb-alert-success { background: #064e3b; border-color: #047857; color: #a7f3d0; }
[data-theme="dark"] .sb-alert-warning { background: #451a03; border-color: #b45309; color: #fde68a; }
[data-theme="dark"] .sb-alert-info { background: #4c0519; border-color: #1e4a7a; color: #dbeafe; }

[data-theme="dark"] .sb-toast {
    background: var(--sb-card);
    color: var(--sb-text);
}

[data-theme="dark"] .review-row {
    border-bottom-color: #334155;
}

[data-theme="dark"] .review-label { color: #94a3b8; }
[data-theme="dark"] .review-value { color: #f1f5f9; }

[data-theme="dark"] .account-type-card {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .account-type-card:hover {
    background: #334155;
    border-color: #60a5fa;
}

[data-theme="dark"] .account-type-card.selected {
    background: #1e3a5f;
    border-color: #3b82f6;
}

[data-theme="dark"] .onboard-step-banner {
    background: linear-gradient(135deg, #1e3a5f, #1e293b);
    border-color: #334155;
}

[data-theme="dark"] .onboard-step-hint { color: #cbd5e1; }

[data-theme="dark"] .onboard-progress::before {
    background: #334155;
}

[data-theme="dark"] .onboard-step-dot {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .bg-slate-50 { background-color: #1e293b !important; }
[data-theme="dark"] .bg-white { background-color: var(--sb-card) !important; }
[data-theme="dark"] .bg-slate-100 { background-color: #334155 !important; }

[data-theme="dark"] .text-slate-900 { color: #f8fafc !important; }
[data-theme="dark"] .text-slate-800 { color: #f1f5f9 !important; }
[data-theme="dark"] .text-slate-700 { color: #e2e8f0 !important; }
[data-theme="dark"] .text-slate-600 { color: #cbd5e1 !important; }
[data-theme="dark"] .text-slate-500 { color: #94a3b8 !important; }
[data-theme="dark"] .text-slate-400 { color: #94a3b8 !important; }

[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-slate-300 {
    border-color: #334155 !important;
}

[data-theme="dark"] .hover\:bg-slate-50:hover {
    background-color: #334155 !important;
}

/* Dashboard dark */
[data-theme="dark"] .bank-app {
    background: #0f172a;
}

[data-theme="dark"] .bank-topbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .bank-topbar-balance-value { color: #f1f5f9; }

[data-theme="dark"] .panel-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .panel-card-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .dash-page-title { color: #f8fafc; }
[data-theme="dark"] .dash-page-sub { color: #94a3b8; }

[data-theme="dark"] .dash-info-row {
    border-bottom-color: #334155;
}

[data-theme="dark"] .bank-user-menu-btn {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .bank-user-menu-btn:hover {
    background: #334155;
}

[data-theme="dark"] .bank-user-menu-dropdown {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .bank-user-menu-dropdown a {
    color: #cbd5e1;
}

[data-theme="dark"] .bank-user-menu-dropdown a:hover {
    background: #334155;
}

[data-theme="dark"] .bank-user-menu-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .dash-table th {
    background: #0f172a;
    color: #94a3b8;
}

[data-theme="dark"] .dash-table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .dash-table tr:hover td {
    background: #334155;
}

[data-theme="dark"] .tx-success-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .tx-success-title { color: #f8fafc; }
[data-theme="dark"] .tx-success-sub { color: #94a3b8; }

[data-theme="dark"] .tx-success-details {
    border-color: #334155;
}

[data-theme="dark"] .tx-success-row {
    border-bottom-color: #334155;
}

[data-theme="dark"] .tx-success-row strong { color: #f1f5f9; }

/* Homepage sections (light content areas) */
[data-theme="dark"] .el-service-card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .el-about-card,
[data-theme="dark"] .el-rate-card,
[data-theme="dark"] .el-faq-item {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .el-section-title {
    color: #f8fafc !important;
}

[data-theme="dark"] section.bg-white {
    background-color: #0f172a !important;
}

[data-theme="dark"] section.bg-slate-50 {
    background-color: #0b1220 !important;
}

[data-theme="dark"] .el-faq-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .el-faq-q {
    color: #f1f5f9;
}

[data-theme="dark"] .el-faq-q:hover {
    background: #334155;
}

[data-theme="dark"] .el-faq-a {
    color: #94a3b8;
}

[data-theme="dark"] .el-rate-card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .sb-stepper .sb-step-label {
    color: #94a3b8;
}

[data-theme="dark"] .intl-method-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .intl-method-card h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .intl-method-card p {
    color: #94a3b8;
}

/* Admin dark */
[data-theme="dark"] body.bg-slate-50 {
    background-color: #0f172a !important;
}

[data-theme="dark"] .admin-topbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .admin-topbar h1,
[data-theme="dark"] .admin-mobile-topbar h1 {
    color: #f1f5f9;
}

[data-theme="dark"] .admin-mobile-topbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .admin-menu-btn {
    color: #e2e8f0;
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .admin-menu-btn:hover {
    background: #475569;
    color: #f8fafc;
}

[data-theme="dark"] .sb-card {
    background: var(--sb-card);
    border-color: var(--sb-border);
}

[data-theme="dark"] .admin-auth-panel {
    background: #0f172a;
}

[data-theme="dark"] .admin-auth-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .admin-auth-card-header h1 {
    color: #f8fafc;
}

[data-theme="dark"] .admin-auth-card-header p {
    color: #94a3b8;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Public site layout — dark mode */
[data-theme="dark"] .auth-bg {
    background: linear-gradient(160deg, #060d18 0%, #0b1324 60%, #141f33 100%);
}

[data-theme="dark"] .el-topbar {
    background: #060d18;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .el-nav-main {
    background: rgba(11, 19, 36, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .el-nav-main.scrolled {
    background: rgba(15, 23, 42, 0.96);
    border-bottom-color: #334155;
    box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .el-nav-main.scrolled .el-nav-brand-text {
    color: #f1f5f9;
}

[data-theme="dark"] .el-nav-main.scrolled .el-nav-pills {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .el-nav-main.scrolled .el-nav-pill {
    color: #94a3b8;
}

[data-theme="dark"] .el-nav-main.scrolled .el-nav-pill:hover,
[data-theme="dark"] .el-nav-main.scrolled .el-nav-pill.active {
    color: #f1f5f9;
    background: #334155;
    box-shadow: none;
}

[data-theme="dark"] .el-nav-main.scrolled .el-nav-login {
    color: #7eb8e8;
}

[data-theme="dark"] .el-nav-main.scrolled .el-mobile-btn {
    color: #f1f5f9;
}

[data-theme="dark"] .el-nav-main.scrolled .el-mobile-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .el-nav-main.scrolled #mobile-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .el-nav-main.scrolled #mobile-menu a {
    color: #cbd5e1;
}

[data-theme="dark"] .el-nav-main.scrolled #mobile-menu a:hover {
    background: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .el-nav-actions .theme-toggle-icon {
    color: #fbbf24;
}

[data-theme="dark"] .el-nav-actions .theme-toggle-icon--moon {
    color: #a5b4fc;
}

[data-theme="dark"] .el-nav-actions .theme-toggle-track {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .el-section--alt {
    background: #0b1220;
}

[data-theme="dark"] .el-stats-grid {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .el-stat-item strong {
    color: #7eb8e8;
}

[data-theme="dark"] .el-stat-item span {
    color: #94a3b8;
}

[data-theme="dark"] .el-bento-card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .el-bento-icon {
    background: #334155;
    color: #7eb8e8;
}

[data-theme="dark"] .el-feature-row {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .el-feature-row:hover {
    border-color: #475569;
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .el-feature-row-icon {
    background: #334155;
    color: #7eb8e8;
}

[data-theme="dark"] .bank-sidebar {
    background: linear-gradient(180deg, #060d18 0%, #0b1324 50%, #141f33 100%);
}

/* Homepage hero — stays polished in both themes */
[data-theme="dark"] .el-hero {
    background: #060d18;
}

[data-theme="dark"] .el-hero-bg {
    background:
        radial-gradient(ellipse 70% 55% at 88% 28%, rgba(59, 122, 184, 0.28) 0%, transparent 58%),
        radial-gradient(ellipse 45% 60% at 12% 85%, rgba(30, 74, 122, 0.22) 0%, transparent 55%),
        linear-gradient(155deg, #040810 0%, #0b1324 42%, #111827 100%);
}

[data-theme="dark"] .el-mission-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-left-color: #3b82f6;
}

[data-theme="dark"] .el-vision-card {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-left-color: #5b9fd4;
}
