/* ═══════════════════════════════════════════════════════════════
   FaithTrip — Dark Mode  |  Admin · B2B · B2C Portal
   ═══════════════════════════════════════════════════════════════ */

/* ─── Theme Toggle — compact icon button (T360-style) ────────── */
.ft-theme-switch {
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
    cursor: pointer; outline: none; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .82rem; padding: 0;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.ft-theme-switch:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.4);
    color: #fff;
}
[data-theme="dark"] .ft-theme-switch {
    background: rgba(245,166,35,.14);
    border-color: rgba(245,166,35,.4);
    color: #F5A623;
    box-shadow: 0 0 8px rgba(245,166,35,.12);
}
[data-theme="dark"] .ft-theme-switch:hover {
    background: rgba(245,166,35,.24);
    box-shadow: 0 0 12px rgba(245,166,35,.2);
}
.ft-theme-icon-sun  { display: none; }
.ft-theme-icon-moon { display: block; }
[data-theme="dark"] .ft-theme-icon-sun  { display: block; }
[data-theme="dark"] .ft-theme-icon-moon { display: none; }

/* ─── Admin / B2B Dark Variables — Brand Navy Palette ───────── */
[data-theme="dark"] body {
    background: #040c1e !important;
    color: #d4d9ee !important;
}

/* Topbar / Navbar */
[data-theme="dark"] .navbar-custom-menu {
    background: #12162e !important;
}
[data-theme="dark"] .b2b-topbar,
[data-theme="dark"] #b2b-topbar {
    background: linear-gradient(90deg, #0b102b 0%, #1a2352 100%) !important;
    border-color: rgba(255,255,255,.06) !important;
}

/* Sidebar */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .nav-sidebar,
[data-theme="dark"] .left-sidebar {
    background: #0b102b !important;
    border-color: rgba(255,255,255,.06) !important;
}
[data-theme="dark"] .sidebar-item a,
[data-theme="dark"] .nav-sidebar .nav-link {
    color: #a8b0cc !important;
}
[data-theme="dark"] .sidebar-item a:hover,
[data-theme="dark"] .nav-sidebar .nav-link:hover,
[data-theme="dark"] .nav-sidebar .nav-link.active {
    background: rgba(77,107,221,.18) !important;
    color: #fff !important;
}

/* Cards */
[data-theme="dark"] .card {
    background: #1a1d27 !important;
    border-color: rgba(255,255,255,.08) !important;
    color: #d8dce8 !important;
}
[data-theme="dark"] .card-header {
    background: #22263a !important;
    border-color: rgba(255,255,255,.08) !important;
    color: #d8dce8 !important;
}
[data-theme="dark"] .card-body  { color: #d8dce8 !important; }
[data-theme="dark"] .card-footer {
    background: #1e2236 !important;
    border-color: rgba(255,255,255,.08) !important;
}
[data-theme="dark"] .card-title { color: #eaeef8 !important; }

/* Tables */
[data-theme="dark"] .table { color: #d8dce8 !important; }
[data-theme="dark"] .table > :not(caption) > * > * {
    background: transparent !important;
    border-color: rgba(255,255,255,.07) !important;
    color: #d8dce8 !important;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(255,255,255,.025) !important;
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background: rgba(77,107,221,.12) !important;
}
[data-theme="dark"] thead th { color: #9aa3b8 !important; border-color: rgba(255,255,255,.1) !important; }

/* Inputs & Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #22263a !important;
    border-color: rgba(255,255,255,.12) !important;
    color: #d8dce8 !important;
}
[data-theme="dark"] .form-control::placeholder { color: #6d7591 !important; }
[data-theme="dark"] .input-group-text {
    background: #2a2f4a !important;
    border-color: rgba(255,255,255,.12) !important;
    color: #9aa3b8 !important;
}
[data-theme="dark"] .form-label { color: #b0b8d4 !important; }
[data-theme="dark"] .form-check-label { color: #b0b8d4 !important; }
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background: #22263a !important;
    border-color: rgba(255,255,255,.12) !important;
    color: #d8dce8 !important;
}
[data-theme="dark"] .select2-container--default .select2-selection__rendered { color: #d8dce8 !important; }
[data-theme="dark"] .select2-dropdown {
    background: #1e2236 !important;
    border-color: rgba(255,255,255,.1) !important;
}
[data-theme="dark"] .select2-results__option { color: #d0d6f0 !important; }
[data-theme="dark"] .select2-results__option--highlighted { background: rgba(77,107,221,.2) !important; }

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
    background: #1e2236 !important;
    border-color: rgba(255,255,255,.1) !important;
}
[data-theme="dark"] .dropdown-item { color: #d0d6f0 !important; }
[data-theme="dark"] .dropdown-item:hover { background: rgba(77,107,221,.18) !important; }
[data-theme="dark"] .dropdown-divider { border-color: rgba(255,255,255,.1) !important; }

/* Modals */
[data-theme="dark"] .modal-content {
    background: #1a1d27 !important;
    color: #d8dce8 !important;
    border-color: rgba(255,255,255,.1) !important;
}
[data-theme="dark"] .modal-header {
    border-color: rgba(255,255,255,.1) !important;
}
[data-theme="dark"] .modal-footer { border-color: rgba(255,255,255,.1) !important; }
[data-theme="dark"] .modal-title { color: #eaeef8 !important; }
[data-theme="dark"] .btn-close { filter: invert(1) brightness(2); }

/* Alerts */
[data-theme="dark"] .alert { border-color: rgba(255,255,255,.08) !important; }

/* Badges & Pills */
[data-theme="dark"] .badge.bg-light,
[data-theme="dark"] .badge.bg-white,
[data-theme="dark"] .badge.bg-secondary {
    background: #2a2f4a !important; color: #d0d6f0 !important;
}

/* Borders & Dividers */
[data-theme="dark"] .border,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end { border-color: rgba(255,255,255,.1) !important; }
[data-theme="dark"] hr { border-color: rgba(255,255,255,.1) !important; }

/* Background utilities */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light { background: #1a1d27 !important; }

/* Text utilities */
[data-theme="dark"] .text-dark  { color: #d8dce8 !important; }
[data-theme="dark"] .text-muted { color: #7a84a0 !important; }

/* ─── B2C Portal Specific ────────────────────────────────────── */
[data-theme="dark"] #portal-header {
    --portal-header-bg: #12162e;
    background: #12162e !important;
    border-color: rgba(255,255,255,.07) !important;
}
[data-theme="dark"] #portal-sidebar {
    --portal-sidebar-bg: #0b102b;
    background: #0b102b !important;
    border-color: rgba(255,255,255,.06) !important;
}
[data-theme="dark"] #portal-content,
[data-theme="dark"] .portal-main {
    background: #0f1117 !important;
}
[data-theme="dark"] .sidebar-logo-wrap,
[data-theme="dark"] .sidebar-nav-section-label { border-color: rgba(255,255,255,.07) !important; }
[data-theme="dark"] .sidebar-nav a {
    color: #a8b0cc !important;
}
[data-theme="dark"] .sidebar-nav a:hover,
[data-theme="dark"] .sidebar-nav a.active {
    background: rgba(77,107,221,.18) !important;
    color: #fff !important;
}
[data-theme="dark"] .sidebar-collapse-btn {
    background: #1e2236 !important;
    border-color: rgba(255,255,255,.1) !important;
    color: #9aa3b8 !important;
}
[data-theme="dark"] .balance-btn {
    background: rgba(255,255,255,.08) !important;
    color: #d0d6f0 !important;
    border-color: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .balance-dropdown {
    background: #1e2236 !important;
    border-color: rgba(255,255,255,.1) !important;
    color: #d8dce8 !important;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
[data-theme="dark"] ::-webkit-scrollbar       { background: #1a1d27; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a4170; border-radius: 4px; }
[data-theme="dark"] * { scrollbar-color: #3a4170 #1a1d27; }
