/* =========================================================
   SEFTON FULL DARK MODE COVERAGE v68
   Portal / mobile / dashboard / activity / drawers / forms
   ========================================================= */

html[data-theme="dark"]{
    color-scheme:dark;
}

/* PAGE / SHELL */
html[data-theme="dark"] body,
html[data-theme="dark"] .portal-shell,
html[data-theme="dark"] .portal-page,
html[data-theme="dark"] .portal-content,
html[data-theme="dark"] .portal-main,
html[data-theme="dark"] .sv4-dashboard,
html[data-theme="dark"] .sv5-dashboard,
html[data-theme="dark"] .dashboard-mobile,
html[data-theme="dark"] .dashboard-content{
    background:#07151c !important;
    color:#edf4f6 !important;
}

/* HEADER */
html[data-theme="dark"] .portal-header,
html[data-theme="dark"] .ref-header,
html[data-theme="dark"] .portal-topbar,
html[data-theme="dark"] .mobile-header,
html[data-theme="dark"] header.portal-header{
    background:#081a22 !important;
    border-color:#263c46 !important;
    color:#f3f7f8 !important;
}

html[data-theme="dark"] .ref-user-trigger,
html[data-theme="dark"] .ref-bell,
html[data-theme="dark"] .menu-toggle,
html[data-theme="dark"] .mobile-menu-button{
    background:#102730 !important;
    border-color:#304852 !important;
    color:#f3f7f8 !important;
}

/* MOBILE DRAWER / SIDE MENU */
html[data-theme="dark"] .portal-drawer,
html[data-theme="dark"] .mobile-drawer,
html[data-theme="dark"] .mobile-sidebar,
html[data-theme="dark"] .portal-mobile-menu,
html[data-theme="dark"] .drawer-panel,
html[data-theme="dark"] .sidebar-panel,
html[data-theme="dark"] .ref-mobile-menu{
    background:#0a1b23 !important;
    border-color:#2a404a !important;
    color:#edf4f6 !important;
    box-shadow:18px 0 50px rgba(0,0,0,.42) !important;
}

html[data-theme="dark"] .portal-drawer *,
html[data-theme="dark"] .mobile-drawer *,
html[data-theme="dark"] .mobile-sidebar *,
html[data-theme="dark"] .portal-mobile-menu *,
html[data-theme="dark"] .drawer-panel *,
html[data-theme="dark"] .sidebar-panel *{
    border-color:#29414a;
}

html[data-theme="dark"] .portal-drawer h1,
html[data-theme="dark"] .portal-drawer h2,
html[data-theme="dark"] .portal-drawer h3,
html[data-theme="dark"] .portal-drawer strong,
html[data-theme="dark"] .mobile-drawer strong,
html[data-theme="dark"] .mobile-sidebar strong,
html[data-theme="dark"] .portal-mobile-menu strong,
html[data-theme="dark"] .drawer-panel strong{
    color:#f4f8f9 !important;
}

html[data-theme="dark"] .portal-drawer p,
html[data-theme="dark"] .portal-drawer small,
html[data-theme="dark"] .mobile-drawer p,
html[data-theme="dark"] .mobile-drawer small,
html[data-theme="dark"] .mobile-sidebar p,
html[data-theme="dark"] .mobile-sidebar small,
html[data-theme="dark"] .portal-mobile-menu small,
html[data-theme="dark"] .drawer-panel small{
    color:#9fb2ba !important;
}

html[data-theme="dark"] .portal-drawer a,
html[data-theme="dark"] .mobile-drawer a,
html[data-theme="dark"] .mobile-sidebar a,
html[data-theme="dark"] .portal-mobile-menu a,
html[data-theme="dark"] .drawer-panel a{
    color:#dce8eb !important;
}

html[data-theme="dark"] .portal-drawer a.active,
html[data-theme="dark"] .mobile-drawer a.active,
html[data-theme="dark"] .mobile-sidebar a.active,
html[data-theme="dark"] .portal-mobile-menu a.active,
html[data-theme="dark"] .drawer-panel a.active{
    background:#2a1115 !important;
    color:#fff !important;
}

html[data-theme="dark"] .portal-drawer .menu-icon,
html[data-theme="dark"] .mobile-drawer .menu-icon,
html[data-theme="dark"] .portal-mobile-menu .menu-icon{
    background:#142b34 !important;
    color:#e7edf0 !important;
}

/* DASHBOARD RED HERO REMAINS RED */
html[data-theme="dark"] .sv4-welcome,
html[data-theme="dark"] .sv4-balance-card,
html[data-theme="dark"] .dashboard-hero,
html[data-theme="dark"] .mobile-dashboard-hero,
html[data-theme="dark"] .red-dashboard-area{
    color:#fff !important;
}

html[data-theme="dark"] .sv4-balance-card strong,
html[data-theme="dark"] .sv4-balance-card h1,
html[data-theme="dark"] .sv4-balance-card h2,
html[data-theme="dark"] .sv4-balance-card p,
html[data-theme="dark"] .sv4-balance-card small{
    color:#fff !important;
}

/* SESSION BAR */
html[data-theme="dark"] .sv4-session-bar{
    background:#0d222b !important;
    border-color:#2b414b !important;
    color:#dfe9ec !important;
}

html[data-theme="dark"] .sv4-session-bar small{
    color:#82979f !important;
}

html[data-theme="dark"] .sv4-session-bar strong{
    color:#eef5f7 !important;
}

/* DASHBOARD SECTIONS */
html[data-theme="dark"] .sv4-metrics article,
html[data-theme="dark"] .sv4-service-section,
html[data-theme="dark"] .sv4-service-grid a,
html[data-theme="dark"] .sv4-service-grid button,
html[data-theme="dark"] .sv4-panel,
html[data-theme="dark"] .sv5-panel,
html[data-theme="dark"] .sv5-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-card{
    background:#0d2028 !important;
    border-color:#29404a !important;
    color:#eef5f7 !important;
    box-shadow:0 12px 30px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"] .sv4-metrics strong,
html[data-theme="dark"] .sv4-service-grid strong,
html[data-theme="dark"] .sv4-section-head h2,
html[data-theme="dark"] .sv4-panel h2,
html[data-theme="dark"] .sv5-panel h2,
html[data-theme="dark"] .dashboard-panel h2,
html[data-theme="dark"] .dashboard-card h2{
    color:#f2f7f8 !important;
}

html[data-theme="dark"] .sv4-metrics p,
html[data-theme="dark"] .sv4-service-grid small,
html[data-theme="dark"] .sv4-section-head span,
html[data-theme="dark"] .sv4-panel p,
html[data-theme="dark"] .sv5-panel p,
html[data-theme="dark"] .dashboard-panel p,
html[data-theme="dark"] .dashboard-card p{
    color:#9eb0b7 !important;
}

/* RECENT ACTIVITY / TRANSACTION SECTION */
html[data-theme="dark"] .recent-activity,
html[data-theme="dark"] .recent-transactions,
html[data-theme="dark"] .transaction-section,
html[data-theme="dark"] .activity-section,
html[data-theme="dark"] .sv4-activity,
html[data-theme="dark"] .sv5-activity,
html[data-theme="dark"] .activity-list,
html[data-theme="dark"] .activity-wrap{
    background:#081a22 !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .recent-activity h2,
html[data-theme="dark"] .recent-transactions h2,
html[data-theme="dark"] .transaction-section h2,
html[data-theme="dark"] .activity-section h2,
html[data-theme="dark"] .sv4-activity h2,
html[data-theme="dark"] .sv5-activity h2{
    color:#f3f8f9 !important;
}

/* Transaction cards - broad coverage */
html[data-theme="dark"] .transaction-card,
html[data-theme="dark"] .activity-card,
html[data-theme="dark"] .entry-card,
html[data-theme="dark"] .mobile-entry,
html[data-theme="dark"] .mobile-transaction,
html[data-theme="dark"] .sv4-transaction,
html[data-theme="dark"] .sv5-transaction,
html[data-theme="dark"] .tt62-activity-table tbody tr{
    background:#0d2028 !important;
    border-color:#2b424b !important;
    color:#eef5f7 !important;
    box-shadow:0 8px 22px rgba(0,0,0,.16) !important;
}

/* The current activity partial uses a table on mobile */
html[data-theme="dark"] .tt62-activity-table,
html[data-theme="dark"] .tt62-activity-table tbody{
    background:#081a22 !important;
}

html[data-theme="dark"] .tt62-activity-table tbody tr{
    background:#0d2028 !important;
}

html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(2){
    color:#eef5f7 !important;
}

html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(3),
html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(1),
html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(5){
    color:#9db0b7 !important;
}

html[data-theme="dark"] .tt62-activity-table tbody td:nth-child(4){
    color:#eef5f7 !important;
}

/* red debits / green credits remain strong */
html[data-theme="dark"] .amount-debit,
html[data-theme="dark"] .debit,
html[data-theme="dark"] .transaction-debit{
    color:#ff6972 !important;
}

html[data-theme="dark"] .amount-credit,
html[data-theme="dark"] .credit,
html[data-theme="dark"] .transaction-credit{
    color:#55d69b !important;
}

/* References / eyebrow labels */
html[data-theme="dark"] .reference,
html[data-theme="dark"] .transaction-reference,
html[data-theme="dark"] .activity-reference,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .sv4-eyebrow{
    color:#dfbd63 !important;
}

/* Status badges */
html[data-theme="dark"] .status-posted,
html[data-theme="dark"] .badge.status-posted,
html[data-theme="dark"] .posted{
    color:#74deb0 !important;
    background:#123b31 !important;
    border-color:#215849 !important;
}

html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .badge.status-pending{
    color:#efd374 !important;
    background:#3a3216 !important;
    border-color:#5a4d20 !important;
}

/* TRACKER */
html[data-theme="dark"] .tt58-page,
html[data-theme="dark"] .tt58-hero,
html[data-theme="dark"] .tt58-updates{
    background:#07151c !important;
}

html[data-theme="dark"] .tt58-card,
html[data-theme="dark"] .tt58-update{
    background:#0d2028 !important;
    border-color:#29414a !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .tt58-card h2{
    color:#f05058 !important;
}

html[data-theme="dark"] .tt58-amount{
    color:#f4f8f9 !important;
}

html[data-theme="dark"] .tt58-card p,
html[data-theme="dark"] .tt58-update p{
    color:#a8b8be !important;
}

html[data-theme="dark"] .tt58-note{
    background:#102630 !important;
    color:#b8c8cd !important;
    border-color:#304851 !important;
}

/* CARDS PAGE */
html[data-theme="dark"] .sc6-page,
html[data-theme="dark"] .sc6-requested,
html[data-theme="dark"] .sc6-card-list{
    background:#07151c !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .sc6-request-card,
html[data-theme="dark"] .sc6-panel,
html[data-theme="dark"] .sc6-card-meta{
    background:#0d2028 !important;
    border-color:#2a414a !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .sc6-request-card h2,
html[data-theme="dark"] .sc6-request-card h3,
html[data-theme="dark"] .sc6-panel h2,
html[data-theme="dark"] .sc6-panel h3{
    color:#f2f7f8 !important;
}

html[data-theme="dark"] .sc6-request-card p,
html[data-theme="dark"] .sc6-request-card small,
html[data-theme="dark"] .sc6-panel p,
html[data-theme="dark"] .sc6-panel small{
    color:#9fb1b8 !important;
}

/* TRANSFER / DEPOSIT / PROFILE / SUPPORT */
html[data-theme="dark"] .transfer-page,
html[data-theme="dark"] .deposit-page,
html[data-theme="dark"] .profile-page,
html[data-theme="dark"] .support-page,
html[data-theme="dark"] .account-page,
html[data-theme="dark"] .statement-page{
    background:#07151c !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .transfer-card,
html[data-theme="dark"] .deposit-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .support-card,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .statement-card,
html[data-theme="dark"] .tr50-panel,
html[data-theme="dark"] .tf-panel{
    background:#0d2028 !important;
    border-color:#29414a !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .transfer-card h1,
html[data-theme="dark"] .transfer-card h2,
html[data-theme="dark"] .deposit-card h1,
html[data-theme="dark"] .deposit-card h2,
html[data-theme="dark"] .profile-card h1,
html[data-theme="dark"] .profile-card h2,
html[data-theme="dark"] .support-card h1,
html[data-theme="dark"] .support-card h2,
html[data-theme="dark"] .account-card h1,
html[data-theme="dark"] .account-card h2{
    color:#f2f7f8 !important;
}

/* FORMS */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
    background:#0a1b23 !important;
    border-color:#314953 !important;
    color:#f0f6f7 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
    color:#71858e !important;
}

html[data-theme="dark"] option{
    background:#0a1b23 !important;
    color:#eef5f7 !important;
}

/* DROPDOWNS / MENUS */
html[data-theme="dark"] .ref-user-dropdown,
html[data-theme="dark"] .notification-dropdown,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .menu-dropdown{
    background:#0d2028 !important;
    border-color:#2c434d !important;
    color:#eef5f7 !important;
    box-shadow:0 18px 45px rgba(0,0,0,.35) !important;
}

html[data-theme="dark"] .ref-user-dropdown a,
html[data-theme="dark"] .notification-dropdown a,
html[data-theme="dark"] .dropdown-menu a{
    color:#e6eef1 !important;
}

html[data-theme="dark"] .ref-user-dropdown small,
html[data-theme="dark"] .notification-dropdown small,
html[data-theme="dark"] .dropdown-menu small{
    color:#98abb2 !important;
}

/* MODALS / DIALOGS */
html[data-theme="dark"] dialog,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .sheet,
html[data-theme="dark"] .bottom-sheet{
    background:#0c2029 !important;
    color:#eef5f7 !important;
    border-color:#2d4650 !important;
}

html[data-theme="dark"] dialog::backdrop,
html[data-theme="dark"] .modal-backdrop{
    background:rgba(0,8,12,.74) !important;
}

/* BOTTOM NAV */
html[data-theme="dark"] .mobile-bottom-nav,
html[data-theme="dark"] .portal-bottom-nav,
html[data-theme="dark"] .bottom-nav,
html[data-theme="dark"] nav.mobile-nav{
    background:#091a22 !important;
    border-color:#2a414a !important;
    box-shadow:0 -12px 30px rgba(0,0,0,.24) !important;
}

html[data-theme="dark"] .mobile-bottom-nav a,
html[data-theme="dark"] .portal-bottom-nav a,
html[data-theme="dark"] .bottom-nav a,
html[data-theme="dark"] nav.mobile-nav a{
    color:#aebfc5 !important;
}

html[data-theme="dark"] .mobile-bottom-nav a svg,
html[data-theme="dark"] .portal-bottom-nav a svg,
html[data-theme="dark"] .bottom-nav a svg,
html[data-theme="dark"] nav.mobile-nav a svg{
    stroke:currentColor !important;
}

html[data-theme="dark"] .mobile-bottom-nav a.active,
html[data-theme="dark"] .portal-bottom-nav a.active,
html[data-theme="dark"] .bottom-nav a.active,
html[data-theme="dark"] nav.mobile-nav a.active{
    color:#ff5a63 !important;
}

/* Keep center Transfer action recognizable */
html[data-theme="dark"] .mobile-bottom-nav .transfer,
html[data-theme="dark"] .portal-bottom-nav .transfer,
html[data-theme="dark"] .bottom-nav .transfer{
    background:#a51620 !important;
    color:#fff !important;
}

/* BUTTONS */
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .button.ghost,
html[data-theme="dark"] .btn.ghost{
    background:#122832 !important;
    color:#eaf2f4 !important;
    border-color:#354e58 !important;
}

/* LINES / DIVIDERS */
html[data-theme="dark"] hr,
html[data-theme="dark"] .divider,
html[data-theme="dark"] .separator{
    border-color:#29414a !important;
}

/* MOBILE SAFE FALLBACK:
   Any pure white common card inside the portal should inherit dark surface.
   This deliberately avoids images and branded red hero areas. */
@media(max-width:850px){
    html[data-theme="dark"] .portal-main .card:not(.sv4-balance-card),
    html[data-theme="dark"] .portal-main .panel,
    html[data-theme="dark"] .portal-main .tile,
    html[data-theme="dark"] .portal-main .list-card,
    html[data-theme="dark"] .portal-main .summary-card{
        background:#0d2028 !important;
        border-color:#2a414a !important;
        color:#eef5f7 !important;
    }

    html[data-theme="dark"] .portal-main .card:not(.sv4-balance-card) h1,
    html[data-theme="dark"] .portal-main .card:not(.sv4-balance-card) h2,
    html[data-theme="dark"] .portal-main .card:not(.sv4-balance-card) h3,
    html[data-theme="dark"] .portal-main .panel h1,
    html[data-theme="dark"] .portal-main .panel h2,
    html[data-theme="dark"] .portal-main .panel h3{
        color:#f2f7f8 !important;
    }

    html[data-theme="dark"] .portal-main .card:not(.sv4-balance-card) p,
    html[data-theme="dark"] .portal-main .card:not(.sv4-balance-card) small,
    html[data-theme="dark"] .portal-main .panel p,
    html[data-theme="dark"] .portal-main .panel small{
        color:#9fb1b8 !important;
    }
}
