/* 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: #3b82f6;
}

.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);
}

/* Nav / topbar placement */
.el-nav-top .theme-toggle-wrap {
    margin-right: 0.25rem;
}

.el-nav-top .theme-toggle-icon {
    color: #fbbf24;
}

.el-nav-top .theme-toggle-icon--moon {
    color: #a5b4fc;
}

.el-nav-top .theme-toggle-track {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.el-nav-top .theme-toggle.is-dark .theme-toggle-track {
    background: rgba(59, 130, 246, 0.85);
}

.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(37, 99, 235, 0.12) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0, transparent 50%),
        radial-gradient(at 50% 100%, rgba(37, 99, 235, 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: #1e3a5f; border-color: #2563eb; color: #bfdbfe; }

[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 {
    color: #f1f5f9;
}

[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;
}
