/* =========================================================
   SEFTON DARK READABILITY + TOGGLE POSITION v69
   Fixes desktop/mobile contrast after v68.
   ========================================================= */

/* Move theme button to the upper-right so it no longer covers activity. */
.sefton-theme-toggle{
    top:105px !important;
    right:18px !important;
    bottom:auto !important;
}

@media(max-width:850px){
    .sefton-theme-toggle{
        top:205px !important;
        right:14px !important;
        bottom:auto !important;
        width:46px !important;
        height:46px !important;
    }
}

/* =========================================================
   DESKTOP DASHBOARD — EXPLICIT V47/V48 CLASSES
   ========================================================= */
html[data-theme="dark"] .sv4-dashboard{
    background:#07151c !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .sv47-main-grid,
html[data-theme="dark"] .sv47-desktop-side{
    background:transparent !important;
}

html[data-theme="dark"] .sv47-side-card,
html[data-theme="dark"] .sv4-activity-panel{
    background:#0d2028 !important;
    border-color:#2c434d !important;
    color:#eef5f7 !important;
}

html[data-theme="dark"] .sv47-mini-brand{
    color:#efc660 !important;
}

html[data-theme="dark"] .sv47-side-actions{
    border-color:#2c434d !important;
}

html[data-theme="dark"] .sv47-side-actions a{
    border-color:#2c434d !important;
    color:#eaf2f4 !important;
    background:#0d2028 !important;
}

html[data-theme="dark"] .sv47-side-actions a:hover{
    background:#132a34 !important;
}

html[data-theme="dark"] .sv47-side-actions span{
    color:#ef4c55 !important;
}

html[data-theme="dark"] .sv47-side-actions strong{
    color:#edf5f6 !important;
}

html[data-theme="dark"] .sv47-side-head{
    border-color:#2c434d !important;
}

html[data-theme="dark"] .sv47-side-head strong,
html[data-theme="dark"] .sv47-summary-list strong,
html[data-theme="dark"] .sv47-side-transfer strong{
    color:#f1f7f8 !important;
}

html[data-theme="dark"] .sv47-side-head a{
    color:#ff6770 !important;
}

html[data-theme="dark"] .sv47-summary-list > div,
html[data-theme="dark"] .sv47-side-transfer > div{
    border-color:#263d47 !important;
}

html[data-theme="dark"] .sv47-summary-list span,
html[data-theme="dark"] .sv47-side-transfer span,
html[data-theme="dark"] .sv47-side-transfer small{
    color:#aabac0 !important;
}

/* Account cards in red hero */
html[data-theme="dark"] .sv47-account-box,
html[data-theme="dark"] .sv42-account-slide{
    color:#fff !important;
}

html[data-theme="dark"] .sv47-account-name strong,
html[data-theme="dark"] .sv47-account-value,
html[data-theme="dark"] .sv47-account-meta,
html[data-theme="dark"] .sv47-account-meta span,
html[data-theme="dark"] .sv47-account-meta small,
html[data-theme="dark"] .sv42-account-topline strong,
html[data-theme="dark"] .sv42-account-amount,
html[data-theme="dark"] .sv42-account-bottomline{
    color:#fff !important;
}

/* =========================================================
   TRANSACTIONS — FORCE READABLE TEXT
   ========================================================= */
html[data-theme="dark"] .sv4-activity-panel .sv4-panel-head{
    border-color:#29414a !important;
    background:#0d2028 !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv4-panel-head h2{
    color:#f3f8f9 !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table-wrap,
html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table,
html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody{
    background:#0d2028 !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody tr{
    background:#0d2028 !important;
    border-color:#2a424c !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody td{
    color:#b8c7cc !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-description{
    color:#eef5f7 !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody td:nth-child(1){
    color:#93a6ad !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody td:nth-child(5){
    color:#eef5f7 !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody td:nth-child(5).positive{
    color:#55d69b !important;
}

html[data-theme="dark"] .sv4-activity-panel .sv5-transaction-table tbody td:nth-child(5).negative{
    color:#ff6872 !important;
}

/* =========================================================
   SIDE SUMMARY / TRANSFER CENTER — REMOVE WHITE CARDS
   ========================================================= */
html[data-theme="dark"] .sv47-desktop-side > *,
html[data-theme="dark"] .sv47-side-card,
html[data-theme="dark"] .sv47-side-card > div,
html[data-theme="dark"] .sv47-side-card section{
    background:#0d2028 !important;
    color:#eef5f7 !important;
}

/* =========================================================
   PORTAL NAV / LEFT SIDEBAR
   ========================================================= */
html[data-theme="dark"] .portal-sidebar,
html[data-theme="dark"] .ref-sidebar,
html[data-theme="dark"] .portal-drawer,
html[data-theme="dark"] .mobile-drawer{
    background:#081a22 !important;
    color:#eef5f7 !important;
}

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

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

html[data-theme="dark"] .portal-sidebar .active,
html[data-theme="dark"] .ref-sidebar .active,
html[data-theme="dark"] .portal-drawer .active,
html[data-theme="dark"] .mobile-drawer .active{
    background:#351317 !important;
    color:#fff !important;
}

/* =========================================================
   MOBILE ACTIVITY CARDS / TRACKER
   ========================================================= */
@media(max-width:850px){
    html[data-theme="dark"] .tt62-activity-table tbody tr,
    html[data-theme="dark"] .tt62-tracker-card,
    html[data-theme="dark"] .transaction-card,
    html[data-theme="dark"] .activity-card{
        background:#0d2028 !important;
        border-color:#2d4650 !important;
        color:#eef5f7 !important;
    }

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

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

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

/* =========================================================
   GENERAL PORTAL READABILITY SAFETY NET
   ========================================================= */
html[data-theme="dark"] .portal-main h1,
html[data-theme="dark"] .portal-main h2,
html[data-theme="dark"] .portal-main h3,
html[data-theme="dark"] .portal-main h4,
html[data-theme="dark"] .portal-main strong{
    color:#f2f7f8 !important;
}

html[data-theme="dark"] .portal-main p,
html[data-theme="dark"] .portal-main small,
html[data-theme="dark"] .portal-main .muted{
    color:#a5b6bc !important;
}

html[data-theme="dark"] .portal-main a:not(.button):not(.btn){
    color:#efc55e;
}

/* Do not wash out branded red hero content. */
html[data-theme="dark"] .sv47-desktop-hero *,
html[data-theme="dark"] .sv42-mobile-hero *{
    color:inherit;
}
