@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&display=swap');


/* Trade V4 */
.modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.82);z-index:1000;align-items:center;justify-content:center;padding:15px}
.modal-content{width:min(470px,100%);background:#222;border:1px solid #555;border-radius:14px;padding:22px;position:relative}
.modal-close{position:absolute;left:12px;top:10px;background:#555;color:#fff;font-size:22px;padding:4px 11px}
.modal-content label{display:block;margin:12px 0 5px}
.help{display:block;color:#bbb;line-height:1.7;margin-top:5px}
.trade-summary{background:#191919;border:1px solid #444;border-radius:9px;padding:12px;margin:15px 0;display:grid;grid-template-columns:1fr 1fr;gap:9px}
.trade-summary strong{text-align:left;color:#f0c14e}
.trades-section{margin-top:26px}
.trade-history-card{display:grid;grid-template-columns:1.4fr .8fr 1fr 1fr .8fr .7fr;gap:10px;align-items:center;background:#222;border:1px solid #3d3d3d;border-radius:9px;padding:12px;margin:8px 0}
.trade-history-card>div:first-child{display:flex;flex-direction:column;gap:5px}
.trade-history-card span{color:#bbb;font-size:.88rem}
.status{font-weight:bold}
.status-pending{color:#f0c14e}.status-approved{color:#45c46f}.status-rejected{color:#ee5060}
.countdown{font-weight:bold;color:#f0c14e}
.admin-trades-table{background:#222;border:1px solid #3d3d3d;border-radius:9px;overflow:hidden}
.admin-trade-row{display:grid;grid-template-columns:1.2fr .8fr 1fr .9fr 1fr 1fr .9fr;gap:8px;padding:12px;border-bottom:1px solid #3d3d3d;align-items:center}
.admin-trade-row:last-child{border-bottom:0}
.admin-trade-head{background:#292929;font-weight:bold}
@media(max-width:900px){
.trade-history-card,.admin-trade-row{grid-template-columns:1fr 1fr}
.admin-trade-head{display:none}
}

.trades-admin-list{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.trade-admin-card{background:#222;border:1px solid #3d3d3d;border-radius:10px;padding:14px;display:grid;grid-template-columns:1fr 1fr;gap:9px}
.trade-state{grid-column:1/-1;font-weight:bold;padding:8px;border-radius:7px;text-align:center}
.state-pending{background:#4a3b14;color:#f0c14e}
.state-approved{background:#164b2a;color:#d9ffe4}
.state-rejected{background:#5b1f24;color:#ffd9dc}
.trade-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.trade-actions form{margin:0}
.trade-actions button{width:100%;padding:11px}
.approve-btn{background:#28a745;color:#fff}
.reject-btn{background:#dc3545;color:#fff}
.reason{grid-column:1/-1;color:#ffb7bf}
@media(max-width:850px){.trades-admin-list{grid-template-columns:1fr}}

.customer-tabs{display:flex;align-items:center;gap:8px;margin:0 20px}
.customer-tab-btn{background:#333;color:#ddd;border:1px solid #555;padding:9px 16px}
.customer-tab-btn.active{background:#f0c14e;color:#111;border-color:#f0c14e}
.customer-tab-panel{display:none}
.customer-tab-panel.active{display:block}

.trade-buttons-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.trade-buttons-row .trade-btn{margin:0;min-width:0}
.market-card .trade-btn strong{font-size:1.42rem;word-break:break-word}

.trade-date-group{background:#1c1c1c;border:1px solid #3d3d3d;border-radius:10px;margin:10px 0;overflow:hidden}
.trade-date-group summary{cursor:pointer;padding:14px;display:flex;justify-content:space-between;align-items:center;background:#262626;color:#f0c14e}
.trade-date-list{padding:10px}
.trade-history-card{grid-template-columns:1.2fr .8fr 1fr 1fr .7fr .8fr .7fr}
.trade-history-card>div:not(:first-child){display:flex;flex-direction:column;gap:5px}
.trade-history-card>div>span{color:#aaa;font-size:.78rem}

@media(max-width:850px){
  .topbar{flex-wrap:wrap}
  .customer-tabs{order:3;width:100%;margin:8px 0 0}
  .customer-tab-btn{flex:1}
  .trade-history-card{grid-template-columns:1fr 1fr}
}
@media(max-width:520px){
  .trade-buttons-row{grid-template-columns:1fr 1fr}
  .market-card .trade-btn{padding:10px 5px}
  .market-card .trade-btn strong{font-size:1.12rem}
}

#admin-trade-popup-stack{
    position:fixed;
    left:18px;
    right:18px;
    bottom:18px;
    z-index:5000;
    display:flex;
    flex-direction:row;
    flex-wrap:wrap-reverse;
    align-items:flex-end;
    align-content:flex-end;
    justify-content:flex-start;
    gap:10px;
    max-height:calc(100vh - 36px);
    overflow-y:auto;
    pointer-events:none;
}
.admin-trade-popup{
    width:360px;
    flex:0 0 360px;pointer-events:auto;background:#202020;border:1px solid #555;border-right:4px solid #f0c14e;border-radius:12px;box-shadow:0 12px 35px rgba(0,0,0,.45);padding:13px;transition:.3s ease}
.admin-trade-popup.busy{opacity:.65;pointer-events:none}
.admin-trade-popup.popup-approved,.admin-trade-popup.popup-rejected,.admin-trade-popup.popup-timeout{opacity:0;transform:translateX(-30px)}
.admin-trade-popup.popup-expiring{border-color:#dc3545}
.popup-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;color:#f0c14e}
.popup-countdown{font-weight:bold}
.popup-details{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.popup-details>div{background:#171717;border:1px solid #3d3d3d;border-radius:8px;padding:8px;display:flex;flex-direction:column;gap:4px}
.popup-details span{font-size:.76rem;color:#aaa}
.popup-details strong{font-size:.93rem}
.popup-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.popup-actions button{width:100%;padding:10px;color:#fff}
.popup-approve{background:#28a745}.popup-reject{background:#dc3545}
.popup-error{color:#ff9ca6;font-size:.8rem;margin-top:7px;min-height:1em}

@media(max-width:760px){
    #admin-trade-popup-stack{
        left:10px;
        right:10px;
        bottom:10px;
        gap:8px;
    }

    .admin-trade-popup{
        width:calc(50vw - 16px);
        flex-basis:calc(50vw - 16px);
    }
}

@media(max-width:520px){
    .admin-trade-popup{
        width:100%;
        flex-basis:100%;
    }
}

.table-wrap{overflow-x:auto;background:#202020;border:1px solid #3d3d3d;border-radius:10px}
.admin-data-table{width:100%;border-collapse:collapse;min-width:1200px}
.admin-data-table th,.admin-data-table td{padding:11px 9px;border-bottom:1px solid #3d3d3d;text-align:center;white-space:nowrap}
.admin-data-table th{background:#292929;color:#f0c14e;position:sticky;top:0}
.admin-data-table tbody tr:hover{background:#272727}
.table-status{display:inline-block;padding:6px 9px;border-radius:7px;font-weight:bold}
.table-status.status-approved{background:#164b2a;color:#d9ffe4}
.table-status.status-rejected{background:#5b1f24;color:#ffd9dc}
.mini-btn{padding:7px 10px;font-size:.82rem}

.customer-search-form{display:grid;grid-template-columns:1fr auto auto;gap:8px;margin:18px 0}
.customer-search-form button{background:#f0c14e;color:#111}
.clear-search{display:flex;align-items:center;padding:0 12px;background:#444;border-radius:7px}
.customers-list{display:flex;flex-direction:column;gap:10px}
.customer-row-card{display:grid;grid-template-columns:52px 260px 1fr;gap:12px;align-items:start;background:#222;border:1px solid #3d3d3d;border-radius:10px;padding:12px}
.customer-row-number{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#f0c14e;color:#111;font-weight:bold}
.customer-main-info{display:flex;flex-direction:column;gap:6px}
.customer-main-info span{color:#bbb}
.customer-row-card details summary{cursor:pointer;color:#f0c14e}
.customer-edit-form{margin-top:12px}
.announcement-editor textarea{width:100%;padding:14px;border-radius:8px;border:1px solid #666;font-family:Tahoma;font-size:1rem;resize:vertical}
.announcement-actions{display:flex;gap:8px;margin-top:10px}
.customer-announcement{background:#332800;border:1px solid #f0c14e;border-radius:10px;padding:12px;margin-bottom:15px;display:flex;flex-direction:column;gap:7px}
.customer-announcement strong{color:#f0c14e}

@media(max-width:850px){
  .customer-row-card{grid-template-columns:45px 1fr}
  .customer-row-card details{grid-column:1/-1}
  .customer-search-form{grid-template-columns:1fr auto}
  .clear-search{grid-column:1/-1;justify-content:center;padding:8px}
}

.page-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}
.page-title-row h2{margin:0}
.excel-export-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#217346;
    color:#fff;
    padding:10px 15px;
    border-radius:8px;
    font-weight:bold;
}
.excel-export-btn:hover{background:#185c37}

.admin-register-trade{
    max-width:720px;
    margin:0 auto;
}
.admin-register-trade form{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
}
.admin-register-trade input,
.admin-register-trade select{
    width:100%;
    box-sizing:border-box;
}
.admin-register-trade small{
    color:#aaa;
    margin-bottom:8px;
}

.customer-announcement{
    white-space:pre-wrap;
    background:#332800;
    border:1px solid #f0c14e;
    color:#fff;
    border-radius:10px;
    padding:13px;
    margin-bottom:15px;
    line-height:1.9;
}
.customer-announcement[hidden]{display:none}

#customer-status-notification-stack{
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:6000;
    display:flex;
    flex-direction:column;
    gap:9px;
    width:min(360px,calc(100vw - 36px));
    pointer-events:none;
}
.customer-status-notification{
    pointer-events:auto;
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:14px;
    border-radius:11px;
    color:#fff;
    box-shadow:0 12px 30px rgba(0,0,0,.4);
    opacity:0;
    transform:translateX(30px);
    transition:.3s ease;
}
.customer-status-notification.show{
    opacity:1;
    transform:translateX(0);
}
.notification-approved{
    background:#176234;
    border:1px solid #35ad62;
}
.notification-rejected{
    background:#762633;
    border:1px solid #d65363;
}

@media(max-width:650px){
    .page-title-row{
        align-items:stretch;
        flex-direction:column;
    }
    .excel-export-btn{width:100%;box-sizing:border-box}
}

/* خوانایی قیمت‌ها در مدیریت کالا */
.products-grid .product-card{
    min-width:0;
    padding:10px;
}
.products-grid .product-card input.money-input{
    min-width:0;
    width:100%;
    box-sizing:border-box;
    direction:ltr;
    text-align:center;
    font-family:Tahoma,Arial,sans-serif;
    font-size:13px;
    font-weight:700;
    letter-spacing:-.35px;
    padding-left:3px;
    padding-right:3px;
}
.products-grid .raw-price-control{
    grid-template-columns:30px minmax(0,1fr) 30px !important;
    gap:4px !important;
}
.products-grid .price-arrow{
    width:30px;
    height:38px;
    min-width:30px;
    padding:0;
    font-size:14px;
}
.products-grid .calculated-prices{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:5px;
}
.products-grid .calculated-prices>div{
    min-width:0;
    padding:7px 3px;
}
.products-grid .calculated-prices strong{
    display:block;
    direction:ltr;
    text-align:center;
    white-space:nowrap;
    font-family:Tahoma,Arial,sans-serif;
    font-size:clamp(11px,.86vw,15px);
    letter-spacing:-.55px;
    line-height:1.45;
}
.products-grid .derived-box strong{
    display:block;
    direction:ltr;
    white-space:nowrap;
    font-size:clamp(12px,.9vw,16px);
    letter-spacing:-.45px;
}

/* پنجره زنده تعیین وضعیت معامله مشتری */
.trade-waiting-state{
    border-radius:12px;
    padding:18px;
    text-align:center;
    border:2px solid #d8a929;
    background:#332900;
    transition:background .3s,border-color .3s;
}
.trade-waiting-state[hidden]{display:none}
.trade-result-icon{
    width:58px;
    height:58px;
    margin:0 auto 10px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:34px;
    font-weight:bold;
    background:rgba(255,255,255,.12);
}
.trade-waiting-state h3{margin:6px 0}
.trade-waiting-state p{line-height:1.8}
.trade-live-details{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:14px 0;
}
.trade-live-details>div{
    min-width:0;
    background:rgba(0,0,0,.24);
    border:1px solid rgba(255,255,255,.16);
    border-radius:8px;
    padding:8px;
    display:flex;
    flex-direction:column;
    gap:5px;
}
.trade-live-details>div:first-child{
    grid-column:1/-1;
}
.trade-live-details span{
    font-size:.78rem;
    color:#ddd;
}
.trade-live-details strong{
    direction:ltr;
    overflow-wrap:anywhere;
}
.customer-trade-countdown{
    font-size:28px;
    font-weight:900;
    margin:14px 0;
    font-variant-numeric:tabular-nums;
}
.trade-state-approved{
    background:#123d24;
    border-color:#38b66d;
}
.trade-state-rejected{
    background:#541b24;
    border-color:#e14a5d;
}
.trade-state-expired{
    background:#5a3600;
    border-color:#f0a226;
}
.trade-state-pending{
    background:#332900;
    border-color:#d8a929;
}
.trade-btn.trade-disabled,
.trade-btn:disabled{
    opacity:.48;
    cursor:not-allowed;
    filter:grayscale(.35);
}

@media(max-width:600px){
    .trade-live-details{grid-template-columns:1fr}
    .trade-live-details>div:first-child{grid-column:auto}
}

/* نسخه 16 — خوانایی کامل قیمت‌ها در مدیریت کالا */

/* عرض صفحه مدیریت کالاها بیشتر شود تا شش کارت بدون فشردگی جا بگیرند */
body:has(.products-grid) .page{
    width:calc(100% - 32px);
    max-width:1540px;
    box-sizing:border-box;
}

/* کارت‌ها حداقل عرض منطقی داشته باشند؛ در عرض کم اسکرول افقی ایجاد شود */
.products-grid{
    grid-template-columns:repeat(6,minmax(190px,1fr)) !important;
    gap:9px !important;
    overflow-x:auto;
    align-items:start;
    padding-bottom:8px;
}

.products-grid .product-card{
    min-width:190px !important;
    width:auto;
    box-sizing:border-box;
    overflow:hidden;
}

/* قیمت خام: فضای اصلی به عدد اختصاص داده شود */
.products-grid .raw-price-control{
    display:grid !important;
    grid-template-columns:26px minmax(112px,1fr) 26px !important;
    gap:4px !important;
    align-items:center;
    direction:ltr;
}

.products-grid .raw-price-control input.money-input{
    min-width:112px !important;
    width:100% !important;
    height:38px;
    padding:5px 2px !important;
    font-family:Arial,Tahoma,sans-serif !important;
    font-size:13px !important;
    font-weight:700 !important;
    letter-spacing:-.25px !important;
    text-align:center !important;
    direction:ltr !important;
    overflow:visible;
}

.products-grid .raw-price-control .price-arrow{
    width:26px !important;
    min-width:26px !important;
    height:38px !important;
    padding:0 !important;
}

/* خرید و فروش در مدیریت کالاها زیر هم باشند تا عدد کامل دیده شود */
.products-grid .calculated-prices{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:5px !important;
    width:100%;
}

.products-grid .calculated-prices > div{
    width:100%;
    min-width:0;
    box-sizing:border-box;
    padding:7px 6px !important;
}

.products-grid .calculated-prices strong{
    display:block;
    width:100%;
    box-sizing:border-box;
    white-space:nowrap !important;
    overflow:visible !important;
    text-align:center !important;
    direction:ltr !important;
    font-family:Arial,Tahoma,sans-serif !important;
    font-size:14px !important;
    font-weight:800 !important;
    letter-spacing:-.3px !important;
    line-height:1.35 !important;
}

/* قیمت محاسبه‌شده مظنه کارتخوان */
.products-grid .derived-box{
    width:100%;
    box-sizing:border-box;
}

.products-grid .derived-box strong{
    display:block;
    width:100%;
    white-space:nowrap !important;
    text-align:center;
    direction:ltr;
    font-family:Arial,Tahoma,sans-serif !important;
    font-size:15px !important;
    font-weight:800;
    letter-spacing:-.25px;
}

/* جلوگیری از بیرون‌زدگی کلمه تومان */
.products-grid .calculated-prices small,
.products-grid .derived-box small{
    display:block;
    margin-top:2px;
    text-align:center;
    white-space:nowrap;
}

/* پنل مشتری — فاصله کمتر بین کالاها */
#market-grid.market-grid{
    column-gap:8px !important;
    row-gap:8px !important;
    gap:8px !important;
    align-items:start;
}

#market-grid .market-card{
    margin:0 !important;
    padding:10px !important;
    min-height:0 !important;
}

#market-grid .market-card h3{
    margin:0 0 8px !important;
}

#market-grid .trade-buttons-row{
    gap:6px !important;
}

#market-grid .trade-btn{
    padding:9px 5px !important;
}

/* در نمایشگرهای محدود، شش ستون فشرده نشوند */
@media(max-width:1250px){
    .products-grid{
        grid-template-columns:repeat(4,minmax(190px,1fr)) !important;
    }
}

@media(max-width:900px){
    .products-grid{
        grid-template-columns:repeat(2,minmax(190px,1fr)) !important;
    }
}

@media(max-width:520px){
    .products-grid{
        grid-template-columns:minmax(190px,1fr) !important;
    }

    #market-grid.market-grid{
        gap:6px !important;
    }
}

/* نسخه 17 — مدیریت چند مدیر و سطوح دسترسی */
.topbar small{
    display:block;
    color:#aaa;
    margin-top:3px;
    font-size:.78rem;
}

.admin-create-form,
.admin-edit-form{
    display:grid;
    gap:9px;
}

.admin-permission-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin:8px 0;
}

.admin-permission-grid label{
    display:flex;
    align-items:center;
    gap:7px;
    background:#191919;
    border:1px solid #444;
    border-radius:8px;
    padding:10px;
}

.admin-users-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:15px;
}

.admin-user-card{
    background:#222;
    border:1px solid #444;
    border-radius:11px;
    padding:13px;
}

.super-admin-card{
    border-color:#f0c14e;
}

.admin-user-heading{
    display:grid;
    grid-template-columns:44px 1fr auto;
    align-items:center;
    gap:10px;
    margin-bottom:10px;
}

.admin-user-heading>div:nth-child(2){
    display:flex;
    flex-direction:column;
    gap:4px;
}

.admin-user-heading span{
    color:#aaa;
}

.admin-row-number{
    width:40px;
    height:40px;
    display:flex;
    justify-content:center;
    align-items:center;
    border-radius:50%;
    background:#f0c14e;
    color:#111;
    font-weight:bold;
}

.admin-user-status{
    padding:6px 9px;
    border-radius:7px;
    font-weight:bold;
}

.admin-user-status.active{
    background:#164b2a;
    color:#d9ffe4;
}

.admin-user-status.inactive{
    background:#5b1f24;
    color:#ffd9dc;
}

.super-admin-note{
    background:#332800;
    border:1px solid #f0c14e;
    color:#f0c14e;
    padding:12px;
    border-radius:8px;
    text-align:center;
}

.admin-active-switch{
    display:flex;
    align-items:center;
    gap:7px;
}

.admin-card-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.delete-admin-btn{
    width:100%;
    margin-top:10px;
    background:#7d1f2b;
    color:#fff;
}

.admin-meta{
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    gap:7px;
    margin-top:10px;
    color:#999;
    font-size:.78rem;
}

.admin-log-filter{
    display:grid;
    grid-template-columns:260px 1fr auto auto;
    gap:8px;
    margin-bottom:14px;
}

.admin-log-table{
    min-width:1050px;
}

.log-description{
    white-space:normal !important;
    min-width:300px;
    text-align:right !important;
}

.no-access-panel{
    max-width:700px;
    margin:50px auto;
    text-align:center;
}

@media(max-width:950px){
    .admin-users-list{
        grid-template-columns:1fr;
    }

    .admin-permission-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .admin-log-filter{
        grid-template-columns:1fr 1fr;
    }
}

@media(max-width:560px){
    .admin-permission-grid{
        grid-template-columns:1fr;
    }

    .admin-log-filter{
        grid-template-columns:1fr;
    }
}

/* نسخه 18 */
.price-chart-controls{
    display:grid;
    grid-template-columns:auto minmax(220px,1fr) auto minmax(170px,260px);
    gap:10px;
    align-items:center;
}
.chart-panel{
    overflow-x:auto;
}
#candlestick-chart{
    display:block;
    max-width:none;
    background:#151515;
    border-radius:9px;
}
.chart-help{
    margin:0;
    color:#bbb;
    line-height:1.9;
}

.api-token-once{
    border-color:#f0c14e;
}
.api-token-once code{
    display:block;
    direction:ltr;
    text-align:left;
    background:#111;
    padding:13px;
    border-radius:8px;
    overflow-wrap:anywhere;
    margin:9px 0;
    color:#f0c14e;
}
.api-create-form{
    display:grid;
    grid-template-columns:1fr auto;
    gap:8px;
}
.api-doc-box pre{
    direction:ltr;
    text-align:left;
    background:#111;
    padding:12px;
    border-radius:8px;
    overflow:auto;
}
.api-clients-table{
    min-width:950px;
}

.report-table{
    min-width:1450px;
}
.report-mark-checkbox{
    width:21px;
    height:21px;
    cursor:pointer;
}
.report-row-marked{
    background:#3e3514 !important;
}
.report-row-marked td:first-child{
    box-shadow:inset 4px 0 #f0c14e;
}

@media(max-width:800px){
    .price-chart-controls{
        grid-template-columns:1fr;
    }
    .api-create-form{
        grid-template-columns:1fr;
    }
}

/* نسخه 20 */
.table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
}

.trades-table{
    min-width:1540px !important;
    width:max-content !important;
    table-layout:auto;
}

.trades-table th,
.trades-table td{
    white-space:nowrap;
}

.trades-table th:last-child,
.trades-table td:last-child{
    min-width:150px;
    width:150px;
    position:sticky;
    left:0;
    z-index:3;
    background:#222;
    box-shadow:5px 0 10px rgba(0,0,0,.45);
}

.trades-table thead th:last-child{
    background:#292929;
    z-index:5;
}

.trades-table .mark-column{
    min-width:60px;
    width:60px;
    text-align:center;
}

.trades-table .report-mark-checkbox{
    width:21px;
    height:21px;
    cursor:pointer;
}

.trades-table .report-row-marked{
    background:#3e3514 !important;
}

.trades-table .mini-btn{
    min-width:115px;
    white-space:nowrap;
}

.trade-btn[hidden]{
    display:none !important;
}

/* نسخه 22 */
.customer-trades-list{display:grid;gap:7px;padding:8px 0}
.customer-trade-row{
    display:grid;
    grid-template-columns:110px 1.2fr 1fr 1fr;
    gap:8px;
    align-items:center;
    background:#222;
    border:1px solid #3d3d3d;
    border-radius:9px;
    padding:9px;
}
.customer-trade-row>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.customer-trade-row span{color:#aaa;font-size:.8rem}
.trade-status-badge{display:inline-block;width:max-content;border-radius:6px;padding:4px 8px;font-weight:bold}
.trade-status-badge.approved{background:#176236;color:#e4ffec}
.trade-status-badge.rejected{background:#7d2530;color:#ffe7ea}
.trade-status-badge.expired{background:#825109;color:#fff0d0}
.trade-status-badge.pending{background:#665100;color:#fff4b8}
.trade-status-approved{border-right:4px solid #2ebd65}
.trade-status-rejected{border-right:4px solid #e3485b}
.trade-status-expired{border-right:4px solid #f1a52b}
.trade-status-pending{border-right:4px solid #d7b52c}
@media(max-width:800px){.customer-trade-row{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.customer-trade-row{grid-template-columns:1fr}}

/* نسخه 24 — نمایش هر کالا در یک ردیف در موبایل */
#market-grid.market-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:7px !important;
}

#market-grid .market-card{
    padding:0 !important;
    margin:0 !important;
    min-height:0 !important;
    overflow:hidden;
    border-radius:10px;
}

#market-grid .market-row{
    display:grid;
    grid-template-columns:minmax(110px,1fr) minmax(110px,1fr) minmax(125px,1.15fr);
    grid-template-areas:"sell buy title";
    gap:4px;
    direction:ltr;
    align-items:stretch;
}

#market-grid .sell-slot{
    grid-area:sell;
}

#market-grid .buy-slot{
    grid-area:buy;
}

#market-grid .market-product-title{
    grid-area:title;
    direction:rtl;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    min-width:0;
    padding:7px 9px;
    background:#242424;
    color:#fff;
    font-size:13px;
    font-weight:800;
    line-height:1.35;
    text-align:right;
    overflow-wrap:anywhere;
}

#market-grid .market-price-slot{
    min-width:0;
    display:flex;
}

#market-grid .trade-btn,
#market-grid .trade-btn-placeholder{
    width:100%;
    min-height:58px;
    margin:0 !important;
    box-sizing:border-box;
    border-radius:5px;
}

#market-grid .trade-btn{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:1px;
    padding:4px 3px !important;
    color:#fff;
}

#market-grid .buy-slot .trade-btn{
    background:#25aa49;
}

#market-grid .sell-slot .trade-btn{
    background:#df3349;
}

#market-grid .trade-side-label{
    display:block;
    font-size:9px;
    line-height:1.1;
    font-weight:600;
    white-space:nowrap;
    opacity:.95;
}

#market-grid .live-price{
    display:block;
    direction:ltr;
    font-family:Arial,Tahoma,sans-serif;
    font-size:14px;
    line-height:1.2;
    font-weight:800;
    white-space:nowrap;
}

#market-grid .derived-price{
    display:block;
    direction:ltr;
    font-family:Arial,Tahoma,sans-serif;
    font-size:9px;
    line-height:1.1;
    font-weight:600;
    white-space:nowrap;
    opacity:.92;
}

#market-grid .trade-btn-placeholder{
    background:#171717;
    border:1px dashed #343434;
}

/* ستون قرمز، ستون سبز و نام کالا حتی در حالت بسته بودن ثابت می‌مانند */
#market-grid .sell-slot,
#market-grid .buy-slot,
#market-grid .market-product-title{
    align-self:stretch;
}

@media(max-width:1050px){
    #market-grid.market-grid{
        grid-template-columns:1fr !important;
    }
}

@media(max-width:560px){
    .page{
        width:calc(100% - 12px) !important;
        padding-left:0 !important;
        padding-right:0 !important;
    }

    #market-grid.market-grid{
        gap:5px !important;
    }

    #market-grid .market-row{
        grid-template-columns:minmax(92px,1fr) minmax(92px,1fr) minmax(105px,1.08fr);
        gap:3px;
    }

    #market-grid .market-card{
        border-radius:8px;
    }

    #market-grid .market-product-title{
        padding:5px 6px;
        font-size:11px;
    }

    #market-grid .trade-btn,
    #market-grid .trade-btn-placeholder{
        min-height:52px;
    }

    #market-grid .trade-side-label{
        font-size:8px;
    }

    #market-grid .live-price{
        font-size:12px;
    }

    #market-grid .derived-price{
        font-size:8px;
    }
}

@media(max-width:380px){
    #market-grid .market-row{
        grid-template-columns:minmax(82px,1fr) minmax(82px,1fr) minmax(90px,1.02fr);
    }

    #market-grid .market-product-title{
        font-size:10px;
    }

    #market-grid .live-price{
        font-size:11px;
    }
}

/* نسخه 25 — تایپوگرافی فارسی و ارقام فارسی */
:root{
    --eshmesh-font:
        "Vazirmatn",
        "IRANSansX",
        "IRANSans",
        "Segoe UI",
        Tahoma,
        -apple-system,
        BlinkMacSystemFont,
        Arial,
        sans-serif;

    --eshmesh-number-font:
        "Vazirmatn",
        "IRANSansX",
        "Segoe UI",
        Tahoma,
        -apple-system,
        BlinkMacSystemFont,
        Arial,
        sans-serif;
}

html,
body,
button,
input,
select,
textarea,
table,
th,
td{
    font-family:var(--eshmesh-font) !important;
}

body{
    text-rendering:optimizeLegibility;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    font-feature-settings:"kern" 1, "liga" 1;
}

h1,
h2,
h3,
h4,
strong,
.topbar strong,
.market-product-title{
    font-family:var(--eshmesh-font) !important;
    font-weight:800;
    letter-spacing:-0.015em;
}

p,
span,
small,
label,
a,
button,
input,
select,
textarea{
    line-height:1.65;
}

.live-price,
.derived-price,
.trade-status-badge,
.admin-data-table td,
.admin-data-table th,
.customer-trade-row strong,
.customer-trade-row span{
    font-family:var(--eshmesh-number-font) !important;
    font-variant-numeric:tabular-nums;
    font-feature-settings:"tnum" 1, "kern" 1;
}

#market-grid .trade-side-label{
    font-family:var(--eshmesh-font) !important;
    font-weight:700;
    letter-spacing:0;
}

#market-grid .live-price{
    font-size:14px;
    font-weight:900;
    letter-spacing:-0.02em;
}

#market-grid .derived-price{
    font-size:9px;
    font-weight:700;
    letter-spacing:-0.01em;
}

@media(max-width:560px){
    #market-grid .market-product-title{
        font-size:11px;
        font-weight:800;
    }

    #market-grid .trade-side-label{
        font-size:8px;
        font-weight:700;
    }

    #market-grid .live-price{
        font-size:12px;
    }

    #market-grid .derived-price{
        font-size:8px;
    }
}

/* نسخه 26 — عنوان ثابت ستون‌ها و اعداد بزرگ‌تر */
.market-columns-header{
    display:grid;
    grid-template-columns:minmax(110px,1fr) minmax(110px,1fr) minmax(125px,1.15fr);
    grid-template-areas:"sell buy product";
    gap:4px;
    direction:ltr;
    margin:0 0 5px;
    padding:0;
}

.market-header-sell,
.market-header-buy,
.market-header-product{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:4px 6px;
    border-radius:6px;
    font-family:var(--eshmesh-font) !important;
    font-size:12px;
    font-weight:800;
    line-height:1.2;
    color:#fff;
    text-align:center;
}

.market-header-sell{
    grid-area:sell;
    background:#8f2332;
}

.market-header-buy{
    grid-area:buy;
    background:#176f31;
}

.market-header-product{
    grid-area:product;
    background:#2b2b2b;
}

/* برچسب داخل باکس دیگر نمایش داده نمی‌شود */
#market-grid .trade-side-label{
    display:none !important;
}

#market-grid .trade-btn{
    min-height:62px !important;
    padding:4px 2px !important;
    gap:2px !important;
}

#market-grid .live-price{
    flex:0 0 auto;
    width:100%;
    display:flex !important;
    align-items:center;
    justify-content:center;
    font-size:19px !important;
    line-height:1.05 !important;
    font-weight:900 !important;
    letter-spacing:-0.03em;
    white-space:nowrap;
}

#market-grid .derived-price{
    font-size:10px !important;
    line-height:1.05 !important;
    font-weight:700 !important;
}

@media(max-width:560px){
    .market-columns-header{
        grid-template-columns:minmax(92px,1fr) minmax(92px,1fr) minmax(105px,1.08fr);
        gap:3px;
        margin-bottom:4px;
    }

    .market-header-sell,
    .market-header-buy,
    .market-header-product{
        min-height:26px;
        padding:3px 4px;
        font-size:10px;
        border-radius:5px;
    }

    #market-grid .trade-btn{
        min-height:56px !important;
    }

    #market-grid .live-price{
        font-size:16px !important;
    }

    #market-grid .derived-price{
        font-size:9px !important;
    }
}

@media(max-width:380px){
    .market-columns-header{
        grid-template-columns:minmax(82px,1fr) minmax(82px,1fr) minmax(90px,1.02fr);
    }

    .market-header-sell,
    .market-header-buy,
    .market-header-product{
        font-size:9px;
    }

    #market-grid .live-price{
        font-size:14px !important;
    }
}

/* نسخه 27 — جدول گزارش عریض و ستون‌های کامل */
.report-table{
    min-width:1750px !important;
    width:max-content !important;
    table-layout:auto !important;
}

.report-table th,
.report-table td{
    white-space:nowrap;
    vertical-align:middle;
}

.report-table .report-total-column{
    min-width:165px;
    width:165px;
    font-weight:800;
}

.report-table .report-status-column{
    min-width:120px;
    width:120px;
    font-weight:800;
    text-align:center;
}

/* مبلغ کل و وضعیت در سمت چپ جدول ثابت بمانند */
.report-table th.report-status-column,
.report-table td.report-status-column{
    position:sticky;
    left:0;
    z-index:3;
    background:#222;
    box-shadow:5px 0 10px rgba(0,0,0,.40);
}

.report-table th.report-total-column,
.report-table td.report-total-column{
    position:sticky;
    left:120px;
    z-index:2;
    background:#222;
}

.report-table thead th.report-status-column,
.report-table thead th.report-total-column{
    background:#292929;
    z-index:5;
}

.report-table tr.report-row-marked td.report-status-column,
.report-table tr.report-row-marked td.report-total-column{
    background:#3e3514;
}

/* اسکرول افقی واضح‌تر و قابل استفاده‌تر */
.table-wrap{
    overflow-x:auto !important;
    overflow-y:visible;
    max-width:100%;
    scrollbar-width:auto;
    scrollbar-color:#777 #222;
}

.table-wrap::-webkit-scrollbar{
    height:14px;
}

.table-wrap::-webkit-scrollbar-track{
    background:#222;
    border-radius:8px;
}

.table-wrap::-webkit-scrollbar-thumb{
    background:#666;
    border-radius:8px;
    border:3px solid #222;
}

.table-wrap::-webkit-scrollbar-thumb:hover{
    background:#888;
}

/* نسخه 28 — اصلاح جدول معاملات */
.trades-table{
    min-width:1800px !important;
    width:max-content !important;
    table-layout:auto !important;
}
.trades-table th,.trades-table td{
    white-space:nowrap;
    vertical-align:middle;
}
.trades-table .trade-total-column{
    min-width:170px;
    width:170px;
    font-weight:800;
}
.trades-table .trade-status-column{
    min-width:125px;
    width:125px;
    text-align:center;
    font-weight:800;
}
.trades-table th:last-child,
.trades-table td:last-child{
    position:sticky;
    left:0 !important;
    min-width:150px !important;
    width:150px !important;
    z-index:5 !important;
    background:#222;
}
.trades-table th.trade-status-column,
.trades-table td.trade-status-column{
    position:sticky;
    left:150px;
    z-index:4;
    background:#222;
}
.trades-table th.trade-total-column,
.trades-table td.trade-total-column{
    position:sticky;
    left:275px;
    z-index:3;
    background:#222;
}
.trades-table thead th:last-child,
.trades-table thead th.trade-status-column,
.trades-table thead th.trade-total-column{
    background:#292929;
    z-index:7;
}
.trades-table tr.report-row-marked td:last-child,
.trades-table tr.report-row-marked td.trade-status-column,
.trades-table tr.report-row-marked td.trade-total-column{
    background:#3e3514;
}
.trades-table .table-status{
    min-width:95px;
    box-sizing:border-box;
}
.trades-table td:last-child .mini-btn{
    width:128px;
    min-width:128px;
}
.table-wrap{
    overflow-x:auto !important;
    overflow-y:visible !important;
    max-width:100%;
}
.table-wrap::-webkit-scrollbar{height:15px}
.table-wrap::-webkit-scrollbar-track{background:#1c1c1c;border-radius:8px}
.table-wrap::-webkit-scrollbar-thumb{background:#696969;border:3px solid #1c1c1c;border-radius:8px}
.table-wrap::-webkit-scrollbar-thumb:hover{background:#898989}

/* نسخه 29 — ستون‌های مقدار، قیمت واحد و قیمت کل */
.trades-table{
    min-width:1900px !important;
    width:max-content !important;
    table-layout:auto !important;
}

.trades-table .trade-quantity-column{
    min-width:125px;
    width:125px;
    text-align:center;
}

.trades-table .trade-unit-price-column{
    min-width:165px;
    width:165px;
    text-align:center;
    font-weight:800;
}

.trades-table .trade-total-column{
    min-width:180px;
    width:180px;
    text-align:center;
    font-weight:900;
}

/* ستون‌های ثابت سمت چپ */
.trades-table th.trade-unit-price-column,
.trades-table td.trade-unit-price-column{
    position:sticky;
    left:455px;
    z-index:2;
    background:#222;
}

.trades-table th.trade-total-column,
.trades-table td.trade-total-column{
    position:sticky;
    left:275px;
    z-index:3;
    background:#222;
}

.trades-table thead th.trade-unit-price-column,
.trades-table thead th.trade-total-column{
    background:#292929;
    z-index:7;
}

.trades-table tr.report-row-marked td.trade-unit-price-column,
.trades-table tr.report-row-marked td.trade-total-column{
    background:#3e3514;
}

/* نسخه 30 — جدول معاملات فشرده و بدون اسکرول افقی */
body:has(.trades-table) .page{
    width:calc(100% - 20px) !important;
    max-width:none !important;
    margin-left:auto !important;
    margin-right:auto !important;
    padding-left:0 !important;
    padding-right:0 !important;
    box-sizing:border-box;
}

body:has(.trades-table) .table-wrap{
    overflow-x:visible !important;
    max-width:none !important;
}

.trades-table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
    font-size:12px;
}

.trades-table th,
.trades-table td{
    padding:7px 5px !important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    text-align:center;
}

/* عرض ستون‌ها */
.trades-table .mark-column{
    width:3.5%;
    min-width:0 !important;
}

.trades-table th:nth-child(2),
.trades-table td:nth-child(2){
    width:3.5%;
}

.trades-table .compact-id-column{
    width:6%;
}

.trades-table .compact-date-column{
    width:10%;
}

.trades-table .compact-customer-column{
    width:12%;
    text-align:right;
}

.trades-table .compact-type-column{
    width:6%;
}

.trades-table .compact-product-column{
    width:10%;
    text-align:right;
}

.trades-table .trade-quantity-column{
    width:8%;
    min-width:0 !important;
}

.trades-table .trade-unit-price-column{
    width:12%;
    min-width:0 !important;
}

.trades-table .trade-total-column{
    width:13%;
    min-width:0 !important;
}

.trades-table .trade-status-column{
    width:7%;
    min-width:0 !important;
}

.trades-table .compact-action-column{
    width:9%;
}

/* حذف stickyهای نسخه‌های قبل */
.trades-table th,
.trades-table td{
    position:static !important;
    left:auto !important;
    box-shadow:none !important;
}

.trade-type-badge,
.table-status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:52px !important;
    padding:5px 7px !important;
    border-radius:6px;
    font-size:11px;
    font-weight:800;
}

.trade-type-badge.type-buy{
    background:#176236;
    color:#eafff0;
}

.trade-type-badge.type-sell{
    background:#7d2530;
    color:#ffe9ec;
}

.trades-table .compact-action-column .mini-btn{
    width:auto !important;
    min-width:58px !important;
    padding:6px 9px !important;
    font-size:11px !important;
    white-space:nowrap;
}

.trades-table .trade-unit-price-column,
.trades-table .trade-total-column{
    font-size:11px;
    letter-spacing:-0.02em;
}

.trades-table .compact-date-column{
    font-size:11px;
}

@media(max-width:1450px){
    .trades-table{
        font-size:11px;
    }

    .trades-table th,
    .trades-table td{
        padding:6px 3px !important;
    }

    .trades-table .trade-unit-price-column,
    .trades-table .trade-total-column,
    .trades-table .compact-date-column{
        font-size:10px;
    }
}

@media(max-width:1100px){
    body:has(.trades-table) .table-wrap{
        overflow-x:auto !important;
    }

    .trades-table{
        min-width:1050px !important;
    }
}

/* نسخه 31 — همگام‌سازی زنده وضعیت درخواست مشتری */
#customer-trades-history,
.trade-history-card,
.customer-trade-row,
.trade-status-badge,
.status{
    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease,
        opacity .18s ease;
}

/* نسخه 33 — ترتیب فلش‌های قیمت خام */
.products-grid .raw-price-control{
    direction:ltr !important;
}

/*
 * ترتیب بصری:
 * سمت چپ: کاهش
 * وسط: قیمت خام
 * سمت راست: افزایش
 */
.products-grid .raw-price-control .price-arrow[data-direction="down"],
.products-grid .raw-price-control .price-arrow[data-action="decrease"],
.products-grid .raw-price-control .price-arrow.decrease{
    order:1;
}

.products-grid .raw-price-control input.money-input{
    order:2;
}

.products-grid .raw-price-control .price-arrow[data-direction="up"],
.products-grid .raw-price-control .price-arrow[data-action="increase"],
.products-grid .raw-price-control .price-arrow.increase{
    order:3;
}

/* تطبیق با کلاس‌های واقعی دکمه‌های قیمت */
.products-grid .raw-price-control .price-down{
    order:1 !important;
}

.products-grid .raw-price-control .raw-price-input{
    order:2 !important;
}

.products-grid .raw-price-control .price-up{
    order:3 !important;
}

/* نسخه 34 — بازخورد بصری تغییر زنده وضعیت */
.trade-history-card.trade-row-live-updated{
    outline:2px solid rgba(240,193,78,.75);
    outline-offset:1px;
    transition:
        outline-color .25s ease,
        background-color .25s ease;
}

/* نسخه 35 — سفارش شرطی و واترمارک لوگو */
body:has(.customer-tabs)::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    background:
        linear-gradient(rgba(15,15,15,.93),rgba(15,15,15,.93)),
        url("/assets/images/eshmesh-panel-watermark.jpg") center 56% / min(72vw,900px) auto no-repeat;
}

body:has(.customer-tabs){
    background:#101010 !important;
}

.customer-tabs{
    flex-wrap:wrap;
}

.limit-order-create-card{
    max-width:760px;
    margin:0 auto 22px;
    padding:18px;
    border:1px solid #4b4127;
    border-radius:12px;
    background:rgba(31,31,31,.94);
}

.limit-order-create-card h3{
    margin-top:0;
}

.limit-order-help{
    color:#c8c8c8;
    font-size:13px;
    line-height:1.9;
}

.limit-order-form{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px 14px;
}

.limit-order-form label{
    align-self:end;
}

.limit-order-form input,
.limit-order-form select{
    width:100%;
    box-sizing:border-box;
}

.limit-order-form .wide{
    grid-column:1 / -1;
}

.limit-orders-list-title{
    margin-top:24px;
}

.limit-orders-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.limit-order-card{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
    padding:12px;
    border:1px solid #3d3d3d;
    border-right-width:4px;
    border-radius:10px;
    background:rgba(33,33,33,.95);
}

.limit-order-card>div{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
}

.limit-order-card span{
    color:#aaa;
    font-size:11px;
}

.limit-order-card strong{
    overflow-wrap:anywhere;
}

.limit-order-cancel-form{
    grid-column:1 / -1;
}

.limit-order-status-active{border-right-color:#d3a936}
.limit-order-status-triggered{border-right-color:#e28c2b}
.limit-order-status-approved{border-right-color:#28a85a}
.limit-order-status-rejected{border-right-color:#d83e50}
.limit-order-status-cancelled{border-right-color:#777}
.limit-order-status-expired{border-right-color:#9a6b31}

.limit-order-status-label{
    font-weight:900;
}

.limit-orders-admin-table{
    width:100%;
    min-width:1250px;
}

@media(max-width:850px){
    .limit-order-form{
        grid-template-columns:1fr;
    }

    .limit-order-form .wide{
        grid-column:auto;
    }

    .limit-orders-list{
        grid-template-columns:1fr;
    }

    .limit-order-card{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    body:has(.customer-tabs)::before{
        background:
            linear-gradient(rgba(15,15,15,.94),rgba(15,15,15,.94)),
            url("/assets/images/eshmesh-panel-watermark.jpg") center 52% / 115vw auto no-repeat;
    }
}

@media(max-width:480px){
    .limit-order-card{
        grid-template-columns:1fr 1fr;
        font-size:12px;
    }

    .limit-order-create-card{
        padding:12px;
    }
}

/* نسخه 36 — لاگ روزانه و شرح کامل تغییرات */
.admin-log-days{
    display:grid;
    gap:12px;
}

.admin-log-day{
    border:1px solid #3d3d3d;
    border-radius:10px;
    background:#1d1d1d;
    overflow:hidden;
}

.admin-log-day>summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 16px;
    cursor:pointer;
    background:#262626;
    color:#f1c34f;
    font-weight:900;
}

.admin-log-day>summary strong{
    color:#ddd;
    font-size:12px;
}

.admin-log-table{
    width:100%;
    table-layout:auto;
}

.admin-log-table th:nth-child(1),
.admin-log-table td:nth-child(1){
    width:55px;
}

.admin-log-table th:nth-child(2),
.admin-log-table td:nth-child(2){
    width:95px;
}

.admin-log-table th:nth-child(3),
.admin-log-table td:nth-child(3){
    width:130px;
}

.admin-log-table th:nth-child(4),
.admin-log-table td:nth-child(4){
    width:170px;
}

.admin-log-table .log-description{
    min-width:420px;
    white-space:normal;
    line-height:1.9;
    text-align:right;
}

.admin-log-table th:last-child,
.admin-log-table td:last-child{
    width:120px;
}

/* نسخه 37 — فونت خواناتر و ممیز نمایشی */
:root{
    --eshmesh-font:
        "Tahoma",
        "Segoe UI",
        "Noto Sans Arabic",
        "Arial",
        sans-serif;

    --eshmesh-number-font:
        "Tahoma",
        "Segoe UI",
        "Noto Sans Arabic",
        "Arial",
        sans-serif;
}

html,
body,
button,
input,
select,
textarea,
table,
th,
td,
.live-price,
.derived-price,
.trade-status-badge,
.admin-data-table td,
.admin-data-table th{
    font-family:var(--eshmesh-font) !important;
}

.live-price,
.derived-price,
.trade-quantity-column,
.trade-unit-price-column,
.trade-total-column{
    font-variant-numeric:tabular-nums;
    font-feature-settings:"tnum" 1;
    letter-spacing:0 !important;
}

.customer-chart-controls{
    display:flex;
    gap:10px;
    margin-bottom:12px;
}

.customer-chart-controls select{
    min-width:180px;
}

.customer-price-chart-card{
    position:relative;
    min-height:380px;
    padding:14px;
    border:1px solid #3d3d3d;
    border-radius:12px;
    background:rgba(30,30,30,.95);
}

#customer-price-chart{
    display:block;
    max-width:none;
    touch-action:none;
}
.customer-price-chart-card{overflow-x:auto;overflow-y:hidden}
.customer-technical-toolbar{flex-wrap:wrap;align-items:flex-end}
.customer-technical-toolbar>label{display:flex;flex-direction:column;gap:6px}
.customer-indicator-group,.customer-drawing-group{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.customer-indicator-group label{display:flex;flex-direction:row;align-items:center;gap:6px;padding:8px 10px;border:1px solid rgba(255,255,255,.10);border-radius:8px;background:rgba(255,255,255,.04);white-space:nowrap}
.customer-indicator-group input{width:auto}
.customer-drawing-group button{padding:8px 12px;border-radius:8px;border:1px solid #555;background:#232830;color:#eee;cursor:pointer}
.customer-drawing-group button.active{border-color:#d6a936;color:#f3ca62}
.customer-chart-tooltip{position:absolute;z-index:4;pointer-events:none;background:rgba(8,10,14,.94);border:1px solid #c69a35;border-radius:8px;padding:8px 10px;color:#fff;font-size:12px;line-height:1.8;white-space:nowrap}
.customer-chart-help{margin-top:10px;line-height:1.9}
html[data-theme="light"] .customer-indicator-group label{background:rgba(0,0,0,.035);border-color:rgba(0,0,0,.12)}
html[data-theme="light"] .customer-drawing-group button{background:#fff;color:#222;border-color:#bbb}
html[data-theme="light"] .customer-drawing-group button.active{border-color:#b48719;color:#8d6500}

@media(max-width:650px){
    .customer-chart-controls{
        flex-direction:column;
        align-items:stretch;
    }

    .customer-chart-controls select{
        width:100%;
    }
    .customer-indicator-group,.customer-drawing-group{width:100%}
    .customer-drawing-group button{flex:1;min-width:110px}
}

/* نسخه 38 — فونت واقعی جدید و خوانایی رقم ۴ */
:root{
    --eshmesh-font:
        "Vazirmatn",
        "Arial",
        "Noto Sans Arabic",
        sans-serif !important;

    --eshmesh-number-font:
        "Vazirmatn",
        "Arial",
        "Noto Sans Arabic",
        sans-serif !important;
}

html,
body,
body *,
button,
input,
select,
textarea,
table,
th,
td,
canvas{
    font-family:
        "Vazirmatn",
        "Arial",
        "Noto Sans Arabic",
        sans-serif !important;
}

input[type="number"],
input[inputmode="numeric"],
input[inputmode="decimal"],
.live-price,
.derived-price,
.money-input,
.trade-quantity-column,
.trade-unit-price-column,
.trade-total-column{
    font-family:
        "Vazirmatn",
        "Arial",
        "Noto Sans Arabic",
        sans-serif !important;
    font-variant-numeric:tabular-nums;
    font-feature-settings:"tnum" 1;
}

/* نسخه 40 — دسته‌بندی کالاهای پنل مشتری */
.market-category-block{
    width:100%;
    margin:0 0 18px;
}
.market-category-title{
    margin:0 0 9px;
    padding:9px 13px;
    border-right:4px solid #f0c14e;
    border-radius:7px;
    background:rgba(38,38,38,.96);
    color:#f0c14e;
    font-size:18px;
    font-weight:900;
}
.market-category-products{
    display:flex;
    flex-direction:column;
    gap:5px;
    width:100%;
}
.market-category-products .market-row,
.market-category-products .market-card{
    width:100%;
}

/* نسخه 41 — حفظ دسته‌بندی در به‌روزرسانی زنده */
#market-grid.market-grid{
    display:block;
}

#market-grid .market-category-block{
    display:block;
    width:100%;
}

#market-grid .market-category-products{
    display:flex;
    flex-direction:column;
    width:100%;
    gap:5px;
}

#market-grid .market-category-products .market-card{
    display:block;
    width:100%;
}

/* نسخه 43 — جست‌وجوی ستونی ثابت در معاملات و سفارشات */
.table-wrap:has(.filterable-admin-table){
    position:relative;
    max-height:calc(100vh - 185px);
    overflow:auto !important;
    border-radius:9px;
}

.filterable-admin-table{
    border-collapse:separate !important;
    border-spacing:0 !important;
}

.filterable-admin-table thead .sticky-heading-row th{
    position:sticky !important;
    top:0 !important;
    z-index:30 !important;
    height:42px;
    box-sizing:border-box;
    background:#292929 !important;
    box-shadow:0 1px 0 #555;
}

.filterable-admin-table thead .table-filter-row th{
    position:sticky !important;
    top:42px !important;
    z-index:29 !important;
    height:42px;
    box-sizing:border-box;
    padding:5px 4px !important;
    background:#202020 !important;
    box-shadow:0 1px 0 #444;
}

.filterable-admin-table .column-filter{
    display:block;
    width:100%;
    min-width:0;
    height:30px;
    box-sizing:border-box;
    padding:4px 5px;
    border:1px solid #555;
    border-radius:5px;
    outline:none;
    background:#101010;
    color:#fff;
    font-size:10px;
    text-align:center;
}

.filterable-admin-table .column-filter:focus{
    border-color:#f0c14e;
    box-shadow:0 0 0 1px rgba(240,193,78,.25);
}

.filterable-admin-table .column-filter::placeholder{
    color:#8e8e8e;
    opacity:1;
}

/* خنثی‌کردن stickyهای قدیمی سلول‌ها تا فقط دو ردیف بالا فریز باشند */
.filterable-admin-table tbody td{
    position:static !important;
    left:auto !important;
    right:auto !important;
}

@media(max-width:1200px){
    .filterable-admin-table thead .sticky-heading-row th{
        height:38px;
    }

    .filterable-admin-table thead .table-filter-row th{
        top:38px !important;
        height:39px;
    }

    .filterable-admin-table .column-filter{
        height:27px;
        padding:3px;
        font-size:9px;
    }
}

/* نسخه 44 */
.market-closed-hero{
    margin:18px auto;
    max-width:760px;
    padding:34px 22px;
    text-align:center;
    border:1px solid #b38822;
    border-radius:18px;
    background:radial-gradient(circle at top,rgba(240,193,78,.18),transparent 55%),rgba(27,27,27,.96);
    box-shadow:0 14px 45px rgba(0,0,0,.35);
}
.market-closed-icon{font-size:42px;margin-bottom:8px}
.market-closed-hero h2{margin:0 0 8px;color:#f0c14e;font-size:28px}
.market-closed-hero p{margin:0;color:#ddd;font-size:15px}
.dashboard-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.market-state-pill{padding:8px 14px;border-radius:999px;font-weight:900}
.market-state-pill.open{background:#155f35;color:#d9ffe8}
.market-state-pill.closed{background:#7b2631;color:#ffe5e9}
.dashboard-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}
.dashboard-card{padding:18px;border:1px solid #3d3d3d;border-radius:12px;background:#212121}
.dashboard-card span{display:block;color:#aaa;margin-bottom:8px}
.dashboard-card strong{font-size:22px;color:#f0c14e}
.system-settings-form{display:grid;gap:14px}
.settings-card{display:grid;gap:8px;padding:18px;border:1px solid #3d3d3d;border-radius:12px;background:#202020}
.settings-card input,.settings-card textarea{width:100%;box-sizing:border-box}
.switch-row{display:flex;align-items:center;gap:8px}
.switch-row input{width:auto}
.hint{color:#aaa;font-size:12px}
@media(max-width:700px){
    .dashboard-cards{grid-template-columns:1fr}
    .dashboard-head{align-items:flex-start;flex-direction:column}
}

/* نسخه 47 */
:root{
    --bg:#101010;
    --surface:#1f1f1f;
    --surface-2:#292929;
    --text:#f4f4f4;
    --muted:#b8b8b8;
    --border:#3d3d3d;
    --gold:#f0c14e;
    --input:#111;
}

html[data-theme="light"]{
    --bg:#f4f1ea;
    --surface:#fff;
    --surface-2:#ece5d8;
    --text:#1b1b1b;
    --muted:#666;
    --border:#d2c8b7;
    --gold:#a87300;
    --input:#fff;
}

html,body{background:var(--bg)!important;color:var(--text)!important}
.card,.market-card,.settings-card,.dashboard-card,.limit-order-card,.customer-price-chart-card,.admin-log-day,.modal-content{
    background:var(--surface)!important;
    color:var(--text)!important;
    border-color:var(--border)!important;
}
.admin-data-table th,.filterable-admin-table thead th{
    background:var(--surface-2)!important;
    color:var(--text)!important;
}
.admin-data-table td{
    background:var(--surface)!important;
    color:var(--text)!important;
    border-color:var(--border)!important;
}
input,select,textarea,.column-filter{
    background:var(--input)!important;
    color:var(--text)!important;
    border-color:var(--border)!important;
}
.theme-toggle{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:7px 11px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface-2);
    color:var(--text);
    cursor:pointer;
}
.market-closed-only-message{
    max-width:760px;
    margin:24px auto;
    padding:48px 24px;
    text-align:center;
    border:1px solid var(--gold);
    border-radius:20px;
    background:radial-gradient(circle at top,rgba(240,193,78,.22),transparent 58%),var(--surface);
}
.market-closed-only-message .market-closed-icon{font-size:54px;margin-bottom:12px}
.market-closed-only-message h2{margin:0 0 10px;font-size:32px;color:var(--gold)!important}
.market-closed-only-message p{margin:0;font-size:16px;color:var(--text)}

body:has(.customer-tabs)::before{
    background:
        linear-gradient(rgba(15,15,15,.82),rgba(15,15,15,.82)),
        url("/assets/images/eshmesh-panel-watermark.jpg")
        center 56% / min(72vw,900px) auto no-repeat!important;
}
html[data-theme="light"] body:has(.customer-tabs)::before{
    background:
        linear-gradient(rgba(244,241,234,.72),rgba(244,241,234,.72)),
        url("/assets/images/eshmesh-panel-watermark.jpg")
        center 56% / min(72vw,900px) auto no-repeat!important;
}
@media(max-width:700px){
    .theme-label{display:none}
    .theme-toggle{padding:6px 8px}
}

/* نسخه 48 */
.trade-history-card.customer-buy-card{
  background:rgba(150,45,55,.20)!important;
  border-color:rgba(210,70,85,.50)!important;
}
.trade-history-card.customer-sell-card{
  background:rgba(35,120,70,.20)!important;
  border-color:rgba(55,170,95,.50)!important;
}
html[data-theme="light"] .trade-history-card.customer-buy-card{
  background:#fdecee!important;border-color:#e5a6ae!important;
}
html[data-theme="light"] .trade-history-card.customer-sell-card{
  background:#eaf8ef!important;border-color:#9bd0aa!important;
}
.product-telegram-toggle{
  display:flex;align-items:center;gap:7px;padding:7px 8px;margin:7px 0;
  border:1px solid var(--border);border-radius:7px;background:var(--surface-2);
  color:var(--text);font-size:12px;
}
.product-telegram-toggle input{width:auto!important}

/* نسخه 49 — اصلاح تم مشتری، اعتبار و وضعیت زنده بازار */
.customer-header-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.customer-header-actions form{
    margin:0;
}

/* طبق درخواست جدید: خرید از ما سبز و فروش به ما قرمز */
.trade-history-card.customer-buy-card{
    background:rgba(35,120,70,.24)!important;
    border-color:rgba(55,180,100,.58)!important;
}

.trade-history-card.customer-sell-card{
    background:rgba(150,45,55,.24)!important;
    border-color:rgba(220,75,90,.58)!important;
}

html[data-theme="light"] .trade-history-card.customer-buy-card{
    background:#e4f7eb!important;
    border-color:#83c798!important;
}

html[data-theme="light"] .trade-history-card.customer-sell-card{
    background:#fde8eb!important;
    border-color:#df98a3!important;
}

/* تم روشن پنل مشتری با اولویت بالاتر از استایل‌های قدیمی */
html[data-theme="light"] body,
body[data-theme="light"]{
    background:#f4f1ea!important;
    color:#1b1b1b!important;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .page,
html[data-theme="light"] .customer-tab-panel,
html[data-theme="light"] .market-card,
html[data-theme="light"] .market-category-block,
html[data-theme="light"] .trade-history-card,
html[data-theme="light"] .limit-order-card,
html[data-theme="light"] .limit-order-create-card,
html[data-theme="light"] .customer-price-chart-card,
html[data-theme="light"] .modal-content{
    color:#1b1b1b!important;
}

html[data-theme="light"] .topbar{
    background:#fff!important;
    border-color:#d2c8b7!important;
}

html[data-theme="light"] .customer-tab-btn{
    background:#e8e1d5!important;
    color:#242424!important;
    border-color:#d2c8b7!important;
}

html[data-theme="light"] .customer-tab-btn.active{
    background:#d5a51d!important;
    color:#111!important;
}

html[data-theme="light"] .market-card,
html[data-theme="light"] .limit-order-card,
html[data-theme="light"] .limit-order-create-card,
html[data-theme="light"] .customer-price-chart-card,
html[data-theme="light"] .modal-content{
    background:rgba(255,255,255,.94)!important;
    border-color:#d2c8b7!important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea{
    background:#fff!important;
    color:#1b1b1b!important;
    border-color:#c9bda9!important;
}

/* لوگوی پس‌زمینه واضح‌تر */
body:has(.customer-tabs)::before{
    background:
        linear-gradient(rgba(15,15,15,.68),rgba(15,15,15,.68)),
        url("/assets/images/eshmesh-panel-watermark.jpg")
        center 55% / min(76vw,940px) auto no-repeat!important;
}

html[data-theme="light"] body:has(.customer-tabs)::before{
    background:
        linear-gradient(rgba(244,241,234,.56),rgba(244,241,234,.56)),
        url("/assets/images/eshmesh-panel-watermark.jpg")
        center 55% / min(76vw,940px) auto no-repeat!important;
    filter:contrast(1.12) saturate(.9);
}

@media(max-width:700px){
    body:has(.customer-tabs)::before{
        background:
            linear-gradient(rgba(15,15,15,.70),rgba(15,15,15,.70)),
            url("/assets/images/eshmesh-panel-watermark.jpg")
            center 52% / 125vw auto no-repeat!important;
    }

    html[data-theme="light"] body:has(.customer-tabs)::before{
        background:
            linear-gradient(rgba(244,241,234,.58),rgba(244,241,234,.58)),
            url("/assets/images/eshmesh-panel-watermark.jpg")
            center 52% / 125vw auto no-repeat!important;
    }
}

/* نسخه 50 — کالای سیستمی یک گرم طلای آبشده */
.product-card[data-product-type="one_gram_gold"]{
    border:1px solid #c89c32;
    background:
        radial-gradient(circle at top right,rgba(240,193,78,.12),transparent 44%),
        var(--surface);
}

.one-gram-derived-box{
    margin-bottom:10px;
}

.product-help,
.system-product-note{
    padding:8px 10px;
    border-radius:7px;
    background:rgba(240,193,78,.10);
    color:var(--muted);
    font-size:12px;
    line-height:1.8;
}

.forced-telegram{
    border-color:#c89c32;
}

/* v52 rejected overlay */
.trade-history-card{position:relative;overflow:hidden}
.trade-history-card.status-rejected::after,
.trade-history-card[data-status="rejected"]::after{
 content:"✕";
 position:absolute;
 inset:0;
 display:flex;
 align-items:center;
 justify-content:center;
 font-size:min(11rem,45vw);
 font-weight:900;
 color:rgba(255,140,0,.38);
 pointer-events:none;
 line-height:1;
 z-index:5;
}


/* نسخه 54 — بهبود پنل مدیریت */
/* منوی مدیریت هنگام اسکرول ثابت می‌ماند. */
.topbar{
    position:sticky!important;
    top:0!important;
    z-index:4500!important;
    backdrop-filter:blur(10px);
}

/* API به شکل زیرمنوی تنظیمات سایت نمایش داده می‌شود. */
.admin-nav-settings{
    position:relative;
    display:inline-block;
    margin:0;
}
.admin-nav-settings>summary{
    list-style:none;
    cursor:pointer;
    padding:7px 10px;
    border-radius:8px;
    color:inherit;
    user-select:none;
}
.admin-nav-settings>summary::-webkit-details-marker{display:none}
.admin-nav-settings>summary::after{content:' ▾';font-size:.75em}
.admin-nav-settings[open]>summary{background:var(--surface-2)}
.admin-nav-submenu{
    position:absolute;
    top:calc(100% + 6px);
    right:0;
    min-width:175px;
    display:flex;
    flex-direction:column;
    gap:3px;
    padding:8px;
    background:var(--surface)!important;
    border:1px solid var(--border)!important;
    border-radius:10px;
    box-shadow:0 12px 28px rgba(0,0,0,.25);
    z-index:4600;
}
.admin-nav-submenu a{display:block!important;margin:0!important;white-space:nowrap}

/* جلوگیری از محوشدن متن‌های سفید در حالت روز مدیریت. */
html[data-theme="light"] .page,
html[data-theme="light"] .page .panel,
html[data-theme="light"] .page .product-card,
html[data-theme="light"] .page .trade-admin-card,
html[data-theme="light"] .page .customer-row-card,
html[data-theme="light"] .page .admin-user-card,
html[data-theme="light"] .page .settings-card,
html[data-theme="light"] .page .dashboard-card,
html[data-theme="light"] .page .admin-log-day,
html[data-theme="light"] .page .table-wrap,
html[data-theme="light"] .page .derived-box,
html[data-theme="light"] .page .calculated-prices{
    color:#202124!important;
}
html[data-theme="light"] .page h1,
html[data-theme="light"] .page h2,
html[data-theme="light"] .page h3,
html[data-theme="light"] .page h4,
html[data-theme="light"] .page label,
html[data-theme="light"] .page p,
html[data-theme="light"] .page small,
html[data-theme="light"] .page td,
html[data-theme="light"] .page th,
html[data-theme="light"] .page .product-card span,
html[data-theme="light"] .page .customer-main-info span,
html[data-theme="light"] .page .derived-box span,
html[data-theme="light"] .page .calculated-prices span{
    color:#202124!important;
}
html[data-theme="light"] .page .hint,
html[data-theme="light"] .page .product-help,
html[data-theme="light"] .page .help,
html[data-theme="light"] .page .muted{
    color:#5f6368!important;
}
html[data-theme="light"] .page .btn,
html[data-theme="light"] .page button,
html[data-theme="light"] .page .status,
html[data-theme="light"] .page .table-status,
html[data-theme="light"] .page .notice,
html[data-theme="light"] .page .alert{
    /* رنگ اختصاصی این عناصر حفظ شود */
}
.one-gram-auto-raw{font-size:1.15rem;color:var(--gold)!important}
.one-gram-derived-box small{display:block;margin-top:4px;color:var(--muted)!important}

@media(max-width:850px){
    .topbar{position:sticky!important;top:0!important}
    .admin-nav-submenu{right:auto;left:0}
}




/* v60 — هدر مستقل برای هر گروه، جداکننده ردیف‌ها و اعداد سفید پاپ‌آپ */

/* چیدمان دو گروه در کنار هم روی دسکتاپ */
#market-grid.market-grid {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:22px 10px !important;
    align-items:start;
}

#market-grid .market-category-block {
    min-width:0;
    margin:0 !important;
}

/* عنوان گروه و سرستون‌ها دقیقاً متعلق به همان گروه هستند */
#market-grid .market-category-title {
    margin:0 0 6px !important;
}

#market-grid .market-category-columns-header {
    width:100%;
    box-sizing:border-box;
    margin:0 0 4px !important;
}

#market-grid .market-category-products {
    gap:0 !important;
}

/* خط واضح زیر هر ردیف کالا */
#market-grid .market-card {
    border-radius:0 !important;
    border-left:0 !important;
    border-right:0 !important;
    border-top:0 !important;
    border-bottom:2px solid rgba(240,193,78,.62) !important;
    padding:4px 0 !important;
    overflow:visible !important;
}

#market-grid .market-card:first-child {
    padding-top:0 !important;
}

#market-grid .market-card:last-child {
    border-bottom-color:rgba(240,193,78,.8) !important;
}

#market-grid .market-row {
    overflow:hidden;
    border-radius:7px;
}

/* در نمایش‌های کوچک هر گروه تمام عرض را بگیرد */
@media(max-width:1050px) {
    #market-grid.market-grid {
        grid-template-columns:1fr !important;
        gap:18px !important;
    }
}

/* اعداد پاپ‌آپ معامله در تمام تم‌ها سفید و پررنگ باشند */
#trade-modal #trade-unit-price,
#trade-modal #trade-quantity,
#trade-modal #trade-amount,
#trade-modal #normal-quantity,
#trade-modal #summary-quantity,
#trade-modal #summary-total {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    font-weight:900 !important;
    opacity:1 !important;
    text-shadow:none !important;
    font-variant-numeric:tabular-nums;
}

/* ورودی‌های عددی نیز روی زمینه تیره و با متن سفید نمایش داده شوند */
#trade-modal #trade-quantity,
#trade-modal #trade-amount,
#trade-modal #normal-quantity {
    background:#252525 !important;
    border:1px solid #777 !important;
    caret-color:#ffffff !important;
}

#trade-modal #trade-quantity::placeholder,
#trade-modal #trade-amount::placeholder,
#trade-modal #normal-quantity::placeholder {
    color:#d1d5db !important;
    -webkit-text-fill-color:#d1d5db !important;
    opacity:1 !important;
}

/* جلوگیری از بازنویسی رنگ سفید در حالت روز */
html[data-theme="light"] #trade-modal #trade-unit-price,
html[data-theme="light"] #trade-modal #trade-quantity,
html[data-theme="light"] #trade-modal #trade-amount,
html[data-theme="light"] #trade-modal #normal-quantity,
html[data-theme="light"] #trade-modal #summary-quantity,
html[data-theme="light"] #trade-modal #summary-total,
.light-theme #trade-modal #trade-unit-price,
.light-theme #trade-modal #trade-quantity,
.light-theme #trade-modal #trade-amount,
.light-theme #trade-modal #normal-quantity,
.light-theme #trade-modal #summary-quantity,
.light-theme #trade-modal #summary-total {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}


/* =========================================================
   v61 — طرح 4: پنل تیره و لوکس ای شمش
   تمام قوانین این بخش فقط روی پنل مشتری اعمال می‌شوند.
   ========================================================= */
:root {
    --luxe-bg:#070b12;
    --luxe-surface:#101722;
    --luxe-surface-2:#172130;
    --luxe-line:rgba(212,168,68,.28);
    --luxe-gold:#d8ad4d;
    --luxe-gold-soft:#f1d083;
    --luxe-text:#f7f9fc;
    --luxe-muted:#99a7ba;
    --luxe-green:#0d6b51;
    --luxe-green-bright:#16a777;
    --luxe-red:#79263a;
    --luxe-red-bright:#c83f58;
}

body.customer-luxe-body {
    background:
        radial-gradient(circle at 50% -10%, rgba(216,173,77,.12), transparent 30%),
        linear-gradient(180deg,#080d15 0%,#05080d 100%) !important;
    color:var(--luxe-text);
    min-height:100vh;
}

.customer-luxe-topbar {
    position:sticky;
    top:0;
    z-index:100;
    min-height:74px;
    padding:10px clamp(14px,3vw,42px) !important;
    background:rgba(7,11,18,.96) !important;
    border-bottom:1px solid var(--luxe-line) !important;
    box-shadow:0 14px 38px rgba(0,0,0,.34);
    backdrop-filter:blur(18px);
}

.customer-brand-block,
.customer-header-actions,
.customer-user-chip {
    display:flex;
    align-items:center;
}

.customer-brand-block { gap:11px; min-width:210px; }
.customer-brand-emblem {
    width:46px;height:46px;border-radius:15px;
    display:grid;place-items:center;
    color:#15100a;font-size:23px;
    background:linear-gradient(145deg,#f2d985,#b77c20);
    box-shadow:0 0 0 1px rgba(255,255,255,.12),0 8px 24px rgba(216,173,77,.22);
}
.customer-brand-copy { display:flex;flex-direction:column;line-height:1.2; }
.customer-brand-copy strong { color:#fff;font-size:20px;font-weight:900;letter-spacing:-.4px; }
.customer-brand-copy small { color:var(--luxe-gold-soft);font-size:11px;margin-top:5px; }

.customer-luxe-tabs {
    background:#0d141f;
    border:1px solid rgba(255,255,255,.06);
    border-radius:14px;
    padding:5px;
    gap:4px;
}
.customer-luxe-tabs .customer-tab-btn {
    border:0 !important;
    color:#aab6c6 !important;
    background:transparent !important;
    border-radius:10px !important;
    padding:10px 15px !important;
    transition:.2s ease;
}
.customer-luxe-tabs .customer-tab-btn:hover { color:#fff !important;background:#172130 !important; }
.customer-luxe-tabs .customer-tab-btn.active {
    color:#160f06 !important;
    background:linear-gradient(135deg,#f1d083,#c88d2e) !important;
    box-shadow:0 7px 22px rgba(216,173,77,.18);
}

.customer-header-actions { gap:8px; min-width:280px; justify-content:flex-end; }
.customer-user-chip {
    gap:7px;color:#d8e0ec;font-size:12px;
    max-width:210px;padding:8px 10px;border-radius:10px;
    background:#101722;border:1px solid rgba(255,255,255,.06);
}
.customer-user-chip span:last-child { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.customer-user-dot { width:8px;height:8px;border-radius:50%;background:#2ed393;box-shadow:0 0 10px #2ed393;flex:0 0 auto; }
.customer-luxe-topbar .theme-toggle,
.customer-logout-btn {
    min-height:37px;border-radius:10px !important;
    color:#e9edf4 !important;background:#151e2b !important;
    border:1px solid rgba(255,255,255,.08) !important;
}
.customer-luxe-topbar .theme-label { display:none; }
.customer-logout-btn { padding:8px 13px !important; }

.customer-luxe-page {
    width:min(1460px,calc(100% - 28px)) !important;
    margin:0 auto !important;
    padding:24px 0 58px !important;
    color:var(--luxe-text);
}

.customer-market-snapshot {
    display:grid;
    grid-template-columns:1.25fr 1fr 1fr;
    gap:13px;
    margin-bottom:18px;
}
.snapshot-card {
    position:relative;overflow:hidden;
    display:flex;align-items:center;gap:14px;
    min-height:92px;padding:16px 18px;
    border-radius:18px;
    background:linear-gradient(145deg,rgba(23,33,48,.98),rgba(12,18,28,.98));
    border:1px solid rgba(255,255,255,.07);
    box-shadow:0 16px 38px rgba(0,0,0,.25);
}
.snapshot-card::after {
    content:"";position:absolute;inset:auto -28px -45px auto;width:120px;height:120px;border-radius:50%;
    background:radial-gradient(circle,rgba(216,173,77,.18),transparent 68%);
}
.snapshot-icon {
    width:48px;height:48px;border-radius:14px;display:grid;place-items:center;flex:0 0 auto;
    color:#171007;font-size:24px;font-weight:900;background:linear-gradient(145deg,#f4dc91,#bd8225);
}
.snapshot-copy { display:flex;flex-direction:column;position:relative;z-index:1; }
.snapshot-copy span { color:var(--luxe-muted);font-size:12px; }
.snapshot-copy strong { color:#fff;font-size:23px;font-weight:900;margin:4px 0 2px;direction:ltr;text-align:right; }
.snapshot-copy small { color:var(--luxe-gold-soft);font-size:11px; }
.market-state-card .snapshot-icon { color:#c9ffe9;background:linear-gradient(145deg,#126c55,#0a3e32); }
.clock-card .snapshot-icon { color:#d8e8ff;background:linear-gradient(145deg,#284b77,#142a49); }

.customer-luxe-page .customer-announcement,
.customer-luxe-page .notice,
.customer-luxe-page .alert {
    border-radius:14px !important;
    background:#111a26 !important;
    border:1px solid rgba(216,173,77,.22) !important;
    color:#e8edf5 !important;
}

.customer-market-heading {
    display:flex;align-items:flex-end;justify-content:space-between;
    margin:8px 0 15px;
}
.customer-market-heading h2 { margin:0;color:#fff;font-size:25px; }
.customer-market-heading p { margin:5px 0 0;color:var(--luxe-muted);font-size:12px; }
.live-market-badge {
    display:inline-flex;align-items:center;gap:7px;
    color:#9ce9ca;background:rgba(17,107,82,.20);border:1px solid rgba(46,211,147,.22);
    border-radius:999px;padding:7px 12px;font-size:11px;
}
.live-market-badge i { width:7px;height:7px;border-radius:50%;background:#2ed393;box-shadow:0 0 9px #2ed393; }

/* گروه‌بندی مشابه طرح 4: هدر طلایی و جدول تیره */
.customer-luxe-page #market-grid.market-grid {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:16px !important;
}
.customer-luxe-page .market-category-block {
    border-radius:18px;
    overflow:hidden;
    padding:0 !important;
    background:linear-gradient(180deg,#121b28,#0c121c);
    border:1px solid rgba(216,173,77,.25);
    box-shadow:0 18px 44px rgba(0,0,0,.30);
}
.customer-luxe-page .market-category-title {
    margin:0 !important;padding:11px 16px !important;text-align:center;
    color:#160f06 !important;font-size:15px !important;font-weight:900 !important;
    background:linear-gradient(90deg,#b77920,#f2d67d,#b77920) !important;
    border:0 !important;border-radius:0 !important;
}
.customer-luxe-page .market-category-columns-header {
    margin:0 !important;padding:0 8px !important;
    min-height:38px;background:#0e1621 !important;border:0 !important;border-bottom:1px solid rgba(255,255,255,.07) !important;
    color:#9ba9ba !important;
}
.customer-luxe-page .market-category-columns-header > div { font-size:11px !important;font-weight:700 !important; }
.customer-luxe-page .market-category-products { padding:5px 8px 8px; }
.customer-luxe-page #market-grid .market-card {
    padding:5px 0 !important;
    border-bottom:1px solid rgba(255,255,255,.075) !important;
    background:transparent !important;
}
.customer-luxe-page #market-grid .market-card:last-child { border-bottom:0 !important; }
.customer-luxe-page .market-row {
    min-height:58px;
    background:transparent !important;
    border-radius:10px !important;
    gap:7px;
}
.customer-luxe-page .market-product-title {
    color:#f1f4f8 !important;background:transparent !important;
    font-weight:800 !important;font-size:13px !important;
    border:0 !important;padding:8px 10px !important;
}
.customer-luxe-page .trade-btn {
    min-height:47px !important;border-radius:11px !important;border:1px solid transparent !important;
    box-shadow:none !important;transition:transform .16s ease,filter .16s ease !important;
}
.customer-luxe-page .trade-btn:hover { transform:translateY(-1px);filter:brightness(1.08); }
.customer-luxe-page .trade-btn.buy {
    background:linear-gradient(145deg,#0d6d52,#084b3c) !important;
    border-color:rgba(46,211,147,.22) !important;color:#eafff7 !important;
}
.customer-luxe-page .trade-btn.sell {
    background:linear-gradient(145deg,#81283d,#541a2a) !important;
    border-color:rgba(236,82,105,.22) !important;color:#fff0f3 !important;
}
.customer-luxe-page .trade-btn .live-price { font-size:16px !important;font-weight:900 !important;color:#fff !important; }
.customer-luxe-page .trade-btn .derived-price { color:rgba(255,255,255,.68) !important;font-size:9px !important; }
.customer-luxe-page .trade-btn-placeholder { min-height:47px;border-radius:11px;background:rgba(255,255,255,.025) !important; }

/* سایر تب‌ها در همان زبان بصری */
.customer-luxe-page .customer-tab-panel > h2,
.customer-luxe-page .customer-tab-panel > h3 { color:#fff !important; }
.customer-luxe-page .limit-order-create-card,
.customer-luxe-page .limit-order-card,
.customer-luxe-page .trade-history-card,
.customer-luxe-page .chart-card,
.customer-luxe-page .placeholder {
    background:#101722 !important;color:#eef3fa !important;
    border:1px solid rgba(255,255,255,.07) !important;border-radius:16px !important;
}
.customer-luxe-page input,
.customer-luxe-page select,
.customer-luxe-page textarea {
    background:#0b111a !important;color:#fff !important;border:1px solid #344155 !important;
}

/* مودال معامله لوکس و خوانا */
#trade-modal .modal-content {
    background:linear-gradient(160deg,#182231,#0b111a) !important;
    color:#fff !important;border:1px solid rgba(216,173,77,.32) !important;
    box-shadow:0 28px 90px rgba(0,0,0,.62) !important;
}
#trade-modal label,#trade-modal span,#trade-modal p,#trade-modal small { color:#cbd5e1; }
#trade-modal #trade-unit-price,
#trade-modal #trade-quantity,
#trade-modal #trade-amount,
#trade-modal #normal-quantity,
#trade-modal #summary-quantity,
#trade-modal #summary-total { color:#fff !important;-webkit-text-fill-color:#fff !important; }

@media(max-width:1100px) {
    .customer-luxe-topbar { flex-wrap:wrap; }
    .customer-luxe-tabs { order:3;width:100%;overflow:auto;justify-content:center; }
    .customer-market-snapshot { grid-template-columns:1fr 1fr; }
    .ounce-card { grid-column:1/-1; }
}
@media(max-width:760px) {
    .customer-luxe-page { width:min(100% - 18px,700px) !important;padding-top:14px !important; }
    .customer-brand-block { min-width:auto; }
    .customer-brand-copy small,.customer-user-chip { display:none; }
    .customer-header-actions { min-width:auto; }
    .customer-market-snapshot { grid-template-columns:1fr;gap:9px; }
    .ounce-card { grid-column:auto; }
    .snapshot-card { min-height:78px;padding:12px 14px;border-radius:15px; }
    .snapshot-copy strong { font-size:20px; }
    .customer-luxe-page #market-grid.market-grid { grid-template-columns:1fr !important; }
    .customer-luxe-tabs { justify-content:flex-start; }
    .customer-luxe-tabs .customer-tab-btn { white-space:nowrap;padding:9px 12px !important; }
}


/* =========================================================
   v62 — خلاصه بازار فشرده در موبایل + تابلوی اعلانات دائمی
   ========================================================= */
.customer-luxe-page .customer-market-snapshot {
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:10px !important;
    margin-bottom:12px !important;
}
.customer-luxe-page .customer-market-snapshot .snapshot-card {
    min-width:0 !important;
}
.customer-luxe-page .customer-announcement-board {
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    margin:0 0 14px !important;
    padding:12px 14px !important;
}
.customer-announcement-title {
    display:block;
    color:var(--luxe-gold-soft) !important;
    font-weight:900;
    margin-bottom:6px;
}
.customer-announcement-message {
    color:#e8edf5;
    line-height:1.9;
    white-space:pre-line;
}

@media(max-width:1100px) {
    .customer-luxe-page .customer-market-snapshot {
        grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    }
    .customer-luxe-page .customer-market-snapshot .ounce-card {
        grid-column:auto !important;
    }
}

@media(max-width:760px) {
    .customer-luxe-page .customer-market-snapshot {
        display:grid !important;
        grid-template-columns:repeat(3,minmax(0,1fr)) !important;
        gap:5px !important;
        margin-bottom:8px !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-card {
        min-height:58px !important;
        height:58px !important;
        padding:6px 4px !important;
        border-radius:10px !important;
        gap:3px !important;
        flex-direction:column !important;
        justify-content:center !important;
        text-align:center !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-icon {
        width:22px !important;
        height:22px !important;
        border-radius:7px !important;
        font-size:12px !important;
        flex:0 0 22px !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-copy {
        min-width:0 !important;
        width:100% !important;
        align-items:center !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-copy span {
        font-size:8px !important;
        line-height:1.1 !important;
        white-space:nowrap !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-copy strong {
        font-size:11px !important;
        line-height:1.15 !important;
        margin:1px 0 0 !important;
        max-width:100% !important;
        overflow:hidden !important;
        text-overflow:ellipsis !important;
        white-space:nowrap !important;
        text-align:center !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-copy small {
        display:none !important;
    }
    .customer-luxe-page .customer-market-snapshot .ounce-card {
        grid-column:auto !important;
    }
    .customer-luxe-page .customer-announcement-board {
        margin-bottom:10px !important;
        padding:9px 11px !important;
        border-radius:11px !important;
        font-size:11px !important;
    }
    .customer-announcement-title {
        margin-bottom:3px !important;
        font-size:11px !important;
    }
    .customer-announcement-message {
        line-height:1.65 !important;
        font-size:10px !important;
    }
}

@media(max-width:360px) {
    .customer-luxe-page .customer-market-snapshot {
        gap:3px !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-card {
        padding:5px 2px !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-copy span {
        font-size:7px !important;
    }
    .customer-luxe-page .customer-market-snapshot .snapshot-copy strong {
        font-size:9px !important;
    }
}


/* =========================================================
   v63 — مشتری: اونس برجسته، اعلان شرطی، رسپانسیو و دکمه انصراف
   ========================================================= */
.customer-luxe-page .customer-market-snapshot.customer-ounce-only {
    display:block !important;
    margin-bottom:14px !important;
}
.customer-luxe-page .customer-market-snapshot.customer-ounce-only .ounce-card {
    width:100% !important;
    min-height:112px !important;
    padding:20px 26px !important;
    flex-direction:row !important;
    justify-content:center !important;
    text-align:center !important;
    gap:18px !important;
    box-sizing:border-box !important;
}
.customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-icon {
    width:60px !important;height:60px !important;flex:0 0 60px !important;
    font-size:30px !important;border-radius:18px !important;
}
.customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy {
    align-items:center !important;min-width:0 !important;
}
.customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy span {
    font-size:18px !important;font-weight:900 !important;color:#f1d083 !important;
}
.customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy strong {
    font-size:clamp(32px,4vw,52px) !important;line-height:1.15 !important;
    margin:5px 0 3px !important;text-align:center !important;
}
.customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy small {
    display:block !important;font-size:13px !important;
}
.customer-announcement-board[hidden] { display:none !important; }
.customer-luxe-page .customer-announcement-board {
    padding:18px 20px !important;margin-bottom:16px !important;
}
.customer-luxe-page .customer-announcement-title {
    font-size:19px !important;line-height:1.6 !important;margin-bottom:8px !important;
}
.customer-luxe-page .customer-announcement-message {
    font-size:17px !important;line-height:2 !important;font-weight:600 !important;
}
.trade-modal-actions {
    display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);
    gap:10px;margin-top:14px;
}
.trade-modal-actions .btn { width:100%;min-height:44px;margin:0 !important; }
.trade-cancel-btn { border:1px solid rgba(255,255,255,.18) !important; }

@media(max-width:900px) {
    .customer-luxe-topbar { padding:10px !important;gap:9px !important; }
    .customer-luxe-page { width:calc(100% - 18px) !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .ounce-card {
        min-height:96px !important;padding:15px 18px !important;
    }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy span { font-size:16px !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy strong { font-size:clamp(28px,7vw,42px) !important; }
    .customer-luxe-page #market-grid.market-grid { grid-template-columns:1fr !important; }
}
@media(max-width:600px) {
    .customer-luxe-page { width:calc(100% - 12px) !important;padding-top:9px !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only { margin-bottom:9px !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .ounce-card {
        min-height:82px !important;height:auto !important;padding:11px 10px !important;
        flex-direction:row !important;gap:10px !important;border-radius:13px !important;
    }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-icon {
        width:42px !important;height:42px !important;flex:0 0 42px !important;font-size:21px !important;
    }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy span { font-size:14px !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy strong { font-size:27px !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy small { font-size:10px !important; }
    .customer-luxe-page .customer-announcement-board { padding:14px 15px !important; }
    .customer-luxe-page .customer-announcement-title { font-size:17px !important; }
    .customer-luxe-page .customer-announcement-message { font-size:15px !important;line-height:1.9 !important; }
    .market-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(84px,.72fr) !important; }
    .trade-modal-actions { grid-template-columns:1fr 1fr; }
}
@media(max-width:380px) {
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy strong { font-size:23px !important; }
    .customer-luxe-page .customer-market-snapshot.customer-ounce-only .snapshot-copy span { font-size:12px !important; }
}

/* =========================================================
   v63 — مدیریت: منوی افقی و عمودی مستقل و قابل بستن
   ========================================================= */
.admin-menu-switches {
    position:fixed;left:12px;bottom:12px;z-index:9000;
    display:flex;gap:7px;padding:7px;border-radius:13px;
    background:rgba(13,18,26,.92);border:1px solid rgba(240,193,78,.30);
    box-shadow:0 10px 30px rgba(0,0,0,.35);backdrop-filter:blur(8px);
}
.admin-menu-switches button {
    padding:8px 11px;border-radius:9px;background:#242c38;color:#dce3ec;
    border:1px solid rgba(255,255,255,.09);font-size:12px;
}
.admin-menu-switches button.is-active { background:#f0c14e;color:#17120a;border-color:#f0c14e; }
.admin-vertical-menu {
    position:fixed;right:0;top:0;bottom:0;width:245px;z-index:8500;
    padding:14px 12px;box-sizing:border-box;overflow-y:auto;
    background:linear-gradient(180deg,#171d27,#0d121a);border-left:1px solid rgba(240,193,78,.25);
    box-shadow:-14px 0 36px rgba(0,0,0,.32);transform:translateX(105%);transition:transform .22s ease;
}
.admin-sidebar-open .admin-vertical-menu { transform:translateX(0); }
.admin-vertical-menu-head { display:flex;justify-content:space-between;align-items:center;padding:7px 5px 14px;color:#f0c14e; }
.admin-vertical-menu-head button { width:32px;height:32px;padding:0;border-radius:9px;background:#2b313b;color:#fff; }
.admin-vertical-menu nav { display:flex;flex-direction:column;gap:6px; }
.admin-vertical-menu nav > a,
.admin-vertical-menu nav > details > summary,
.admin-vertical-menu .theme-toggle {
    display:flex !important;width:100%;box-sizing:border-box;align-items:center;justify-content:flex-start;
    padding:11px 12px !important;margin:0 !important;border-radius:9px !important;
    background:#1b2430;color:#edf2f8;border:1px solid rgba(255,255,255,.06);text-decoration:none;
}
.admin-vertical-menu .admin-nav-settings { position:static !important;width:100%; }
.admin-vertical-menu .admin-nav-submenu { position:static !important;display:flex !important;flex-direction:column;gap:5px;margin-top:5px;padding:5px !important;box-shadow:none !important; }
.admin-sidebar-logout { margin-top:12px; }
.admin-sidebar-logout button { width:100%;background:#6c2633;color:#fff; }
@media(min-width:1000px) {
    body.admin-sidebar-open .page { margin-right:265px !important;width:calc(100% - 295px) !important;transition:.22s ease; }
    body.admin-horizontal-hidden > .admin-horizontal-menu { display:none !important; }
}
@media(max-width:999px) {
    .admin-vertical-menu { display:none !important; }
    .admin-menu-switches { display:none !important; }
}

/* =========================================================
   v63 — رنگ‌بندی کارت کالاها در پنل مدیریت
   ========================================================= */
.products-grid .product-card.product-category-gold {
    background:linear-gradient(160deg,#e5bc42,#a87510) !important;
    border-color:#f7dc7b !important;color:#171109 !important;
}
.products-grid .product-card.product-category-coin {
    background:linear-gradient(160deg,#2c8a55,#155236) !important;
    border-color:#63c889 !important;color:#f4fff8 !important;
}
.products-grid .product-card.product-category-silver {
    background:linear-gradient(160deg,#d8dde2,#858e98) !important;
    border-color:#f1f4f7 !important;color:#111820 !important;
}
.products-grid .product-card.product-category-other {
    background:linear-gradient(160deg,#252525,#151515) !important;
    border-color:#454545 !important;color:#f4f4f4 !important;
}
.products-grid .product-card.product-category-gold label,
.products-grid .product-card.product-category-gold span,
.products-grid .product-card.product-category-gold small,
.products-grid .product-card.product-category-gold p,
.products-grid .product-card.product-category-silver label,
.products-grid .product-card.product-category-silver span,
.products-grid .product-card.product-category-silver small,
.products-grid .product-card.product-category-silver p { color:#171109 !important; }
.products-grid .product-card.product-category-coin label,
.products-grid .product-card.product-category-coin span,
.products-grid .product-card.product-category-coin small,
.products-grid .product-card.product-category-coin p,
.products-grid .product-card.product-category-other label,
.products-grid .product-card.product-category-other span,
.products-grid .product-card.product-category-other small,
.products-grid .product-card.product-category-other p { color:#f4f6f8 !important; }
.products-grid .product-card.product-category-gold input,
.products-grid .product-card.product-category-gold select,
.products-grid .product-card.product-category-silver input,
.products-grid .product-card.product-category-silver select {
    background:rgba(255,255,255,.88) !important;color:#111 !important;border-color:rgba(0,0,0,.24) !important;
}
.products-grid .product-card.product-category-coin input,
.products-grid .product-card.product-category-coin select,
.products-grid .product-card.product-category-other input,
.products-grid .product-card.product-category-other select {
    background:rgba(7,15,13,.62) !important;color:#fff !important;border-color:rgba(255,255,255,.20) !important;
}
.products-grid .product-card .calculated-prices > div,
.products-grid .product-card .derived-box,
.products-grid .product-card .checks {
    background:rgba(0,0,0,.18) !important;border-color:rgba(255,255,255,.18) !important;
}

/* =========================================================
   v64 — اصلاح قطعی نمایش منوهای مدیریت
   ========================================================= */
#admin-horizontal-menu.admin-horizontal-menu {
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
}
body.admin-horizontal-hidden #admin-horizontal-menu.admin-horizontal-menu {
    display:none !important;
}
.admin-menu-switches {
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
}
.admin-vertical-menu {
    display:block !important;
    visibility:visible !important;
}
body:not(.admin-sidebar-open) .admin-vertical-menu {
    transform:translateX(105%) !important;
}
body.admin-sidebar-open .admin-vertical-menu {
    transform:translateX(0) !important;
}
@media (max-width:999px) {
    #admin-horizontal-menu.admin-horizontal-menu {
        display:flex !important;
        position:sticky !important;
        top:0 !important;
        z-index:8200 !important;
    }
    .admin-menu-switches {
        display:flex !important;
        left:8px !important;
        bottom:8px !important;
        z-index:9100 !important;
    }
    .admin-menu-switches button {
        min-height:38px;
    }
    .admin-menu-switches #toggle-admin-horizontal:disabled {
        opacity:.55;
        cursor:not-allowed;
    }
    .admin-vertical-menu {
        display:block !important;
        width:min(285px,86vw) !important;
        z-index:9000 !important;
    }
    body.admin-sidebar-open::after {
        content:"";
        position:fixed;
        inset:0;
        z-index:8400;
        background:rgba(0,0,0,.48);
        backdrop-filter:blur(1px);
    }
    body.admin-sidebar-open .page {
        margin-right:auto !important;
        width:auto !important;
    }
}


/* V65: عدد فرعی داخل زیرکارت همان دکمه قیمت */
#market-grid .trade-btn .derived-price-card{
    display:flex;
    align-items:center;
    justify-content:center;
    width:calc(100% - 10px);
    min-height:20px;
    margin:5px auto 0;
    padding:3px 7px;
    border-radius:7px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.09);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
#market-grid .trade-btn.buy .derived-price-card{
    background:rgba(255,255,255,.105);
    border-color:rgba(187,255,230,.16);
}
#market-grid .trade-btn.sell .derived-price-card{
    background:rgba(255,255,255,.095);
    border-color:rgba(255,214,222,.15);
}
#market-grid .trade-btn .derived-price-card .derived-price{
    display:block !important;
    margin:0 !important;
    color:rgba(255,255,255,.82) !important;
    font-size:10px !important;
    line-height:1.2 !important;
    font-weight:700 !important;
    opacity:1 !important;
}
@media(max-width:520px){
    #market-grid .trade-btn .derived-price-card{
        width:calc(100% - 6px);
        min-height:18px;
        margin-top:4px;
        padding:2px 4px;
        border-radius:6px;
    }
    #market-grid .trade-btn .derived-price-card .derived-price{
        font-size:9px !important;
    }
}


/* V65.1: برچسب واضح «هر گرم» در کنار عدد فرعی */
#market-grid .trade-btn .derived-price-card{
    gap:5px;
    direction:rtl;
    background:rgba(255,255,255,.16);
    border-color:rgba(255,255,255,.25);
}
#market-grid .trade-btn.buy .derived-price-card{
    background:rgba(10,95,64,.46);
    border-color:rgba(105,241,183,.42);
}
#market-grid .trade-btn.sell .derived-price-card{
    background:rgba(116,39,54,.48);
    border-color:rgba(255,139,160,.40);
}
#market-grid .trade-btn .derived-price-label{
    display:inline-block;
    color:rgba(255,255,255,.92);
    font-size:9px;
    line-height:1.2;
    font-weight:700;
    white-space:nowrap;
}
#market-grid .trade-btn .derived-price-card .derived-price{
    color:#fff !important;
}
@media(max-width:520px){
    #market-grid .trade-btn .derived-price-card{gap:3px}
    #market-grid .trade-btn .derived-price-label{font-size:8px}
}


/* =========================================================
   V73 — هم‌ترازی تیترها، مودال ثابت موبایل و جلوگیری از زوم
   ========================================================= */
.customer-luxe-page .market-category-columns-header,
.customer-luxe-page #market-grid .market-row {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(84px,.72fr) !important;
    column-gap:7px !important;
}
.customer-luxe-page .market-category-columns-header {
    box-sizing:border-box !important;
    width:100% !important;
}
.customer-luxe-page .market-category-products {
    box-sizing:border-box !important;
}

#trade-modal {
    box-sizing:border-box !important;
    overflow:hidden !important;
    overscroll-behavior:contain;
}
#trade-modal .modal-content {
    box-sizing:border-box !important;
    width:min(430px,calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100svh - 24px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    margin:auto !important;
    transform:none !important;
    zoom:1 !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
}
#trade-modal input,
#trade-modal select,
#trade-modal textarea {
    box-sizing:border-box !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    font-size:16px !important;
    line-height:1.35 !important;
    transform:none !important;
    zoom:1 !important;
}

@media(max-width:600px) {
    .customer-luxe-page .market-category-columns-header,
    .customer-luxe-page #market-grid .market-row {
        grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(84px,.72fr) !important;
        column-gap:7px !important;
    }
    #trade-modal {
        padding:8px !important;
        align-items:center !important;
        justify-content:center !important;
        height:100svh !important;
        min-height:100svh !important;
    }
    #trade-modal .modal-content {
        width:calc(100vw - 16px) !important;
        max-width:calc(100vw - 16px) !important;
        max-height:calc(100svh - 16px) !important;
        padding:14px 13px !important;
        border-radius:12px !important;
    }
    #trade-modal .modal-content h3 {
        margin:0 30px 7px 0 !important;
        font-size:17px !important;
        line-height:1.35 !important;
    }
    #trade-modal .modal-content p,
    #trade-modal .modal-content label {
        margin-top:7px !important;
        margin-bottom:4px !important;
        font-size:12px !important;
    }
    #trade-modal .modal-content small {
        font-size:10px !important;
        line-height:1.55 !important;
    }
    #trade-modal .trade-summary {
        margin-top:8px !important;
        padding:8px !important;
    }
    #trade-modal .trade-modal-actions {
        margin-top:9px !important;
        gap:7px !important;
    }
    #trade-modal .trade-modal-actions .btn {
        min-height:40px !important;
        padding:7px 5px !important;
        font-size:12px !important;
    }
}

/* V76.2 — branded tenant login pages */
.tenant-auth-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(218,166,54,.20), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(10,110,83,.18), transparent 34%),
    #080b10;
  color: #f8f4e8;
}
.tenant-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, .95fr);
  align-items: stretch;
  direction: ltr;
}
.tenant-auth-visual,
.tenant-auth-card { direction: rtl; }
.tenant-auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(38px, 7vw, 100px);
  background:
    linear-gradient(145deg, rgba(12,17,25,.94), rgba(19,28,38,.78)),
    url('/assets/images/eshmesh-panel-watermark.jpg') center/cover no-repeat;
  border-left: 1px solid rgba(227,177,65,.24);
}
.tenant-auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,8,12,.96), transparent 62%);
  pointer-events: none;
}
.tenant-auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .55;
}
.tenant-auth-orb-one { width: 240px; height: 240px; top: -70px; right: -70px; background: rgba(224,171,54,.18); box-shadow: 0 0 90px rgba(224,171,54,.32); }
.tenant-auth-orb-two { width: 300px; height: 300px; left: -120px; bottom: -100px; background: rgba(8,114,82,.18); box-shadow: 0 0 110px rgba(8,114,82,.26); }
.tenant-auth-brandmark,
.tenant-auth-brandcopy { position: relative; z-index: 1; }
.tenant-auth-brandmark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  margin-bottom: 22px;
  background: linear-gradient(145deg,#f0c45e,#bd8020);
  color: #101318;
  font-size: 34px;
  box-shadow: 0 18px 50px rgba(207,148,38,.28);
}
.tenant-auth-brandcopy strong { display: block; font-size: clamp(28px,4vw,54px); line-height: 1.2; }
.tenant-auth-brandcopy span { display: block; margin-top: 12px; color: #d9d0ba; font-size: 16px; }
.tenant-auth-card {
  width: min(520px, calc(100% - 44px));
  margin: auto;
  padding: clamp(28px,5vw,52px);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 28px;
  background: rgba(18,22,29,.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
}
.tenant-auth-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.tenant-auth-heading h1 { margin: 0 0 7px; font-size: 27px; color: #fff; }
.tenant-auth-heading p { margin: 0; color: #aeb6c3; line-height: 1.8; }
.tenant-auth-icon {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg,#e4ae42,#b87b20);
  color: #15181d;
  font-size: 24px;
}
.tenant-auth-form { display: grid; gap: 18px; }
.tenant-auth-form label { display: grid; gap: 8px; color: #e6dfd0; font-weight: 700; }
.tenant-auth-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  background: rgba(7,10,15,.72);
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tenant-auth-form input:focus { border-color: #d9a538; box-shadow: 0 0 0 4px rgba(217,165,56,.13); transform: translateY(-1px); }
.tenant-auth-submit { min-height: 54px; margin-top: 5px; border-radius: 15px; font-size: 16px; font-weight: 900; }
.tenant-auth-footnote { display: block; margin-top: 20px; color: #818c9a; text-align: center; }
.tenant-auth-alert { margin-bottom: 18px; }

/* V76.2 — tenant product autosave feedback */
.tenant-save-status { min-height: 24px; margin: 8px 0 12px; font-weight: 800; transition: color .2s; }
.tenant-save-status.is-success { color: #44d291; }
.tenant-save-status.is-error { color: #ff7182; }
#tenant-products [data-field].is-saving { opacity: .68; }
#tenant-products [data-field].is-saved { outline: 2px solid rgba(44,199,126,.75); }
#tenant-products [data-field].is-save-error { outline: 2px solid rgba(239,74,92,.85); }

@media (max-width: 820px) {
  .tenant-auth-shell { grid-template-columns: 1fr; align-content: center; padding: 22px 0; }
  .tenant-auth-visual { display: none; }
  .tenant-auth-card { width: min(520px, calc(100% - 28px)); padding: 27px 20px; border-radius: 22px; }
  .tenant-auth-heading { align-items: flex-start; }
  .tenant-auth-heading h1 { font-size: 23px; }
}

/* نسخه 76.22 — چیدمان فشرده ردیفی کالاها در مدیریت مادر */
body:has(.products-grid) .page{
    max-width:1680px;
}
.products-grid{
    display:flex !important;
    flex-direction:column !important;
    gap:8px !important;
    overflow:visible !important;
}
.products-grid .product-card{
    width:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:flex-end !important;
    gap:6px 8px !important;
    padding:9px 11px !important;
    border-radius:12px !important;
}
.products-grid .product-card > label{
    flex:0 0 auto;
    margin:0 !important;
    font-size:.76rem !important;
    white-space:nowrap;
}
.products-grid .product-card > input:not([type="hidden"]),
.products-grid .product-card > select{
    flex:1 1 125px;
    width:auto !important;
    min-width:105px !important;
    max-width:190px;
    height:35px !important;
    margin:0 !important;
}
.products-grid .product-card > .raw-price-control{
    flex:1 1 190px;
    max-width:240px;
    margin:0 !important;
}
.products-grid .product-card > .derived-box{
    flex:1 1 190px;
    max-width:260px;
    margin:0 !important;
    padding:6px 9px !important;
}
.products-grid .product-card > .checks{
    flex:1 1 250px;
    display:flex !important;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:5px 12px !important;
    margin:0 !important;
    padding:7px 9px !important;
}
.products-grid .product-card > .calculated-prices{
    flex:1 1 290px;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(120px,1fr)) !important;
    gap:6px !important;
    margin:0 !important;
}
.products-grid .product-card > .product-telegram-toggle,
.products-grid .product-card > .system-product-note{
    flex:1 1 245px;
    margin:0 !important;
    padding:7px 9px !important;
}
.products-grid .product-card > .delete-product-btn{
    flex:0 0 auto;
    width:auto !important;
    min-height:35px;
    margin:0 0 0 auto !important;
    padding:7px 12px !important;
}
.products-grid .product-card .product-help{
    flex:1 1 260px;
    margin:0 !important;
    font-size:.72rem !important;
}
@media(max-width:900px){
    .products-grid .product-card{
        align-items:stretch !important;
    }
    .products-grid .product-card > input:not([type="hidden"]),
    .products-grid .product-card > select,
    .products-grid .product-card > .raw-price-control,
    .products-grid .product-card > .derived-box{
        max-width:none;
    }
}
@media(max-width:600px){
    .products-grid .product-card > label{flex-basis:100%}
    .products-grid .product-card > input:not([type="hidden"]),
    .products-grid .product-card > select,
    .products-grid .product-card > .raw-price-control,
    .products-grid .product-card > .derived-box,
    .products-grid .product-card > .checks,
    .products-grid .product-card > .calculated-prices,
    .products-grid .product-card > .product-telegram-toggle,
    .products-grid .product-card > .system-product-note{
        flex-basis:100%;
        max-width:none;
    }
}

/* نسخه 76.22 — بازطراحی مرتب تب تنظیمات مدیر زیرمجموعه */
.tenant-settings-page{max-width:1160px !important}
.tenant-settings-heading{margin-bottom:14px}
.tenant-settings-form{display:grid;gap:14px}
.tenant-settings-form .settings-section{
    padding:0 !important;
    overflow:hidden;
    border-radius:18px;
}
.settings-section-header{
    display:flex;
    align-items:center;
    gap:12px;
    padding:15px 18px;
    border-bottom:1px solid rgba(255,255,255,.09);
    background:rgba(255,255,255,.025);
}
.settings-section-header h2{margin:0 0 3px;font-size:1.03rem}
.settings-section-header p{margin:0;opacity:.65;font-size:.8rem}
.settings-section-icon{
    width:42px;height:42px;border-radius:13px;display:grid;place-items:center;
    background:color-mix(in srgb,var(--tenant-primary,#d7a63d) 22%,transparent);
    border:1px solid color-mix(in srgb,var(--tenant-primary,#d7a63d) 48%,transparent);
    color:var(--tenant-primary,#d7a63d);font-weight:900;direction:ltr;
}
.settings-fields-grid,.settings-upload-grid{padding:18px;display:grid;gap:14px}
.settings-fields-two,.settings-upload-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.settings-field{display:grid;gap:7px;margin:0 !important}
.settings-field>span,.settings-upload-title{font-weight:800;font-size:.88rem}
.settings-field input:not([type="color"]){width:100%;height:43px;box-sizing:border-box}
.color-input-wrap{display:flex;align-items:center;gap:12px;min-height:43px;padding:7px 10px;border:1px solid rgba(255,255,255,.12);border-radius:11px;background:rgba(255,255,255,.03)}
.color-input-wrap input[type="color"]{width:58px;height:34px;padding:2px;border:0;background:transparent}
.color-input-wrap small{opacity:.65}
.settings-upload-card{
    position:relative;display:grid;align-content:start;gap:7px;min-height:155px;
    padding:16px;border:1px dashed rgba(255,255,255,.18);border-radius:15px;
    background:rgba(255,255,255,.025);cursor:pointer;box-sizing:border-box;
}
.settings-upload-card:hover{border-color:var(--tenant-primary,#d7a63d)}
.settings-upload-card>small{opacity:.62;font-size:.76rem}
.settings-upload-card input[type="file"]{position:absolute;opacity:0;pointer-events:none}
.settings-file-button{display:inline-flex;align-items:center;justify-content:center;width:max-content;margin-top:5px;padding:8px 12px;border-radius:9px;background:var(--tenant-primary,#d7a63d);color:#17120a;font-weight:900;font-size:.8rem}
.settings-preview-box{display:flex;align-items:center;justify-content:center;min-height:68px;margin-top:5px;padding:8px;border-radius:10px;background:rgba(0,0,0,.18)}
.settings-preview-box .setting-preview{margin:0;max-width:190px;max-height:68px}
.favicon-preview-box .setting-preview{max-width:48px;max-height:48px}
.settings-submit-bar{
    position:sticky;bottom:10px;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:12px 15px;border:1px solid rgba(255,255,255,.13);border-radius:15px;
    background:rgba(18,20,24,.94);box-shadow:0 12px 30px rgba(0,0,0,.25);backdrop-filter:blur(12px)
}
.settings-submit-bar span{opacity:.7;font-size:.82rem}
.settings-submit-bar button{min-width:160px;margin:0}
html[data-theme="light"] .settings-section-header{border-bottom-color:rgba(0,0,0,.08);background:rgba(0,0,0,.025)}
html[data-theme="light"] .settings-upload-card,html[data-theme="light"] .color-input-wrap{border-color:rgba(0,0,0,.13);background:rgba(0,0,0,.02)}
html[data-theme="light"] .settings-submit-bar{background:rgba(255,255,255,.94);border-color:rgba(0,0,0,.12)}
@media(max-width:760px){
    .settings-fields-two,.settings-upload-grid{grid-template-columns:1fr}
    .settings-submit-bar{align-items:stretch;flex-direction:column}
    .settings-submit-bar button{width:100%}
}

/* نسخه 76.23 — کارت‌های عمودی فشرده؛ ۸ کارت در هر ردیف دسکتاپ */
body:has(.products-grid) .page{
    width:min(1920px,calc(100% - 18px)) !important;
    max-width:1920px !important;
    padding-inline:9px !important;
}
.products-grid{
    display:grid !important;
    grid-template-columns:repeat(8,minmax(0,1fr)) !important;
    align-items:start !important;
    gap:7px !important;
    overflow:visible !important;
}
.products-grid .product-card{
    width:auto !important;
    min-width:0 !important;
    min-height:0 !important;
    display:flex !important;
    flex-direction:column !important;
    flex-wrap:nowrap !important;
    align-items:stretch !important;
    gap:3px !important;
    padding:7px !important;
    border-radius:10px !important;
    box-sizing:border-box !important;
}
.products-grid .product-card > label{
    flex:none !important;
    width:100% !important;
    margin:1px 0 0 !important;
    font-size:.66rem !important;
    line-height:1.15 !important;
    white-space:normal !important;
}
.products-grid .product-card > input:not([type="hidden"]),
.products-grid .product-card > select{
    flex:none !important;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    height:29px !important;
    min-height:29px !important;
    margin:0 !important;
    padding:3px 6px !important;
    font-size:.72rem !important;
    border-radius:7px !important;
    box-sizing:border-box !important;
}
.products-grid .product-card > .raw-price-control{
    flex:none !important;
    width:100% !important;
    max-width:none !important;
    height:29px !important;
    min-height:29px !important;
    margin:0 !important;
    gap:2px !important;
}
.products-grid .raw-price-control input.money-input{
    height:29px !important;
    min-height:29px !important;
    padding:2px 4px !important;
    font-size:.71rem !important;
}
.products-grid .raw-price-control .price-arrow{
    width:25px !important;
    min-width:25px !important;
    height:29px !important;
    min-height:29px !important;
    padding:0 !important;
    font-size:.62rem !important;
}
.products-grid .product-card > .derived-box{
    flex:none !important;
    width:100% !important;
    max-width:none !important;
    min-height:0 !important;
    margin:0 !important;
    padding:5px 6px !important;
    gap:1px !important;
    border-radius:7px !important;
}
.products-grid .derived-box span,
.products-grid .derived-box small{
    font-size:.6rem !important;
    line-height:1.15 !important;
}
.products-grid .derived-box strong{
    font-size:.72rem !important;
    line-height:1.2 !important;
}
.products-grid .product-card > .checks{
    flex:none !important;
    width:100% !important;
    display:grid !important;
    grid-template-columns:1fr !important;
    align-items:center !important;
    justify-content:stretch !important;
    gap:2px !important;
    margin:1px 0 0 !important;
    padding:4px 5px !important;
    border-radius:7px !important;
    box-sizing:border-box !important;
}
.products-grid .checks label{
    margin:0 !important;
    font-size:.62rem !important;
    line-height:1.15 !important;
    white-space:nowrap !important;
}
.products-grid .checks input[type="checkbox"]{
    width:13px !important;
    height:13px !important;
    margin:0 0 0 3px !important;
}
.products-grid .product-card > .calculated-prices{
    flex:none !important;
    width:100% !important;
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:3px !important;
    margin:1px 0 0 !important;
}
.products-grid .calculated-prices > div{
    min-height:0 !important;
    padding:4px 5px !important;
    border-radius:7px !important;
}
.products-grid .calculated-prices span{
    font-size:.59rem !important;
    line-height:1.1 !important;
}
.products-grid .calculated-prices strong{
    font-size:.69rem !important;
    line-height:1.15 !important;
    white-space:nowrap !important;
}
.products-grid .product-card > .product-telegram-toggle,
.products-grid .product-card > .system-product-note{
    flex:none !important;
    width:100% !important;
    margin:1px 0 0 !important;
    padding:5px !important;
    font-size:.59rem !important;
    line-height:1.2 !important;
    border-radius:7px !important;
    box-sizing:border-box !important;
}
.products-grid .product-card > .delete-product-btn{
    flex:none !important;
    width:100% !important;
    min-height:28px !important;
    height:28px !important;
    margin:1px 0 0 !important;
    padding:3px 6px !important;
    font-size:.66rem !important;
    border-radius:7px !important;
}
.products-grid .product-card .product-help{
    flex:none !important;
    width:100% !important;
    margin:0 !important;
    font-size:.57rem !important;
    line-height:1.15 !important;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
@media(max-width:1650px){.products-grid{grid-template-columns:repeat(6,minmax(0,1fr)) !important}}
@media(max-width:1250px){.products-grid{grid-template-columns:repeat(4,minmax(0,1fr)) !important}}
@media(max-width:820px){.products-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}}
@media(max-width:520px){.products-grid{grid-template-columns:1fr !important}}

/* نسخه 76.25 — بازچینی منوی پنل مدیریت مادر */
.admin-nav-group > summary {
    font-weight: 700;
}
.admin-nav-nested {
    width: 100%;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 4px;
}
.admin-nav-nested > summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 7px;
    white-space: nowrap;
}
.admin-nav-nested > summary::-webkit-details-marker { display: none; }
.admin-nav-nested > summary::after { content: ' ◂'; font-size: .75em; }
.admin-nav-nested[open] > summary::after { content: ' ▾'; }
.admin-nav-layout-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px 0 0;
}
.admin-nav-layout-actions button {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border-radius: 7px;
    text-align: right;
    font-size: .85rem;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.admin-nav-layout-actions button.is-active {
    border-color: rgba(240,193,78,.75);
    box-shadow: inset 0 0 0 1px rgba(240,193,78,.18);
}
.admin-vertical-menu .admin-nav-nested {
    position: static;
    border-color: rgba(255,255,255,.08);
}
.admin-vertical-menu .admin-nav-nested > summary,
.admin-vertical-menu .admin-nav-layout-actions button {
    color: #edf2f8;
    background: #141c27;
    border-color: rgba(255,255,255,.06);
}
#new-admin,
#manage-admins,
#new-agency {
    scroll-margin-top: 95px;
}


/* V76.29 - readable admin request popup in both themes */
.admin-trade-popup,
.admin-trade-popup .popup-details strong,
.admin-trade-popup .popup-countdown { color:#f7f7f7 !important; }
.admin-trade-popup .popup-details span { color:#c8c8c8 !important; }
.admin-trade-popup .popup-title strong { color:#f0c14e !important; }
html[data-theme="light"] .admin-trade-popup,
body[data-theme="light"] .admin-trade-popup {
    background:#ffffff !important;
    border-color:#c8c8c8 !important;
    box-shadow:0 12px 35px rgba(0,0,0,.22) !important;
}
html[data-theme="light"] .admin-trade-popup .popup-details>div,
body[data-theme="light"] .admin-trade-popup .popup-details>div {
    background:#f3f4f6 !important;
    border-color:#d4d7dc !important;
}
html[data-theme="light"] .admin-trade-popup .popup-details strong,
html[data-theme="light"] .admin-trade-popup .popup-countdown,
body[data-theme="light"] .admin-trade-popup .popup-details strong,
body[data-theme="light"] .admin-trade-popup .popup-countdown { color:#181818 !important; }
html[data-theme="light"] .admin-trade-popup .popup-details span,
body[data-theme="light"] .admin-trade-popup .popup-details span { color:#555 !important; }
.report-mark-unavailable{display:inline-block;min-width:18px;color:#888;font-weight:700}


/* =========================================================
   V76.31 — اصلاح قطعی کارت قیمت فردایی و تایپوگرافی پنل زیرمجموعه
   ========================================================= */
.customer-luxe-body,
.customer-luxe-body button,
.customer-luxe-body input,
.customer-luxe-body select,
.customer-luxe-body textarea,
.customer-luxe-body table,
.customer-luxe-body th,
.customer-luxe-body td,
.customer-luxe-body a,
.customer-luxe-body span,
.customer-luxe-body small,
.customer-luxe-body strong,
.customer-luxe-body label,
.customer-luxe-body p,
.customer-luxe-body h1,
.customer-luxe-body h2,
.customer-luxe-body h3,
.customer-luxe-body h4 {
    font-family:var(--eshmesh-font) !important;
}

/* اندازه‌های کارت قیمت عین ظاهر پنل مادر */
.customer-luxe-page #market-grid .trade-btn {
    min-height:66px !important;
    padding:6px 5px !important;
}
.customer-luxe-page #market-grid .trade-btn .live-price {
    display:block !important;
    font-family:var(--eshmesh-number-font) !important;
    font-size:21px !important;
    line-height:1.22 !important;
    font-weight:900 !important;
    letter-spacing:0 !important;
    font-variant-numeric:tabular-nums;
    font-feature-settings:"tnum" 1;
}
.customer-luxe-page #market-grid .trade-btn .derived-price-card {
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:calc(100% - 10px) !important;
    min-height:22px !important;
    margin:5px auto 0 !important;
    padding:3px 7px !important;
    gap:5px !important;
    border-radius:7px !important;
    box-sizing:border-box !important;
}
.customer-luxe-page #market-grid .trade-btn .derived-price-label,
.customer-luxe-page #market-grid .trade-btn .derived-price {
    font-family:var(--eshmesh-number-font) !important;
    font-size:11px !important;
    line-height:1.2 !important;
    font-weight:800 !important;
    white-space:nowrap !important;
}
.customer-luxe-page #market-grid .trade-btn .derived-price {
    display:inline-block !important;
    margin:0 !important;
    color:#fff !important;
    opacity:1 !important;
    letter-spacing:0 !important;
}
.customer-luxe-page .market-product-title {
    font-family:var(--eshmesh-font) !important;
    font-size:15px !important;
    line-height:1.5 !important;
    font-weight:900 !important;
}
.customer-luxe-page .market-category-columns-header > div {
    font-family:var(--eshmesh-font) !important;
    font-size:13px !important;
    font-weight:800 !important;
}
.customer-luxe-page .market-category-title {
    font-family:var(--eshmesh-font) !important;
    font-size:16px !important;
}

@media(max-width:520px){
    .customer-luxe-page #market-grid .trade-btn {
        min-height:58px !important;
        padding:5px 3px !important;
    }
    .customer-luxe-page #market-grid .trade-btn .live-price {
        font-size:17px !important;
    }
    .customer-luxe-page #market-grid .trade-btn .derived-price-card {
        width:calc(100% - 6px) !important;
        min-height:19px !important;
        margin-top:4px !important;
        padding:2px 4px !important;
        gap:3px !important;
    }
    .customer-luxe-page #market-grid .trade-btn .derived-price-label,
    .customer-luxe-page #market-grid .trade-btn .derived-price {
        font-size:9px !important;
    }
    .customer-luxe-page .market-product-title {
        font-size:12px !important;
    }
    .customer-luxe-page .market-category-columns-header > div {
        font-size:10px !important;
    }
}

/* نسخه 76.44: هدر فشرده و یک‌خطی پنل مدیریت مادر */
#admin-horizontal-menu.admin-horizontal-menu{
    min-height:58px!important;
    height:auto!important;
    padding:7px 18px!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:12px!important;
    box-sizing:border-box!important;
}
#admin-horizontal-menu.admin-horizontal-menu>div{
    display:flex!important;
    flex:1 1 auto!important;
    min-width:0!important;
    align-items:center!important;
    gap:12px!important;
    flex-wrap:nowrap!important;
}
#admin-horizontal-menu.admin-horizontal-menu>div>strong{
    flex:0 0 auto!important;
    margin:0!important;
    white-space:nowrap!important;
    line-height:1.1!important;
}
#admin-horizontal-menu.admin-horizontal-menu>div>small{
    flex:0 0 auto!important;
    display:block!important;
    margin:0!important;
    white-space:nowrap!important;
    line-height:1.1!important;
    font-size:.72rem!important;
}
#admin-horizontal-links{
    display:flex!important;
    flex:1 1 auto!important;
    min-width:0!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:3px!important;
    overflow:visible!important;
}
#admin-horizontal-links>a,
#admin-horizontal-links>.admin-nav-group,
#admin-horizontal-links>.theme-toggle{
    flex:0 0 auto!important;
    margin:0!important;
}
#admin-horizontal-links>a,
#admin-horizontal-links>.admin-nav-group>summary,
#admin-horizontal-links>.theme-toggle{
    min-height:34px!important;
    padding:6px 8px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
}
#admin-horizontal-menu.admin-horizontal-menu>form{
    flex:0 0 auto!important;
    margin:0!important;
}
#admin-horizontal-menu.admin-horizontal-menu>form button{
    min-height:34px!important;
    padding:6px 11px!important;
    margin:0!important;
}

/* جستجوی جدول معاملات: hidden باید بر display ردیف غلبه کند. */
table[data-column-filter-table] tbody tr[hidden]{display:none!important}

@media(max-width:1350px){
    #admin-horizontal-menu.admin-horizontal-menu{padding:6px 10px!important;gap:7px!important}
    #admin-horizontal-menu.admin-horizontal-menu>div{gap:7px!important}
    #admin-horizontal-links{gap:1px!important}
    #admin-horizontal-links>a,
    #admin-horizontal-links>.admin-nav-group>summary,
    #admin-horizontal-links>.theme-toggle{padding:5px 6px!important;font-size:.82rem!important}
    #admin-horizontal-menu.admin-horizontal-menu>div>small{display:none!important}
}
@media(max-width:999px){
    #admin-horizontal-menu.admin-horizontal-menu{min-height:52px!important;flex-wrap:wrap!important}
    #admin-horizontal-menu.admin-horizontal-menu>div{flex-wrap:wrap!important}
    #admin-horizontal-links{width:100%!important;overflow-x:auto!important;overflow-y:visible!important}
}

/* V80.02 - trades date range */
.trades-date-range-form{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:0 0 14px;padding:12px;background:#202020;border:1px solid #3d3d3d;border-radius:10px}
.trades-date-range-form label{display:grid;gap:5px;min-width:170px}.trades-date-range-form input{direction:ltr;text-align:center}.trades-date-range-form .clear-date-range{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 12px;background:#444;border-radius:7px}
html[data-theme="light"] .trades-date-range-form{background:#fff;border-color:#ccd2d8}html[data-theme="light"] .trades-date-range-form .clear-date-range{background:#e8ebef;color:#172033}
@media(max-width:650px){.trades-date-range-form{display:grid;grid-template-columns:1fr}.trades-date-range-form label{min-width:0}.trades-date-range-form .gold,.trades-date-range-form .clear-date-range{width:100%}}

/* 81.47: direction belongs to the quote, independent of buy/sell button color. */
#market-grid .price-direction {
    display: inline-block;
    margin-inline-start: .3em;
    font-family: Arial, sans-serif;
    font-size: 1.1em;
    font-weight: 900;
    line-height: 1;
    vertical-align: middle;
}
#market-grid .price-direction-up { color: #16a34a; }
#market-grid .price-direction-down { color: #ef4444; }

/* =========================================================
   v81.59 — طرح جدید منوی موبایل پنل مشتری (منوی شناور پایین)
   فقط وقتی body.customer-nav-v2 دارد *و* عرض صفحه موبایل است فعال
   می‌شود؛ در غیر این صورت (کلید خاموش، یا دسکتاپ) هیچ‌چیز تغییر نمی‌کند.
   ========================================================= */

.customer-floating-nav { display:none; }

.customer-profile-card {
    display:flex;align-items:center;gap:14px;
    background:var(--luxe-surface);
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;padding:16px;margin-bottom:14px;
}
.customer-profile-avatar {
    width:48px;height:48px;border-radius:50%;flex:0 0 auto;
    display:grid;place-items:center;font-weight:800;font-size:18px;
    color:#15100a;
    background:linear-gradient(145deg,#f2d985,#b77c20);
}
.customer-profile-identity { display:flex;flex-direction:column;gap:4px;overflow:hidden; }
.customer-profile-identity strong { color:#fff;font-size:15px; }
.customer-profile-identity small { color:var(--luxe-muted);font-size:12px; }

.customer-profile-menu {
    background:var(--luxe-surface);
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;overflow:hidden;margin-bottom:14px;
}
.customer-profile-item {
    display:flex;align-items:center;width:100%;
    padding:15px 16px;border:0;background:transparent;
    border-bottom:1px solid rgba(255,255,255,.06);
    color:var(--luxe-text);font-family:inherit;font-size:13.5px;font-weight:600;
    text-align:right;cursor:pointer;
}
.customer-profile-item:last-child { border-bottom:0; }
.customer-profile-item:hover { background:var(--luxe-surface-2); }

.customer-profile-logout-form { margin:0; }
.customer-profile-logout-btn {
    width:100%;padding:14px;border-radius:16px;
    background:rgba(200,63,88,.12);border:1px solid rgba(200,63,88,.35);
    color:#f3a2b1;font-family:inherit;font-size:13.5px;font-weight:700;cursor:pointer;
}
.customer-profile-logout-btn:hover { background:rgba(200,63,88,.2); }

@media (max-width:760px) {
    body.customer-nav-v2 .customer-luxe-tabs { display:none !important; }
    body.customer-nav-v2 .customer-header-actions .customer-user-chip,
    body.customer-nav-v2 .customer-header-actions .customer-password-btn,
    body.customer-nav-v2 .customer-header-actions form { display:none !important; }
    body.customer-nav-v2 .customer-header-actions { min-width:auto;gap:0; }
    body.customer-nav-v2 .customer-luxe-topbar .theme-toggle {
        min-height:34px;min-width:34px;padding:0 !important;
        border-radius:999px !important;display:grid !important;place-items:center;
    }
    body.customer-nav-v2 .customer-development-footer { display:none; }
    body.customer-nav-v2 .customer-luxe-page { padding-bottom:132px !important; }

    body.customer-nav-v2 .customer-floating-nav {
        display:block;position:fixed;left:12px;right:12px;
        bottom:calc(12px + env(safe-area-inset-bottom, 0px));
        z-index:200;background:rgba(16,23,34,.96);
        border:1px solid rgba(255,255,255,.08);border-radius:22px;
        box-shadow:0 16px 40px rgba(0,0,0,.5);backdrop-filter:blur(18px);
        overflow:hidden;
    }
    .customer-floating-nav-items { display:flex;align-items:stretch;padding:7px 5px 3px; }
    .customer-floating-nav-item {
        flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;
        padding:6px 2px;border:0;background:transparent;border-radius:14px;
        color:#8b97a8;font-family:inherit;font-size:10.5px;font-weight:600;cursor:pointer;
    }
    .customer-floating-nav-item.active {
        color:#160f06;
        background:linear-gradient(135deg,#f1d083,#c88d2e);
    }
    .customer-floating-nav-item svg { width:19px;height:19px; }
    .customer-floating-nav-credit {
        border-top:1px solid rgba(255,255,255,.06);
        padding:5px 0;text-align:center;
    }
    .customer-floating-nav-credit a { font-size:9.5px;color:#5d6676; }
}
