/* =====================================================================
   ڕووکاری تاریک (Dark Mode)
   بە  <html data-theme="dark">  چالاک دەبێت — دوگمەی 🌙 لە باری سەرەوە.
   هەڵبژاردنەکە لەسەر هەر کۆمپیوتەرێک جیا هەڵدەگیرێت (localStorage).
   لاپەڕەکانی چاپ هەمیشە ڕووناکن.
   ===================================================================== */

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

    --navy:        #16223b;
    --navy-dark:   #0f1829;
    --navy-light:  #22324f;
    --navy-hover:  #2b3e63;

    --bg:          #11151d;
    --bg-soft:     #1b2130;
    --bg-card:     #171d29;
    --border:      #2a3344;
    --border-dark: #384357;
    --line:        #2a3344;

    --text:        #e3e8f1;
    --text-soft:   #98a4b8;
    --text-invert: #ffffff;

    --success:     #3fcb86;
    --success-bg:  #12291d;
    --danger:      #f06464;
    --danger-bg:   #331a1d;
    --warning:     #f0b429;
    --warning-bg:  #33290f;
    --info:        #56a9f0;
    --info-bg:     #12263a;

    --row-pink:    #2e2126;
    --row-pink-alt:#34252b;
    --shadow:      0 1px 3px rgba(0, 0, 0, .45);
    --shadow-lg:   0 6px 22px rgba(0, 0, 0, .55);

    --pos-row-bg:  #2a2027;
    --pos-sel-bg:  #4a2a33;
}

html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] ::placeholder { color: #6f7b8f; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { color: var(--text); }
html[data-theme="dark"] .inp:focus { border-color: #4a6fb0; }
html[data-theme="dark"] table.tbl tbody tr:nth-child(even) { background: var(--bg-soft); }
html[data-theme="dark"] table.tbl tbody tr:hover { background: #222b3c; }
html[data-theme="dark"] table.tbl-maroon tbody tr:nth-child(even) { background: var(--bg-soft); }
html[data-theme="dark"] table.tbl-maroon tbody tr:hover { background: #222b3c; }
html[data-theme="dark"] table.tbl-items tbody tr:nth-child(even) { background: var(--bg-soft); }
html[data-theme="dark"] tr[style*="#e9e9e9"], html[data-theme="dark"] tr[style*="#eef4ff"], html[data-theme="dark"] tr[style*="#e8f7ef"] { background: var(--bg-soft) !important; }
html[data-theme="dark"] img.item-thumb, html[data-theme="dark"] .pi-img { background-color: var(--bg-soft); }
html[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] hr { border-color: var(--border); }
html[data-theme="dark"] .text-soft { color: var(--text-soft) !important; }
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334055; border-radius: 6px; }

/* ---- دوگمەی گۆڕینی ڕووکار ---- */
.theme-toggle { font-size: 15px; line-height: 1; }
.theme-toggle .t-dark { display: inline; }
.theme-toggle .t-light { display: none; }
html[data-theme="dark"] .theme-toggle .t-dark { display: none; }
html[data-theme="dark"] .theme-toggle .t-light { display: inline; }

/* ---- خۆکارانە دروستکراو لە ڕەنگە ڕووناکەکانی app.css / pos.css ---- */
html[data-theme="dark"] [style*="color:var(--navy)"] { color: #9fbcf0 !important; }

/* ---- assets/css/app.css ---- */
html[data-theme="dark"] .bf-name{color:#9fbcf0}
html[data-theme="dark"] table.tbl{background:var(--bg-card)}
html[data-theme="dark"] table.tbl tbody tr:hover{background:var(--bg-soft)}
html[data-theme="dark"] .inp, html[data-theme="dark"] select.inp, html[data-theme="dark"] textarea.inp{background:var(--bg-card)}
html[data-theme="dark"] .btn-light{background:var(--bg-card)}
html[data-theme="dark"] .alert-success{color:#78e3ad}
html[data-theme="dark"] .alert-danger{color:#e37777}
html[data-theme="dark"] .alert-warning{color:#f9ca62}
html[data-theme="dark"] .alert-info{color:#6db1ee}
html[data-theme="dark"] .badge-warning{color:#f8d463}
html[data-theme="dark"] .pager a, html[data-theme="dark"] .pager span{background:var(--bg-card)}
html[data-theme="dark"] .modal{background:var(--bg-card)}
html[data-theme="dark"] .err-box{background:var(--bg-card)}
html[data-theme="dark"] .text-navy{color:#9fbcf0 !important}
html[data-theme="dark"] table.tbl-maroon tbody tr{background:var(--bg-card)}
html[data-theme="dark"] table.tbl-maroon tbody tr:nth-child(even){background:var(--bg-soft)}
html[data-theme="dark"] table.tbl-maroon tbody tr:hover{background:var(--bg-soft)}
html[data-theme="dark"] table.tbl-maroon td{border-color:var(--border)}
html[data-theme="dark"] table tbody tr.row-debt:hover{background:#2e313e !important}
html[data-theme="dark"] table tbody tr.row-debt td{border-color:var(--border)}
html[data-theme="dark"] table.tbl-yellow tbody tr:hover{background:#2e3435}
html[data-theme="dark"] table.tbl-yellow td{border-color:var(--border)}
html[data-theme="dark"] .search-row{background:var(--bg-card)}
html[data-theme="dark"] .sum-panel{background:var(--bg-soft)}
html[data-theme="dark"] .sum-panel .sum-box{background:var(--bg-card)}
html[data-theme="dark"] .profile-head .ph-actions{border-top:1px solid var(--border)}
html[data-theme="dark"] .tabs .tab:hover{color:#9fbcf0}
html[data-theme="dark"] .tabs .tab.active{color:#9fbcf0}
html[data-theme="dark"] .msg{background:var(--bg-card)}
html[data-theme="dark"] .msg.unread{background:var(--bg-soft)}
html[data-theme="dark"] .denom{background:var(--bg-card)}
html[data-theme="dark"] table#priceTable input.price-in.edited{background:#303540}
html[data-theme="dark"] table#priceTable tbody tr:has(.row-check:checked){background:#2d3543 !important}
html[data-theme="dark"] .tb-branch{border:1px solid var(--border)}
html[data-theme="dark"] .sb-branch .inp{border:1px solid var(--border);background:var(--bg-card);color:var(--text)}
html[data-theme="dark"] .tb-btn.back{border:1px solid var(--border)}
html[data-theme="dark"] .reset-opt:hover{background:var(--bg-soft)}
html[data-theme="dark"] .ab-hero img{background:var(--bg-card)}
html[data-theme="dark"] .ab-ver{border:1px solid var(--border)}
html[data-theme="dark"] .ask-box > svg{color:#9fbcf0}
html[data-theme="dark"] .ask-period{border:1px solid var(--border)}
html[data-theme="dark"] .ask-value{color:#9fbcf0}
html[data-theme="dark"] .ai-advice .ai-t{color:#a174e6}
html[data-theme="dark"] .bc-preview{background:var(--bg-card)}
html[data-theme="dark"] table#bcTable tbody tr.sel td{background:#30343e !important}
html[data-theme="dark"] .shelf-label{background:var(--bg-card);color:var(--text)}
html[data-theme="dark"] .sl-shop{color:var(--text-soft)}
html[data-theme="dark"] .sl-foot{color:var(--text-soft);border-top:1px dashed var(--border)}
html[data-theme="dark"] .pc-card{background:var(--bg-card);color:var(--text)}
html[data-theme="dark"] .pc-price{color:#63d38f}
html[data-theme="dark"] .pc-sub{color:var(--text-soft)}
html[data-theme="dark"] .itm-wsale-toggle{background:var(--bg-soft, var(--bg-soft));border:1px solid var(--line, var(--border))}
html[data-theme="dark"] .iinfo{background:var(--bg-card)}
html[data-theme="dark"] .iinfo-body hr{border-top:1px solid var(--line,var(--border))}
html[data-theme="dark"] .iinfo-img{background:var(--bg-soft,var(--bg-soft))}
html[data-theme="dark"] .iinfo-row > span{color:var(--text-soft)}
html[data-theme="dark"] .iinfo-row.good > b{color:#63d38f}
html[data-theme="dark"] .iinfo-row.bad  > b{color:#ea7171}
html[data-theme="dark"] .iinfo-bcs span{background:var(--bg-soft,var(--bg-soft));border:1px solid var(--line,var(--border))}
html[data-theme="dark"] .iinfo-wait{color:var(--text-soft)}
html[data-theme="dark"] .tag-ext{background:#303540;color:#ffbc5c;border:1px solid var(--border)}
html[data-theme="dark"] .ip-results{border:1px solid var(--line,var(--border));background:var(--bg-card)}
html[data-theme="dark"] .ip-row{border-bottom:1px solid var(--line,var(--border))}
html[data-theme="dark"] .ip-row:hover{background:var(--bg-soft,var(--bg-soft))}
html[data-theme="dark"] .ip-row .ip-c{color:var(--text-soft)}
html[data-theme="dark"] .ip-row .ip-p{color:#63d38f}
html[data-theme="dark"] .ip-none{color:var(--text-soft)}
html[data-theme="dark"] .cell-time{background:var(--bg-soft,var(--bg-soft));color:var(--text-soft)}
html[data-theme="dark"] .fuzzy-note{background:#303540;color:#ffc65c;border:1px solid var(--border)}
html[data-theme="dark"] .tbl-items tr.editing .qe-inp{background:var(--bg-card)}
html[data-theme="dark"] .tbl-items tr.editing{background:var(--bg-soft) !important}
html[data-theme="dark"] .tbl-items .btn-icon.qe-save{color:#78e29e}
html[data-theme="dark"] .tbl-items .btn-icon.qe-cancel{color:#e07b7b}
html[data-theme="dark"] .rc-parts-head{color:#eda3a3}
html[data-theme="dark"] .itf-note b{color:#9fbcf0}
html[data-theme="dark"] .itf-cost-note{color:#eda3a3}
html[data-theme="dark"] .ptbl td .inp.manual{background:#303540}
html[data-theme="dark"] .tcfg-h{color:#9fbcf0}
html[data-theme="dark"] #auTable tr.au-flash td{background:#30353c !important}
/* ---- assets/css/pos.css ---- */
html[data-theme="dark"] .pos-bar{background:var(--bg-card)}
html[data-theme="dark"] .pos-tabs{background:var(--bg-card)}
html[data-theme="dark"] .pos-tabs .tab.active{background:var(--bg-card);color:#9fbcf0}
html[data-theme="dark"] table.cart-tbl td{border-bottom:1px solid var(--border)}
html[data-theme="dark"] table.cart-tbl tbody tr.sel{background:var(--pos-sel-bg, #2f313e)}
html[data-theme="dark"] table.cart-tbl .cell-inp:hover{background:var(--bg-card)}
html[data-theme="dark"] table.cart-tbl .cell-inp:focus{background:var(--bg-card)}
html[data-theme="dark"] table.cart-tbl .cell-inp[data-f="price"]{color:#eda3a3}
html[data-theme="dark"] .pos-side{background:var(--bg-soft)}
html[data-theme="dark"] .pos-grid .pitem{background:var(--bg-card)}
html[data-theme="dark"] .pos-grid .pitem .pi-price{color:#63d38f}
html[data-theme="dark"] .pos-bottom{background:var(--bg-card)}
html[data-theme="dark"] .notes-grid button{background:var(--bg-card)}
html[data-theme="dark"] .lookup-list .lu:hover, html[data-theme="dark"] .lookup-list .lu.sel{background:var(--bg-soft)}
html[data-theme="dark"] .lookup-list .lu .pr{color:#63d38f}
html[data-theme="dark"] table.cart-tbl .unit-sel:hover{background:var(--bg-card)}
html[data-theme="dark"] table.cart-tbl .unit-sel:focus{background:var(--bg-card)}
html[data-theme="dark"] .pos-bar .rate-btn:hover{background:var(--bg-card)}
html[data-theme="dark"] .rate-preview b{color:#63d38f}
html[data-theme="dark"] .pt-branch, html[data-theme="dark"] .pt-shift{border:1px solid var(--border)}
html[data-theme="dark"] .bc-suggest{background:var(--bg-card);color:var(--text);border:1px solid var(--border)}
html[data-theme="dark"] .bc-suggest .bs{border-bottom:1px solid var(--border)}
html[data-theme="dark"] .bc-suggest .bs.on{background:var(--bg-soft)}
html[data-theme="dark"] .bc-suggest .bs .cd{color:var(--text-soft)}
html[data-theme="dark"] .bc-suggest .bs .pr{color:#f0886b}
html[data-theme="dark"] .bc-suggest .bs-empty{color:#e47777}
html[data-theme="dark"] .pos-bar .ss-btn{background:var(--bg-card);color:var(--text);border:1px solid var(--border)}
html[data-theme="dark"] .pos-bar .ss-panel{color:var(--text)}
html[data-theme="dark"] .stock-warn .sw-item{background:var(--bg-soft);color:#e57575}
html[data-theme="dark"] .stock-warn .sw-grid > div{background:var(--bg-soft);border:1px solid var(--border)}
html[data-theme="dark"] .stock-warn .sw-grid span{color:var(--text-soft)}
html[data-theme="dark"] .stock-warn .sw-note{background:var(--bg-soft);color:#71b1ea}
html[data-theme="dark"] .ps-tools{background:var(--bg-card)}
html[data-theme="dark"] .pi-info{background:var(--bg-card);color:#9fbcf0}
html[data-theme="dark"] .ps-pager{background:var(--bg-card)}
html[data-theme="dark"] .dw-err{background:var(--bg-soft);color:#e57575}
html[data-theme="dark"] .ui-sub{color:#eda3a3}
html[data-theme="dark"] .ui-sw .ui-sw-x:hover{color:#eda3a3}
html[data-theme="dark"] .ui-range b{color:#9fbcf0}
html[data-theme="dark"] .pos-side .ps-head .ps-sort{border:1px solid var(--border)}
/* ---- assets/css/login.css ---- */
html[data-theme="dark"] .login-card{background:var(--bg-card)}
html[data-theme="dark"] .login-head h1{color:#9fbcf0}
html[data-theme="dark"] .login-foot .bf-name{color:#87a0d3}
html[data-theme="dark"] .login-foot .bf-tel, html[data-theme="dark"] .login-foot .bf-web{color:var(--text-soft)}
html[data-theme="dark"] .login-foot .bf-web{color:#71b1ea}

/* جۆری گواستنەوە — تاریک */
html[data-theme="dark"] .trf-kind{ background:var(--bg-card); border-color:var(--border); }
html[data-theme="dark"] .trf-kind .tk-txt small{ color:#9aa3b2; }
html[data-theme="dark"] .trf-kind.on{ background:#232833; border-color:#7d8db0; }
html[data-theme="dark"] .trf-kind.out.on{ background:#3a2326; border-color:#d64545; }
html[data-theme="dark"] .trf-kind.in.on { background:#1f3328; border-color:#2fb36a; }
html[data-theme="dark"] .trf-summary{ background:#232833; border-color:var(--border); }
html[data-theme="dark"] .trf-summary.out{ background:#3a2326; }
html[data-theme="dark"] .trf-summary.in { background:#1f3328; }
html[data-theme="dark"] .trf-summary .m, html[data-theme="dark"] .trf-tag.out, html[data-theme="dark"] .trf-kind.out em{ color:#ff8a8a; }
html[data-theme="dark"] .trf-summary .p, html[data-theme="dark"] .trf-tag.in, html[data-theme="dark"] .trf-kind.in em{ color:#6fdc9c; }
html[data-theme="dark"] .trf-tag{ background:#303540; color:#dfe4ee; }
html[data-theme="dark"] .trf-tag.out, html[data-theme="dark"] .trf-kind.out em{ background:#4a2629; }
html[data-theme="dark"] .trf-tag.in, html[data-theme="dark"] .trf-kind.in em{ background:#1e3d2b; }

/* دراو — تاریک */
html[data-theme="dark"] .m-usd{ color:#5fd896; }
html[data-theme="dark"] .cur-badge.usd{ background:#1e3d2b; color:#6fdc9c; }
html[data-theme="dark"] .cur-badge.iqd{ background:#303540; color:#c8cfdc; }
html[data-theme="dark"] .cur-fix{ background:#3a3220; border-color:#6b5a2a; color:#f2d68a; }
html[data-theme="dark"] .cur-fix.on{ background:#1f3328; border-color:#2f6a47; color:#9be3b8; }
