
/* R3.4 CLEAN UI - isolated override layer
   Loaded after style.css so old rules cannot break the layout. */

:root{
    --ui-bg:#0a1123;
    --ui-panel:#151f38;
    --ui-panel2:#1b2744;
    --ui-line:rgba(148,163,184,.16);
    --ui-text:#f7f9ff;
    --ui-muted:#93a4c7;
    --ui-soft:#cbd5e1;
    --ui-radius:16px;
}

*{box-sizing:border-box}
body{
    overflow-x:hidden;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
.topbar{position:sticky;top:0;z-index:100;background:rgba(7,13,29,.96);backdrop-filter:blur(12px);border-bottom:1px solid var(--ui-line)}
.topnav-clean{
    max-width:1280px;
    min-height:76px;
    padding:12px 20px;
    display:grid;
    grid-template-columns:auto minmax(210px,1fr) auto auto auto auto auto;
    align-items:center;
    gap:10px;
}
.topnav-brand,
.topnav-links a,
.topnav-account,
.topnav-deposit,
.topnav-logout{
    text-decoration:none;
}
.topnav-brand{
    min-height:48px;
    padding:0 18px;
    display:flex;
    align-items:center;
    gap:9px;
    border-radius:15px;
    color:#fff;
    font-weight:900;
    background:linear-gradient(135deg,var(--pri),var(--pri2));
    box-shadow:0 10px 26px rgba(0,0,0,.18);
    white-space:nowrap;
}
.topnav-search{position:relative;min-width:0}
.topnav-search>i{
    position:absolute;left:14px;top:50%;transform:translateY(-50%);
    color:#8090b4;font-size:13px;pointer-events:none
}
.topnav-search input{
    width:100%;height:46px;padding:0 46px 0 40px;
    color:#fff;background:#0d1730;border:1px solid var(--ui-line);
    border-radius:14px;outline:none;
}
.topnav-search input:focus{border-color:var(--pri);box-shadow:0 0 0 3px rgba(124,58,237,.12)}
.topnav-search button{
    position:absolute;right:6px;top:6px;width:34px;height:34px;
    border:0;border-radius:10px;cursor:pointer;
    color:#fff;background:linear-gradient(135deg,var(--pri),var(--pri2))
}
.topnav-links{display:flex;gap:6px}
.topnav-links a{
    height:44px;padding:0 12px;display:flex;align-items:center;gap:7px;
    border-radius:13px;color:#dfe7ff;background:#16213d;border:1px solid rgba(255,255,255,.04);
    font-size:13px;font-weight:800;white-space:nowrap
}
.topnav-links a i{color:#aebde0;font-size:12px}
.topnav-prefs{display:flex;gap:5px}
.topnav-prefs select{
    width:72px;height:44px;padding:0 9px;border-radius:12px;
    color:#fff;background:#0d1730;border:1px solid var(--ui-line)
}
.topnav-account{
    min-width:145px;max-width:190px;height:48px;padding:6px 10px;
    display:flex;align-items:center;gap:9px;border-radius:14px;
    color:#fff;background:#1a2747;border:1px solid var(--ui-line)
}
.topnav-account-icon{
    width:34px;height:34px;flex:0 0 34px;display:grid;place-items:center;
    border-radius:11px;background:linear-gradient(135deg,var(--pri),var(--pri2))
}
.topnav-account-copy{min-width:0;display:flex;flex-direction:column;line-height:1.18}
.topnav-account-copy small{color:#8fa0c4;font-size:10px}
.topnav-account-copy b{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topnav-account.guest{min-width:105px}
.topnav-deposit{
    height:44px;padding:0 13px;display:flex;align-items:center;gap:7px;
    border-radius:13px;color:#fff;background:linear-gradient(135deg,var(--pri),var(--pri2));
    font-size:13px;font-weight:900;white-space:nowrap
}
.topnav-logout{
    width:42px;height:42px;display:grid;place-items:center;
    border-radius:12px;color:#dce5ff;background:#16213d;border:1px solid var(--ui-line)
}

/* Home */
.home-shell{
    display:grid!important;
    grid-template-columns:220px minmax(0,1fr)!important;
    gap:18px!important;
    align-items:start!important;
    margin-top:18px;
}
.home-shell.has-account{
    grid-template-columns:220px minmax(0,1fr) 245px!important;
}
.home-shell .home-category-sidebar{grid-column:1!important;grid-row:1!important;min-width:0}
.home-shell .home-products-main{grid-column:2!important;grid-row:1!important;min-width:0}
.home-shell .home-account-card{grid-column:3!important;grid-row:1!important;min-width:0}
.home-products-main .grid{align-items:start}
.home-products-main .product{height:auto;min-height:0}
.home-account-card{
    position:sticky;top:92px;
    padding:0;overflow:hidden;border-radius:20px;
    background:linear-gradient(180deg,#1a2746,#121c34);
    border:1px solid var(--ui-line);
    box-shadow:0 16px 38px rgba(0,0,0,.22);
}
.home-account-head{
    padding:16px;display:flex;align-items:center;gap:11px;
    border-bottom:1px solid var(--ui-line)
}
.home-account-avatar{
    width:42px;height:42px;flex:0 0 42px;display:grid;place-items:center;
    border-radius:13px;color:#fff;background:linear-gradient(135deg,var(--pri),var(--pri2))
}
.home-account-head small{display:block;color:var(--ui-muted);font-size:11px;font-weight:700}
.home-account-head strong{display:block;margin-top:2px;color:#fff;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-account-list{padding:7px 15px}
.home-account-list>div{
    padding:11px 0;display:flex;justify-content:space-between;align-items:center;gap:10px;
    border-bottom:1px solid rgba(148,163,184,.10)
}
.home-account-list span{color:var(--ui-muted);font-size:12px}
.home-account-list b{color:#fff;font-size:14px;font-variant-numeric:tabular-nums}
.home-account-list .discount b{color:#86efac;font-size:17px}
.home-account-note{
    margin:9px 14px 0;padding:10px 11px;border-radius:11px;
    color:#b9f5ce;background:rgba(34,197,94,.09);border:1px solid rgba(34,197,94,.22);
    font-size:11px;line-height:1.45
}
.home-account-open{
    min-height:42px;margin:14px;padding:0 13px;
    display:flex;align-items:center;justify-content:space-between;
    border-radius:11px;color:#fff;background:linear-gradient(135deg,var(--pri),var(--pri2));
    font-size:12px;font-weight:900;text-decoration:none
}

/* Account page */
.account-page{max-width:1180px!important;padding-top:32px!important;padding-bottom:48px!important}
.account-hero-clean{
    padding:18px 20px;margin-bottom:18px;
    display:flex;justify-content:space-between;align-items:center;gap:20px;
    border-radius:20px;background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(6,182,212,.06));
    border:1px solid var(--ui-line)
}
.account-hero-user{display:flex;align-items:center;gap:14px;min-width:0}
.account-hero-avatar{
    width:54px;height:54px;flex:0 0 54px;display:grid;place-items:center;
    border-radius:16px;color:#fff;background:linear-gradient(135deg,var(--pri),var(--pri2))
}
.account-hero-user small{display:block;color:var(--ui-muted);font-weight:800;font-size:12px}
.account-hero-user h2{margin:2px 0 3px!important;color:#fff;font-size:27px;line-height:1.1}
.account-hero-user p{margin:0;color:var(--ui-muted);font-size:12px}
.account-home-link{
    height:42px;padding:0 14px;display:flex;align-items:center;gap:8px;
    border-radius:12px;text-decoration:none;color:#dfe7ff;background:#16213d;border:1px solid var(--ui-line);
    font-size:12px;font-weight:800;white-space:nowrap
}
.account-stats{
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:14px!important;margin:0 0 18px!important
}
.account-stat-card{
    min-height:118px!important;padding:20px!important;
    display:flex!important;flex-direction:column!important;justify-content:center!important;gap:8px!important;
    border-radius:18px!important;background:linear-gradient(160deg,#1c2948,#141e36)!important;
    border:1px solid var(--ui-line)!important
}
.account-stat-card span{display:block!important;color:var(--ui-muted)!important;font-size:12px!important;font-weight:700!important}
.account-stat-card strong{display:block!important;color:#fff!important;font-size:24px!important;line-height:1.1!important;font-weight:900!important}
.account-stat-card.discount{background:linear-gradient(160deg,#153b37,#141e36)!important}
.account-stat-card.discount strong{color:#86efac!important}
.account-settings-grid{
    display:grid!important;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr)!important;
    gap:16px!important;margin:0 0 20px!important
}
.account-section{
    padding:22px!important;border-radius:19px!important;
    background:linear-gradient(180deg,#1a2745,#131d35)!important;border:1px solid var(--ui-line)!important
}
.account-section h3{
    display:flex!important;align-items:center!important;gap:9px!important;
    margin:0 0 16px!important;color:#fff!important;font-size:16px!important
}
.account-section-icon{
    width:32px;height:32px;display:grid;place-items:center;border-radius:10px;
    color:#c8b9ff;background:rgba(124,58,237,.14)
}
.account-section form{display:grid!important;gap:7px!important}
.account-section label{display:block!important;margin:5px 0 0!important;color:#bbc7e0!important;font-size:12px!important;font-weight:800!important}
.account-section .input{
    width:100%!important;min-height:45px!important;margin:0!important;padding:11px 13px!important;
    color:#fff!important;background:#0c1429!important;border:1px solid var(--ui-line)!important;border-radius:11px!important
}
.account-section .btn{width:max-content!important;min-width:105px!important;margin-top:8px!important}
.account-section p{color:var(--ui-muted)!important;line-height:1.55!important}
.account-history-head{margin-top:4px;padding:0 2px 8px}
.account-history-head h3{display:flex;align-items:center;gap:8px;margin:0;color:#fff;font-size:16px}
.account-history-head i{color:#8aa2ff}
.account-table-wrap{overflow-x:auto}
.account-table-wrap .table{min-width:720px;margin-top:0!important}
.account-table-wrap .table th{padding:0 12px 6px!important;color:#8fa0c4!important}
.account-table-wrap .table td{padding:13px 12px!important}

/* Responsive */
@media(max-width:1180px){
    .topnav-clean{
        grid-template-columns:auto minmax(190px,1fr) auto auto auto auto;
    }
    .topnav-links a span{display:none}
    .topnav-links a{width:42px;padding:0;justify-content:center}
}
@media(max-width:980px){
    .topnav-clean{display:flex;flex-wrap:wrap}
    .topnav-brand{order:1}
    .topnav-search{order:2;flex:1 1 280px}
    .topnav-links,.topnav-prefs,.topnav-account,.topnav-deposit,.topnav-logout{order:3}
    .home-shell.has-account{grid-template-columns:210px minmax(0,1fr)!important}
    .home-shell .home-account-card{
        grid-column:1 / -1!important;grid-row:2!important;position:static;
    }
    .home-account-list{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:12px}
    .home-account-list>div{display:block;border:1px solid var(--ui-line);border-radius:11px;padding:10px}
    .home-account-list span{display:block;margin-bottom:5px}
}
@media(max-width:820px){
    .home-shell,.home-shell.has-account{grid-template-columns:1fr!important}
    .home-shell .home-category-sidebar,
    .home-shell .home-products-main,
    .home-shell .home-account-card{grid-column:1!important;grid-row:auto!important}
    .account-stats{grid-template-columns:repeat(2,1fr)!important}
    .account-settings-grid{grid-template-columns:1fr!important}
}
@media(max-width:620px){
    .topnav-brand span,.topnav-links a span,.topnav-account-copy,.topnav-deposit span{display:none}
    .topnav-brand{width:46px;padding:0;justify-content:center}
    .topnav-account{min-width:46px;width:46px;padding:6px;justify-content:center}
    .topnav-deposit{width:44px;padding:0;justify-content:center}
    .topnav-search{order:4;flex-basis:100%}
    .account-hero-clean{align-items:flex-start}
    .account-hero-user p{display:none}
    .account-home-link span{display:none}
    .account-stats{grid-template-columns:1fr!important}
    .home-account-list{grid-template-columns:1fr 1fr}
}


/* ===== R3.6 background + admin settings repair ===== */
html,body{min-height:100%}
body{
    background:
      linear-gradient(rgba(255,255,255,.015),rgba(0,0,0,.035)),
      var(--bg,#0b1120) !important;
}

/* Keep the selected background visible while cards remain readable. */
.settings-page{padding:8px 0 48px}
.settings-titlebar{margin:0 0 22px}
.settings-kicker{
    display:inline-flex;align-items:center;gap:8px;
    color:var(--ui-soft,#cbd5e1);font-size:12px;font-weight:800
}
.settings-titlebar h1{margin:10px 0 7px!important;font-size:30px;line-height:1.15}
.settings-titlebar p{margin:0;color:var(--ui-muted,#93a4c7);line-height:1.55}
.settings-form{display:grid!important;gap:20px!important}
.settings-section{
    display:block!important;
    padding:22px!important;
    margin:0!important;
    border:1px solid rgba(148,163,184,.18)!important;
    border-radius:18px!important;
    background:rgba(10,17,35,.78)!important;
    box-shadow:0 12px 30px rgba(0,0,0,.14)!important;
}
.settings-section-head{
    display:flex!important;align-items:flex-start!important;gap:13px!important;
    padding:0 0 17px!important;margin:0 0 18px!important;
    border-bottom:1px solid rgba(148,163,184,.14)!important
}
.settings-section-icon{
    width:38px;height:38px;flex:0 0 38px;
    display:grid;place-items:center;border-radius:11px;
    color:#fff;background:linear-gradient(135deg,var(--pri),var(--pri2))
}
.settings-section-head h3{margin:1px 0 5px!important;font-size:17px!important;line-height:1.25!important}
.settings-section-head p{margin:0!important;color:#9aa9c8!important;font-size:12px!important;line-height:1.55!important}
.settings-fields{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:18px 20px!important;
    align-items:start!important
}
.settings-fields.three-col{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.settings-field{
    min-width:0!important;
    display:flex!important;flex-direction:column!important;
    gap:8px!important;margin:0!important
}
.settings-field.full{grid-column:1/-1!important}
.settings-field label{
    display:block!important;margin:0!important;
    color:#eef3ff!important;font-size:13px!important;font-weight:800!important;line-height:1.35!important
}
.settings-field small{
    display:block!important;margin:0!important;
    color:#91a1c1!important;font-size:11px!important;line-height:1.55!important
}
.settings-field .input,
.settings-field input:not([type="color"]),
.settings-field textarea,
.settings-field select{
    width:100%!important;margin:0!important;
    min-height:46px!important;padding:11px 13px!important;
    color:#fff!important;background:#0c1429!important;
    border:1px solid rgba(148,163,184,.22)!important;
    border-radius:12px!important;outline:none!important
}
.settings-field textarea{min-height:96px!important;resize:vertical!important;line-height:1.55!important}
.settings-field .color-input{
    width:100%!important;height:54px!important;min-height:54px!important;
    padding:6px!important;border-radius:12px!important;
    background:#0c1429!important;border:1px solid rgba(148,163,184,.22)!important;
    cursor:pointer
}
.settings-field input:focus,.settings-field textarea:focus,.settings-field select:focus{
    border-color:var(--pri)!important;box-shadow:0 0 0 3px rgba(124,58,237,.12)!important
}
.cron-field code{
    display:block!important;padding:14px!important;border-radius:12px!important;
    white-space:normal!important;word-break:break-all!important;line-height:1.55!important;
    color:#cfe0ff!important;background:#071023!important;border:1px solid rgba(148,163,184,.16)!important
}
.settings-savebar{
    position:sticky;bottom:12px;z-index:20;
    padding:12px!important;margin-top:0!important;
    border-radius:16px!important;background:rgba(8,15,31,.92)!important;
    border:1px solid rgba(148,163,184,.18)!important;
    backdrop-filter:blur(12px)
}
.settings-savebar .btn{min-height:44px!important}

/* On light custom backgrounds, keep content panels legible but let the chosen
   background remain clearly visible around the page. */
@media(max-width:900px){
    .settings-fields,.settings-fields.three-col{grid-template-columns:1fr!important}
}


/* ===== R3.7 automatic contrast for custom background ===== */
body{
    color:var(--theme-text,#f8fafc)!important;
}
body, .home-shell, .settings-page, main, .container{
    color:var(--theme-text,#f8fafc);
}
.home-sidebar,
.home-products .product-card,
.home-account-card,
.card,
.panel,
.settings-section{
    background:var(--theme-panel,rgba(10,17,35,.78))!important;
    color:var(--theme-text,#f8fafc)!important;
    border-color:var(--theme-border,rgba(148,163,184,.18))!important;
    box-shadow:0 12px 30px var(--theme-shadow,rgba(0,0,0,.22))!important;
}
.home-sidebar *,
.home-products .product-card *,
.home-account-card *,
.card *,
.panel *,
.settings-section *{
    color:inherit;
}
.home-sidebar .muted,
.home-products .muted,
.home-account-card .muted,
.settings-section small,
.settings-section-head p,
.settings-titlebar p,
.product-card .meta,
.product-card .desc,
.home-account-label,
.home-top-list{
    color:var(--theme-muted,#a9b5ca)!important;
}
.settings-kicker{
    color:var(--theme-soft,#cbd5e1)!important;
}
.settings-field label,
.settings-section-head h3,
.settings-titlebar h1{
    color:var(--theme-text,#f8fafc)!important;
}
.settings-field .input,
.settings-field input:not([type="color"]),
.settings-field textarea,
.settings-field select,
.settings-field .color-input{
    background:var(--theme-panel2,rgba(12,20,41,.92))!important;
    color:var(--theme-text,#f8fafc)!important;
    border-color:var(--theme-border,rgba(148,163,184,.18))!important;
}
.settings-field select option{
    background:#ffffff;
    color:#111827;
}
.product-card .title,
.product-card h3,
.home-sidebar h3,
.home-account-card strong,
.home-account-card b{
    color:var(--theme-text,#f8fafc)!important;
}
/* Keep intentionally colored UI elements intact. */
.btn.primary,
.topnav-brand,
.topnav-search button,
.topnav-account-icon,
.topnav-deposit,
.home-account-avatar,
.home-account-open,
.product-card .buy-btn{
    color:#fff!important;
}


/* ===== R3.8 preset background palette ===== */
.theme-preset-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin-top:2px;
}
.theme-preset{
    appearance:none;
    width:100%;
    min-height:72px;
    display:flex;
    align-items:center;
    gap:12px;
    position:relative;
    padding:10px 38px 10px 10px;
    border:1px solid var(--theme-border,rgba(148,163,184,.18));
    border-radius:14px;
    background:var(--theme-panel2,rgba(12,20,41,.92));
    color:var(--theme-text,#f8fafc);
    cursor:pointer;
    text-align:left;
    transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.theme-preset:hover{
    transform:translateY(-1px);
    border-color:var(--pri);
    box-shadow:0 8px 20px var(--theme-shadow,rgba(0,0,0,.18));
}
.theme-preset.active{
    border-color:var(--pri)!important;
    box-shadow:0 0 0 3px rgba(124,58,237,.16),0 8px 20px var(--theme-shadow,rgba(0,0,0,.18));
}
.theme-preset-swatch{
    width:46px;
    height:46px;
    flex:0 0 46px;
    border-radius:11px;
    border:1px solid rgba(127,127,127,.28);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}
.theme-preset-copy{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:4px;
}
.theme-preset-copy strong{
    color:var(--theme-text,#f8fafc)!important;
    font-size:13px;
    line-height:1.25;
}
.theme-preset-copy small{
    color:var(--theme-muted,#a9b5ca)!important;
    font-size:10.5px!important;
    line-height:1.35!important;
}
.theme-preset-check{
    display:none;
    position:absolute;
    right:13px;
    top:50%;
    transform:translateY(-50%);
    width:22px;
    height:22px;
    place-items:center;
    border-radius:999px;
    background:var(--pri);
    color:#fff!important;
    font-size:10px;
}
.theme-preset.active .theme-preset-check{display:grid}
@media(max-width:1050px){
    .theme-preset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px){
    .theme-preset-grid{grid-template-columns:1fr}
}


/* ===== R3.9 preset check visibility fix ===== */
.theme-preset .theme-preset-check,
.theme-preset .fa-solid.theme-preset-check{
    display:none!important;
}
.theme-preset.active .theme-preset-check,
.theme-preset.active .fa-solid.theme-preset-check{
    display:grid!important;
}


/* ===== R4.0 USDT TRC20 deposit ===== */
.crypto-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,.75fr);gap:18px;padding:28px 0 48px}
.crypto-main,.crypto-note{padding:24px!important}
.crypto-title{display:flex;align-items:center;gap:14px;margin-bottom:18px}
.crypto-title h2{margin:0 0 5px}
.crypto-title p{margin:0}
.crypto-logo{width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:#26a17b;color:#fff;font-weight:900;font-size:26px}
.crypto-rate{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:15px 16px;border-radius:14px;background:var(--theme-panel2);border:1px solid var(--theme-border);margin:16px 0}
.crypto-rate strong{font-size:18px}
.crypto-create{display:grid;gap:10px;max-width:520px}
.crypto-create .btn{margin-top:6px}
.crypto-status-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0 18px;border-bottom:1px solid var(--theme-border)}
.crypto-status-row>div{display:grid;gap:4px}
.crypto-status{padding:8px 11px;border-radius:999px;font-size:12px;font-weight:800;background:#f59e0b;color:#111827}
.crypto-status.done{background:#16a34a;color:#fff}
.crypto-status.expired{background:#64748b;color:#fff}
.crypto-pay-grid{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:22px;padding:20px 0}
.crypto-pay-info{display:grid;gap:10px}
.crypto-exact{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px;border-radius:14px;background:rgba(38,161,123,.12);border:1px solid rgba(38,161,123,.35)}
.crypto-exact strong{font-size:25px;color:#18a978!important;letter-spacing:.4px}
.crypto-exact button{width:38px;height:38px;border:0;border-radius:10px;cursor:pointer;background:var(--pri);color:#fff}
.crypto-network{display:flex;justify-content:space-between;gap:10px;padding:12px 14px;border-radius:12px;background:var(--theme-panel2);border:1px solid var(--theme-border)}
.crypto-address{display:grid;grid-template-columns:1fr auto;gap:8px}
.crypto-qr{text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}
.crypto-qr img{width:230px;max-width:100%;padding:10px;background:#fff;border-radius:16px}
.crypto-wait{padding:13px 15px;border-radius:12px;background:rgba(14,165,233,.12);border:1px solid rgba(14,165,233,.28)}
.crypto-note{height:max-content}
.crypto-note code{display:block;word-break:break-all;padding:12px;border-radius:10px;background:var(--theme-panel2);margin-bottom:14px}
.crypto-note .btn{display:block;margin-top:10px;text-align:center}
@media(max-width:900px){.crypto-layout{grid-template-columns:1fr}.crypto-pay-grid{grid-template-columns:1fr}.crypto-qr{order:-1}}


/* ===== R4.1 clean database upgrade result ===== */
.upgrade-page{max-width:900px;margin:0 auto;padding:10px 0 48px}
.upgrade-head{margin-bottom:18px}
.upgrade-kicker{
    display:inline-flex;align-items:center;gap:8px;
    font-size:12px;font-weight:800;color:var(--theme-muted,#a9b5ca)
}
.upgrade-head h1{margin:9px 0 6px;font-size:30px}
.upgrade-head p{margin:0;color:var(--theme-muted,#a9b5ca);line-height:1.55}
.upgrade-success,.upgrade-warning,.upgrade-info{
    display:flex;align-items:flex-start;gap:14px;
    padding:18px 20px;border-radius:16px;margin:18px 0;
    border:1px solid var(--theme-border,rgba(148,163,184,.18));
    background:var(--theme-panel,rgba(10,17,35,.78));
}
.upgrade-success{border-color:rgba(34,197,94,.42);background:rgba(34,197,94,.10)}
.upgrade-warning{border-color:rgba(245,158,11,.48);background:rgba(245,158,11,.10)}
.upgrade-info{border-color:rgba(59,130,246,.32);background:rgba(59,130,246,.08)}
.upgrade-success-icon,.upgrade-warning-icon{
    width:42px;height:42px;flex:0 0 42px;
    display:grid;place-items:center;border-radius:50%;font-size:22px
}
.upgrade-success-icon{background:#16a34a;color:#fff}
.upgrade-warning-icon{background:#f59e0b;color:#111827}
.upgrade-success strong,.upgrade-warning strong,.upgrade-info strong{
    display:block;font-size:16px;margin-bottom:5px
}
.upgrade-success p,.upgrade-warning p,.upgrade-info span{
    margin:0;color:var(--theme-muted,#a9b5ca);line-height:1.55
}
.upgrade-info>i{margin-top:3px;font-size:20px}
.upgrade-issues{display:grid;gap:10px;margin-bottom:16px}
.upgrade-action{
    display:flex;justify-content:flex-start;
    padding-top:3px
}
.upgrade-action .btn{min-height:44px;padding:0 18px}


/* ===== R4.2 TRC20 diagnostics ===== */
.trc20-test-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.trc20-test-row small{margin:0!important}
.trc-test-page{max-width:950px;margin:0 auto;padding:12px 0 50px}
.trc-test-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.trc-test-head h1{margin:8px 0 6px}
.trc-test-head p{margin:0;color:var(--theme-muted,#a9b5ca)}
.trc-test-summary{display:flex;align-items:center;gap:13px;padding:16px 18px;border-radius:15px;margin-bottom:15px;border:1px solid var(--theme-border)}
.trc-test-summary>i{font-size:26px}
.trc-test-summary div{display:grid;gap:4px}
.trc-test-summary span{color:var(--theme-muted,#a9b5ca)}
.trc-test-summary.ok{background:rgba(34,197,94,.10);border-color:rgba(34,197,94,.38)}
.trc-test-summary.ok>i{color:#22c55e}
.trc-test-summary.bad{background:rgba(239,68,68,.09);border-color:rgba(239,68,68,.38)}
.trc-test-summary.bad>i{color:#ef4444}
.trc-test-grid{display:grid;gap:10px}
.trc-test-item{display:flex;align-items:flex-start;gap:13px;padding:15px 17px;border-radius:14px;background:var(--theme-panel);border:1px solid var(--theme-border)}
.trc-test-icon{width:34px;height:34px;flex:0 0 34px;display:grid;place-items:center;border-radius:50%}
.trc-test-item strong{display:block;margin-bottom:4px}
.trc-test-item p{margin:0;color:var(--theme-muted,#a9b5ca);line-height:1.5;word-break:break-word}
.trc-test-item.ok .trc-test-icon{background:#16a34a;color:#fff}
.trc-test-item.warn .trc-test-icon{background:#f59e0b;color:#111827}
.trc-test-item.warn{border-color:rgba(245,158,11,.35)}
.trc-test-item.bad .trc-test-icon{background:#dc2626;color:#fff}
.trc-test-item.bad{border-color:rgba(239,68,68,.38)}
.trc-test-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
@media(max-width:700px){.trc-test-head{flex-direction:column}}


/* ===== R4.3 TRC20 order countdown ===== */
.crypto-countdown{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0 16px;padding:14px 16px;border-radius:14px;border:1px solid rgba(34,197,94,.34);background:rgba(34,197,94,.08)}
.crypto-countdown-left{display:flex;align-items:center;gap:12px}
.crypto-countdown-left>i{font-size:22px}
.crypto-countdown-left>div{display:grid;gap:3px}
.crypto-countdown small{color:var(--theme-muted,#a9b5ca)}
.crypto-countdown strong{font-size:28px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:1px}
.crypto-countdown>span{font-size:13px;color:var(--theme-muted,#a9b5ca);text-align:right}
.crypto-countdown.expired{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.09)}
.crypto-countdown.expired strong,.crypto-countdown.expired .crypto-countdown-left>i{color:#ef4444}
.crypto-expired-warning{display:flex;gap:12px;align-items:flex-start;margin:0 0 16px;padding:13px 15px;border-radius:13px;border:1px solid rgba(245,158,11,.42);background:rgba(245,158,11,.09)}
.crypto-expired-warning[hidden]{display:none!important}
.crypto-expired-warning>i{color:#f59e0b;margin-top:2px}
.crypto-expired-warning div{display:grid;gap:3px}
.crypto-expired-warning span{color:var(--theme-muted,#a9b5ca);font-size:13px}
@media(max-width:700px){.crypto-countdown{align-items:flex-start;flex-direction:column}.crypto-countdown>span{text-align:left}}


/* ===== R4.6 AUTO CLEANUP ===== */
.cleanup-page{max-width:1050px;margin:0 auto;padding:10px 0 50px}
.cleanup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.cleanup-head h1{margin:8px 0 6px}.cleanup-head p{margin:0;color:var(--theme-muted,#a9b5ca)}
.cleanup-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}
.cleanup-stats>div{padding:14px 16px;border:1px solid var(--theme-border);border-radius:14px;background:var(--theme-panel)}
.cleanup-stats span{display:block;color:var(--theme-muted,#a9b5ca);font-size:13px;margin-bottom:5px}.cleanup-stats b{font-size:22px}
.cleanup-key-row{display:flex;gap:10px;align-items:center}.cleanup-key-row .input{flex:1}
.cleanup-readonly{min-height:46px;padding:12px 13px;border-radius:10px;border:1px solid var(--theme-border);background:rgba(15,23,42,.14);word-break:break-word}
.cleanup-actions{margin-top:14px}.cleanup-run-now{display:inline-block;margin-top:12px}
.cleanup-safe-note{display:flex;gap:12px;align-items:flex-start;margin-top:18px;padding:14px 16px;border:1px solid rgba(34,197,94,.35);background:rgba(34,197,94,.08);border-radius:14px}
.cleanup-safe-note>i{color:#22c55e;margin-top:2px}.cleanup-safe-note div{display:grid;gap:4px}.cleanup-safe-note span{color:var(--theme-muted,#a9b5ca)}
@media(max-width:800px){.cleanup-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.cleanup-head,.cleanup-key-row{flex-direction:column}.cleanup-key-row{align-items:stretch}}


/* ===== R4.7 ORDERS RETENTION ===== */
.cleanup-stats{grid-template-columns:repeat(5,minmax(0,1fr))}
.cleanup-orders-box{border-color:rgba(245,158,11,.22)}
.cleanup-danger-note{display:flex!important;gap:12px!important;align-items:flex-start;padding:13px 15px!important;border:1px solid rgba(245,158,11,.38)!important;background:rgba(245,158,11,.08)!important;border-radius:12px}
.cleanup-danger-note>i{color:#f59e0b;margin-top:2px}
.cleanup-danger-note>div{display:grid;gap:4px}.cleanup-danger-note span{color:var(--theme-muted,#a9b5ca);line-height:1.5}
@media(max-width:900px){.cleanup-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* ===== R4.8 CLEANUP SIMPLIFIED ===== */
.cleanup-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:760px){.cleanup-stats{grid-template-columns:1fr}}


/* ===== R4.9 RETENTION COUNTDOWN LABELS ===== */
.retention-notice{display:flex;gap:12px;align-items:flex-start;margin:0 0 16px;padding:13px 15px;border:1px solid rgba(59,130,246,.32);background:rgba(59,130,246,.08);border-radius:13px}
.retention-notice>i{color:#60a5fa;margin-top:3px}
.retention-notice>div{display:grid;gap:4px}
.retention-notice span{color:var(--theme-muted,#a9b5ca);line-height:1.45}
.retention-notice.retention-disabled{border-color:var(--theme-border);background:var(--theme-panel)}
.retention-badge{display:inline-flex;align-items:center;white-space:nowrap;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid rgba(59,130,246,.35);background:rgba(59,130,246,.10);color:#93c5fd}
.retention-badge.urgent{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.10);color:#fbbf24}
.retention-badge.off{border-color:var(--theme-border);background:rgba(148,163,184,.08);color:var(--theme-muted,#a9b5ca)}
.retention-badge.safe{border-color:rgba(34,197,94,.4);background:rgba(34,197,94,.09);color:#4ade80}


/* ===== R5.0 INVENTORY MARKETPLACE REDESIGN ===== */
.home-shell{
    grid-template-columns:172px minmax(0,1fr) 190px!important;
    gap:14px!important;
    align-items:start!important;
}
.home-shell:not(.has-account){grid-template-columns:172px minmax(0,1fr)!important}
.home-category-sidebar{
    position:sticky;top:92px;
    border-radius:18px!important;
    overflow:hidden;
}
.home-category-sidebar>h3{font-size:13px;margin:2px 0 12px;text-transform:uppercase;letter-spacing:.04em;color:var(--theme-soft,#cbd5e1)!important}
.home-category-sidebar .cat{
    display:flex!important;align-items:center;gap:9px;
    min-height:42px;padding:9px 10px!important;margin:0 0 7px!important;
    border-radius:11px!important;
    border:1px solid var(--theme-border)!important;
    background:rgba(255,255,255,.025)!important;
    transition:.16s ease;
}
.home-category-sidebar .cat:hover{transform:translateX(2px);border-color:var(--pri)!important}
.home-category-sidebar .cat.active{
    background:linear-gradient(135deg,var(--pri),var(--pri2))!important;
    border-color:transparent!important;color:#fff!important;
}
.home-category-sidebar .cat-name{min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-category-sidebar .cat-count{
    min-width:24px;height:24px;padding:0 6px;
    display:inline-grid;place-items:center;
    border-radius:999px;
    background:rgba(255,255,255,.09);
    font-size:11px;font-weight:800;
}
.home-category-sidebar .cat.active .cat-count{background:rgba(255,255,255,.2);color:#fff}

.sidebar-section-title{display:flex;align-items:center;justify-content:space-between;margin:18px 0 10px}
.sidebar-section-title h3{margin:0!important}
.sidebar-section-title span{font-size:10px;font-weight:800;color:var(--theme-muted,#a9b5ca)}
.best-seller-list{display:grid;gap:7px}
.best-seller-item{
    display:grid;grid-template-columns:26px minmax(0,1fr);gap:8px;align-items:center;
    padding:8px;border-radius:10px;border:1px solid var(--theme-border);
    background:rgba(255,255,255,.022)
}
.best-seller-rank{
    width:26px;height:26px;display:grid;place-items:center;
    border-radius:8px;background:rgba(245,158,11,.13);
    color:#fbbf24;font-weight:900;font-size:11px
}
.best-seller-item strong{display:block;font-size:10.5px;line-height:1.3;color:var(--theme-text)!important}
.best-seller-item small{display:block;margin-top:2px;font-size:9px;color:var(--theme-muted,#a9b5ca)!important}
.best-seller-empty{font-size:11px!important}

.inventory-toolbar{
    display:flex;justify-content:space-between;align-items:center;gap:14px;
    margin:0 0 12px;padding:14px 16px;
    border-radius:16px;border:1px solid var(--theme-border);
    background:var(--theme-panel);
}
.inventory-kicker{
    display:inline-flex;align-items:center;gap:7px;
    font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;
    color:var(--theme-muted,#a9b5ca)
}
.inventory-toolbar h2{margin:4px 0 2px;font-size:20px}
.inventory-toolbar p{margin:0;font-size:11px;color:var(--theme-muted,#a9b5ca)}
.inventory-toolbar-note{
    display:flex;align-items:center;gap:8px;
    max-width:240px;padding:8px 10px;border-radius:11px;
    background:rgba(34,197,94,.08);border:1px solid rgba(34,197,94,.24);
    color:var(--theme-muted,#a9b5ca);font-size:10.5px;line-height:1.4
}
.inventory-toolbar-note i{color:#22c55e}

.inventory-product-list{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
.inventory-card{
    position:relative;
    display:grid;grid-template-columns:minmax(0,1fr) 205px;
    gap:12px;align-items:stretch;
    min-height:128px;
    padding:12px;
    border:1px solid var(--theme-border);
    border-radius:16px;
    background:linear-gradient(180deg,var(--theme-panel2),var(--theme-panel));
    box-shadow:0 8px 24px var(--theme-shadow,rgba(0,0,0,.16));
    transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
    overflow:hidden;
}
.inventory-card:before{
    content:"";position:absolute;inset:0 auto 0 0;width:3px;
    background:linear-gradient(180deg,var(--pri),var(--pri2));opacity:.7
}
.inventory-card:hover{
    transform:translateY(-2px);
    border-color:color-mix(in srgb,var(--pri) 52%,transparent);
    box-shadow:0 14px 32px var(--theme-shadow,rgba(0,0,0,.22))
}
.inventory-card-main{display:grid;grid-template-columns:86px minmax(0,1fr);gap:12px;align-items:center;min-width:0}
.inventory-visual{
    width:86px;height:86px;border-radius:14px;overflow:hidden;
    border:1px solid var(--theme-border);
    background:linear-gradient(145deg,rgba(59,130,246,.12),rgba(124,58,237,.10));
    display:grid;place-items:center
}
.inventory-visual img{width:100%!important;height:100%!important;object-fit:cover!important;margin:0!important;border-radius:0!important}
.inventory-placeholder{
    width:48px;height:48px;border-radius:14px;
    display:grid;place-items:center;
    background:linear-gradient(135deg,var(--pri),var(--pri2));
    box-shadow:0 8px 20px rgba(0,0,0,.18);
    color:#fff;font-size:21px
}
.inventory-info{min-width:0}
.inventory-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.inventory-category{
    display:inline-flex;align-items:center;max-width:180px;
    padding:4px 7px;border-radius:999px;
    background:rgba(148,163,184,.08);border:1px solid var(--theme-border);
    color:var(--theme-muted,#a9b5ca);font-size:9.5px;font-weight:800;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.inventory-chip{
    display:inline-flex;align-items:center;gap:4px;
    padding:4px 7px;border-radius:999px;
    border:1px solid rgba(34,197,94,.25);background:rgba(34,197,94,.08);
    color:#4ade80;font-size:9px;font-weight:900
}
.inventory-chip.hot{border-color:rgba(245,158,11,.3);background:rgba(245,158,11,.08);color:#fbbf24}
.inventory-chip.api{border-color:rgba(59,130,246,.3);background:rgba(59,130,246,.08);color:#93c5fd}
.inventory-title{
    margin:0 0 5px!important;
    font-size:15px!important;line-height:1.35!important;
    color:var(--theme-text,#f8fafc)!important
}
.inventory-desc{
    margin:0!important;max-width:680px;
    color:var(--theme-muted,#a9b5ca)!important;
    font-size:10.5px!important;line-height:1.5!important
}
.inventory-buybox{
    display:grid;grid-template-rows:auto auto 1fr;align-content:center;gap:8px;
    padding:10px 0 10px 12px;
    border-left:1px solid var(--theme-border)
}
.inventory-price{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap}
.inventory-price small{
    flex-basis:100%;font-size:9px;text-transform:uppercase;letter-spacing:.05em;
    color:var(--theme-muted,#a9b5ca)
}
.inventory-price strong{font-size:21px;line-height:1;color:var(--theme-text,#f8fafc)!important}
.inventory-price .old-price{font-size:10px!important}
.inventory-price .discount-badge{font-size:9px!important;padding:3px 6px!important}
.inventory-stock{
    width:max-content;display:inline-flex;align-items:center;gap:6px;
    padding:5px 8px;border-radius:999px;
    font-size:10px;font-weight:900;
    border:1px solid rgba(34,197,94,.28);background:rgba(34,197,94,.08);color:#4ade80
}
.inventory-stock.mid{border-color:rgba(59,130,246,.28);background:rgba(59,130,246,.08);color:#93c5fd}
.inventory-stock.low{border-color:rgba(245,158,11,.34);background:rgba(245,158,11,.09);color:#fbbf24}
.inventory-stock.out{border-color:rgba(239,68,68,.34);background:rgba(239,68,68,.08);color:#f87171}
.inventory-actions{display:grid;grid-template-columns:1fr 1.25fr;gap:7px;align-self:end}
.inventory-actions .btn{
    min-height:36px!important;padding:7px 8px!important;
    display:flex!important;align-items:center;justify-content:center;gap:6px;
    font-size:10.5px!important;border-radius:10px!important
}
.inventory-detail{background:rgba(148,163,184,.08)!important}
.inventory-buy{box-shadow:0 8px 18px color-mix(in srgb,var(--pri) 26%,transparent)}
.inventory-soldout{opacity:.6;cursor:not-allowed}
.inventory-footer-mobile{display:none}

.home-account-card{
    position:sticky;top:92px;
    border-radius:18px!important;
    overflow:hidden
}
.home-account-list>div{padding:9px 0!important}
.home-account-list span{font-size:10px!important}
.home-account-list b{font-size:11px!important}

.product-view-grid .inventory-card,
.product-view-list .inventory-card{width:100%!important}

@media(max-width:1150px){
    .home-shell,.home-shell.has-account{grid-template-columns:160px minmax(0,1fr)!important}
    .home-account-card{display:none}
}
@media(max-width:820px){
    .home-shell,.home-shell.has-account,.home-shell:not(.has-account){grid-template-columns:1fr!important}
    .home-category-sidebar{position:static;display:block}
    .inventory-toolbar{align-items:flex-start}
    .inventory-toolbar-note{display:none}
}
@media(max-width:680px){
    .inventory-card{grid-template-columns:1fr;gap:10px}
    .inventory-card-main{grid-template-columns:64px minmax(0,1fr)}
    .inventory-visual{width:64px;height:64px}
    .inventory-placeholder{width:38px;height:38px;font-size:17px}
    .inventory-buybox{border-left:0;border-top:1px solid var(--theme-border);padding:10px 0 0;grid-template-columns:1fr auto;grid-template-rows:auto auto}
    .inventory-buybox>.inventory-stock{display:none}
    .inventory-price small{display:none}
    .inventory-actions{grid-column:1/-1}
    .inventory-footer-mobile{display:block;margin-top:8px}
    .inventory-title{font-size:14px!important}
}


/* ===== R5.1 WIDE INVENTORY + INLINE LOGOUT ===== */
.wrap{
    width:min(94vw,1500px)!important;
    max-width:1500px!important;
}
.topnav-clean{
    width:min(94vw,1500px)!important;
    max-width:1500px!important;
    margin-left:auto!important;
    margin-right:auto!important;
}
.topnav-clean{
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    flex-wrap:nowrap!important;
}
.topnav-search{min-width:240px!important;flex:1 1 420px!important;max-width:520px!important}
.topnav-links,.topnav-prefs,.topnav-account{
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    flex:0 0 auto!important;
    white-space:nowrap!important;
}
.topnav-logout{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 auto!important;
    width:auto!important;
    margin:0!important;
    white-space:nowrap!important;
}
.home-shell{
    grid-template-columns:190px minmax(0,1fr) 210px!important;
    gap:16px!important;
    width:100%!important;
}
.home-products-main{min-width:0!important}
.inventory-card{
    grid-template-columns:minmax(0,1fr) 220px!important;
}
.inventory-card-main{
    grid-template-columns:88px minmax(0,1fr)!important;
}
.inventory-title{
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    max-width:none!important;
}
.inventory-desc{
    max-width:none!important;
}
@media(min-width:1450px){
    .wrap,.topnav-clean{
        width:min(96vw,1560px)!important;
        max-width:1560px!important;
    }
    .home-shell{
        grid-template-columns:205px minmax(0,1fr) 220px!important;
        gap:18px!important;
    }
    .inventory-card{
        grid-template-columns:minmax(0,1fr) 230px!important;
    }
}
@media(max-width:1280px){
    .topnav-search{min-width:200px!important;flex-basis:300px!important}
    .topnav-clean{gap:6px!important}
}
@media(max-width:1180px){
    .topnav-clean{flex-wrap:wrap!important}
    .topnav-logout{margin-left:0!important}
}


/* ===== R5.2 EDGE-WIDE INVENTORY ===== */

/* Desktop: sát hai sườn hơn, bỏ khoảng trống lớn. */
.wrap{
    width:calc(100vw - 32px)!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
}
.topnav-clean{
    width:calc(100vw - 32px)!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
}

/* Font tổng thể tăng nhẹ. */
body{font-size:15px!important}
.topnav-brand{font-size:15px!important}
.topnav-links a,
.topnav-deposit,
.topnav-logout{font-size:13px!important}
.notice{font-size:13px!important}
.btn,.input,select,textarea{font-size:13px!important}

/* Sidebar trái/phải rộng và cân đối hơn. */
.home-shell{
    grid-template-columns:250px minmax(0,1fr) 270px!important;
    gap:18px!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
}
.home-category-sidebar{
    width:100%!important;
    padding:17px!important;
}
.home-category-sidebar>h3{font-size:14px!important}
.home-category-sidebar .cat{
    min-height:47px!important;
    padding:11px 12px!important;
    font-size:12.5px!important;
}
.home-category-sidebar .cat-count{
    min-width:27px!important;
    height:27px!important;
    font-size:11px!important;
}
.sidebar-section-title h3{font-size:14px!important}
.sidebar-section-title span{font-size:10.5px!important}
.best-seller-item{
    grid-template-columns:30px minmax(0,1fr)!important;
    padding:9px!important;
}
.best-seller-rank{
    width:30px!important;
    height:30px!important;
}
.best-seller-item strong{font-size:11.5px!important}
.best-seller-item small{font-size:10px!important}

/* Account card phải to hơn, đỡ cảm giác hẹp. */
.home-account-card{
    width:100%!important;
    min-width:0!important;
}
.home-account-head{
    padding:17px!important;
}
.home-account-list{
    padding-left:17px!important;
    padding-right:17px!important;
}
.home-account-list>div{
    min-height:44px!important;
    padding:11px 0!important;
}
.home-account-list span{font-size:11.5px!important}
.home-account-list b{font-size:12.5px!important}

/* Trung tâm rộng, tên sản phẩm ít xuống dòng. */
.inventory-toolbar{
    padding:16px 18px!important;
}
.inventory-toolbar h2{font-size:22px!important}
.inventory-toolbar p{font-size:12px!important}
.inventory-kicker{font-size:10.5px!important}
.inventory-toolbar-note{
    max-width:290px!important;
    font-size:11px!important;
}
.inventory-card{
    grid-template-columns:minmax(0,1fr) 235px!important;
    min-height:142px!important;
    padding:14px!important;
}
.inventory-card-main{
    grid-template-columns:94px minmax(0,1fr)!important;
    gap:14px!important;
}
.inventory-visual{
    width:94px!important;
    height:94px!important;
}
.inventory-title{
    font-size:16.5px!important;
    line-height:1.3!important;
    max-width:none!important;
}
.inventory-desc{font-size:11.5px!important}
.inventory-category{font-size:10px!important}
.inventory-chip{font-size:9.5px!important}
.inventory-price strong{font-size:23px!important}
.inventory-stock{font-size:10.5px!important}
.inventory-actions .btn{
    min-height:39px!important;
    font-size:11px!important;
}

/* Header: giữ một hàng, icon logout nằm sau USDT. */
.topnav-clean{
    display:flex!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:7px!important;
}
.topnav-search{
    min-width:300px!important;
    max-width:680px!important;
    flex:1 1 520px!important;
}
.topnav-links,.topnav-prefs{
    gap:6px!important;
    flex:0 0 auto!important;
}
.topnav-account,.topnav-deposit,.topnav-logout{
    flex:0 0 auto!important;
    white-space:nowrap!important;
}
.topnav-logout{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
    border-radius:10px!important;
}

/* Màn rất rộng: gần sát mép hơn nữa. */
@media(min-width:1500px){
    .wrap,.topnav-clean{
        width:calc(100vw - 24px)!important;
    }
    .home-shell{
        grid-template-columns:270px minmax(0,1fr) 290px!important;
        gap:20px!important;
    }
    .inventory-card{
        grid-template-columns:minmax(0,1fr) 245px!important;
    }
}

/* Breakpoint giữ responsive. */
@media(max-width:1320px){
    .wrap,.topnav-clean{
        width:calc(100vw - 20px)!important;
    }
    .home-shell{
        grid-template-columns:220px minmax(0,1fr) 235px!important;
        gap:14px!important;
    }
    .inventory-card{
        grid-template-columns:minmax(0,1fr) 220px!important;
    }
    .topnav-search{
        min-width:220px!important;
        flex-basis:340px!important;
    }
}
@media(max-width:1180px){
    .topnav-clean{flex-wrap:wrap!important}
    .home-shell,.home-shell.has-account{
        grid-template-columns:190px minmax(0,1fr)!important;
    }
    .home-account-card{display:none!important}
}
@media(max-width:820px){
    .wrap,.topnav-clean{
        width:calc(100vw - 14px)!important;
    }
    .home-shell,.home-shell.has-account,.home-shell:not(.has-account){
        grid-template-columns:1fr!important;
    }
}


/* ===== R5.3 BALANCED WIDTH + BIGGER SIDE TEXT ===== */

/* Pull the whole desktop layout back inward: not edge-to-edge, but still wider than R5.1. */
.wrap{
    width:calc(100vw - 110px)!important;
    max-width:1580px!important;
    margin-left:auto!important;
    margin-right:auto!important;
}
.topnav-clean{
    width:calc(100vw - 110px)!important;
    max-width:1580px!important;
    margin-left:auto!important;
    margin-right:auto!important;
}

/* Push the Home button/header content a little to the right naturally with the balanced container. */
.topnav-clean{
    padding-left:8px!important;
    padding-right:8px!important;
}

/* Balanced 3-column layout: wider side panels, center no longer overly stretched. */
.home-shell{
    grid-template-columns:265px minmax(0,1fr) 285px!important;
    gap:20px!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
}

/* Left category panel: bigger, clearer typography. */
.home-category-sidebar{
    padding:18px!important;
}
.home-category-sidebar>h3{
    font-size:15px!important;
    letter-spacing:.03em!important;
}
.home-category-sidebar .cat{
    min-height:50px!important;
    padding:12px 13px!important;
    font-size:14px!important;
    line-height:1.25!important;
}
.home-category-sidebar .cat-name{
    font-size:14px!important;
    max-width:none!important;
}
.home-category-sidebar .cat-count{
    min-width:28px!important;
    height:28px!important;
    font-size:12px!important;
}
.sidebar-section-title{
    margin-top:20px!important;
}
.sidebar-section-title h3{
    font-size:15px!important;
}
.sidebar-section-title span{
    font-size:11px!important;
}
.best-seller-item{
    grid-template-columns:32px minmax(0,1fr)!important;
    gap:9px!important;
    padding:10px!important;
}
.best-seller-rank{
    width:32px!important;
    height:32px!important;
    font-size:12px!important;
}
.best-seller-item strong{
    font-size:12.5px!important;
    line-height:1.35!important;
}
.best-seller-item small{
    font-size:11px!important;
}

/* Right account panel: wider + larger text. */
.home-account-card{
    width:100%!important;
    min-width:0!important;
}
.home-account-head{
    padding:18px!important;
}
.home-account-head small{
    font-size:11px!important;
}
.home-account-head b{
    font-size:14px!important;
}
.home-account-list{
    padding-left:18px!important;
    padding-right:18px!important;
}
.home-account-list>div{
    min-height:46px!important;
    padding:12px 0!important;
}
.home-account-list span{
    font-size:13px!important;
}
.home-account-list b{
    font-size:14px!important;
}
.home-account-card .btn{
    font-size:13px!important;
    min-height:42px!important;
}

/* Center inventory: slightly shorter/narrower feel than R5.2. */
.inventory-toolbar{
    padding:15px 17px!important;
}
.inventory-toolbar h2{
    font-size:21px!important;
}
.inventory-card{
    grid-template-columns:minmax(0,1fr) 225px!important;
    min-height:134px!important;
    padding:13px!important;
}
.inventory-card-main{
    grid-template-columns:88px minmax(0,1fr)!important;
    gap:13px!important;
}
.inventory-visual{
    width:88px!important;
    height:88px!important;
}
.inventory-title{
    font-size:16px!important;
    line-height:1.32!important;
}
.inventory-desc{
    font-size:11px!important;
}
.inventory-price strong{
    font-size:22px!important;
}
.inventory-actions .btn{
    min-height:37px!important;
    font-size:11px!important;
}

/* Keep the header on one line on normal desktop widths. */
.topnav-search{
    min-width:260px!important;
    max-width:600px!important;
    flex:1 1 460px!important;
}

/* Large desktop: still leave a visible gutter. */
@media(min-width:1600px){
    .wrap,.topnav-clean{
        width:calc(100vw - 140px)!important;
        max-width:1640px!important;
    }
    .home-shell{
        grid-template-columns:275px minmax(0,1fr) 295px!important;
        gap:22px!important;
    }
}

/* Medium desktop: reduce gutter but do not go edge-to-edge. */
@media(max-width:1380px){
    .wrap,.topnav-clean{
        width:calc(100vw - 70px)!important;
    }
    .home-shell{
        grid-template-columns:235px minmax(0,1fr) 250px!important;
        gap:16px!important;
    }
    .home-category-sidebar .cat,
    .home-category-sidebar .cat-name{
        font-size:13px!important;
    }
    .home-account-list span{
        font-size:12px!important;
    }
    .home-account-list b{
        font-size:13px!important;
    }
}
@media(max-width:1180px){
    .wrap,.topnav-clean{
        width:calc(100vw - 34px)!important;
    }
    .topnav-clean{
        flex-wrap:wrap!important;
    }
    .home-shell,.home-shell.has-account{
        grid-template-columns:200px minmax(0,1fr)!important;
    }
    .home-account-card{
        display:none!important;
    }
}
@media(max-width:820px){
    .wrap,.topnav-clean{
        width:calc(100vw - 16px)!important;
    }
    .home-shell,.home-shell.has-account,.home-shell:not(.has-account){
        grid-template-columns:1fr!important;
    }
}


/* ===== R5.4 TOP ACCOUNT USERNAME DESCENDER FIX ===== */
.topnav-account-copy{
    min-width:0!important;
    overflow:visible!important;
    padding-bottom:2px!important;
}
.topnav-account-copy b{
    display:block!important;
    line-height:1.35!important;
    padding-bottom:2px!important;
    overflow:visible!important;
    text-overflow:clip!important;
}
.topnav-account{
    overflow:visible!important;
    min-height:42px!important;
}


/* ===== R5.5 WIDER SIDE PANELS + NARROWER INVENTORY ===== */

/* Keep the balanced outer gutter from R5.4. */
.wrap,
.topnav-clean{
    width:calc(100vw - 110px)!important;
    max-width:1580px!important;
}

/* Give more room to category/account panels, take a little from center. */
.home-shell{
    grid-template-columns:305px minmax(0,1fr) 315px!important;
    gap:20px!important;
}

/* Left category: allow longer labels to be readable. */
.home-category-sidebar{
    min-width:0!important;
    padding:18px!important;
}
.home-category-sidebar .cat{
    min-height:50px!important;
    padding:12px 14px!important;
}
.home-category-sidebar .cat-name{
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    line-height:1.25!important;
    font-size:14px!important;
}
.home-category-sidebar .cat-count{
    flex:0 0 auto!important;
}

/* Right account panel slightly wider and roomier. */
.home-account-card{
    min-width:0!important;
}
.home-account-head{
    padding:18px 19px!important;
}
.home-account-list{
    padding-left:19px!important;
    padding-right:19px!important;
}
.home-account-list span{
    font-size:13px!important;
}
.home-account-list b{
    font-size:14px!important;
}

/* Center inventory intentionally a little narrower/shorter. */
.inventory-toolbar{
    padding:14px 16px!important;
}
.inventory-card{
    grid-template-columns:minmax(0,1fr) 218px!important;
    min-height:132px!important;
    padding:12px!important;
}
.inventory-card-main{
    grid-template-columns:86px minmax(0,1fr)!important;
    gap:12px!important;
}
.inventory-visual{
    width:86px!important;
    height:86px!important;
}
.inventory-title{
    font-size:15.7px!important;
}
.inventory-desc{
    font-size:10.8px!important;
}
.inventory-buybox{
    padding-left:11px!important;
}
.inventory-price strong{
    font-size:21.5px!important;
}
.inventory-actions{
    gap:6px!important;
}
.inventory-actions .btn{
    min-height:36px!important;
}

/* Large desktop: keep side panels visibly wider. */
@media(min-width:1600px){
    .wrap,
    .topnav-clean{
        width:calc(100vw - 140px)!important;
        max-width:1640px!important;
    }
    .home-shell{
        grid-template-columns:320px minmax(0,1fr) 330px!important;
        gap:22px!important;
    }
    .inventory-card{
        grid-template-columns:minmax(0,1fr) 225px!important;
    }
}

/* Mid desktop: still preserve readable side labels. */
@media(max-width:1380px){
    .wrap,
    .topnav-clean{
        width:calc(100vw - 70px)!important;
    }
    .home-shell{
        grid-template-columns:270px minmax(0,1fr) 280px!important;
        gap:16px!important;
    }
    .home-category-sidebar .cat-name{
        font-size:13.5px!important;
    }
    .home-account-list span{
        font-size:12.5px!important;
    }
    .home-account-list b{
        font-size:13.5px!important;
    }
}
@media(max-width:1180px){
    .home-shell,
    .home-shell.has-account{
        grid-template-columns:220px minmax(0,1fr)!important;
    }
}


/* ===== R5.6 REAL WIDER SIDE PANELS ===== */

/*
 * R5.6: Không cho tên Danh mục xuống dòng để "giả" rộng nữa.
 * Tăng chiều NGANG thực tế của 2 cột bên và thu cột sản phẩm giữa lại.
 */
.home-shell{
    grid-template-columns:350px minmax(0,1fr) 340px!important;
    gap:22px!important;
}

/* DANH MỤC: rộng thật và giữ tên trên 1 dòng. */
.home-category-sidebar{
    width:350px!important;
    min-width:350px!important;
    max-width:350px!important;
    padding:18px!important;
}
.home-category-sidebar .cat{
    width:100%!important;
    min-height:50px!important;
    padding:12px 14px!important;
}
.home-category-sidebar .cat-name{
    display:block!important;
    min-width:0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:14px!important;
    line-height:1.25!important;
}
.home-category-sidebar .cat-count{
    flex:0 0 auto!important;
}

/* TÀI KHOẢN: tăng chiều ngang thật. */
.home-account-card{
    width:340px!important;
    min-width:340px!important;
    max-width:340px!important;
}
.home-account-head{
    padding:18px 20px!important;
}
.home-account-list{
    padding-left:20px!important;
    padding-right:20px!important;
}
.home-account-list span{
    font-size:13px!important;
}
.home-account-list b{
    font-size:14px!important;
}

/* Cột sản phẩm giữa thu lại rõ ràng hơn so với R5.5. */
.home-products-main{
    min-width:0!important;
}
.inventory-toolbar{
    padding:14px 16px!important;
}
.inventory-card{
    grid-template-columns:minmax(0,1fr) 210px!important;
    min-height:130px!important;
    padding:12px!important;
}
.inventory-card-main{
    grid-template-columns:84px minmax(0,1fr)!important;
    gap:12px!important;
}
.inventory-visual{
    width:84px!important;
    height:84px!important;
}
.inventory-title{
    font-size:15.5px!important;
}
.inventory-desc{
    font-size:10.8px!important;
}
.inventory-buybox{
    padding-left:10px!important;
}

/* Desktop lớn: sidebars tiếp tục rộng, center vẫn vừa phải. */
@media(min-width:1600px){
    .home-shell{
        grid-template-columns:370px minmax(0,1fr) 360px!important;
        gap:24px!important;
    }
    .home-category-sidebar{
        width:370px!important;
        min-width:370px!important;
        max-width:370px!important;
    }
    .home-account-card{
        width:360px!important;
        min-width:360px!important;
        max-width:360px!important;
    }
}

/* Desktop vừa: vẫn ưu tiên sidebars rộng hơn R5.5. */
@media(max-width:1380px){
    .home-shell{
        grid-template-columns:300px minmax(0,1fr) 300px!important;
        gap:18px!important;
    }
    .home-category-sidebar{
        width:300px!important;
        min-width:300px!important;
        max-width:300px!important;
    }
    .home-account-card{
        width:300px!important;
        min-width:300px!important;
        max-width:300px!important;
    }
    .home-category-sidebar .cat-name{
        font-size:13.5px!important;
    }
}

/* Tablet trở xuống quay lại responsive bình thường. */
@media(max-width:1180px){
    .home-shell,
    .home-shell.has-account{
        grid-template-columns:220px minmax(0,1fr)!important;
    }
    .home-category-sidebar{
        width:220px!important;
        min-width:220px!important;
        max-width:220px!important;
    }
    .home-account-card{
        display:none!important;
    }
}
@media(max-width:820px){
    .home-shell,
    .home-shell.has-account,
    .home-shell:not(.has-account){
        grid-template-columns:1fr!important;
    }
    .home-category-sidebar{
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
    }
}


/* ===== R5.7 FIX GRID OVERLAP ===== */

/*
 * Fix R5.6: sidebar fixed-width bị lớn hơn track của grid ở một số kích thước,
 * khiến Danh mục đè lên bảng sản phẩm.
 *
 * R5.7 để GRID quyết định chiều rộng, sidebar chỉ width:100%.
 * Như vậy 3 cột luôn nằm đúng track và không thể chồng lên nhau.
 */
.home-shell{
    display:grid!important;
    grid-template-columns:300px minmax(0,1fr) 300px!important;
    gap:20px!important;
    align-items:start!important;
    width:100%!important;
    max-width:none!important;
    overflow:visible!important;
}

.home-category-sidebar,
.home-products-main,
.home-account-card{
    position:relative!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
}

.home-category-sidebar{
    width:100%!important;
}
.home-account-card{
    width:100%!important;
}
.home-products-main{
    width:100%!important;
    overflow:hidden!important;
}

/* Danh mục vẫn rộng hơn R5.5 nhưng không được lấn sang center. */
.home-category-sidebar .cat{
    width:100%!important;
    box-sizing:border-box!important;
}
.home-category-sidebar .cat-name{
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
}

/* Center thu gọn đúng nghĩa. */
.inventory-toolbar,
.inventory-product-list,
.inventory-card{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
}
.inventory-card{
    grid-template-columns:minmax(0,1fr) 205px!important;
}
.inventory-card-main{
    min-width:0!important;
}
.inventory-info{
    min-width:0!important;
}
.inventory-title{
    max-width:100%!important;
}

/* Desktop lớn: tăng sidebar vừa phải, vẫn không chồng. */
@media(min-width:1600px){
    .home-shell{
        grid-template-columns:315px minmax(0,1fr) 315px!important;
        gap:22px!important;
    }
}

/* Desktop phổ biến. */
@media(max-width:1450px){
    .home-shell{
        grid-template-columns:280px minmax(0,1fr) 285px!important;
        gap:18px!important;
    }
    .inventory-card{
        grid-template-columns:minmax(0,1fr) 198px!important;
    }
}

/* Tablet/laptop nhỏ. */
@media(max-width:1180px){
    .home-shell,
    .home-shell.has-account{
        grid-template-columns:220px minmax(0,1fr)!important;
        gap:14px!important;
    }
    .home-account-card{
        display:none!important;
    }
}
@media(max-width:820px){
    .home-shell,
    .home-shell.has-account,
    .home-shell:not(.has-account){
        grid-template-columns:1fr!important;
    }
    .home-category-sidebar,
    .home-products-main{
        width:100%!important;
    }
}


/* ===== R5.8 FORCE CORRECT 3-COLUMN DESKTOP LAYOUT ===== */

/*
 * Nguyên nhân R5.7: rule cũ .home-shell.has-account có specificity cao hơn
 * .home-shell nên trên desktop nó vẫn ép layout thành 2 cột.
 * R5.8 override CẢ .home-shell và .home-shell.has-account, đồng thời khóa vị trí
 * của 3 vùng để Danh mục/Tài khoản luôn ngang hàng với Kho sản phẩm.
 */
@media(min-width:1181px){
    .home-shell,
    .home-shell.has-account{
        display:grid!important;
        grid-template-columns:300px minmax(0,1fr) 300px!important;
        gap:20px!important;
        align-items:start!important;
        width:100%!important;
        max-width:none!important;
        margin:0!important;
    }

    .home-shell .home-category-sidebar{
        grid-column:1!important;
        grid-row:1!important;
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
        align-self:start!important;
        position:sticky!important;
        top:92px!important;
    }

    .home-shell .home-products-main{
        grid-column:2!important;
        grid-row:1!important;
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
        align-self:start!important;
        overflow:hidden!important;
    }

    .home-shell .home-account-card{
        grid-column:3!important;
        grid-row:1!important;
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
        align-self:start!important;
        position:sticky!important;
        top:92px!important;
        display:block!important;
    }

    /* Center thật sự co trong cột số 2, không lấn sang sidebar. */
    .inventory-toolbar,
    .inventory-product-list,
    .inventory-card{
        width:100%!important;
        max-width:100%!important;
        min-width:0!important;
        box-sizing:border-box!important;
    }

    .inventory-card{
        grid-template-columns:minmax(0,1fr) 205px!important;
    }
}

/* Màn desktop rộng: tăng 2 sườn vừa phải nhưng vẫn cân đối. */
@media(min-width:1500px){
    .home-shell,
    .home-shell.has-account{
        grid-template-columns:320px minmax(0,1fr) 320px!important;
        gap:22px!important;
    }
}

/* Laptop desktop nhỏ: vẫn giữ đủ 3 cột đến 1180px. */
@media(min-width:1181px) and (max-width:1380px){
    .home-shell,
    .home-shell.has-account{
        grid-template-columns:270px minmax(0,1fr) 275px!important;
        gap:16px!important;
    }
    .inventory-card{
        grid-template-columns:minmax(0,1fr) 195px!important;
    }
}


/* ===== R6.2 MOBILE RESPONSIVE REDESIGN ===== */
@media(max-width:820px){

    html,body{
        overflow-x:hidden!important;
    }

    body{
        font-size:14px!important;
    }

    .wrap,
    .topnav-clean{
        width:calc(100vw - 24px)!important;
        max-width:none!important;
        margin-left:auto!important;
        margin-right:auto!important;
        padding-left:0!important;
        padding-right:0!important;
    }

    /* ===== MOBILE HEADER ===== */
    .topbar{
        padding:10px 0 12px!important;
    }

    .topnav-clean{
        display:grid!important;
        grid-template-columns:repeat(6,minmax(0,1fr))!important;
        gap:8px!important;
        align-items:center!important;
    }

    .topnav-brand{
        grid-column:1 / span 1!important;
        width:48px!important;
        height:46px!important;
        min-width:48px!important;
        padding:0!important;
        display:flex!important;
        justify-content:center!important;
        align-items:center!important;
        border-radius:13px!important;
    }

    .topnav-brand span{
        display:none!important;
    }

    .topnav-links{
        display:contents!important;
    }

    .topnav-links a{
        width:48px!important;
        height:46px!important;
        min-width:48px!important;
        padding:0!important;
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        border-radius:13px!important;
    }

    .topnav-links a span{
        display:none!important;
    }

    .topnav-prefs{
        display:contents!important;
    }

    .topnav-prefs select{
        width:100%!important;
        min-width:0!important;
        height:46px!important;
        padding:0 10px!important;
        border-radius:13px!important;
        font-size:13px!important;
    }

    .topnav-account{
        grid-column:2 / span 2!important;
        width:100%!important;
        min-width:0!important;
        height:46px!important;
        padding:6px 10px!important;
        border-radius:13px!important;
    }

    .topnav-account-copy small{
        font-size:8px!important;
    }

    .topnav-account-copy b{
        font-size:11px!important;
        line-height:1.25!important;
    }

    .topnav-deposit,
    .topnav-logout{
        width:48px!important;
        min-width:48px!important;
        height:46px!important;
        padding:0!important;
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        border-radius:13px!important;
    }

    .topnav-deposit span{
        display:none!important;
    }

    .topnav-search{
        grid-column:1 / -1!important;
        grid-row:auto!important;
        width:100%!important;
        min-width:0!important;
        max-width:none!important;
        height:48px!important;
        margin-top:2px!important;
        border-radius:13px!important;
    }

    .topnav-search input{
        font-size:13px!important;
    }

    /* ===== NOTICE ===== */
    .alert.ok{
        border-radius:13px!important;
        padding:12px 14px!important;
        font-size:13px!important;
        margin-top:12px!important;
    }

    /* ===== HOME LAYOUT ===== */
    .home-shell,
    .home-shell.has-account,
    .home-shell:not(.has-account){
        display:flex!important;
        flex-direction:column!important;
        width:100%!important;
        gap:14px!important;
        margin-top:14px!important;
    }

    .home-category-sidebar,
    .home-products-main{
        width:100%!important;
        max-width:none!important;
        min-width:0!important;
        position:static!important;
        top:auto!important;
        grid-column:auto!important;
        grid-row:auto!important;
    }

    .home-account-card{
        display:none!important;
    }

    /* ===== CATEGORY MOBILE ===== */
    .home-category-sidebar{
        padding:14px!important;
        border-radius:16px!important;
        overflow:hidden!important;
    }

    .home-category-sidebar>h3{
        font-size:14px!important;
        margin:0 0 11px!important;
    }

    .home-category-sidebar .cat{
        min-height:44px!important;
        width:100%!important;
        margin-bottom:7px!important;
        padding:9px 11px!important;
        border-radius:11px!important;
    }

    .home-category-sidebar .cat-name{
        font-size:13px!important;
        line-height:1.25!important;
        white-space:nowrap!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    .home-category-sidebar .cat-count{
        width:26px!important;
        min-width:26px!important;
        height:26px!important;
        padding:0!important;
    }

    .sidebar-section-title{
        margin:14px 0 8px!important;
        padding-top:12px!important;
        border-top:1px solid var(--theme-border)!important;
    }

    .sidebar-section-title h3{
        font-size:13px!important;
    }

    .best-seller-list{
        display:flex!important;
        gap:8px!important;
        overflow-x:auto!important;
        padding-bottom:4px!important;
        scroll-snap-type:x proximity;
    }

    .best-seller-item{
        flex:0 0 210px!important;
        min-width:210px!important;
        padding:9px!important;
        scroll-snap-align:start;
    }

    /* ===== INVENTORY HEADER ===== */
    .inventory-toolbar{
        width:100%!important;
        min-width:0!important;
        display:block!important;
        padding:14px!important;
        border-radius:16px!important;
        margin:0 0 10px!important;
    }

    .inventory-toolbar h2{
        font-size:20px!important;
        line-height:1.25!important;
        margin:5px 0 3px!important;
    }

    .inventory-toolbar p{
        font-size:11px!important;
    }

    .inventory-toolbar-note{
        display:none!important;
    }

    /* ===== PRODUCT CARD MOBILE ===== */
    .inventory-product-list{
        width:100%!important;
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:10px!important;
    }

    .inventory-card{
        width:100%!important;
        min-width:0!important;
        min-height:0!important;
        display:block!important;
        padding:12px!important;
        border-radius:16px!important;
        overflow:hidden!important;
    }

    .inventory-card-main{
        display:grid!important;
        grid-template-columns:68px minmax(0,1fr)!important;
        gap:11px!important;
        align-items:start!important;
    }

    .inventory-visual{
        width:68px!important;
        height:68px!important;
        border-radius:13px!important;
    }

    .inventory-placeholder{
        width:42px!important;
        height:42px!important;
        border-radius:12px!important;
    }

    .inventory-info{
        min-width:0!important;
        width:100%!important;
    }

    .inventory-meta{
        gap:5px!important;
        margin-bottom:5px!important;
    }

    .inventory-category,
    .inventory-chip{
        font-size:9px!important;
        padding:3px 6px!important;
    }

    .inventory-title{
        width:100%!important;
        max-width:100%!important;
        margin:0 0 5px!important;
        font-size:14px!important;
        line-height:1.35!important;
        white-space:normal!important;
        overflow:visible!important;
        word-break:normal!important;
        overflow-wrap:anywhere!important;
    }

    .inventory-desc{
        width:100%!important;
        max-width:100%!important;
        font-size:10.5px!important;
        line-height:1.4!important;
        white-space:normal!important;
        overflow-wrap:anywhere!important;
    }

    .inventory-footer-mobile{
        display:block!important;
        margin-top:8px!important;
    }

    .inventory-buybox{
        width:100%!important;
        display:grid!important;
        grid-template-columns:minmax(0,1fr) auto!important;
        grid-template-rows:auto auto!important;
        gap:8px!important;
        margin-top:11px!important;
        padding:10px 0 0!important;
        border-left:0!important;
        border-top:1px solid var(--theme-border)!important;
    }

    .inventory-price{
        min-width:0!important;
        display:flex!important;
        align-items:center!important;
        gap:6px!important;
        flex-wrap:wrap!important;
    }

    .inventory-price small{
        display:none!important;
    }

    .inventory-price strong{
        font-size:20px!important;
    }

    .inventory-buybox>.inventory-stock{
        display:none!important;
    }

    .inventory-actions{
        grid-column:1 / -1!important;
        width:100%!important;
        display:grid!important;
        grid-template-columns:1fr 1fr!important;
        gap:8px!important;
    }

    .inventory-actions .btn{
        width:100%!important;
        min-height:40px!important;
        padding:8px!important;
        font-size:11px!important;
        border-radius:10px!important;
    }

    /* ===== GENERAL MOBILE CARDS / FORMS ===== */
    .card{
        border-radius:16px!important;
    }

    textarea,
    .input,
    input,
    select{
        max-width:100%!important;
        box-sizing:border-box!important;
    }

    .live-tool-card{
        padding:14px!important;
    }

    .live-mode-tabs{
        display:grid!important;
        grid-template-columns:1fr 1fr!important;
        gap:8px!important;
    }

    .live-mode-btn{
        width:100%!important;
        min-width:0!important;
        min-height:42px!important;
        padding:8px!important;
        font-size:11px!important;
    }

    .idbm-auth-grid{
        grid-template-columns:1fr!important;
        gap:10px!important;
    }

    .live-action-row{
        align-items:stretch!important;
    }

    .live-action-row .btn{
        width:100%!important;
        min-height:42px!important;
    }

    .live-result-grid{
        grid-template-columns:1fr!important;
        gap:12px!important;
    }

    .result-card{
        padding:12px!important;
    }

    #liveBox,#dieBox,#errorBox,#idbmCookie,#idbmIds,#uids{
        font-size:11px!important;
        min-height:180px!important;
    }

    footer,
    .footer{
        font-size:11px!important;
        padding-left:12px!important;
        padding-right:12px!important;
    }
}

/* Very small phones */
@media(max-width:420px){
    .wrap,
    .topnav-clean{
        width:calc(100vw - 18px)!important;
    }

    .topnav-clean{
        gap:6px!important;
    }

    .topnav-brand,
    .topnav-links a,
    .topnav-deposit,
    .topnav-logout{
        width:44px!important;
        min-width:44px!important;
        height:44px!important;
    }

    .topnav-prefs select{
        height:44px!important;
        font-size:12px!important;
    }

    .topnav-account{
        height:44px!important;
    }

    .inventory-card-main{
        grid-template-columns:60px minmax(0,1fr)!important;
    }

    .inventory-visual{
        width:60px!important;
        height:60px!important;
    }

    .inventory-title{
        font-size:13.5px!important;
    }

    .inventory-actions{
        grid-template-columns:1fr!important;
    }
}


/* ===== R6.4 CRYPTO TOPBAR CHOOSER ===== */
.topnav-crypto-menu{position:relative;display:inline-flex;align-items:center;flex:0 0 auto;z-index:80}
.topnav-crypto-toggle{border:0;cursor:pointer}
.topnav-crypto-dropdown{position:absolute;right:0;top:calc(100% + 10px);width:235px;padding:8px;border:1px solid var(--theme-border);border-radius:14px;background:var(--theme-panel2,#0c1429);box-shadow:0 18px 45px rgba(0,0,0,.32);display:none;z-index:999}
.topnav-crypto-menu.open .topnav-crypto-dropdown{display:grid;gap:5px}
.topnav-crypto-dropdown a{display:grid;grid-template-columns:34px minmax(0,1fr);gap:9px;align-items:center;padding:10px;border-radius:10px;color:var(--theme-text,#f8fafc);text-decoration:none;white-space:normal}
.topnav-crypto-dropdown a:hover{background:rgba(34,197,94,.12)}
.topnav-crypto-dropdown a>i{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:rgba(34,197,94,.12);color:#22c55e}
.topnav-crypto-dropdown a span{display:grid;gap:2px;min-width:0}
.topnav-crypto-dropdown a b{font-size:13px}
.topnav-crypto-dropdown a small{font-size:11px;color:var(--theme-muted,#a9b5ca)}
@media(max-width:700px){
  .topnav-crypto-menu{order:3}
  .topnav-crypto-dropdown{position:fixed;left:12px;right:12px;top:auto;bottom:16px;width:auto;max-width:none}
}


/* ===== R7.7 Top categories + API catalog import ===== */
.home-top-categories{display:flex;gap:8px;align-items:center;overflow-x:auto;padding:4px 0 10px;margin:0 0 8px;scrollbar-width:thin}
.home-top-categories .top-cat{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;min-height:38px;padding:8px 13px;border-radius:9px;background:rgba(15,23,42,.88);border:1px solid rgba(148,163,184,.16);color:var(--txt);font-size:12px;font-weight:800;text-decoration:none;white-space:nowrap}
.home-top-categories .top-cat:hover,.home-top-categories .top-cat.active{background:linear-gradient(135deg,var(--pri),var(--pri2));color:#fff;border-color:transparent}
.home-top-categories .top-cat b{display:inline-grid;place-items:center;min-width:21px;height:21px;padding:0 5px;border-radius:999px;background:rgba(255,255,255,.12);font-size:10px}
.api-import-box{display:grid;grid-template-columns:minmax(260px,1fr) minmax(280px,1fr);gap:16px;padding:16px;border:1px solid rgba(148,163,184,.16);border-radius:14px;background:rgba(255,255,255,.035)}
.api-import-toggle{display:flex;align-items:flex-start;gap:11px;cursor:pointer}.api-import-toggle input{margin-top:4px;transform:scale(1.15)}.api-import-toggle span{display:flex;flex-direction:column;gap:5px}.api-import-toggle small{color:var(--muted);line-height:1.45}
@media(max-width:760px){.api-import-box{grid-template-columns:1fr}.home-top-categories{margin-left:-2px;margin-right:-2px}}


/* ===== R7.8 Sellmup-style category bar ===== */
.home-top-categories{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px!important;overflow:visible!important;padding:0!important;margin:0 0 12px!important}
.home-top-categories .top-cat{min-height:42px!important;justify-content:flex-start!important;border-radius:6px!important;padding:9px 14px!important;background:rgba(26,26,31,.92)!important;border:1px solid rgba(255,255,255,.08)!important;font-size:12px!important;box-shadow:none!important}
.home-top-categories .top-cat.active,.home-top-categories .top-cat:hover{background:linear-gradient(135deg,var(--pri),var(--pri2))!important;border-color:transparent!important}
.home-top-categories .top-cat b{margin-left:auto}
.home-shell.category-top-only{grid-template-columns:minmax(0,1fr) 280px!important}
.home-shell.category-top-only:not(.has-account){grid-template-columns:minmax(0,1fr)!important}
.home-shell.category-top-only .home-products-main{grid-column:1!important}
.home-shell.category-top-only .home-account-card{grid-column:2!important}
@media(max-width:1100px){.home-top-categories{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:760px){.home-top-categories{grid-template-columns:repeat(2,minmax(0,1fr))!important}.home-shell.category-top-only,.home-shell.category-top-only.has-account{grid-template-columns:1fr!important}.home-shell.category-top-only .home-account-card{grid-column:1!important}}
@media(max-width:480px){.home-top-categories{grid-template-columns:1fr!important}}


/* ===== R85 Sellmup light preset + imported category icons ===== */
.theme-preset-sellmup .sellmup-swatch{box-shadow:inset 0 0 0 1px rgba(15,23,42,.08),0 2px 8px rgba(15,23,42,.08)}
body.theme-sellmup-skin .btn,
body.theme-sellmup-skin .inventory-buy,
body.theme-sellmup-skin .topnav-search button,
body.theme-sellmup-skin .home-account-open{border-radius:6px!important}
body.theme-sellmup-skin .btn.primary,
body.theme-sellmup-skin .inventory-buy,
body.theme-sellmup-skin .topnav-search button,
body.theme-sellmup-skin .home-account-open{background:linear-gradient(135deg,var(--pri),var(--pri2))!important;box-shadow:0 5px 12px rgba(79,70,229,.18)!important}
body.theme-sellmup-skin .inventory-card,
body.theme-sellmup-skin .panel,
body.theme-sellmup-skin .card{border-radius:8px!important}
.category-icon-img{width:20px;height:20px;object-fit:contain;display:inline-block;vertical-align:middle;flex:0 0 20px}
.category-icon-text{display:inline-grid;place-items:center;min-width:20px;height:20px;font-size:16px;line-height:1;vertical-align:middle}
.home-top-categories .top-cat .category-icon-img{width:21px;height:21px;flex-basis:21px}
.home-category-sidebar .cat .category-icon-img{width:19px;height:19px;flex-basis:19px}


/* ===== R86: Sellmup light preset contrast fixes ===== */
body.theme-sellmup-skin .inventory-detail{
    background:#eef2f7!important;
    border:1px solid #d8e0ea!important;
    color:#334155!important;
    box-shadow:none!important;
}
body.theme-sellmup-skin .inventory-detail i{color:#64748b!important}
body.theme-sellmup-skin .inventory-detail:hover{
    background:#e2e8f0!important;
    border-color:#cbd5e1!important;
    color:#0f172a!important;
}
body.theme-sellmup-skin .inventory-detail:hover i{color:#334155!important}
\n\n/* ===== R87: Sellmup light badge/stock contrast ===== */
body.theme-sellmup-skin .inventory-chip:not(.hot):not(.api){
    background:#dcfce7!important;
    border-color:#86efac!important;
    color:#166534!important;
}
body.theme-sellmup-skin .inventory-chip.hot{
    background:#fff7ed!important;
    border-color:#fdba74!important;
    color:#9a3412!important;
}
body.theme-sellmup-skin .inventory-chip.api{
    background:#dbeafe!important;
    border-color:#93c5fd!important;
    color:#1e40af!important;
}
body.theme-sellmup-skin .inventory-price .discount-badge{
    background:#dcfce7!important;
    border:1px solid #86efac!important;
    color:#166534!important;
    font-weight:900!important;
}
body.theme-sellmup-skin .inventory-stock{
    background:#dcfce7!important;
    border-color:#86efac!important;
    color:#166534!important;
}
body.theme-sellmup-skin .inventory-stock.mid{
    background:#dbeafe!important;
    border-color:#93c5fd!important;
    color:#1e40af!important;
}
body.theme-sellmup-skin .inventory-stock.low{
    background:#fff7ed!important;
    border-color:#fdba74!important;
    color:#9a3412!important;
}
body.theme-sellmup-skin .inventory-stock.out{
    background:#fee2e2!important;
    border-color:#fca5a5!important;
    color:#991b1b!important;
}

/* R88 - Sellmup light theme: admin form/readability + stronger stock badges */
body.theme-sellmup-skin .inventory-chip:not(.hot):not(.api){color:#087a36!important;font-weight:900!important;border-color:#4ade80!important;background:#dcfce7!important}

/* Admin uses many dark inputs inherited from the old dark theme. Force readable text. */
body.theme-sellmup-skin input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
body.theme-sellmup-skin textarea,
body.theme-sellmup-skin select{
  color:#f8fafc!important;
  -webkit-text-fill-color:#f8fafc!important;
  caret-color:#f8fafc!important;
}
body.theme-sellmup-skin input::placeholder,
body.theme-sellmup-skin textarea::placeholder{color:#94a3b8!important;opacity:1!important;-webkit-text-fill-color:#94a3b8!important}
body.theme-sellmup-skin select option{background:#0f172a!important;color:#f8fafc!important}

/* Read-only/code-like dark boxes and order item contents. */
body.theme-sellmup-skin pre,
body.theme-sellmup-skin code,
body.theme-sellmup-skin .code,
body.theme-sellmup-skin .mono,
body.theme-sellmup-skin td pre,
body.theme-sellmup-skin td code{
  color:#e2e8f0!important;
}


/* ===== R89: Sellmup preset - Admin full light mode =====
   When the Sellmup preset is active, every admin content surface is white
   with dark readable text. Purple/semantic action buttons keep their colors. */
body.admin-page.theme-sellmup-skin{
  background:#f4f6f9!important;
  color:#111827!important;
  --theme-text:#111827!important;
  --theme-muted:#475569!important;
  --theme-soft:#64748b!important;
  --theme-panel:#ffffff!important;
  --theme-panel2:#ffffff!important;
  --theme-border:#d7dee8!important;
  --theme-shadow:rgba(15,23,42,.10)!important;
  --txt:#111827!important;
  --muted:#475569!important;
  --line:#d7dee8!important;
}
body.admin-page.theme-sellmup-skin .wrap,
body.admin-page.theme-sellmup-skin main,
body.admin-page.theme-sellmup-skin .container{
  color:#111827!important;
}

/* Cards / panels / settings blocks / tool boxes */
body.admin-page.theme-sellmup-skin .card,
body.admin-page.theme-sellmup-skin .panel,
body.admin-page.theme-sellmup-skin .adminCard,
body.admin-page.theme-sellmup-skin .settings-section,
body.admin-page.theme-sellmup-skin .cleanup-section,
body.admin-page.theme-sellmup-skin .cleanup-card,
body.admin-page.theme-sellmup-skin .cleanup-box,
body.admin-page.theme-sellmup-skin .retention-card,
body.admin-page.theme-sellmup-skin .api-import-box,
body.admin-page.theme-sellmup-skin form:not(.inline-form){
  background:#ffffff!important;
  color:#111827!important;
  border-color:#d7dee8!important;
  box-shadow:0 8px 24px rgba(15,23,42,.08)!important;
}

/* Normal text inside admin should always be dark. */
body.admin-page.theme-sellmup-skin h1,
body.admin-page.theme-sellmup-skin h2,
body.admin-page.theme-sellmup-skin h3,
body.admin-page.theme-sellmup-skin h4,
body.admin-page.theme-sellmup-skin h5,
body.admin-page.theme-sellmup-skin h6,
body.admin-page.theme-sellmup-skin p,
body.admin-page.theme-sellmup-skin label,
body.admin-page.theme-sellmup-skin td,
body.admin-page.theme-sellmup-skin th,
body.admin-page.theme-sellmup-skin strong,
body.admin-page.theme-sellmup-skin b,
body.admin-page.theme-sellmup-skin .small,
body.admin-page.theme-sellmup-skin .muted,
body.admin-page.theme-sellmup-skin small{
  color:#111827!important;
}
body.admin-page.theme-sellmup-skin .muted,
body.admin-page.theme-sellmup-skin small,
body.admin-page.theme-sellmup-skin .settings-section-head p,
body.admin-page.theme-sellmup-skin .cleanup-head p,
body.admin-page.theme-sellmup-skin .retention-notice span{
  color:#475569!important;
}

/* All data-entry controls: white background, black text. */
body.admin-page.theme-sellmup-skin input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="submit"]):not([type="button"]),
body.admin-page.theme-sellmup-skin textarea,
body.admin-page.theme-sellmup-skin select,
body.admin-page.theme-sellmup-skin .input,
body.admin-page.theme-sellmup-skin .cleanup-readonly{
  background:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  caret-color:#111827!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}
body.admin-page.theme-sellmup-skin input::placeholder,
body.admin-page.theme-sellmup-skin textarea::placeholder{
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  opacity:1!important;
}
body.admin-page.theme-sellmup-skin select option{
  background:#ffffff!important;
  color:#111827!important;
}
body.admin-page.theme-sellmup-skin input:focus,
body.admin-page.theme-sellmup-skin textarea:focus,
body.admin-page.theme-sellmup-skin select:focus{
  border-color:#7c3aed!important;
  box-shadow:0 0 0 3px rgba(124,58,237,.12)!important;
}

/* File controls should not inherit unreadable dark-theme colors. */
body.admin-page.theme-sellmup-skin input[type="file"]{
  background:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
}
body.admin-page.theme-sellmup-skin input[type="file"]::file-selector-button{
  color:#111827!important;
  background:#f1f5f9!important;
  border:1px solid #cbd5e1!important;
}

/* Tables and order rows. */
body.admin-page.theme-sellmup-skin .table,
body.admin-page.theme-sellmup-skin table{
  color:#111827!important;
}
body.admin-page.theme-sellmup-skin .table th,
body.admin-page.theme-sellmup-skin table th{
  color:#475569!important;
}
body.admin-page.theme-sellmup-skin .table td,
body.admin-page.theme-sellmup-skin table td{
  background:#ffffff!important;
  color:#111827!important;
  border-color:#e2e8f0!important;
}
body.admin-page.theme-sellmup-skin .table tbody tr:nth-child(even) td,
body.admin-page.theme-sellmup-skin table tbody tr:nth-child(even) td{
  background:#f8fafc!important;
}

/* Code/order-content boxes are also light in Sellmup admin mode. */
body.admin-page.theme-sellmup-skin pre,
body.admin-page.theme-sellmup-skin code,
body.admin-page.theme-sellmup-skin .code,
body.admin-page.theme-sellmup-skin .mono,
body.admin-page.theme-sellmup-skin .itemBox,
body.admin-page.theme-sellmup-skin td pre,
body.admin-page.theme-sellmup-skin td code,
body.admin-page.theme-sellmup-skin .cron-field code{
  background:#f8fafc!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}

/* Notices: keep semantic tint, but always dark readable copy. */
body.admin-page.theme-sellmup-skin .alert,
body.admin-page.theme-sellmup-skin .retention-notice,
body.admin-page.theme-sellmup-skin .cleanup-safe-note,
body.admin-page.theme-sellmup-skin .cleanup-danger-note{
  color:#111827!important;
}

/* Preserve action/navigation buttons as colored controls with white labels. */
body.admin-page.theme-sellmup-skin .admin-menu a,
body.admin-page.theme-sellmup-skin .btn.primary,
body.admin-page.theme-sellmup-skin .btn.danger,
body.admin-page.theme-sellmup-skin button.btn.primary,
body.admin-page.theme-sellmup-skin a.btn.primary{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
body.admin-page.theme-sellmup-skin .btn:not(.primary):not(.danger):not(.ok){
  background:#eef2f7!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
}
body.admin-page.theme-sellmup-skin .btn.ok{
  color:#052e16!important;
  -webkit-text-fill-color:#052e16!important;
}

/* ===== R90: Sellmup admin - stronger status/readability ===== */
body.admin-page.theme-sellmup-skin .status,
body.admin-page.theme-sellmup-skin .status-visible,
body.admin-page.theme-sellmup-skin .text-success,
body.admin-page.theme-sellmup-skin .success,
body.admin-page.theme-sellmup-skin td .green,
body.admin-page.theme-sellmup-skin td[style*="color"]{
  font-weight:800!important;
}
body.admin-page.theme-sellmup-skin .text-success,
body.admin-page.theme-sellmup-skin .success,
body.admin-page.theme-sellmup-skin .green{
  color:#087a36!important;
}

/* R94 - Admin shortcut visible only to admin accounts */
.topnav-admin{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 13px;border-radius:10px;background:linear-gradient(135deg,var(--pri),var(--pri2));color:#fff!important;text-decoration:none!important;font-weight:800;white-space:nowrap;box-shadow:0 5px 14px rgba(79,70,229,.18)}
.topnav-admin:hover{filter:brightness(1.06);transform:translateY(-1px)}
@media(max-width:900px){.topnav-admin span{display:none}.topnav-admin{padding:0 11px}}

/* ===== R95: Sellmup light - Live Check + Login contrast ===== */
/* Live-check tabs: inactive stays light/readable, active stays purple/white. */
body.theme-sellmup-skin .live-mode-tabs .live-mode-btn:not(.primary){
  background:#eef2f7!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-weight:800!important;
  box-shadow:none!important;
}
body.theme-sellmup-skin .live-mode-tabs .live-mode-btn:not(.primary) i{color:#334155!important}
body.theme-sellmup-skin .live-mode-tabs .live-mode-btn.primary,
body.theme-sellmup-skin .live-mode-tabs .live-mode-btn.active{
  background:linear-gradient(135deg,var(--pri),var(--pri2))!important;
  border-color:transparent!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-weight:800!important;
}
body.theme-sellmup-skin .live-mode-tabs .live-mode-btn.primary i,
body.theme-sellmup-skin .live-mode-tabs .live-mode-btn.active i{color:#fff!important}

/* Result cards and boxes: white surfaces + dark text in Sellmup light preset. */
body.theme-sellmup-skin .result-card,
body.theme-sellmup-skin #errorWrap{
  background:#fff!important;
  color:#111827!important;
}
body.theme-sellmup-skin #liveBox,
body.theme-sellmup-skin #dieBox,
body.theme-sellmup-skin #errorBox{
  background:#fff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
  caret-color:#111827!important;
}
body.theme-sellmup-skin #liveBox::placeholder,
body.theme-sellmup-skin #dieBox::placeholder,
body.theme-sellmup-skin #errorBox::placeholder{
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  opacity:1!important;
}

/* Copy LIVE / DIE / Error buttons. */
body.theme-sellmup-skin .result-head .btn{
  background:#eef2f7!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-weight:850!important;
  box-shadow:none!important;
}
body.theme-sellmup-skin .result-head .btn:hover{
  background:#e2e8f0!important;
  border-color:#94a3b8!important;
  color:#020617!important;
  -webkit-text-fill-color:#020617!important;
}

/* IDBM credentials/input/result area follows the light preset instead of old navy inputs. */
body.theme-sellmup-skin #idbmCookie,
body.theme-sellmup-skin #idbmIds,
body.theme-sellmup-skin #idbmToken,
body.theme-sellmup-skin #uids{
  background:#fff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
  caret-color:#111827!important;
}
body.theme-sellmup-skin #idbmCookie::placeholder,
body.theme-sellmup-skin #idbmIds::placeholder,
body.theme-sellmup-skin #idbmToken::placeholder,
body.theme-sellmup-skin #uids::placeholder{
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  opacity:1!important;
}
body.theme-sellmup-skin .secret-toggle{
  background:#eef2f7!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-weight:800!important;
}
body.theme-sellmup-skin .idbm-security-note{color:#475569!important;background:#f0fdf4!important;border-color:#bbf7d0!important}

/* Login/register actions: never allow white-on-white in Sellmup light mode. */
body.theme-sellmup-skin form.form.card .btn.primary,
body.theme-sellmup-skin form.form.card button.btn.primary{
  background:linear-gradient(135deg,var(--pri),var(--pri2))!important;
  border-color:transparent!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-weight:850!important;
  box-shadow:0 5px 12px rgba(79,70,229,.18)!important;
}
body.theme-sellmup-skin form.form.card a.btn:not(.primary){
  background:#eef2f7!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  font-weight:800!important;
}

/* ===== R96: Sellmup light - public auth forms are white with dark text ===== */
body.theme-sellmup-skin form.form.card input.input:not([type="checkbox"]):not([type="radio"]),
body.theme-sellmup-skin form.form.card textarea.input,
body.theme-sellmup-skin form.form.card select.input{
  background:#ffffff!important;
  background-color:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  caret-color:#111827!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}
body.theme-sellmup-skin form.form.card input.input::placeholder,
body.theme-sellmup-skin form.form.card textarea.input::placeholder{
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  opacity:1!important;
}
body.theme-sellmup-skin form.form.card input.input:focus,
body.theme-sellmup-skin form.form.card textarea.input:focus,
body.theme-sellmup-skin form.form.card select.input:focus{
  background:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border-color:#6366f1!important;
  box-shadow:0 0 0 3px rgba(99,102,241,.12)!important;
  outline:none!important;
}
/* Chrome password manager/autofill otherwise paints a pale field but keeps inherited white text. */
body.theme-sellmup-skin form.form.card input.input:-webkit-autofill,
body.theme-sellmup-skin form.form.card input.input:-webkit-autofill:hover,
body.theme-sellmup-skin form.form.card input.input:-webkit-autofill:focus,
body.theme-sellmup-skin form.form.card input.input:-webkit-autofill:active{
  -webkit-box-shadow:0 0 0 1000px #ffffff inset!important;
  box-shadow:0 0 0 1000px #ffffff inset!important;
  -webkit-text-fill-color:#111827!important;
  caret-color:#111827!important;
  color:#111827!important;
  transition:background-color 99999s ease-out 0s!important;
}

/* ===== R97: Sellmup light - Account page full light/readable mode ===== */
body.theme-sellmup-skin .account-page{
  color:#111827!important;
}
body.theme-sellmup-skin .account-hero-clean{
  background:linear-gradient(135deg,#f5f3ff,#eef6ff)!important;
  border:1px solid #dbe3ef!important;
  color:#111827!important;
}
body.theme-sellmup-skin .account-hero-user small{
  color:#4338ca!important;
  font-weight:900!important;
}
body.theme-sellmup-skin .account-hero-user h2{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  font-weight:900!important;
}
body.theme-sellmup-skin .account-hero-user p{
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
  font-weight:600!important;
}
body.theme-sellmup-skin .account-home-link{
  background:#eef2ff!important;
  color:#312e81!important;
  -webkit-text-fill-color:#312e81!important;
  border-color:#c7d2fe!important;
}

/* Account summary cards: white + dark copy. */
body.theme-sellmup-skin .account-stat-card,
body.theme-sellmup-skin .account-stat-card.discount{
  background:#ffffff!important;
  border:1px solid #dbe3ef!important;
  box-shadow:0 8px 22px rgba(15,23,42,.06)!important;
}
body.theme-sellmup-skin .account-stat-card span{
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
  font-weight:800!important;
}
body.theme-sellmup-skin .account-stat-card strong{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  font-weight:900!important;
}
body.theme-sellmup-skin .account-stat-card.discount strong{
  color:#087a36!important;
  -webkit-text-fill-color:#087a36!important;
}

/* Password / 2FA panels. */
body.theme-sellmup-skin .account-section{
  background:#ffffff!important;
  border:1px solid #dbe3ef!important;
  color:#111827!important;
  box-shadow:0 8px 22px rgba(15,23,42,.05)!important;
}
body.theme-sellmup-skin .account-section h3{
  color:#312e81!important;
  -webkit-text-fill-color:#312e81!important;
  font-weight:900!important;
}
body.theme-sellmup-skin .account-section-icon{
  color:#5b21b6!important;
  background:#ede9fe!important;
}
body.theme-sellmup-skin .account-section label{
  color:#334155!important;
  -webkit-text-fill-color:#334155!important;
  font-weight:850!important;
}
body.theme-sellmup-skin .account-section .input,
body.theme-sellmup-skin .account-section input.input,
body.theme-sellmup-skin .account-section textarea.input,
body.theme-sellmup-skin .account-section select.input{
  background:#ffffff!important;
  background-color:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  caret-color:#111827!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}
body.theme-sellmup-skin .account-section .input::placeholder,
body.theme-sellmup-skin .account-section input.input::placeholder,
body.theme-sellmup-skin .account-section textarea.input::placeholder{
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
  opacity:1!important;
}
body.theme-sellmup-skin .account-section .input:focus,
body.theme-sellmup-skin .account-section input.input:focus,
body.theme-sellmup-skin .account-section textarea.input:focus,
body.theme-sellmup-skin .account-section select.input:focus{
  background:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border-color:#6366f1!important;
  box-shadow:0 0 0 3px rgba(99,102,241,.12)!important;
  outline:none!important;
}
body.theme-sellmup-skin .account-section input.input:-webkit-autofill,
body.theme-sellmup-skin .account-section input.input:-webkit-autofill:hover,
body.theme-sellmup-skin .account-section input.input:-webkit-autofill:focus,
body.theme-sellmup-skin .account-section input.input:-webkit-autofill:active{
  -webkit-box-shadow:0 0 0 1000px #ffffff inset!important;
  box-shadow:0 0 0 1000px #ffffff inset!important;
  -webkit-text-fill-color:#111827!important;
  caret-color:#111827!important;
  color:#111827!important;
}
body.theme-sellmup-skin .account-section p,
body.theme-sellmup-skin .account-section .muted{
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
}
body.theme-sellmup-skin .account-section .itemBox{
  background:#f8fafc!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
}

/* Balance history title/table: stronger hierarchy, no pale text. */
body.theme-sellmup-skin .account-history-head h3{
  color:#312e81!important;
  -webkit-text-fill-color:#312e81!important;
  font-weight:900!important;
  font-size:17px!important;
}
body.theme-sellmup-skin .account-history-head i{
  color:#4f46e5!important;
}
body.theme-sellmup-skin .account-table-wrap{
  background:#ffffff!important;
  border:1px solid #e2e8f0!important;
  border-radius:14px!important;
  box-shadow:0 6px 18px rgba(15,23,42,.04)!important;
}
body.theme-sellmup-skin .account-table-wrap .table,
body.theme-sellmup-skin .account-table-wrap .table tbody,
body.theme-sellmup-skin .account-table-wrap .table tr{
  background:#ffffff!important;
  color:#111827!important;
}
body.theme-sellmup-skin .account-table-wrap .table th{
  background:#eef2ff!important;
  color:#3730a3!important;
  -webkit-text-fill-color:#3730a3!important;
  font-weight:900!important;
  border-bottom:1px solid #c7d2fe!important;
  padding:11px 12px!important;
}
body.theme-sellmup-skin .account-table-wrap .table td{
  background:#ffffff!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border-bottom:1px solid #eef2f7!important;
}
body.theme-sellmup-skin .account-table-wrap .table tr:nth-child(even) td{
  background:#f8fafc!important;
}
body.theme-sellmup-skin .account-table-wrap .table .muted{
  color:#64748b!important;
  -webkit-text-fill-color:#64748b!important;
}

/* Auth/captcha consistency in Sellmup light mode. */
body.theme-sellmup-skin form.form.card label,
body.theme-sellmup-skin form.form.card label b{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  font-weight:800!important;
}


/* R98 - History page readability for Sellmup light skin. */
body.theme-sellmup-skin .history-page > h2{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  font-weight:900!important;
}
body.theme-sellmup-skin .history-page .history-balance-summary{
  color:#334155!important;
  -webkit-text-fill-color:#334155!important;
  font-weight:700!important;
}
body.theme-sellmup-skin .history-page .history-balance-summary b{
  color:#312e81!important;
  -webkit-text-fill-color:#312e81!important;
  font-weight:900!important;
}
body.theme-sellmup-skin .history-page .table{
  color:#111827!important;
}
body.theme-sellmup-skin .history-page .table th{
  color:#3730a3!important;
  -webkit-text-fill-color:#3730a3!important;
  font-weight:900!important;
  font-size:13px!important;
  background:#eef2ff!important;
  border-bottom:1px solid #c7d2fe!important;
  padding:11px 12px!important;
}
body.theme-sellmup-skin .history-page .table td{
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  background:#ffffff!important;
  border-color:#e2e8f0!important;
}
body.theme-sellmup-skin .history-page .table tr:nth-child(even) td{
  background:#f8fafc!important;
}
body.theme-sellmup-skin .history-page .table td .muted,
body.theme-sellmup-skin .history-page .table .muted{
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
}
body.theme-sellmup-skin .history-page .retention-notice{
  color:#1e293b!important;
  -webkit-text-fill-color:#1e293b!important;
}


/* ===== R102: Sellmup light deposit tabs - all payment methods clearly visible ===== */
body.theme-sellmup-skin .deposit-tabs{
  display:flex!important;
  gap:10px!important;
  flex-wrap:wrap!important;
  margin:0 0 16px!important;
}
body.theme-sellmup-skin .deposit-tabs .btn{
  background:linear-gradient(135deg,#6d5dfc,#5b21d6)!important;
  border:1px solid #5b21d6!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  font-weight:850!important;
  box-shadow:0 5px 12px rgba(91,33,214,.18)!important;
  opacity:1!important;
}
body.theme-sellmup-skin .deposit-tabs .btn i{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
body.theme-sellmup-skin .deposit-tabs .btn:hover{
  filter:brightness(1.06)!important;
  transform:translateY(-1px)!important;
}
body.theme-sellmup-skin .deposit-tabs .btn.primary{
  background:linear-gradient(135deg,#4f46e5,#7c3aed)!important;
  border-color:#4f46e5!important;
  box-shadow:0 7px 16px rgba(79,70,229,.28)!important;
}


/* ===== R103: nền SÁNG - nút trần .btn trên các trang shop =====
   .btn gốc (style.css) là navy #1c2547 nên trên nền sáng nút View/Download ở
   history.php hiện ra đen sì. Trang admin đã có bản vá riêng
   (body.admin-page.theme-sellmup-skin .btn:not(...)); trang shop thì chưa.
   Đây là bản tương ứng, dùng đúng hệ màu của bản admin cho khỏi lệch nhau.
   'theme-light' do theme_contrast_vars() quyết định theo ĐỘ CHÓI của màu nền
   (header.php), KHÔNG khớp cứng mã màu - nên ăn với mọi màu nền sáng, không
   riêng preset sellmup. (Preset đó khớp cứng cả ba mã màu, chỉ cần anh đổi nhẹ
   một mã là nút lại đen sì.)
   Cố ý loại trừ nút đã có hệ màu riêng: .btn-copy (xanh) và .buy-max-btn
   (gradient tím, khai báo trong buy.php). .buy-cancel-btn và .inventory-detail
   tự thắng nhờ !important nên không cần kể tên. */
body.theme-light .btn:not(.primary):not(.danger):not(.ok):not(.btn-copy):not(.buy-max-btn){
  background:#eef2f7!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}
body.theme-light .btn:not(.primary):not(.danger):not(.ok):not(.btn-copy):not(.buy-max-btn):hover{
  background:#e2e8f0!important;
  border-color:#94a3b8!important;
  color:#020617!important;
  -webkit-text-fill-color:#020617!important;
}

/* Hộp nội dung đơn (history.php bấm View) và mọi khối code/mono: style.css để
   nền #081021 chữ sáng, chỉ hợp nền tối - trên nền sáng thành cái hộp navy chói.
   Admin đã có bản vá tương ứng ở R89 (body.admin-page.theme-sellmup-skin .itemBox,
   pre, code...); trang shop thì chưa có gì. Dùng đúng hệ màu của bản admin. */
body.theme-light .itemBox,
body.theme-light pre,
body.theme-light code,
body.theme-light td pre,
body.theme-light td code{
  background:#f8fafc!important;
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
  border:1px solid #cbd5e1!important;
  box-shadow:none!important;
}
