
        :root {
            --bg-color: #f8fafc;
            --surface: #ffffff;
            --primary: #2563eb;
            --success: #059669;
            --danger: #dc2626;
            --warning: #d97706;
            --dark: #0f172a;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border: #cbd5e1;
            --radius: 10px;
        }

        * { box-sizing: border-box; }

        body { 
            margin: 0; 
            padding: 0; 
            font-family: Tahoma, Arial, sans-serif; 
            background-color: #e2e8f0; 
            color: var(--text-main);
        }

        #app-wrapper {
            max-width: 1200px;
            margin: 0 auto;
            background-color: var(--bg-color);
            min-height: 100vh;
            box-shadow: 0 0 25px rgba(0,0,0,0.1);
            position: relative;
        }

        #top-bar {
            display: none; 
            justify-content: space-between; 
            align-items: center; 
            background: #0f172a; 
            padding: 10px 15px; 
            border-bottom: 1px solid #1e293b;
        }

        .tabs { 
            display: flex; 
            overflow-x: auto; 
            background: #0f172a; 
            padding: 10px; 
            gap: 8px; 
            justify-content: flex-start;
            position: sticky;
            top: 0;
            z-index: 100;
            white-space: nowrap;
        }
        @media(min-width: 900px) { .tabs { justify-content: center; } }
        .tabs::-webkit-scrollbar { height: 5px; }
        .tabs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.4); border-radius: 5px; }
        
        .tab-btn { 
            flex: 1; 
            max-width: 160px; 
            background: rgba(255,255,255,0.08); 
            color: #e2e8f0; 
            border: none; 
            padding: 12px 15px; 
            border-radius: 8px; 
            font-family: Tahoma; 
            font-size: 13px; 
            font-weight: bold; 
            cursor: pointer; 
            white-space: nowrap;
            transition: all 0.2s;
        }
        .tab-btn:hover { background: rgba(255,255,255,0.15); }
        .tab-btn.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }
        .tab-logout { background: var(--danger); color: white; max-width: 90px; }

        .tab-content { padding: 20px; display: none; margin: 0 auto; }
        .tab-content.active { display: block; }

        .split-layout { display: flex; gap: 20px; align-items: flex-start; }
        .form-panel { flex: 7; background: var(--surface); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
        .cart-panel { flex: 4; position: sticky; top: 75px; background: var(--surface); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
        
        .responsive-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; align-items: center; }
        
        @media(max-width: 900px) { 
            .split-layout { flex-direction: column; } 
            .form-panel, .cart-panel { width: 100%; flex: none; } 
            .cart-panel { position: relative; top: 0; } 
            .responsive-grid { grid-template-columns: 1fr; gap: 5px; } 
        }

        h2 { font-size: 16px; color: var(--dark); border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-top: 0; font-weight: 900; }
        
        input, select, textarea { 
            width: 100%; padding: 12px 15px; margin: 6px 0; 
            border: 2px solid var(--border); 
            border-radius: 8px; font-family: Tahoma; font-size: 14px; font-weight: bold;
            background-color: #ffffff; color: var(--dark);
            transition: all 0.2s;
        }
        input:focus, select:focus { 
            outline: none; border-color: var(--primary); background-color: #fff; 
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
        }
        .hardware-input { border: 2px solid var(--primary) !important; background-color: #eff6ff !important; font-size: 16px !important; text-align: center; }
        
        .custom-select-wrapper { position: relative; width: 100%; margin-top: 6px; user-select: none; }
        .custom-select-display {
            display: flex; justify-content: space-between; align-items: center;
            background: #ffffff; border: 2px solid var(--border); padding: 12px 15px;
            border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: bold; color: var(--dark);
            transition: all 0.2s;
        }
        .custom-select-display:hover, .custom-select-display:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
        .custom-select-options {
            position: absolute; top: 100%; left: 0; right: 0; background: #ffffff;
            border: 2px solid var(--primary); border-radius: 8px; margin-top: 4px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.15); z-index: 9999;
            display: none; max-height: 220px; overflow-y: auto;
        }
        .custom-option { padding: 12px 15px; border-bottom: 1px solid var(--bg-color); cursor: pointer; font-size: 13px; font-weight: bold; color: var(--dark); }
        .custom-option:hover { background: #eff6ff; color: var(--primary); }

        .input-group { display: flex; gap: 8px; margin: 4px 0; align-items: center; }
        .input-group input, .input-group select { margin: 0; flex: 1; }
        
        button { 
            width: 100%; color: white; padding: 12px 15px; border: none; border-radius: 8px; 
            font-size: 14px; font-weight: bold; cursor: pointer; font-family: Tahoma; margin-top: 8px; 
            display: inline-flex; justify-content: center; align-items: center; gap: 8px;
            transition: transform 0.1s, box-shadow 0.2s;
        }
        @keyframes scanErrPop { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:scale(1); } }
        button:active { transform: scale(0.98); }
        .btn-scan { background-color: var(--dark); width: auto; padding: 0 20px; margin-top: 0; }
        .btn-green { background: var(--success); }
        .btn-red { background: var(--danger); }
        .btn-blue { background: var(--primary); }
        .btn-amber { background: var(--warning); }
        .btn-add { background: var(--warning); margin-top:0; color: #fff; }
        
        .card, .settings-card { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 15px; border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.02); }

        .table-responsive { overflow-y: auto; overflow-x: auto; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; }
        table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
        th, td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--border); }
        th { background-color: #f1f5f9; color: var(--dark); font-weight: 900; position: sticky; top: 0; z-index: 5; border-bottom: 2px solid #cbd5e1; }
        .group-row:hover { background-color: #f8fafc; cursor: pointer; }
        .detail-row { display: none; background-color: #fefeff; }
        
        .dash-header { background: #0f172a; border-radius: 10px; padding: 20px; color: white; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2); }
        .dash-header h2 { color: white; border: none; font-size: 18px; margin: 0 0 6px 0; }
        .dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 20px; }
        .dash-card { background: var(--surface); padding: 15px; border-radius: 10px; border: 1px solid var(--border); position: relative; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.02);}
        .dash-card::before { content:''; position:absolute; top:0; right:0; width:5px; height:100%; background: var(--c, var(--primary)); }
        .dash-card h3 { margin: 0 0 8px 0; font-size: 12px; color: var(--text-muted); font-weight: bold; }
        .dash-card .val { font-size: 22px; font-weight: 900; color: var(--dark); }

        .dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-bottom: 20px; }
        @media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
        
        .recent-list { list-style: none; padding: 0; margin: 0; }
.recent-activity-row{padding:9px 0 !important;gap:10px;}
.recent-invoice-main{font-size:14px;font-weight:900;color:var(--primary);line-height:1.2;}
.recent-doc-sub{font-size:11px;font-weight:900;color:var(--text-main);margin-top:2px;}
.dashboard-recent-card{min-height:180px;}
@media(max-width:600px){.recent-invoice-main{font-size:13px}.recent-doc-sub{font-size:10px}.dashboard-recent-card{min-height:160px;}}
        .recent-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
        .badge { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: bold; color: #fff; }
        .badge.in { background-color: var(--success); }
        .badge.out { background-color: var(--danger); }
        .qty-primary { font-weight: 900 !important; font-size: 15px !important; color: var(--dark); }
        .qty-secondary { font-weight: 700 !important; font-size: 12px !important; color: var(--text-muted); }
        .qty-weight { font-weight: 600 !important; font-size: 11px !important; color: var(--text-muted); }
        .inline-filter-bar { display:grid; grid-template-columns: 1.5fr 1fr auto auto; gap:8px; align-items:center; }
        .inline-filter-bar button { margin:0; width:auto; white-space:nowrap; }
        .item-wh-select { width:auto !important; min-width:125px; padding:6px 8px !important; margin:0 !important; font-size:11px !important; font-weight:900 !important; }
        @media(max-width:800px){ .inline-filter-bar{grid-template-columns:1fr 1fr;} .inline-filter-bar button{width:100%;} }

        .live-info { color: var(--primary); font-size: 13px; min-height: 18px; margin-bottom: 10px; font-weight: bold; text-align: center; }
        .draft-list { background: #fffbeb; border: 1.5px dashed #f59e0b; padding: 15px; margin-top: 15px; border-radius: 8px; }
        .draft-list ul { padding-right: 20px; font-size: 13px; margin: 8px 0; font-weight: bold; }
        .draft-total { margin-top: 12px; font-weight: 900; color: #b45309; font-size: 16px; text-align: center; background: #fef3c7; padding: 12px; border-radius: 8px; border: 2px dashed #f59e0b; }
        
        .autocomplete-wrapper { position: relative; width: 100%; }
        .autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 2px solid var(--primary); border-radius: 8px; max-height: 200px; overflow-y: auto; z-index: 1000; display: none; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
        .autocomplete-item { padding: 10px 15px; border-bottom: 1px solid var(--bg-color); cursor: pointer; font-size: 13px; font-weight: bold; }
        .autocomplete-item:hover { background: #eff6ff; color: var(--primary); }
        
        .radio-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
        .radio-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; background: #fff; padding: 8px 15px; border-radius: 20px; border: 2px solid #cbd5e1; font-weight: bold; transition: all 0.2s; }
        .radio-label input { margin: 0; width: auto; }
        .radio-label:has(input:checked) { background-color: #eff6ff; border-color: var(--primary); color: #1e40af; }

        .req-box { padding: 15px; background: #f8fafc; border-radius: 10px; border: 1.5px solid var(--border); margin-top: 15px; }
        .req-item { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 10px 15px; margin-top: 8px; border-radius: 8px; font-size: 13px; border: 1px solid var(--border); box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
        .req-item.done { border-color: var(--success); background: #ecfdf5; }
/* پنجره قفل‌کننده هنگام آپلود با لودینگ درصد */
#upload-progress-overlay {
    display: none; position: fixed; inset: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.88); z-index: 99999;
    flex-direction: column; justify-content: center; align-items: center; padding: 20px;
}
.upload-progress-box {
    background: #ffffff; border-radius: 14px; padding: 25px 20px;
    width: 90%; max-width: 420px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); border: 2px solid var(--primary);
}
.progress-bar-bg {
    width: 100%; height: 16px; background: #e2e8f0; border-radius: 10px;
    overflow: hidden; margin: 15px 0 10px; position: relative;
}
.progress-bar-fill {
    height: 100%; width: 0%; background: linear-gradient(90deg, #2563eb, #059669);
    border-radius: 10px; transition: width 0.15s ease-out;
}

        /* فرم سفارش‌برداری دستی - سازگار با موبایل */
/* فرم سفارش‌برداری دستی - چیدمان مرتب و واکنش‌گرا */
.req-entry-row {
    display: grid !important;
    grid-template-columns: 3fr 1.2fr auto !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 8px !important;
}

.req-entry-row input {
    margin: 0 !important;
    height: 46px !important;
    box-sizing: border-box !important;
}

.req-entry-btn {
    width: auto !important;
    margin: 0 !important;
    height: 46px !important;
    padding: 0 22px !important;
    white-space: nowrap !important;
    flex: none !important;
}

@media(max-width: 700px) {
    .req-entry-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .req-entry-btn {
        width: 100% !important;
    }
}
        #login-overlay{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;background:#0f172a;z-index:9999;display:flex;justify-content:center;align-items:center;overflow:hidden;}
        .login-box{background:white;padding:30px 25px;border-radius:15px;width:90%;max-width:400px;text-align:center; box-shadow: 0 15px 35px rgba(0,0,0,0.3);}

        #scanner-modal{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.85);z-index:9999;flex-direction:column;justify-content:center;align-items:center;}
        #reader{width:90%;max-width:450px;background:white;border-radius:10px; overflow:hidden;}

        .modal-overlay { display:none; position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(0,0,0,0.85); z-index:9998; flex-direction:column; justify-content:center; align-items:center; }
        .modal-box { background:var(--bg-color); border-radius:12px; width:95%; max-width:850px; display:flex; flex-direction:column; max-height:90vh; overflow:hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
        .modal-header { background:var(--surface); display:flex; justify-content:space-between; align-items:center; border-bottom:1.5px solid var(--border); padding:15px 20px; }
        .modal-body { flex:1; overflow-y:auto; padding:20px; }
        
        #receiptImageDisplay { max-width:100%; max-height:100%; transform-origin:center center; transition:transform 0.1s; border-radius:8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

      
        #document-guide {
            position: absolute;
            top: 10%; left: 5%; right: 5%; bottom: 20%; 
            border: 3px dashed #10b981; 
            box-shadow: 0 0 0 4000px rgba(0,0,0,0.7); 
            border-radius: 8px; pointer-events: none; z-index: 5; display: flex; justify-content: center;
        }
        .guide-text {
            position: absolute; top: 15px; background: rgba(16, 185, 129, 0.95);
            color: white; padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: bold; font-family: Tahoma;
        }

        .camera-btn-container { position: absolute; bottom: 0; width: 100%; background: rgba(15, 23, 42, 0.9); padding: 25px; display: flex; justify-content: center; z-index: 10; }

        .settings-card { border-top: 4px solid var(--primary); }
        .scrollable-list { max-height: 250px; overflow-y: auto; margin-top: 12px; border: 2px solid var(--border); border-radius: 8px; padding: 10px; background: #f1f5f9; }
        .settings-list { list-style: none; padding: 0; margin: 0; }
        .settings-list li { 
            display: flex; justify-content: space-between; align-items: center; 
            padding: 12px 15px; margin-bottom: 6px; 
            background: #ffffff; border: 1px solid #cbd5e1; 
            border-radius: 6px; font-size: 14px; color: #0f172a; font-weight: 900;
            box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        }
        .del-btn { background: var(--danger); padding: 6px 12px; font-size: 11px; width: auto; margin:0; border-radius: 4px; box-shadow: none; }
        .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        @media(max-width:800px) { .two-col { grid-template-columns: 1fr; } }

        #printArea { display:none; width:100%; margin:0 !important; padding:0 !important; }
        @media print {
            @page { size:A4 portrait; margin:8mm; }
            html, body { background:#fff !important; margin:0 !important; padding:0 !important; min-height:0 !important; height:auto !important; overflow:visible !important; }
            body * { visibility:hidden !important; }
            #printArea, #printArea * { visibility:visible !important; }
            #printArea { position:absolute !important; left:0 !important; top:0 !important; width:100% !important; height:auto !important; min-height:0 !important; display:block !important; direction:rtl !important; margin:0 !important; padding:0 !important; overflow:visible !important; box-sizing:border-box !important; }
            #printArea > div { width:100% !important; margin:0 !important; padding:0 !important; }
            #printArea table { width:100% !important; border-collapse:collapse !important; page-break-inside:auto !important; break-inside:auto !important; }
            #printArea thead { display:table-header-group !important; }
            #printArea tr { page-break-inside:avoid !important; break-inside:avoid !important; }
            #printArea .print-header, #printArea .print-summary { break-inside:avoid !important; page-break-inside:avoid !important; }
            #printArea h1, #printArea h2, #printArea h3 { page-break-after:avoid !important; }
        }
    
/* Compact Documents & Cardex layout */
#tab-cardex { direction: rtl; }
#tab-cardex #cardexModeSelectorCard { padding: 7px 10px !important; margin-bottom: 8px !important; }
#tab-cardex #cardexModeSelectorCard .radio-group { margin: 0 !important; gap: 6px !important; }
#tab-cardex #cardexFilterCard { padding: 9px !important; margin-bottom: 8px !important; }
#tab-cardex #cardexFilterCard .radio-group { margin-bottom: 6px !important; gap: 5px !important; }
#tab-cardex #cardexFilterCard .responsive-grid { margin-bottom: 6px !important; gap: 7px !important; }
#tab-cardex #cardexFilterCard .btn-green { margin-top: 5px !important; padding: 8px 12px !important; }
#tab-cardex .cardex-main-table { max-height: calc(100vh - 235px) !important; min-height: 300px; overflow:auto; }
#tab-cardex .cardex-item-table { max-height: calc(100vh - 205px) !important; min-height: 300px; overflow:auto; }
#tab-cardex table { direction: rtl; width:100%; border-collapse: separate; border-spacing:0; }
#tab-cardex table thead th { position:sticky; top:0; z-index:3; white-space:nowrap; }
#tab-cardex #cardexItemView > .card { padding:9px !important; margin-bottom:8px !important; }
#tab-cardex #cardexItemView > .card .responsive-grid { margin-top:7px !important; gap:7px !important; }
#tab-cardex #cardexItemView .autocomplete-wrapper input { min-height:42px; }
@media (max-width: 700px) {
  #tab-cardex h2 { margin: 4px 0 8px !important; font-size:16px !important; }
  #tab-cardex .radio-label { padding:7px 9px !important; font-size:11px !important; }
  #tab-cardex #cardexFilterCard .responsive-grid { grid-template-columns: 1fr !important; }
  #tab-cardex #cardexFilterCard .btn-green { width:100% !important; }
  #tab-cardex .cardex-main-table { max-height: calc(100vh - 285px) !important; min-height:260px; }
  #tab-cardex .cardex-item-table { max-height: calc(100vh - 220px) !important; min-height:280px; }
  #tab-cardex table { min-width:760px; }
  #tab-cardex .table-responsive { -webkit-overflow-scrolling:touch; }
}


        /* چیدمان حرفه‌ای کنترل‌های خرده و کارتن بدون لیبل - مناسب موبایل */
        .dispatch-manual-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px;width:100%;box-sizing:border-box;align-items:stretch;}
        .dispatch-control-card{min-width:0;box-sizing:border-box;border-radius:10px;padding:9px;overflow:hidden;}
        .dispatch-control-row{display:flex;align-items:center;gap:7px;min-width:0;width:100%;box-sizing:border-box;}
        .dispatch-control-row label{flex:0 0 auto;white-space:nowrap;}
        .dispatch-control-row input,.dispatch-control-row select{box-sizing:border-box;min-width:0;margin:0;}
        .dispatch-loose-input{width:68px!important;min-width:68px!important;flex:0 0 68px!important;}
        .dispatch-control-btn{flex:0 0 auto!important;width:auto!important;min-width:78px!important;height:38px!important;padding:7px 10px!important;border:0;border-radius:7px;color:#fff;font-weight:900;white-space:nowrap;cursor:pointer;}
        .dispatch-manual-card{display:flex;flex-direction:column;gap:7px;}
        .dispatch-manual-select{display:block!important;width:100%!important;min-width:0!important;height:42px!important;padding:7px 10px!important;font-size:13px!important;border-radius:8px!important;box-sizing:border-box!important;}
        .dispatch-manual-entry{display:flex;align-items:center;gap:7px;width:100%;min-width:0;box-sizing:border-box;}
        .dispatch-manual-qty{width:72px!important;min-width:72px!important;flex:0 0 72px!important;height:38px!important;padding:6px 4px!important;text-align:center;font-weight:bold;font-size:14px!important;box-sizing:border-box;}
        .dispatch-manual-qty::placeholder{color:#94a3b8;font-weight:800;}
        .dispatch-manual-qty:focus{outline:2px solid rgba(139,92,246,.22);box-shadow:0 0 0 3px rgba(139,92,246,.08);border-color:#8b5cf6!important;}
        #dispatchManualCartonItem:focus,#dispatchManualLooseItem:focus{outline:2px solid rgba(37,99,235,.18);}
        .dispatch-manual-entry .dispatch-control-btn{flex:1 1 auto!important;min-width:0!important;width:auto!important;}
        @media (max-width:600px){
            .dispatch-manual-grid{grid-template-columns:1fr;gap:8px;}
            .dispatch-control-card{padding:8px;}
            .dispatch-control-row{gap:6px;}
            .dispatch-loose-input{width:68px!important;min-width:68px!important;flex-basis:68px!important;}
            .dispatch-control-btn{min-width:88px!important;font-size:11px!important;}
            .dispatch-manual-card{gap:6px;}
            .dispatch-manual-select{height:44px!important;font-size:13px!important;}
            .dispatch-manual-qty{width:76px!important;min-width:76px!important;flex-basis:76px!important;}
        }
/* کدهای اصلاح‌شده - کنترل ابعاد به خود کتابخانه واگذار شد */
#dispatchCameraContainer { width: 100%; max-width: 400px; margin: 10px auto; background: #111827; border-radius: 10px; overflow: hidden; border: 2px solid #8b5cf6; }
#dispatch-reader { width: 100%; }
/* هیچ استایلی به video ندهید تا کتابخانه خودش ابعاد را تنظیم کند */
/* ===== UX3 — حرفه‌ای، تیره‌تر، کم‌تراکم و سریع ===== */
:root{
 --bg-color:#eef2f7;
 --surface:#ffffff;
 --primary:#2563eb;
 --success:#059669;
 --danger:#dc2626;
 --warning:#d97706;
 --dark:#0b1220;
 --text-main:#1e293b;
 --text-muted:#64748b;
 --border:#cbd5e1;
 --radius:12px;
}
body{background:#dfe5ed;color:var(--text-main);}
#app-wrapper{max-width:1160px;background:#f3f6fa;box-shadow:0 0 30px rgba(15,23,42,.18);}
.tabs{background:#0b1220;padding:8px 10px;gap:7px;border-bottom:1px solid #263449;}
.tab-btn{background:#182235;color:#dbe4f0;padding:10px 12px;border-radius:9px;border:1px solid #27354b;box-shadow:none;}
.tab-btn:hover{background:#223049;}
.tab-btn.active{background:#2563eb;border-color:#3b82f6;box-shadow:0 4px 12px rgba(37,99,235,.22);}
.tab-content{padding:14px 16px;}
h2{font-size:17px;color:#0f172a;border-bottom:1px solid #cbd5e1;padding-bottom:7px;margin:0 0 10px;font-weight:900;}
.card,.settings-card,.form-panel,.cart-panel{border:1px solid #cbd5e1;box-shadow:0 3px 12px rgba(15,23,42,.04);}
input,select,textarea{border:1px solid #b9c5d5;border-radius:9px;padding:10px 12px;box-shadow:none;}
input:focus,select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(37,99,235,.10);}
button{border-radius:8px;box-shadow:none;}

/* داشبورد: هدر و کارت‌ها فشرده و خوانا */
.dash-header{background:linear-gradient(135deg,#0b1220,#172238);padding:12px 16px;margin-bottom:10px;border-radius:11px;box-shadow:0 5px 16px rgba(11,18,32,.16);}
.dash-header h2{font-size:16px;margin:0 0 2px;padding:0;color:#fff;border:0;}
.dash-header p{font-size:11px !important;}
.dash-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:10px;}
.dash-card{padding:10px 12px;border-radius:10px;min-height:72px;box-shadow:0 2px 9px rgba(15,23,42,.04);}
.dash-card h3{font-size:11px;margin-bottom:5px;}
.dash-card .val{font-size:20px;}
.dash-grid{gap:10px;margin-bottom:10px;}
.dash-grid .card{padding:12px;}
.dash-grid canvas{max-height:185px;}
#tab-dashboard>.card{padding:11px !important;margin-bottom:10px !important;}
#tab-dashboard .table-responsive{max-height:205px !important;}

/* اسناد و کاردکس: عنوان جمع‌وجور و لیست سند در دید */
#tab-cardex{padding-top:10px;}
#tab-cardex #cardexTitleLabel{font-size:16px;margin:0 0 8px;padding:0;border:0;color:#0f172a;}
#cardexModeSelectorCard{padding:5px 8px !important;margin-bottom:7px !important;background:#e9eef5 !important;}
#cardexModeSelectorCard .radio-group{gap:5px !important;margin:0 !important;}
#cardexModeSelectorCard .radio-label{padding:6px 10px;font-size:11px;background:#fff;}
#cardexFilterCard{background:#e9eef5 !important;padding:7px !important;margin-bottom:7px !important;}
#cardexFilterCard .filter-quick-row{display:grid;grid-template-columns:minmax(260px,2fr) minmax(160px,1fr) auto;gap:7px;align-items:center;}
#cardexFilterCard .filter-search-wrap{display:flex;gap:6px;align-items:center;}
#cardexFilterCard .filter-search-wrap input{margin:0;height:40px;}
#cardexFilterCard .filter-search-wrap .btn-blue{width:44px;height:40px;padding:0;margin:0;}
#cardexFilterCard .filter-quick-row{grid-template-columns:minmax(0,1.45fr) minmax(250px,1fr) minmax(160px,.9fr);}
#cardexFilterCard .barcode-search-box{min-width:0;}
#cardexFilterCard .invoice-only-search{display:flex;gap:5px;align-items:center;min-width:0;}
#cardexFilterCard .invoice-only-search input{margin:0;height:40px;min-width:0;flex:1;font-weight:900;}
#cardexFilterCard .invoice-only-search button{width:40px;height:40px;padding:0;margin:0;flex:0 0 40px;}
#cardexFilterCard .invoice-only-search .invoice-clear-btn{background:#64748b;}
#cardexFilterCard .quick-filter-select{height:40px;background:#fff;}
#cardexFilterCard .btn-green{margin:0 !important;width:auto !important;min-width:90px;height:40px;padding:0 13px !important;}
#cardexFilterCard .filter-advanced{margin-top:6px;}
#cardexFilterCard .filter-advanced summary{cursor:pointer;background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;padding:6px 9px;font-size:11px;font-weight:900;color:#334155;list-style:none;}
#cardexFilterCard .filter-advanced summary::-webkit-details-marker{display:none;}
#cardexFilterCard .filter-advanced summary:before{content:'⚙️ ';}
#cardexFilterCard .filter-advanced[open] summary{margin-bottom:6px;background:#fff;}
#cardexFilterCard .filter-advanced .radio-group{margin:0 0 6px !important;}
#cardexFilterCard .filter-advanced .responsive-grid{margin:0 !important;gap:7px !important;}
#cardexFilterCard .filter-advanced input{margin:0;height:38px;}
#tab-cardex .cardex-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:7px;}
#tab-cardex .cardex-stat{background:#fff;border:1px solid #d6dee9;border-radius:8px;padding:5px 8px;display:flex;justify-content:space-between;align-items:center;font-size:10px;font-weight:900;}
#tab-cardex .cardex-stat b{font-size:14px;color:#0f172a;}
#tab-cardex .cardex-main-table{max-height:calc(100vh - 300px) !important;min-height:360px;overflow:auto;border:1px solid #bfcbd9;border-radius:9px;background:#fff;}
#tab-cardex .cardex-main-table table{min-width:0 !important;}
#tab-cardex .cardex-main-table th{background:#dfe7f1;color:#1e293b;font-size:10px;padding:8px 6px;}
#tab-cardex .cardex-main-table td{font-size:11px;padding:7px 6px;border-bottom:1px solid #dbe3ed;}
#tab-cardex .group-row:hover{background:#f1f5f9;}
#tab-cardex .detail-row td{padding:6px 10px !important;font-size:10px !important;}
#tab-cardex .doc-id-mini{font-size:9px !important;color:#94a3b8 !important;font-weight:700 !important;}
#tab-cardex .office-doc-main{font-size:14px;font-weight:900;color:#1d4ed8;line-height:1.15;}
#tab-cardex .office-doc-user{font-size:9px;color:#64748b;font-weight:700;margin-top:2px;}
#tab-cardex .receipt-inline{display:inline-flex;align-items:center;gap:4px;padding:2px 6px;border-radius:5px;background:#ecfdf5;color:#047857;font-size:9px;font-weight:900;margin-top:3px;white-space:nowrap;}
#tab-cardex .receipt-inline.pending{background:#fff7ed;color:#c2410c;}
#tab-cardex .doc-actions-cell{position:relative;min-width:92px;}
.doc-action-primary{width:86px !important;height:32px !important;margin:0 !important;padding:0 8px !important;background:#182235 !important;border:1px solid #334155 !important;color:#fff !important;font-size:11px !important;font-weight:900 !important;}
.doc-action-primary:hover{background:#223049 !important;}
.doc-action-popup{position:fixed;z-index:100000;min-width:165px;max-width:220px;background:#0f172a;border:1px solid #334155;border-radius:10px;padding:5px;box-shadow:0 16px 35px rgba(0,0,0,.28);}
.doc-action-popup button{width:100%;margin:0 0 3px;padding:8px 9px;border:0;border-radius:7px;text-align:right;justify-content:flex-start;font-size:11px;}
.doc-action-popup button:last-child{margin-bottom:0;}
.doc-action-popup .action-danger{background:#991b1b !important;color:#fff;}
.doc-action-popup .action-blue{background:#1d4ed8 !important;color:#fff;}
.doc-action-popup .action-green{background:#047857 !important;color:#fff;}
.doc-action-popup .action-purple{background:#6d28d9 !important;color:#fff;}
.doc-action-popup .action-orange{background:#b45309 !important;color:#fff;}
.doc-action-popup .action-gray{background:#334155 !important;color:#fff;}

/* رسید: وضعیت + تاریخ/ساعت در یک خط کوچک */
.receipt-meta{display:flex;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap;margin-top:3px;}
.receipt-date{font-size:9px;color:#64748b;font-weight:800;direction:rtl;white-space:nowrap;}

/* کاردکس کالا */
#cardexItemView>.card{padding:8px !important;margin-bottom:7px !important;background:#f7f9fc !important;}
#cardexItemView .item-cardex-top{display:grid;grid-template-columns:minmax(250px,1.7fr) repeat(3,auto);gap:6px;align-items:center;}
#cardexItemView .item-cardex-top button{height:38px;margin:0 !important;width:auto !important;padding:0 12px !important;}
#tab-cardex .cardex-item-table{max-height:calc(100vh - 250px) !important;min-height:360px;border:1px solid #bfcbd9;}
#tab-cardex .cardex-item-table th{background:#dfe7f1;font-size:10px;padding:8px;}

@media(max-width:900px){
 .dash-cards{grid-template-columns:repeat(2,1fr);}
 #cardexFilterCard .filter-quick-row{grid-template-columns:1fr;}
 #cardexFilterCard .btn-green{width:100% !important;}
 #tab-cardex .cardex-main-table{max-height:calc(100vh - 330px) !important;min-height:300px;}
 #tab-cardex .cardex-main-table table{min-width:760px !important;}
 #cardexItemView .item-cardex-top{grid-template-columns:1fr;}
 #cardexItemView .item-cardex-top button{width:100% !important;}
}
@media(max-width:600px){
 .tab-content{padding:10px;}
 .dash-cards{grid-template-columns:1fr 1fr;gap:7px;}
 .dash-card{min-height:66px;padding:8px 9px;}
 #tab-cardex .cardex-stats{grid-template-columns:repeat(2,1fr);}
 #tab-cardex .cardex-main-table{min-height:280px;}
}


/* ===== UX4 — DARK PRO / MAX DATA DENSITY ===== */
:root{
 --bg-color:#0b1220;
 --surface:#111a2b;
 --surface-2:#162238;
 --primary:#3b82f6;
 --success:#10b981;
 --danger:#ef4444;
 --warning:#f59e0b;
 --dark:#f8fafc;
 --text-main:#e5edf7;
 --text-muted:#94a3b8;
 --border:#26364d;
 --radius:10px;
}
html,body{background:#070d18 !important;color:var(--text-main) !important;}
body{font-size:13px !important;}
#app-wrapper{max-width:1380px !important;background:#0b1220 !important;box-shadow:0 0 35px rgba(0,0,0,.45) !important;}
#top-bar{background:#070d18 !important;border-bottom:1px solid #1f2d42 !important;padding:6px 12px !important;}
.tabs{background:#070d18 !important;padding:5px 8px !important;gap:5px !important;border-bottom:1px solid #1f2d42 !important;}
.tab-btn{max-width:none !important;padding:8px 10px !important;height:38px !important;border-radius:8px !important;background:#121d30 !important;border:1px solid #243550 !important;color:#cbd5e1 !important;font-size:12px !important;}
.tab-btn.active{background:#2563eb !important;border-color:#3b82f6 !important;box-shadow:0 3px 10px rgba(37,99,235,.22) !important;}
.tab-logout{max-width:78px !important;background:#8f1d1d !important;border-color:#a52a2a !important;}
.tab-content{padding:9px 12px !important;}
h2{color:#eaf1fb !important;border-color:#26364d !important;font-size:16px !important;margin:0 0 7px !important;padding-bottom:5px !important;}
.card,.settings-card,.form-panel,.cart-panel{background:#111a2b !important;border-color:#26364d !important;box-shadow:0 4px 14px rgba(0,0,0,.16) !important;color:var(--text-main) !important;}
input,select,textarea{background:#0e1727 !important;color:#e5edf7 !important;border-color:#31435f !important;}
input::placeholder,textarea::placeholder{color:#71839d !important;}
input:focus,select:focus{border-color:#3b82f6 !important;background:#111c30 !important;box-shadow:0 0 0 2px rgba(59,130,246,.15) !important;}
.custom-select-display{background:#0e1727 !important;color:#e5edf7 !important;border-color:#31435f !important;}
.custom-select-options{background:#101a2c !important;border-color:#3b82f6 !important;}
.custom-option{background:#101a2c !important;color:#e5edf7 !important;border-color:#1f2d42 !important;}
.custom-option:hover{background:#17263c !important;color:#93c5fd !important;}
.radio-label{background:#0e1727 !important;color:#dbe5f0 !important;border-color:#31435f !important;padding:6px 9px !important;}
.radio-label:has(input:checked){background:#142748 !important;border-color:#3b82f6 !important;color:#dbeafe !important;}
table{color:#dbe5f0 !important;}
th{background:#162238 !important;color:#dbe7f5 !important;border-color:#2a3a52 !important;}
td{border-color:#223149 !important;}
.table-responsive{background:#0d1625 !important;border-color:#26364d !important;}
.group-row:hover{background:#162238 !important;}
.detail-row{background:#0f192a !important;}
.badge.in{background:#047857 !important}.badge.out{background:#b91c1c !important}
.qty-primary{color:#f8fafc !important}.qty-secondary,.qty-weight{color:#94a3b8 !important}
.dash-header{background:linear-gradient(135deg,#070d18,#14213a) !important;border:1px solid #243550 !important;padding:9px 13px !important;margin-bottom:7px !important;box-shadow:0 5px 15px rgba(0,0,0,.22) !important;}
.dash-header h2{font-size:15px !important}
.dash-cards{gap:7px !important;margin-bottom:8px !important}
.dash-card{background:#111a2b !important;border-color:#26364d !important;min-height:64px !important;padding:8px 10px !important;box-shadow:0 3px 10px rgba(0,0,0,.12) !important}
.dash-card h3{color:#94a3b8 !important;font-size:10px !important;margin-bottom:4px !important}
.dash-card .val{color:#f8fafc !important;font-size:19px !important}
#tab-dashboard>.card{background:#111a2b !important;}
#tab-dashboard .table-responsive{background:#0d1625 !important;}
/* اسناد: عنوان و باکس آمار حذف شده، فضای اسناد حداکثری */
#tab-cardex{padding-top:5px !important;}
#tab-cardex #cardexTitleLabel{display:none !important;}
#cardexModeSelectorCard{padding:4px 6px !important;margin:0 0 5px !important;background:#0e1727 !important;border-color:#223149 !important;}
#cardexModeSelectorCard .radio-group{justify-content:flex-end !important;gap:4px !important;}
#cardexModeSelectorCard .radio-label{font-size:10px !important;padding:5px 9px !important;}
#cardexFilterCard{background:#0e1727 !important;padding:5px !important;margin-bottom:5px !important;border-color:#223149 !important;}
#cardexFilterCard .filter-quick-row{grid-template-columns:minmax(360px,2.6fr) minmax(170px,1fr) auto !important;gap:6px !important;}
#cardexFilterCard .filter-search-wrap input{height:34px !important;font-size:12px !important;}
#cardexFilterCard .filter-search-wrap .btn-blue{height:34px !important;width:38px !important;}
#cardexFilterCard .quick-filter-select{height:34px !important;font-size:11px !important;}
#cardexFilterCard .btn-green{height:34px !important;min-width:78px !important;font-size:11px !important;}
#cardexFilterCard .filter-advanced{margin-top:4px !important;}
#cardexFilterCard .filter-advanced summary{background:#101a2c !important;border-color:#2a3a52 !important;color:#cbd5e1 !important;padding:5px 8px !important;font-size:10px !important;}
#cardexFilterCard .filter-advanced[open] summary{background:#162238 !important;}
#cardexFilterCard .filter-advanced .radio-group{display:flex !important;gap:4px !important;flex-wrap:wrap !important;margin:4px 0 0 !important;}
#cardexFilterCard .filter-advanced .radio-label{font-size:10px !important;padding:5px 8px !important;}
#cardexFilterCard .doc-status-row{display:flex;gap:4px;flex-wrap:wrap;align-items:center;margin-top:4px;}
#cardexFilterCard .doc-status-select{height:32px !important;margin:0 !important;min-width:170px;background:#0b1423 !important;font-size:10px !important;}
#tab-cardex .cardex-stats{display:none !important;}
#tab-cardex .cardex-main-table{max-height:calc(100vh - 178px) !important;min-height:540px !important;background:#0b1423 !important;border-color:#273852 !important;}
#tab-cardex .cardex-main-table table{min-width:0 !important;}
#tab-cardex .cardex-main-table th{background:#162238 !important;color:#cbd5e1 !important;font-size:10px !important;padding:7px 6px !important;}
#tab-cardex .cardex-main-table td{font-size:11px !important;padding:6px 6px !important;}
#tab-cardex .office-doc-main{font-size:15px !important;color:#93c5fd !important;}
#tab-cardex .office-doc-user{color:#94a3b8 !important;}
#tab-cardex .doc-id-mini{color:#64748b !important;font-size:8px !important;}
#tab-cardex .receipt-inline{background:#063b31 !important;color:#6ee7b7 !important;border:1px solid #075e4d !important;}
#tab-cardex .receipt-inline.pending{background:#3b2610 !important;color:#fbbf24 !important;border-color:#694414 !important;}
#tab-cardex .doc-action-primary{background:#172338 !important;border-color:#334766 !important;height:30px !important;width:82px !important;font-size:10px !important;}
.doc-action-popup{background:#0b1220 !important;border-color:#334766 !important;box-shadow:0 18px 42px rgba(0,0,0,.55) !important;}
/* ستون‌ها را برای فاکتور عریض‌تر و سند را کوچک‌تر می‌کنیم */
#tab-cardex .cardex-main-table th:nth-child(1),#tab-cardex .cardex-main-table td:nth-child(1){width:26%;}
#tab-cardex .cardex-main-table th:nth-child(2),#tab-cardex .cardex-main-table td:nth-child(2){width:10%;}
#tab-cardex .cardex-main-table th:nth-child(3),#tab-cardex .cardex-main-table td:nth-child(3){width:13%;}
#tab-cardex .cardex-main-table th:nth-child(4),#tab-cardex .cardex-main-table td:nth-child(4){width:28%;}
#tab-cardex .cardex-main-table th:nth-child(5),#tab-cardex .cardex-main-table td:nth-child(5){width:13%;}
#tab-cardex .cardex-main-table th:nth-child(6),#tab-cardex .cardex-main-table td:nth-child(6){width:10%;}
/* کاردکس کالا */
#cardexItemView>.card{background:#0e1727 !important;border-color:#223149 !important;padding:6px !important;}
#cardexItemView .item-cardex-top input{height:34px !important;}
#cardexItemView .item-cardex-top button{height:34px !important;font-size:10px !important;}
#tab-cardex .cardex-item-table{max-height:calc(100vh - 145px) !important;min-height:500px !important;background:#0b1423 !important;border-color:#273852 !important;}
#tab-cardex .cardex-item-table th{background:#162238 !important;color:#cbd5e1 !important;}
/* تنظیمات، مودال‌ها و فرم‌ها */
.modal-box{background:#0e1727 !important;border:1px solid #2a3a52 !important;}
.modal-header{background:#111c2e !important;border-color:#2a3a52 !important;color:#e5edf7 !important;}
.modal-body{background:#0b1220 !important;color:#dbe5f0 !important;}
.scrollable-list{background:#0b1423 !important;border-color:#2a3a52 !important;}
.settings-list li{background:#111a2b !important;border-color:#26364d !important;color:#e5edf7 !important;}
.req-box,.req-item{background:#101a2c !important;border-color:#2a3a52 !important;color:#e5edf7 !important;}
/* حذف سایه‌های سنگین و فشرده‌سازی عمومی */
*{scrollbar-color:#3a4b64 #0a1220;}
::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-track{background:#0a1220}::-webkit-scrollbar-thumb{background:#344760;border-radius:10px}
@media(max-width:1000px){
 #app-wrapper{max-width:100% !important;}
 #cardexFilterCard .filter-quick-row{grid-template-columns:1fr 180px auto !important;}
 #tab-cardex .cardex-main-table{min-height:430px !important;}
}
@media(max-width:700px){
 .tab-content{padding:8px !important;}
 .tab-btn{font-size:11px !important;padding:7px 8px !important;height:36px !important;}
 #cardexFilterCard .filter-quick-row{grid-template-columns:1fr !important;}
 #cardexFilterCard .btn-green{width:100% !important;}
 #tab-cardex .cardex-main-table{max-height:calc(100vh - 250px) !important;min-height:330px !important;}
 #tab-cardex .cardex-main-table table{min-width:820px !important;}
}

/* ===== UX5 — LIGHT PREMIUM / MODERN WAREHOUSE UI ===== */
:root{
 --bg-color:#f4f7fb !important;
 --surface:#ffffff !important;
 --surface-2:#eef3f9 !important;
 --primary:#2563eb !important;
 --success:#059669 !important;
 --danger:#dc2626 !important;
 --warning:#d97706 !important;
 --dark:#172033 !important;
 --text-main:#25324a !important;
 --text-muted:#6b7890 !important;
 --border:#d7e0eb !important;
 --radius:10px !important;
}
html,body{background:#e8edf4 !important;color:var(--text-main) !important;}
body{font-size:13px !important;}
#app-wrapper{max-width:1360px !important;background:#f6f8fb !important;box-shadow:0 10px 35px rgba(30,50,80,.10) !important;}
#top-bar{background:#f8fafc !important;border-bottom:1px solid #e1e7ef !important;padding:6px 12px !important;}
.tabs{background:#ffffff !important;padding:6px 8px !important;gap:6px !important;border-bottom:1px solid #e1e7ef !important;box-shadow:0 2px 8px rgba(30,50,80,.05) !important;}
.tab-btn{max-width:none !important;padding:8px 11px !important;height:38px !important;border-radius:8px !important;background:#eef2f7 !important;border:1px solid #dde5ef !important;color:#42506a !important;font-size:12px !important;}
.tab-btn:hover{background:#e5ebf3 !important;color:#25324a !important;}
.tab-btn.active{background:#2563eb !important;border-color:#2563eb !important;color:#fff !important;box-shadow:0 4px 10px rgba(37,99,235,.16) !important;}
.tab-logout{background:#dc2626 !important;border-color:#dc2626 !important;color:#fff !important;}
.tab-content{padding:10px 12px !important;}
h2{color:#172033 !important;border-color:#d7e0eb !important;font-size:16px !important;}
.card,.settings-card,.form-panel,.cart-panel{background:#fff !important;border-color:#d7e0eb !important;box-shadow:0 4px 14px rgba(37,55,80,.05) !important;color:var(--text-main) !important;}
input,select,textarea{background:#fff !important;color:#25324a !important;border-color:#c8d3e0 !important;}
input::placeholder,textarea::placeholder{color:#8a97aa !important;}
input:focus,select:focus{border-color:#6b9df8 !important;background:#fff !important;box-shadow:0 0 0 3px rgba(37,99,235,.09) !important;}
.custom-select-display{background:#fff !important;color:#25324a !important;border-color:#c8d3e0 !important;}
.custom-select-options{background:#fff !important;border-color:#aac5f8 !important;box-shadow:0 12px 28px rgba(35,55,85,.14) !important;}
.custom-option{background:#fff !important;color:#25324a !important;border-color:#edf1f6 !important;}
.custom-option:hover{background:#f3f7fd !important;color:#2563eb !important;}
.radio-label{background:#fff !important;color:#42506a !important;border-color:#cfd9e6 !important;}
.radio-label:has(input:checked){background:#edf4ff !important;border-color:#6b9df8 !important;color:#1d4ed8 !important;}
table{color:#25324a !important;}
th{background:#eef3f8 !important;color:#344258 !important;border-color:#d3dde9 !important;}
td{border-color:#e1e7ef !important;}
.table-responsive{background:#fff !important;border-color:#d7e0eb !important;}
.group-row:hover{background:#f7faff !important;}
.detail-row{background:#f8fafc !important;}
.qty-primary{color:#172033 !important}.qty-secondary,.qty-weight{color:#7a879a !important}
.dash-header{background:linear-gradient(135deg,#ffffff,#edf3fb) !important;border:1px solid #d9e2ee !important;color:#172033 !important;padding:8px 12px !important;box-shadow:0 4px 12px rgba(37,55,80,.05) !important;}
.dash-header h2{color:#172033 !important;}
.dash-cards{gap:7px !important;}
.dash-card{background:#fff !important;border-color:#d7e0eb !important;box-shadow:0 3px 10px rgba(37,55,80,.05) !important;}
.dash-card h3{color:#748198 !important;}
.dash-card .val{color:#172033 !important;}
#tab-dashboard>.card{background:#fff !important;}
#tab-dashboard .table-responsive{background:#fff !important;}
#cardexModeSelectorCard,#cardexFilterCard{background:#f3f6fa !important;border-color:#d7e0eb !important;}
#cardexModeSelectorCard .radio-label,#cardexFilterCard .radio-label{background:#fff !important;}
#cardexFilterCard .filter-advanced summary{background:#fff !important;border-color:#d5dfeb !important;color:#45536a !important;}
#cardexFilterCard .filter-advanced[open] summary{background:#f0f5fb !important;}
#cardexFilterCard .doc-status-select{background:#fff !important;color:#25324a !important;}
#tab-cardex .cardex-main-table{background:#fff !important;border-color:#d7e0eb !important;}
#tab-cardex .cardex-main-table th{background:#eef3f8 !important;color:#344258 !important;}
#tab-cardex .cardex-main-table td{background:#fff !important;}
#tab-cardex .office-doc-main{font-size:15px !important;color:#1d4ed8 !important;font-weight:900 !important;}
#tab-cardex .office-doc-user{color:#7b8799 !important;}
#tab-cardex .doc-id-mini{color:#9aa6b6 !important;font-size:8px !important;}
#tab-cardex .receipt-inline{background:#ecfdf5 !important;color:#047857 !important;border:1px solid #bbf7d0 !important;}
#tab-cardex .receipt-inline.pending{background:#fff7ed !important;color:#c2410c !important;border-color:#fed7aa !important;}
#tab-cardex .doc-action-primary{background:#f4f7fb !important;border-color:#cfd9e6 !important;color:#334155 !important;height:30px !important;width:82px !important;font-size:10px !important;}
#tab-cardex .doc-action-primary:hover{background:#eaf1fa !important;border-color:#b9c8da !important;}
.doc-action-popup{background:#fff !important;border:1px solid #cfd9e6 !important;box-shadow:0 16px 36px rgba(35,55,85,.18) !important;border-radius:10px !important;padding:5px !important;}
.doc-action-popup button{box-shadow:none !important;}
.doc-action-popup .action-blue{background:#2563eb !important}.doc-action-popup .action-green{background:#059669 !important}.doc-action-popup .action-purple{background:#7c3aed !important}.doc-action-popup .action-orange{background:#d97706 !important}.doc-action-popup .action-gray{background:#64748b !important}.doc-action-popup .action-danger{background:#dc2626 !important}
.modal-box{background:#fff !important;border-color:#d7e0eb !important;}
.modal-header{background:#f8fafc !important;border-color:#d7e0eb !important;color:#25324a !important;}
.modal-body{background:#f3f6fa !important;color:#25324a !important;}
.scrollable-list{background:#f3f6fa !important;border-color:#d7e0eb !important;}
.settings-list li{background:#fff !important;border-color:#d7e0eb !important;color:#25324a !important;}
.req-box,.req-item{background:#f8fafc !important;border-color:#d7e0eb !important;color:#25324a !important;}
*{scrollbar-color:#bcc9d8 #edf1f6;}
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#edf1f6}::-webkit-scrollbar-thumb{background:#b8c5d5;border-radius:10px}

/* ===== اصلاح خوانایی داشبورد و نمایش حرفه‌ای بارکدها ===== */

/* عنوان وضعیت انبار در هدر داشبورد: متن همیشه واضح و سفید */
#tab-dashboard .dash-header h2,
#tab-dashboard .dash-header #dashWelcomeCompany {
    color:#ffffff !important;
}
#tab-dashboard .dash-header p,
#tab-dashboard .dash-header #dashWelcomeName {
    color:rgba(255,255,255,.86) !important;
}

/* جلوگیری از چسبیدن/کش‌آمدن بارکدها در جزئیات سند */
#tab-cardex .barcode-detail-wrap{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:6px !important;
    width:100% !important;
    min-width:0 !important;
}
#tab-cardex .barcode-detail-label{
    flex:0 0 auto !important;
    background:#e2e8f0 !important;
    color:#334155 !important;
    border:1px solid #cbd5e1 !important;
    border-radius:6px !important;
    padding:4px 7px !important;
    font-size:10px !important;
    font-weight:900 !important;
}
#tab-cardex .barcode-chip{
    display:inline-flex !important;
    align-items:center !important;
    max-width:100% !important;
    min-width:0 !important;
    background:#059669 !important;
    color:#ffffff !important;
    border:1px solid #047857 !important;
    border-radius:7px !important;
    padding:5px 8px !important;
    font-family:Consolas,Tahoma,monospace !important;
    font-size:11px !important;
    font-weight:900 !important;
    line-height:1.4 !important;
    direction:ltr !important;
    unicode-bidi:plaintext !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    box-shadow:0 1px 2px rgba(15,23,42,.08) !important;
}
#tab-cardex .barcode-chip + .barcode-chip{
    margin-right:0 !important;
}
#tab-cardex .barcode-chip.match{
    background:#10b981 !important;
    border-color:#059669 !important;
}
#tab-cardex .barcode-chip.manual{
    background:#64748b !important;
    border-color:#475569 !important;
    direction:rtl !important;
    font-family:Tahoma,Arial,sans-serif !important;
}
#tab-cardex .barcode-count{
    flex:0 0 auto !important;
    font-size:10px !important;
    color:#047857 !important;
    background:#ecfdf5 !important;
    border:1px solid #bbf7d0 !important;
    border-radius:6px !important;
    padding:4px 7px !important;
    font-weight:900 !important;
}

/* در موبایل بارکدها ستونی و خواناتر شوند */
@media(max-width:700px){
    #tab-cardex .barcode-detail-wrap{
        align-items:stretch !important;
        gap:5px !important;
    }
    #tab-cardex .barcode-chip{
        width:100% !important;
        justify-content:flex-start !important;
        font-size:11px !important;
        padding:6px 8px !important;
    }
    #tab-cardex .barcode-count{
        align-self:flex-start !important;
    }
}



/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: ux6-balanced-theme */

/* UX6 — Balanced graphite / mist theme: not dark, not glaringly white */
:root{
  --bg-color:#e8edf4 !important;
  --surface:#f6f8fb !important;
  --surface-2:#e1e7ef !important;
  --dark:#172033 !important;
  --text-main:#283548 !important;
  --text-muted:#657287 !important;
  --border:#c7d1de !important;
}
html,body{background:#dfe6ef !important;color:var(--text-main) !important;}
#app-wrapper{background:#e8edf4 !important;box-shadow:0 8px 28px rgba(24,39,63,.14) !important;}
.tabs{background:#182235 !important;border-bottom:1px solid #26354b !important;box-shadow:0 3px 10px rgba(18,30,50,.12) !important;}
.tab-btn{background:#263349 !important;color:#e9eef6 !important;border:1px solid #34435a !important;}
.tab-btn:hover{background:#30405a !important;}
.tab-btn.active{background:#2f6fed !important;border-color:#2f6fed !important;box-shadow:0 4px 12px rgba(47,111,237,.25) !important;}
.tab-logout{background:#c93434 !important;border-color:#c93434 !important;}
.card,.settings-card,.form-panel,.cart-panel{background:#f5f7fa !important;border-color:#cbd5e1 !important;box-shadow:0 3px 12px rgba(30,45,65,.06) !important;}
input,select,textarea{background:#f9fafc !important;color:#263449 !important;border-color:#c3cfdd !important;}
input:focus,select:focus{background:#fff !important;}
.custom-select-display{background:#f9fafc !important;color:#263449 !important;border-color:#c3cfdd !important;}
.custom-select-options{background:#f8fafc !important;border-color:#9ebbe9 !important;}
.custom-option{background:#f8fafc !important;color:#263449 !important;border-color:#e1e7ef !important;}
.custom-option:hover{background:#eaf1fb !important;color:#245cc2 !important;}
.radio-label{background:#eef2f7 !important;color:#3e4c62 !important;border-color:#c5cfdb !important;}
.radio-label:has(input:checked){background:#e6eefb !important;border-color:#6c97e8 !important;color:#214f9f !important;}
.table-responsive{background:#eef2f6 !important;border-color:#bfcbd9 !important;}
table{background:#eef2f6 !important;}
th{background:#dfe6ee !important;color:#233149 !important;border-bottom-color:#b9c5d3 !important;}
td{border-bottom-color:#d0d8e2 !important;}
.group-row:hover{background:#e8eef5 !important;}
.detail-row{background:#f2f5f8 !important;}
#tab-cardex .cardex-main-table td{background:#f1f4f7 !important;}
#tab-cardex .cardex-main-table tr.group-row td{background:#f5f7fa !important;}
#tab-cardex .cardex-main-table tr.group-row:hover td{background:#e8eef5 !important;}
#cardexFilterCard .filter-advanced summary{background:#e8edf3 !important;border-color:#c5cfdb !important;color:#44536a !important;}
#cardexFilterCard .quick-filter-select,#cardexFilterCard .doc-status-select{background:#f9fafc !important;color:#263449 !important;}
.doc-action-popup{background:#f7f9fc !important;border-color:#c4cedb !important;box-shadow:0 14px 30px rgba(35,50,70,.20) !important;}
.doc-action-popup button{box-shadow:none !important;}
.receipt-inline{box-shadow:none !important;}
.dash-header{background:#182235 !important;border-color:#26354b !important;color:#f7f9fc !important;box-shadow:0 4px 12px rgba(18,30,50,.14) !important;}
.dash-card{background:#f5f7fa !important;border-color:#cbd5e1 !important;box-shadow:0 3px 10px rgba(30,45,65,.06) !important;}
.modal-box{background:#f3f6fa !important;border-color:#c7d1de !important;}
.modal-header{background:#eef2f6 !important;border-bottom-color:#c7d1de !important;}
.settings-list li{background:#f5f7fa !important;border-color:#cbd5e1 !important;color:#263449 !important;}
/* Keep strong status colors, but soften empty white zones */
#tab-cardex .cardex-stat{background:#edf1f5 !important;border-color:#c7d1de !important;}
#tab-cardex .receipt-inline.pending{background:#fff2df !important;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: ux-mobile-cards-v2 */

#mobileDocumentCards{display:none;}
.m-doc-card{background:#f8fafc;border:1px solid #d5dfeb;border-radius:14px;overflow:hidden;margin:8px 0;box-shadow:0 3px 12px rgba(30,50,80,.07);}
.m-doc-head{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:11px 12px;background:linear-gradient(135deg,#eef5ff,#f8fafc);border-bottom:1px solid #dbe4ef;cursor:pointer;}
.m-doc-title{display:flex;flex-direction:column;gap:2px;min-width:0;}
.m-doc-invoice{font-size:17px;font-weight:900;color:#1557b0;line-height:1.1;word-break:break-word;}
.m-doc-internal{font-size:9px;color:#98a5b8;font-weight:700;}
.m-doc-head-right{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none;}
.m-doc-type{font-size:10px;font-weight:900;padding:4px 7px;border-radius:999px;white-space:nowrap;}
.m-doc-type.done{background:#e8f8f1;color:#087a54;border:1px solid #bcebd7;}
.m-doc-type.pending{background:#fff5df;color:#b86a00;border:1px solid #f7d99a;}
.m-doc-type.in{background:#e7f0ff;color:#1e5ab6;border:1px solid #c8daf7;}
.m-doc-date{font-size:9px;color:#6f7f94;white-space:nowrap;}
.m-doc-body{padding:9px 10px 10px;}
.m-doc-user{display:flex;justify-content:space-between;align-items:center;gap:6px;flex-wrap:wrap;font-size:10px;color:#64748b;font-weight:800;margin-bottom:8px;}
.m-receipt{font-size:9px;padding:4px 7px;border-radius:999px;font-weight:900;white-space:nowrap;}
.m-receipt.ok{background:#e9f8f1;color:#087a54;border:1px solid #c0ead8;}
.m-receipt.wait{background:#fff3e5;color:#b56200;border:1px solid #f4d2a5;}
.m-route{display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);gap:4px;align-items:center;background:#fff;border:1px solid #e0e7f0;border-radius:10px;padding:7px 8px;margin-bottom:8px;}
.m-route>div{min-width:0;}
.m-route small{display:block;color:#8a98aa;font-size:8px;font-weight:900;margin-bottom:2px;}
.m-route strong{display:block;color:#2d3c52;font-size:10px;line-height:1.45;white-space:normal;word-break:break-word;}
.m-route-arrow{text-align:center;color:#3975d6;font-size:16px;font-weight:900;}
.m-doc-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-bottom:8px;}
.m-doc-summary>div{background:#fff;border:1px solid #dce5ef;border-radius:8px;padding:5px 4px;text-align:center;}
.m-doc-summary small{display:block;color:#8a98aa;font-size:8px;font-weight:800;margin-bottom:1px;}
.m-doc-summary b{display:block;color:#1f2d42;font-size:12px;font-weight:900;}
.m-doc-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-bottom:7px;}
.m-act{margin:0!important;width:100%!important;min-height:34px!important;padding:6px 5px!important;border-radius:8px!important;border:1px solid transparent!important;font-size:10px!important;font-weight:900!important;box-shadow:none!important;}
.m-act.blue{background:#2f6fed!important;border-color:#2f6fed!important;color:#fff!important;}
.m-act.green{background:#0a9f70!important;border-color:#0a9f70!important;color:#fff!important;}
.m-act.purple{background:#7652d8!important;border-color:#7652d8!important;color:#fff!important;}
.m-act.orange{background:#d17a12!important;border-color:#d17a12!important;color:#fff!important;}
.m-act.red{background:#d94343!important;border-color:#d94343!important;color:#fff!important;}
.m-details-toggle{width:100%!important;margin:0!important;height:32px!important;padding:4px!important;background:#edf2f8!important;border:1px solid #d3deea!important;color:#41526a!important;font-size:10px!important;box-shadow:none!important;}
.m-doc-details{margin-top:7px;}
.m-item{background:#fff;border:1px solid #dbe4ee;border-radius:10px;padding:8px;margin-top:6px;}
.m-item-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;}
.m-item-top strong{font-size:10px;color:#243650;line-height:1.45;}
.m-item-top span{font-size:8px;color:#93a0b2;direction:ltr;}
.m-item-qty{display:flex;gap:8px;flex-wrap:wrap;margin-top:5px;font-size:9px;font-weight:900;color:#52647a;}
.m-batch{margin-top:5px;font-size:8px;color:#a65a00;background:#fff7e8;border:1px solid #f2d59f;border-radius:6px;padding:4px 5px;}
.m-barcode-list{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;}
.m-barcode-chip{display:inline-flex;max-width:100%;padding:4px 6px;background:#0cad7c;color:#fff;border-radius:5px;font-family:monospace;font-size:8px;line-height:1.2;word-break:break-all;}
.m-barcode-more{display:inline-flex;align-items:center;padding:4px 6px;background:#e8eef6;color:#51637b;border-radius:5px;font-size:8px;font-weight:900;}
.m-item-empty,.m-doc-empty{padding:18px;text-align:center;color:#7c8da3;font-size:11px;font-weight:900;background:#f7f9fc;border:1px dashed #cfd9e5;border-radius:10px;margin-top:6px;}
@media(max-width:700px){
  #tab-cardex .cardex-main-table{display:none!important;}
  #mobileDocumentCards{display:block;}
  #tab-cardex{padding:6px!important;background:#e9eef5!important;}
  #tab-cardex #cardexModeSelectorCard{padding:3px!important;margin-bottom:5px!important;}
  #tab-cardex #cardexFilterCard{padding:6px!important;margin-bottom:5px!important;}
  #tab-cardex #cardexModeSelectorCard .radio-group{gap:4px!important;}
  #tab-cardex #cardexModeSelectorCard .radio-label{min-height:36px!important;font-size:10px!important;padding:5px 6px!important;}
  #tab-cardex #cardexFilterCard .filter-quick-row{grid-template-columns:1fr!important;gap:5px!important;}
  #tab-cardex #cardexFilterCard .filter-search-wrap input{font-size:11px!important;height:38px!important;}
  #tab-cardex #cardexFilterCard .quick-filter-select{height:34px!important;}
  #tab-cardex #cardexFilterCard .invoice-only-search input{font-size:11px!important;height:38px!important;}
  #tab-cardex #cardexFilterCard .invoice-only-search button{height:38px!important;flex-basis:38px!important;width:38px!important;}
  #tab-cardex #cardexFilterCard .filter-quick-row>.btn-green{position:static!important;grid-column:auto!important;width:38px!important;min-width:38px!important;height:38px!important;font-size:0!important;}
  #tab-cardex #cardexFilterCard .filter-quick-row>.btn-green::after{content:'↧';font-size:18px!important;}
  .m-doc-actions:has(.m-act:nth-child(1):last-child){grid-template-columns:1fr;}
  .m-doc-summary{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media(max-width:390px){
  .m-doc-head{padding:9px;}
  .m-doc-invoice{font-size:15px;}
  .m-doc-body{padding:8px;}
  .m-doc-summary b{font-size:11px;}
  .m-act{font-size:9px!important;}
  .m-route strong{font-size:9px;}
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: ux-documents-desktop-cards */

/* ===== Documents / Cardex: unified card layout on desktop + mobile ===== */
#tab-cardex #cardexDocsView{width:100%;}
#tab-cardex .cardex-main-table{display:none !important;}
#tab-cardex #mobileDocumentCards{display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;align-items:start;}
#tab-cardex #mobileDocumentCards .m-doc-card{margin:0;min-width:0;box-shadow:0 4px 14px rgba(30,50,80,.08);border-radius:12px;}
#tab-cardex #mobileDocumentCards .m-doc-head{min-height:64px;padding:10px 12px;}
#tab-cardex #mobileDocumentCards .m-doc-invoice{font-size:16px;}
#tab-cardex #mobileDocumentCards .m-doc-body{padding:9px 10px 10px;}
#tab-cardex #mobileDocumentCards .m-route strong{font-size:10px;}
#tab-cardex #mobileDocumentCards .m-doc-summary{grid-template-columns:repeat(4,minmax(0,1fr));}
#tab-cardex #mobileDocumentCards .m-doc-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
#tab-cardex #mobileDocumentCards .m-act{min-height:34px!important;}
#tab-cardex #mobileDocumentCards .m-doc-details{max-height:420px;overflow:auto;padding-right:1px;}
#tab-cardex #cardexFilterCard .filter-quick-row{grid-template-columns:minmax(0,2.4fr) minmax(190px,1fr)!important;}
#tab-cardex #cardexFilterCard .filter-quick-row>.btn-green{display:none!important;}
@media (min-width:1250px){
  #tab-cardex #mobileDocumentCards{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:900px){
  #tab-cardex #mobileDocumentCards{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:700px){
  #tab-cardex #mobileDocumentCards{grid-template-columns:1fr!important;gap:8px;}
  #tab-cardex #cardexFilterCard .filter-quick-row{grid-template-columns:minmax(0,1fr) 38px!important;}
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: ux-receipt-alerts */

/* هشدار متمایز برای خروجی هایی که هنوز رسید ندارند */
.m-doc-card.receipt-missing{border-color:#f0c36a !important;box-shadow:0 4px 14px rgba(217,119,6,.10) !important;}
.m-receipt-alert{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:7px 10px;background:linear-gradient(90deg,#fff1e6,#fff8ef);border-bottom:1px solid #f3cfaa;color:#b45309;font-size:10px;font-weight:900;line-height:1.35;}
.m-receipt-alert strong{color:#b91c1c;}
.m-receipt-alert span{font-size:9px;color:#8a5a24;font-weight:800;}
.m-doc-card.receipt-missing .m-receipt.wait{background:#fff0e6 !important;color:#b91c1c !important;border-color:#f4b08c !important;box-shadow:0 0 0 1px rgba(239,68,68,.04);}
#tab-cardex .m-doc-card.receipt-missing{border-right:4px solid #ef4444 !important;}
@media(max-width:700px){
  .m-receipt-alert{font-size:10px;padding:8px 10px;}
  .m-receipt-alert span{width:100%;padding-right:24px;}
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: final-user-db-barcode-fix */

/* نوار نام کاربر + دیتابیس دقیقاً هم‌رنگ نوار تب‌ها */
#top-bar{
    background:#182235 !important;
    border-bottom:1px solid #26354b !important;
}
#top-bar #currentUserDisplay{
    color:#ffffff !important;
}
#top-bar #db-counter{
    background:#182235 !important;
    color:#ffffff !important;
    border:1px solid #34435a !important;
    box-shadow:none !important;
}
#top-bar #cloudStatus{
    background:#182235 !important;
    color:#ffffff !important;
    border:1px solid #34435a !important;
    box-shadow:none !important;
}

/* وقتی جستجو با بارکد انجام شد، فقط همان بارکد دقیق نمایش داده شود */
#tab-cardex .barcode-chip.exact-search-hit{
    background:#f59e0b !important;
    color:#111827 !important;
    border:2px solid #d97706 !important;
    box-shadow:0 0 0 2px rgba(245,158,11,.18),0 3px 8px rgba(245,158,11,.16) !important;
    font-weight:900 !important;
}
#tab-cardex .detail-row.exact-search-row{
    background:#fffaf0 !important;
    border-right:4px solid #f59e0b !important;
}
.m-item.exact-search-item{
    border-color:#f59e0b !important;
    background:#fffaf0 !important;
    box-shadow:inset 3px 0 0 #f59e0b !important;
}
.m-barcode-chip.exact-search-hit{
    background:#f59e0b !important;
    color:#111827 !important;
    border:2px solid #d97706 !important;
    box-shadow:0 0 0 2px rgba(245,158,11,.18),0 3px 8px rgba(245,158,11,.16) !important;
    font-weight:900 !important;
}

/* ===== UX16.1 — اسناد: جستجوی بارکد + فاکتور در یک ردیف ===== */
#tab-cardex #cardexFilterCard .filter-quick-row{grid-template-columns:minmax(0,1.35fr) minmax(240px,.95fr) minmax(150px,.8fr)!important;gap:7px!important;}
#tab-cardex #cardexFilterCard .barcode-search-box input{min-width:0!important;}
#tab-cardex #cardexFilterCard .invoice-only-search{display:flex!important;gap:5px!important;align-items:center!important;padding:0!important;margin:0!important;background:transparent!important;border:0!important;border-radius:0!important;min-width:0!important;}
#tab-cardex #cardexFilterCard .invoice-only-search input{margin:0!important;flex:1!important;min-width:0!important;height:34px!important;font-size:11px!important;}
#tab-cardex #cardexFilterCard .invoice-only-search button{margin:0!important;width:34px!important;min-width:34px!important;height:34px!important;padding:0!important;}
#tab-cardex #cardexFilterCard .invoice-only-search .invoice-clear-btn{background:#64748b!important;}
@media(max-width:700px){
  #tab-cardex #cardexFilterCard .filter-quick-row{grid-template-columns:1fr!important;}
  #tab-cardex #cardexFilterCard .invoice-only-search input{height:38px!important;font-size:11px!important;}
  #tab-cardex #cardexFilterCard .invoice-only-search button{height:38px!important;width:38px!important;min-width:38px!important;}
}
/* حذف تکی بارکد از لیست بارکدهای گرفته‌شده */
.dispatch-scanned-barcode-row{display:flex;align-items:center;gap:7px;background:#fff;border:1px solid #c4b5fd;border-radius:8px;padding:6px 7px;}
.dispatch-scanned-barcode-value{flex:1;min-width:0;font-family:monospace;font-size:11px;font-weight:900;word-break:break-all;color:#1f2937;}
.dispatch-scanned-barcode-delete{width:auto!important;min-width:54px!important;height:30px!important;margin:0!important;padding:4px 8px!important;background:#dc2626!important;border:0!important;border-radius:6px!important;color:#fff!important;font-size:10px!important;font-weight:900!important;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */


/* ===== داشبورد: مرکز هشدار و کارهای فوری ===== */
.dashboard-action-center{margin-bottom:10px;border:1px solid #d7e0eb;border-radius:11px;background:#fff;box-shadow:0 4px 12px rgba(37,55,80,.05);overflow:hidden;}
.dashboard-action-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;background:linear-gradient(135deg,#f8fafc,#eef4fb);border-bottom:1px solid #dbe4ef;flex-wrap:wrap;}
.dashboard-action-title{font-size:14px;font-weight:900;color:#172033;display:flex;align-items:center;gap:7px;}
.dashboard-action-count{font-size:11px;font-weight:900;color:#fff;background:#dc2626;border-radius:999px;padding:4px 9px;min-width:26px;text-align:center;}
.dashboard-alert-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:8px;}
.dashboard-alert-card{border:1px solid #e1e7ef;border-radius:9px;background:#fff;padding:9px;min-width:0;}
.dashboard-alert-card.receipt{border-right:4px solid #dc2626;}
.dashboard-alert-card.loading{border-right:4px solid #d97706;}
.dashboard-alert-card.incomplete{border-right:4px solid #7c3aed;}
.dashboard-alert-label{font-size:11px;font-weight:900;color:#475569;margin-bottom:6px;}
.dashboard-alert-total{font-size:20px;font-weight:900;color:#172033;margin-bottom:7px;}
.dashboard-alert-list{display:flex;flex-direction:column;gap:5px;max-height:150px;overflow:auto;}
.dashboard-alert-row{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 7px;background:#f8fafc;border:1px solid #e6ebf2;border-radius:7px;}
.dashboard-alert-main{min-width:0;flex:1;}
.dashboard-alert-invoice{font-size:11px;font-weight:900;color:#1d4ed8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dashboard-alert-meta{font-size:9px;font-weight:700;color:#64748b;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dashboard-alert-btn{flex:0 0 auto;border:0;border-radius:6px;padding:5px 7px;font-family:Tahoma;font-size:9px;font-weight:900;color:#fff;cursor:pointer;margin:0;width:auto;box-shadow:none;}
.dashboard-alert-btn.receipt{background:#dc2626;}
.dashboard-alert-btn.loading{background:#d97706;}
.dashboard-alert-btn.open{background:#2563eb;}
.dashboard-alert-empty{padding:14px 6px;text-align:center;font-size:10px;font-weight:800;color:#059669;background:#f0fdf4;border-radius:7px;}
@media(max-width:900px){.dashboard-alert-grid{grid-template-columns:1fr 1fr;}.dashboard-alert-card.incomplete{grid-column:1/-1;}}
@media(max-width:600px){.dashboard-alert-grid{grid-template-columns:1fr;}.dashboard-alert-card.incomplete{grid-column:auto;}.dashboard-alert-row{align-items:flex-start;}.dashboard-action-head{padding:9px 10px;}}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */


/* فرم ورود: نمایش صحیح در موبایل */
.entry-meta-row{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
.entry-meta-field{min-width:0 !important; width:100% !important;}
.entry-meta-field input{max-width:100% !important; box-sizing:border-box !important; min-width:0 !important;}
@media (max-width: 760px){
  .entry-meta-row{grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important;}
  .entry-meta-field label{font-size:11px !important; white-space:normal !important; line-height:1.35 !important;}
  .entry-meta-field input{font-size:13px !important; padding:9px 5px !important;}
}
@media (max-width: 430px){
  .entry-meta-row{grid-template-columns:1fr !important; gap:7px !important;}
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */


/* ===== ماژول انبارگردانی دوره‌ای ===== */
.inventory-count-toolbar{display:grid;grid-template-columns:180px 220px 1fr auto;gap:9px;align-items:end;margin-bottom:10px;}
.inventory-count-toolbar .count-field{min-width:0;}
.inventory-count-toolbar label{display:block;font-size:11px;font-weight:900;color:var(--dark);margin-bottom:4px;}
.inventory-count-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:8px 0 10px;}
.inventory-count-stat{background:#f8fafc;border:1px solid var(--border);border-radius:9px;padding:8px 10px;display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:900;}
.inventory-count-stat b{font-size:16px;color:var(--dark);}
.inventory-count-table{max-height:calc(100vh - 330px);overflow:auto;border:1px solid var(--border);border-radius:9px;background:#fff;}
.inventory-count-table table{min-width:820px;}
.inventory-count-table th{position:sticky;top:0;z-index:5;background:#eef3f8 !important;}
.inventory-count-input{width:120px!important;margin:0!important;text-align:center!important;font-weight:900!important;}
.inventory-count-row.diff{background:#fff7ed;}
.inventory-count-row.match{background:#ecfdf5;}
.inventory-count-actions{display:flex;gap:7px;flex-wrap:wrap;}
.inventory-count-actions button{width:auto;margin:0;padding:8px 12px;font-size:11px;}
.inventory-count-note{background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;padding:9px 11px;font-size:11px;font-weight:800;color:#1e40af;line-height:1.8;margin-bottom:10px;}
@media(max-width:800px){
 .inventory-count-toolbar{grid-template-columns:1fr 1fr;}
 .inventory-count-toolbar .count-wide{grid-column:1/-1;}
 .inventory-count-summary{grid-template-columns:1fr 1fr;}
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: inline-scan-dock-css */

#inlineScanDock{position:fixed; z-index:20000; right:10px; bottom:10px; width:320px; background:#0f172a; border:2px solid #8b5cf6; border-radius:14px; box-shadow:0 10px 30px rgba(0,0,0,.45); overflow:hidden; display:none; direction:rtl; font-family:inherit; touch-action:none;}
#inlineScanDock.big{width:min(480px,95vw);}
#inlineScanDockHead{display:flex; align-items:center; justify-content:space-between; gap:6px; padding:6px 8px; background:#1e293b; cursor:move; user-select:none;}
#inlineScanDockHead .ttl{color:#e2e8f0; font-size:11px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
#inlineScanDockHead button{width:auto!important; margin:0!important; padding:3px 7px!important; font-size:11px!important; font-weight:900!important; border:0!important; border-radius:6px!important; color:#fff!important; line-height:1.4!important; min-height:0!important; cursor:pointer;}
#inlineScanStage{position:relative; width:100%; min-height:150px; background:#000; overflow:hidden;}
#inlineScanVideo{width:100%; display:block; max-height:62vh; object-fit:contain; background:#000;}
#inlineScanHost{width:100%;}
#inlineScanHost video{width:100%!important; height:auto!important; display:block;}
#inlineScanFrame{position:absolute; left:3%; right:3%; top:32%; bottom:32%; border:2px solid rgba(139,92,246,.95); border-radius:6px; pointer-events:none;}
#inlineScanLaser{position:absolute; left:3%; right:3%; top:50%; height:2px; background:#ef4444; box-shadow:0 0 10px #ef4444; transform:translateY(-50%); pointer-events:none;}
#inlineScanBadge{padding:6px 8px; background:#fff; color:#111827; font-size:11px; font-weight:900; text-align:center; line-height:1.7;}
#inlineScanStatus{padding:4px 8px 6px; background:#f1f5f9; color:#334155; font-size:9px; font-weight:800; text-align:center; word-break:break-word;}
#inlineScanCtrl{display:flex; align-items:center; gap:6px; padding:5px 9px; background:#e2e8f0;}
#inlineScanCtrl span{font-size:10px; font-weight:900; color:#334155; white-space:nowrap;}
#inlineScanZoom{flex:1; width:auto!important; margin:0!important; min-height:0!important; padding:0!important;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: inline-scan-photo-css-v5 */

#inlineScanPhotoBtn{display:block; width:calc(100% - 16px); margin:8px; padding:12px; background:#059669; color:#fff; border:0; border-radius:10px; font-size:14px; font-weight:900; cursor:pointer;}
#inlineScanPhotoBtn:active{background:#047857;}
#inlineScanPhotoStatus{padding:0 9px 8px; font-size:10px; font-weight:800; color:#b45309; text-align:center; min-height:14px;}
#inlineScanDiag{padding:6px 9px; background:#111827; color:#a5f3fc; font-size:9px; font-family:monospace; text-align:left; direction:ltr; max-height:110px; overflow:auto; white-space:pre-wrap; word-break:break-all;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: inline-scan-crop-css */

#inlineScanCropOverlay{display:none; position:fixed; inset:0; background:rgba(0,0,0,.92); z-index:30000; direction:rtl; flex-direction:column;}
#inlineScanCropOverlay.show{display:flex;}
#inlineScanCropHead{padding:10px 14px; background:#1e293b; color:#fff; font-size:13px; font-weight:900; text-align:center;}
#inlineScanCropStage{position:relative; flex:1; overflow:auto; display:flex; align-items:center; justify-content:center; touch-action:none;}
#inlineScanCropImg{max-width:100%; display:block; user-select:none; -webkit-user-drag:none;}
#inlineScanCropBox{position:absolute; border:3px solid #22c55e; background:rgba(34,197,94,.12); box-shadow:0 0 0 2000px rgba(0,0,0,.55); touch-action:none;}
#inlineScanCropBox::after{content:'بارکد را داخل این کادر بگیرید'; position:absolute; top:-22px; right:0; color:#22c55e; font-size:10px; font-weight:900; white-space:nowrap;}
.inlineScanHandle{position:absolute; width:22px; height:22px; background:#22c55e; border-radius:50%; border:2px solid #fff;}
.inlineScanHandle.nw{top:-11px; left:-11px; cursor:nwse-resize;}
.inlineScanHandle.se{bottom:-11px; right:-11px; cursor:nwse-resize;}
#inlineScanCropFoot{padding:10px; background:#1e293b; display:flex; gap:8px;}
#inlineScanCropFoot button{flex:1; padding:13px; border:0; border-radius:10px; font-size:14px; font-weight:900; color:#fff; cursor:pointer;}
#inlineScanCropGo{background:#22c55e;}
#inlineScanCropCancel{background:#ef4444;}
#inlineScanCropStatus{padding:0 12px 10px; background:#1e293b; color:#fbbf24; font-size:11px; font-weight:800; text-align:center; min-height:16px;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: inline-scan-candidates-css */

#inlineScanCandidates{display:none; margin-top:8px; padding:8px; background:#fff; border:2px solid #f59e0b; border-radius:10px;}
#inlineScanCandidates.show{display:block;}
#inlineScanCandidates .hdr{font-size:11px; font-weight:900; color:#92400e; margin-bottom:6px; text-align:center;}
#inlineScanCandidates button{display:block; width:100%; margin:4px 0; padding:9px; background:#f1f5f9; border:2px solid #cbd5e1; border-radius:8px; font-size:13px; font-weight:900; font-family:monospace; color:#111827; cursor:pointer;}
#inlineScanCandidates button:active{background:#e2e8f0;}
#inlineScanManualRow{display:flex; gap:6px; margin-top:6px;}
#inlineScanManualRow input{flex:1; padding:9px; border:2px solid #cbd5e1; border-radius:8px; font-size:13px; font-family:monospace;}
#inlineScanManualRow button{width:auto; padding:9px 12px; background:#059669; color:#fff; border:0; border-radius:8px; font-size:12px; font-weight:900;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: quagga-live-dock-css */

#quaggaDock{position:fixed; z-index:20000; right:10px; bottom:10px; width:320px; background:#0f172a; border:2px solid #8b5cf6; border-radius:14px; box-shadow:0 10px 30px rgba(0,0,0,.45); overflow:hidden; display:none; direction:rtl; font-family:inherit; touch-action:none;}
#quaggaDock.big{width:min(480px,95vw);}
#quaggaDockHead{display:flex; align-items:center; justify-content:space-between; gap:6px; padding:6px 8px; background:#1e293b; cursor:move; user-select:none;}
#quaggaDockHead .ttl{color:#e2e8f0; font-size:11px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
#quaggaDockHead button{width:auto!important; margin:0!important; padding:3px 7px!important; font-size:11px!important; font-weight:900!important; border:0!important; border-radius:6px!important; color:#fff!important; line-height:1.4!important; min-height:0!important; cursor:pointer;}
#quaggaStage{position:relative; width:100%; min-height:170px; max-height:60vh; background:#000; overflow:hidden;}
#quaggaStage video, #quaggaStage canvas{position:absolute; top:0; left:0; width:100%!important; height:100%!important; object-fit:cover;}
#quaggaScanArea{position:absolute; left:5%; right:5%; top:25%; bottom:25%; border:2px solid rgba(34,197,94,.95); border-radius:6px; pointer-events:none; z-index:5;}
#quaggaFlash{position:absolute; inset:0; background:#22c55e; opacity:0; pointer-events:none; z-index:6;}
#quaggaFlash.hit{opacity:.55; transition:opacity .08s ease-out;}
#quaggaBadge{padding:7px 8px; background:#fff; color:#111827; font-size:12px; font-weight:900; text-align:center; line-height:1.7;}
#quaggaBadge b{color:#6d28d9;}
#quaggaStatus{padding:4px 8px 6px; background:#f1f5f9; color:#334155; font-size:9px; font-weight:800; text-align:center;}
#quaggaLastCode{padding:6px 8px; background:#ecfdf5; color:#065f46; font-size:12px; font-weight:900; text-align:center; font-family:monospace; border-top:1px dashed #a7f3d0; min-height:18px;}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: app-dialog-css */

#appToastStack{position:fixed; left:50%; top:16px; transform:translateX(-50%); z-index:40000; display:flex; flex-direction:column; gap:8px; width:min(380px,92vw); direction:rtl; pointer-events:none;}
.appToast{pointer-events:auto; background:var(--surface,#fff); border-radius:var(--radius,10px); box-shadow:0 12px 30px rgba(0,0,0,.22); overflow:hidden; border:1px solid var(--border,#cbd5e1); animation:appToastIn .18s ease-out;}
@keyframes appToastIn{from{opacity:0; transform:translateY(-10px);} to{opacity:1; transform:translateY(0);}}
.appToast .row{display:flex; align-items:flex-start; gap:10px; padding:12px 14px;}
.appToast .icon{font-size:20px; line-height:1; flex:0 0 auto;}
.appToast .msg{font-size:13px; font-weight:800; color:var(--text-main,#1e293b); white-space:pre-line; flex:1; line-height:1.7;}
.appToast .x{cursor:pointer; font-size:15px; color:var(--text-muted,#64748b); flex:0 0 auto; padding:2px 4px;}
.appToast .bar{height:3px; width:100%; transform-origin:right; animation:appToastBar linear forwards;}
@keyframes appToastBar{from{transform:scaleX(1);} to{transform:scaleX(0);}}
.appToast.success{border-color:#a7f3d0;} .appToast.success .bar{background:var(--success,#059669);}
.appToast.error{border-color:#fecaca;} .appToast.error .bar{background:var(--danger,#dc2626);}
.appToast.warning{border-color:#fde68a;} .appToast.warning .bar{background:var(--warning,#d97706);}
.appToast.info{border-color:#bfdbfe;} .appToast.info .bar{background:var(--primary,#2563eb);}

#appDialogOverlay{display:none; position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:40001; align-items:center; justify-content:center; direction:rtl; padding:16px;}
#appDialogOverlay.show{display:flex;}
#appDialogCard{background:var(--surface,#fff); border-radius:var(--radius,10px); width:min(360px,92vw); box-shadow:0 20px 50px rgba(0,0,0,.35); overflow:hidden;}
#appDialogCard .hd{padding:16px 16px 6px; font-size:14px; font-weight:900; color:var(--text-main,#1e293b); white-space:pre-line; line-height:1.8; text-align:center;}
#appDialogCard input{width:calc(100% - 32px); margin:8px 16px; padding:10px; border:2px solid var(--border,#cbd5e1); border-radius:8px; font-size:14px; text-align:center;}
#appDialogCard .ft{display:flex; gap:8px; padding:12px 16px 16px;}
#appDialogCard .ft button{flex:1; padding:11px; border:0; border-radius:8px; font-size:13px; font-weight:900; color:#fff; cursor:pointer;}
#appDialogYes{background:var(--primary,#2563eb);}
#appDialogNo{background:#e2e8f0!important; color:var(--text-main,#1e293b)!important;}



/* ========================================================================
   DARK MICA v5 — Windows 11 / premium glass inspired
   هدف: خوانایی کامل، رنگ‌های زنده و کنترل‌شده، منوی براق، شیشه‌ای واقعی
   بدون MutationObserver یا دستکاری مداوم DOM
   ======================================================================== */

html[data-theme="dark"]{
    --bg-color:#080d14 !important;
    --surface:#131e2d !important;
    --surface-2:#17263a !important;
    --surface-3:#1c2f49 !important;
    --primary:#244a75 !important;
    --success:#13a968 !important;
    --danger:#e24a52 !important;
    --warning:#e29a32 !important;
    --dark:#f4f7fb !important;
    --text-main:#eef3f8 !important;
    --text-muted:#aab7c6 !important;
    --border:#2b4059 !important;
    --radius:12px !important;
    color-scheme:dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body{
    background:
      radial-gradient(760px 500px at 96% -5%, rgba(38,76,117,.22), transparent 66%),
      radial-gradient(650px 450px at 2% 15%, rgba(22,53,84,.16), transparent 68%),
      #080d14 !important;
    color:var(--text-main) !important;
}

html[data-theme="dark"] body::before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    z-index:0;
    background:
      linear-gradient(135deg, rgba(255,255,255,.025), transparent 24%, transparent 72%, rgba(83,128,173,.035)),
      radial-gradient(500px 300px at 50% 0%, rgba(255,255,255,.018), transparent 72%);
}

html[data-theme="dark"] #app-wrapper{
    position:relative !important;
    z-index:1 !important;
    max-width:1380px !important;
    background:rgba(10,17,27,.90) !important;
    
    border-left:1px solid rgba(174,202,230,.10) !important;
    border-right:1px solid rgba(174,202,230,.10) !important;
    box-shadow:
      0 26px 70px rgba(0,0,0,.48),
      inset 0 1px 0 rgba(255,255,255,.055) !important;
}

/* نوارها / منوی اصلی */
html[data-theme="dark"] #top-bar,
html[data-theme="dark"] .tabs{
    background:rgba(9,16,26,.78) !important;
    
    border-color:rgba(92,124,156,.24) !important;
    box-shadow:
      0 9px 28px rgba(0,0,0,.20),
      inset 0 -1px 0 rgba(255,255,255,.035),
      inset 0 1px 0 rgba(255,255,255,.035) !important;
}
html[data-theme="dark"] .tabs{padding:6px 8px !important;gap:6px !important;}
html[data-theme="dark"] .tab-btn{
    max-width:none !important;
    position:relative !important;
    overflow:hidden !important;
    background:linear-gradient(180deg, rgba(29,45,65,.94), rgba(18,30,45,.94)) !important;
    color:#cbd7e3 !important;
    border:1px solid rgba(102,133,164,.26) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.07),
      inset 0 -1px 0 rgba(0,0,0,.22),
      0 3px 10px rgba(0,0,0,.10) !important;
    border-radius:10px !important;
    text-shadow:0 1px 1px rgba(0,0,0,.20) !important;
}
html[data-theme="dark"] .tab-btn::before{
    content:"";
    position:absolute;
    inset:1px 1px auto;
    height:42%;
    border-radius:9px 9px 5px 5px;
    background:linear-gradient(180deg,rgba(255,255,255,.055),transparent);
    pointer-events:none;
}
html[data-theme="dark"] .tab-btn:hover{
    background:linear-gradient(180deg,#233c5b,#1a304a) !important;
    color:#f5f8fc !important;
    border-color:rgba(121,159,193,.44) !important;
    transform:translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.10),
      0 7px 17px rgba(0,0,0,.20),
      0 0 0 1px rgba(55,100,145,.08) !important;
}
html[data-theme="dark"] .tab-btn.active{
    background:linear-gradient(180deg,#2a547f 0%,#1d3f65 56%,#193858 100%) !important;
    border-color:#4e7ca9 !important;
    color:#ffffff !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.16),
      inset 0 -1px 0 rgba(0,0,0,.18),
      0 8px 20px rgba(12,42,72,.34),
      0 0 18px rgba(49,99,145,.12) !important;
}
html[data-theme="dark"] .tab-logout{
    background:linear-gradient(180deg,#b83b45,#8f2932) !important;
    border-color:#d35a62 !important;
    color:#fff !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 6px 15px rgba(100,20,27,.20) !important;
}

/* تیترها و متن — هیچ متن اصلی نباید خاکستری محو باشد */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] label,
html[data-theme="dark"] legend,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] .text-main,
html[data-theme="dark"] .qty-primary,
html[data-theme="dark"] .office-doc-main,
html[data-theme="dark"] .recent-invoice-main{
    color:#f1f5f9 !important;
}
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] td,
html[data-theme="dark"] span,
html[data-theme="dark"] div{
    color:inherit;
}
html[data-theme="dark"] p,
html[data-theme="dark"] li{color:#dce5ee !important;}
html[data-theme="dark"] small,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .recent-doc-sub,
html[data-theme="dark"] .office-doc-user,
html[data-theme="dark"] .doc-id-mini,
html[data-theme="dark"] .receipt-date,
html[data-theme="dark"] .m-doc-date,
html[data-theme="dark"] .m-doc-user,
html[data-theme="dark"] .m-route small,
html[data-theme="dark"] .m-doc-summary small,
html[data-theme="dark"] .m-item-qty,
html[data-theme="dark"] .qty-secondary,
html[data-theme="dark"] .qty-weight{
    color:#a9b8c8 !important;
}
html[data-theme="dark"] a{color:#8fb6df !important;}

/* هدرها */
html[data-theme="dark"] h2{border-bottom-color:#2c425b !important;}
html[data-theme="dark"] .dash-header{
    background:
      radial-gradient(420px 120px at 8% 0%, rgba(78,121,162,.19), transparent 70%),
      linear-gradient(135deg,rgba(28,48,71,.96),rgba(13,24,38,.96)) !important;
    border:1px solid #38536f !important;
    color:#f5f8fb !important;
    box-shadow:0 12px 28px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .dash-header h2{color:#fff !important;}
html[data-theme="dark"] .dash-card h3{color:#a9b7c7 !important;}
html[data-theme="dark"] .dash-card .val{color:#f6f8fb !important;}

/* شیشه‌ی کارت‌ها و پنل‌ها */
html[data-theme="dark"] .card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .cart-panel,
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] #cardexModeSelectorCard,
html[data-theme="dark"] #cardexFilterCard,
html[data-theme="dark"] .req-box,
html[data-theme="dark"] .req-item,
html[data-theme="dark"] .scrollable-list,
html[data-theme="dark"] .m-doc-card,
html[data-theme="dark"] .m-route,
html[data-theme="dark"] .m-doc-summary>div,
html[data-theme="dark"] .m-item{
    background:
      linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94)) !important;
    border-color:rgba(78,108,139,.42) !important;
    box-shadow:
      0 10px 26px rgba(0,0,0,.16),
      inset 0 1px 0 rgba(255,255,255,.055),
      inset 0 0 0 1px rgba(255,255,255,.012) !important;
    
    color:#eaf0f6 !important;
}
html[data-theme="dark"] .settings-card{border-top-color:#3c78ad !important;}
html[data-theme="dark"] .req-box{background:rgba(16,29,44,.92) !important;}
html[data-theme="dark"] .req-item{background:linear-gradient(180deg,#182b41,#142437) !important;}

/* همه‌ی سطوح روشن قدیمی، از جمله inline-style */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#ffffff"],
html[data-theme="dark"] [style*="background-color: #ffffff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="rgb(255, 255, 255)"],
html[data-theme="dark"] [style*="rgb(255,255,255)"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background: #f1f5f9"],
html[data-theme="dark"] [style*="background:#f3f6fa"],
html[data-theme="dark"] [style*="background: #f3f6fa"],
html[data-theme="dark"] [style*="background:#eef2f7"],
html[data-theme="dark"] [style*="background: #eef2f7"],
html[data-theme="dark"] [style*="background:#f5f7fa"],
html[data-theme="dark"] [style*="background: #f5f7fa"]{
    background:linear-gradient(180deg,#17263a,#142235) !important;
    color:#e9eff5 !important;
    border-color:#30475f !important;
}

/* inline text رنگ قدیمی که در دارک نامرئی می‌شود */
html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#111827"],
html[data-theme="dark"] [style*="color: #111827"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#172033"],
html[data-theme="dark"] [style*="color: #172033"],
html[data-theme="dark"] [style*="color:#25324a"],
html[data-theme="dark"] [style*="color: #25324a"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color:#7a879a"],
html[data-theme="dark"] [style*="color: #7a879a"],
html[data-theme="dark"] [style*="color:#8a97aa"],
html[data-theme="dark"] [style*="color: #8a97aa"]{
    color:#d6e0e9 !important;
}
html[data-theme="dark"] [style*="color:#ffffff"],
html[data-theme="dark"] [style*="color: #ffffff"],
html[data-theme="dark"] [style*="color:#fff"],
html[data-theme="dark"] [style*="color: #fff"]{
    color:#f7f9fb !important;
}

/* ورودی‌ها */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .custom-select-display{
    background:linear-gradient(180deg,#111d2c,#0f1a28) !important;
    color:#f1f5f9 !important;
    border:1px solid #39516b !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.05),
      0 2px 6px rgba(0,0,0,.10) !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#93a4b5 !important;opacity:1 !important;}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .custom-select-display:focus{
    background:linear-gradient(180deg,#14253a,#112035) !important;
    border-color:#557fa9 !important;
    box-shadow:0 0 0 3px rgba(61,108,151,.20),inset 0 1px 0 rgba(255,255,255,.07) !important;
}
html[data-theme="dark"] .hardware-input{
    background:linear-gradient(180deg,#132942,#102238) !important;
    border-color:#5b86b0 !important;
    color:#fff !important;
    box-shadow:0 0 0 2px rgba(54,107,155,.10),inset 0 1px 0 rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] option{background:#101b2a !important;color:#eef3f8 !important;}
html[data-theme="dark"] input[type="checkbox"]{accent-color:#3d75aa;}

/* dropdown / autocomplete — شیشه‌ای و واضح */
html[data-theme="dark"] .custom-select-options,
html[data-theme="dark"] .autocomplete-list{
    background:rgba(15,25,39,.97) !important;
    border-color:#41617f !important;
    box-shadow:0 22px 48px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.06) !important;
    
}
html[data-theme="dark"] .custom-option,
html[data-theme="dark"] .autocomplete-item{
    background:transparent !important;
    color:#e7eef5 !important;
    border-color:#273b52 !important;
}
html[data-theme="dark"] .custom-option:hover,
html[data-theme="dark"] .autocomplete-item:hover{
    background:linear-gradient(90deg,rgba(43,82,122,.38),rgba(37,64,92,.20)) !important;
    color:#fff !important;
}

/* رادیو */
html[data-theme="dark"] .radio-label{
    background:linear-gradient(180deg,#17273b,#132337) !important;
    color:#dce6ef !important;
    border-color:#39516b !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.045) !important;
}
html[data-theme="dark"] .radio-label:has(input:checked){
    background:linear-gradient(180deg,#254b73,#1b3b5f) !important;
    border-color:#5b84ad !important;
    color:#fff !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.09),0 5px 14px rgba(15,55,89,.18) !important;
}

/* دکمه‌های عملیاتی — زنده، اما سرمه‌ای/لوکس */
html[data-theme="dark"] button{color:#fff;}
html[data-theme="dark"] .btn-blue{
    background:linear-gradient(180deg,#2c5b89,#20476f) !important;
    border:1px solid #507fab !important;
    color:#fff !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 7px 17px rgba(13,53,88,.28) !important;
}
html[data-theme="dark"] .btn-blue:hover{background:linear-gradient(180deg,#356a9a,#275579) !important;border-color:#6a95bb !important;}
html[data-theme="dark"] .btn-green{
    background:linear-gradient(180deg,#18b972,#0e9357) !important;
    border:1px solid #42cf91 !important;
    color:#fff !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 7px 17px rgba(9,101,59,.26) !important;
}
html[data-theme="dark"] .btn-red,
html[data-theme="dark"] .del-btn{
    background:linear-gradient(180deg,#ea565e,#c93b45) !important;
    border:1px solid #f2787f !important;
    color:#fff !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 7px 17px rgba(110,20,28,.25) !important;
}
html[data-theme="dark"] .btn-add{
    background:linear-gradient(180deg,#e7a33e,#c97919) !important;
    border:1px solid #f0bc67 !important;
    color:#fff !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 7px 17px rgba(118,69,13,.25) !important;
}
html[data-theme="dark"] .btn-scan{
    background:linear-gradient(180deg,#203a57,#172c44) !important;
    border:1px solid #486887 !important;
    color:#f3f7fb !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 6px 15px rgba(0,0,0,.16) !important;
}
html[data-theme="dark"] .dispatch-control-btn{color:#fff !important;}

/* وضعیت‌ها: رنگ زنده با کنتراست بالا */
html[data-theme="dark"] .badge.in{background:linear-gradient(180deg,#19b974,#0d9556) !important;color:#fff !important;box-shadow:0 5px 12px rgba(12,120,70,.22),inset 0 1px 0 rgba(255,255,255,.12) !important;}
html[data-theme="dark"] .badge.out{background:linear-gradient(180deg,#eb555c,#c93b45) !important;color:#fff !important;box-shadow:0 5px 12px rgba(120,24,31,.22),inset 0 1px 0 rgba(255,255,255,.12) !important;}
html[data-theme="dark"] .receipt-inline{background:#143d2e !important;color:#79e4ae !important;border-color:#328a63 !important;}
html[data-theme="dark"] .receipt-inline.pending{background:#3a2a15 !important;color:#ffc56c !important;border-color:#825c28 !important;}
html[data-theme="dark"] .draft-list{background:#302414 !important;border-color:#966d2e !important;color:#f4c776 !important;}
html[data-theme="dark"] .draft-total{background:#3a2915 !important;color:#ffd083 !important;border-color:#ad7b35 !important;}
html[data-theme="dark"] .req-item.done{background:#16382a !important;border-color:#2c9765 !important;}

/* جدول‌ها — مهم‌ترین بخش خوانایی */
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .cardex-main-table,
html[data-theme="dark"] .cardex-item-table{
    background:#0c1521 !important;
    border-color:#2f465f !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 18px rgba(0,0,0,.10) !important;
}
html[data-theme="dark"] table{
    background:#0c1521 !important;
    color:#eaf0f5 !important;
}
html[data-theme="dark"] thead,
html[data-theme="dark"] th{
    background:linear-gradient(180deg,#243a55,#1b2e45) !important;
    color:#f7f9fb !important;
    border-color:#3b526b !important;
    text-shadow:0 1px 1px rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] tbody tr:nth-child(odd) td{background:#0e1926 !important;}
html[data-theme="dark"] tbody tr:nth-child(even) td{background:#111d2c !important;}
html[data-theme="dark"] td{color:#e2e9f0 !important;border-color:#26394e !important;}
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] .group-row:hover td{background:#19304a !important;}
html[data-theme="dark"] .detail-row td{background:#132338 !important;}
html[data-theme="dark"] .cardex-main-table th,
html[data-theme="dark"] .cardex-item-table th{background:linear-gradient(180deg,#29425f,#20354d) !important;color:#f8fafc !important;}
html[data-theme="dark"] #lowStockTable td:first-child{color:#f0f4f8 !important;}
html[data-theme="dark"] #lowStockTable td:nth-child(2){color:#d8e2eb !important;}
html[data-theme="dark"] #lowStockTable td span{text-shadow:none !important;}

/* اسناد و موبایل */
html[data-theme="dark"] #cardexModeSelectorCard .radio-label,
html[data-theme="dark"] #cardexFilterCard .filter-advanced summary{
    background:linear-gradient(180deg,#17283c,#132337) !important;
    color:#e1eaf2 !important;
    border-color:#39516b !important;
}
html[data-theme="dark"] #cardexFilterCard .filter-advanced[open] summary{background:linear-gradient(180deg,#1e3550,#172b42) !important;}
html[data-theme="dark"] #tab-cardex .cardex-stat{background:linear-gradient(180deg,#17273a,#132235) !important;border-color:#30475e !important;}
html[data-theme="dark"] #tab-cardex .cardex-stat b{color:#f3f7fa !important;}
html[data-theme="dark"] .doc-action-primary{background:linear-gradient(180deg,#203952,#182e46) !important;color:#eef4f8 !important;border-color:#48627d !important;}
html[data-theme="dark"] .doc-action-primary:hover{background:linear-gradient(180deg,#294966,#1e3a58) !important;}
html[data-theme="dark"] .doc-action-popup{background:rgba(13,23,36,.97) !important;border-color:#48627d !important;box-shadow:0 22px 50px rgba(0,0,0,.50),inset 0 1px 0 rgba(255,255,255,.055) !important;}
html[data-theme="dark"] .m-doc-head{background:linear-gradient(135deg,#244462,#182f49) !important;border-color:#446784 !important;}
html[data-theme="dark"] .m-doc-invoice{color:#b8d5ef !important;}
html[data-theme="dark"] .m-route strong,
html[data-theme="dark"] .m-item-top strong,
html[data-theme="dark"] .m-doc-summary b{color:#f1f5f8 !important;}
html[data-theme="dark"] .m-details-toggle{background:linear-gradient(180deg,#1f3853,#182c43) !important;border-color:#486681 !important;color:#e5edf4 !important;}
html[data-theme="dark"] .m-act.blue{background:linear-gradient(180deg,#2d5d8e,#224b73) !important;color:#fff !important;}
html[data-theme="dark"] .m-act.green{background:linear-gradient(180deg,#18b974,#0d9556) !important;color:#fff !important;}
html[data-theme="dark"] .m-act.purple{background:linear-gradient(180deg,#725fba,#584696) !important;color:#fff !important;}
html[data-theme="dark"] .m-act.orange{background:linear-gradient(180deg,#e6a143,#c67a1e) !important;color:#fff !important;}
html[data-theme="dark"] .m-act.red{background:linear-gradient(180deg,#ea565e,#c93b45) !important;color:#fff !important;}
html[data-theme="dark"] .m-item-empty,
html[data-theme="dark"] .m-doc-empty{background:#101c2b !important;border-color:#40546b !important;color:#b8c5d2 !important;}
html[data-theme="dark"] .m-barcode-chip{background:#15583d !important;color:#91efbd !important;}
html[data-theme="dark"] .m-barcode-more{background:#1b2e45 !important;color:#d4dee8 !important;}
html[data-theme="dark"] .m-batch{background:#392716 !important;color:#ffd083 !important;border-color:#825c28 !important;}

/* مودال / اسکن / ورود */
html[data-theme="dark"] .modal-header{background:linear-gradient(180deg,#20364f,#192b41) !important;border-color:#3a536e !important;color:#f2f6f9 !important;box-shadow:inset 0 1px 0 rgba(255,255,255,.07) !important;}
html[data-theme="dark"] .modal-body{background:#0d1725 !important;color:#dfe8ef !important;}
html[data-theme="dark"] #scanner-modal,
html[data-theme="dark"] .modal-overlay{background:rgba(3,7,12,.78) !important;}
html[data-theme="dark"] #reader{background:#070b10 !important;border-color:#527494 !important;box-shadow:0 18px 42px rgba(0,0,0,.45) !important;}
html[data-theme="dark"] #dispatchCameraContainer{background:#070b10 !important;border-color:#527494 !important;box-shadow:0 14px 30px rgba(0,0,0,.34) !important;}
html[data-theme="dark"] .camera-btn-container{background:rgba(10,18,29,.86) !important;border-top:1px solid rgba(110,145,177,.18);}
html[data-theme="dark"] #document-guide{box-shadow:0 0 0 4000px rgba(1,5,10,.76) !important;}
html[data-theme="dark"] .guide-text{background:#15905a !important;color:#fff !important;box-shadow:0 5px 14px rgba(8,109,66,.25) !important;}
html[data-theme="dark"] #upload-progress-overlay{background:rgba(3,7,12,.80) !important;}
html[data-theme="dark"] .upload-progress-box{background:linear-gradient(180deg,#1a2b40,#132235) !important;border-color:#466a8d !important;color:#f1f5f9 !important;box-shadow:0 24px 55px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.07) !important;}
html[data-theme="dark"] .progress-bar-bg{background:#23384e !important;}
html[data-theme="dark"] .progress-bar-fill{background:linear-gradient(90deg,#2f6da3,#18a969) !important;box-shadow:0 0 12px rgba(44,113,164,.18);}
html[data-theme="dark"] #login-overlay{background:rgba(4,9,15,.90) !important;}
html[data-theme="dark"] .login-box{background:linear-gradient(180deg,#1b2e44,#132236) !important;color:#f0f5f9 !important;border:1px solid #3f5e7b !important;box-shadow:0 26px 60px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.07) !important;}

/* toast / dialog */
html[data-theme="dark"] .appToast,
html[data-theme="dark"] #appDialogCard{
    background:rgba(19,32,48,.94) !important;
    color:#f1f5f9 !important;
    border:1px solid #47647f !important;
    box-shadow:0 24px 55px rgba(0,0,0,.50),inset 0 1px 0 rgba(255,255,255,.065) !important;
    
}
html[data-theme="dark"] .appToast .msg,
html[data-theme="dark"] #appDialogCard .hd{color:#f1f5f9 !important;}
html[data-theme="dark"] .appToast .x{color:#afbdca !important;}
html[data-theme="dark"] #appDialogOverlay{background:rgba(2,6,11,.70) !important;}
html[data-theme="dark"] #appDialogNo{background:#2a3b50 !important;color:#eef3f8 !important;}
html[data-theme="dark"] #appDialogYes{background:linear-gradient(180deg,#2b5885,#20476f) !important;color:#fff !important;}

/* inline backgrounds معنایی — بعد از override عمومی دوباره معنی‌دار شوند */
html[data-theme="dark"] [style*="background:#fff1f2"],
html[data-theme="dark"] [style*="background: #fff1f2"],
html[data-theme="dark"] [style*="background:#fee2e2"],
html[data-theme="dark"] [style*="background: #fee2e2"]{background:#381d22 !important;color:#ffc2c5 !important;}
html[data-theme="dark"] [style*="background:#ecfdf5"],
html[data-theme="dark"] [style*="background: #ecfdf5"],
html[data-theme="dark"] [style*="background:#f0fdf4"],
html[data-theme="dark"] [style*="background: #f0fdf4"]{background:#15392a !important;color:#91edbc !important;}
html[data-theme="dark"] [style*="background:#fffbeb"],
html[data-theme="dark"] [style*="background: #fffbeb"],
html[data-theme="dark"] [style*="background:#fff7ed"],
html[data-theme="dark"] [style*="background: #fff7ed"]{background:#392914 !important;color:#ffd384 !important;}
html[data-theme="dark"] [style*="background:#eff6ff"],
html[data-theme="dark"] [style*="background: #eff6ff"],
html[data-theme="dark"] [style*="background:#edf4ff"],
html[data-theme="dark"] [style*="background: #edf4ff"]{background:#19344f !important;color:#b8d8f5 !important;}
html[data-theme="dark"] [style*="background:#ede9fe"],
html[data-theme="dark"] [style*="background: #ede9fe"],
html[data-theme="dark"] [style*="background:#f5f3ff"],
html[data-theme="dark"] [style*="background: #f5f3ff"]{background:#2b2442 !important;color:#d3c5ff !important;}

/* پالت رنگ inline دکمه‌ها */
html[data-theme="dark"] [style*="background:#f59e0b"],
html[data-theme="dark"] [style*="background: #f59e0b"],
html[data-theme="dark"] [style*="background:#f97316"],
html[data-theme="dark"] [style*="background: #f97316"]{background:linear-gradient(180deg,#e7a33e,#c97919) !important;color:#fff !important;}
html[data-theme="dark"] [style*="background:#ef4444"],
html[data-theme="dark"] [style*="background: #ef4444"],
html[data-theme="dark"] [style*="background:#dc2626"],
html[data-theme="dark"] [style*="background: #dc2626"]{background:linear-gradient(180deg,#ea565e,#c93b45) !important;color:#fff !important;}
html[data-theme="dark"] [style*="background:#10b981"],
html[data-theme="dark"] [style*="background: #10b981"],
html[data-theme="dark"] [style*="background:#059669"],
html[data-theme="dark"] [style*="background: #059669"]{background:linear-gradient(180deg,#18b974,#0d9556) !important;color:#fff !important;}
html[data-theme="dark"] [style*="background:#8b5cf6"],
html[data-theme="dark"] [style*="background: #8b5cf6"],
html[data-theme="dark"] [style*="background:#6d28d9"],
html[data-theme="dark"] [style*="background: #6d28d9"]{background:linear-gradient(180deg,#7865be,#5d4c9e) !important;color:#fff !important;}
html[data-theme="dark"] [style*="background:#3b82f6"],
html[data-theme="dark"] [style*="background: #3b82f6"],
html[data-theme="dark"] [style*="background:#2563eb"],
html[data-theme="dark"] [style*="background: #2563eb"]{background:linear-gradient(180deg,#2c5b89,#20476f) !important;color:#fff !important;}

/* کارت‌های آماری/اخیر */
html[data-theme="dark"] .recent-item{border-bottom-color:#2a3d53 !important;}
html[data-theme="dark"] .inline-filter-bar button{color:#fff !important;}

/* اسکرول‌بار ظریف */
html[data-theme="dark"] *{scrollbar-color:#405873 #0b1320;}
html[data-theme="dark"] ::-webkit-scrollbar{width:8px;height:8px;}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:#0b1320;}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#4b6682,#334b64);border-radius:10px;border:2px solid #0b1320;}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{background:#5c7794;}

/* دکمه تغییر تم */
/* پایه: این دکمه باید همیشه — چه در حالت روشن چه تاریک — گوشه پایین‌چپ باشد.
   قبلاً این استایل پایه اصلاً تعریف نشده بود و فقط نسخه تاریکش وجود داشت،
   برای همین در حالت روشن (پیش‌فرض بارگذاری صفحه) دکمه اصلاً دیده نمی‌شد. */
#appThemeToggle{
    position:fixed !important; left:10px !important; bottom:10px !important; z-index:19000 !important;
    width:44px !important; height:44px !important; border-radius:50% !important;
    display:flex !important; align-items:center !important; justify-content:center !important;
    font-size:18px !important; cursor:pointer !important;
    border:1px solid #d7e0eb !important;
    background:#ffffff !important; color:#1e293b !important;
    box-shadow:0 8px 20px rgba(30,50,80,.18) !important;
}
html[data-theme="dark"] #appThemeToggle{
    width:44px !important;height:44px !important;
    border:1px solid rgba(127,160,193,.42) !important;
    background:linear-gradient(180deg,rgba(30,48,70,.94),rgba(17,29,44,.94)) !important;
    color:#fff !important;
    box-shadow:0 14px 28px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.10),0 0 0 1px rgba(46,85,122,.10) !important;
    
}
html[data-theme="dark"] #appThemeToggle:hover{background:linear-gradient(180deg,#294867,#1b334f) !important;border-color:#6b8dac !important;}

/* موبایل */
@media(max-width:700px){
  html[data-theme="dark"] .tab-btn{border-radius:10px !important;}
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .settings-card,
  html[data-theme="dark"] .form-panel,
  html[data-theme="dark"] .cart-panel{border-radius:12px !important;}
  html[data-theme="dark"] #appThemeToggle{left:10px;bottom:10px;}
}

/* ---------------- پوشش کامل‌کننده — رفع نقاط جامانده از تم Mica ---------------- */
/* موارد زیر با اسکن کامل تمام ۱۴ بلاک <style> این فایل (نه فقط بلاک اول) پیدا شدند:
   هر کلاسی که پس‌زمینه/متن روشن داشت ولی قبلاً در تم شب override نشده بود —
   شامل کارت «بارگیری ناقص»، «آخرین فعالیت‌ها»، ردیف‌های بارکد بارگیری،
   جدول انبارگردانی، تب کاردکس، و غیره. */
html[data-theme="dark"] .detail-row{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .m-doc-internal{color:#7fb2ef!important;}
html[data-theme="dark"] .m-route-arrow{color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .m-receipt-alert{color:#f0b862!important;}
html[data-theme="dark"] .dispatch-scanned-barcode-row{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .dispatch-scanned-barcode-value{color:#eef3f8!important;}
html[data-theme="dark"] .dispatch-scanned-barcode-delete{background:#c8434a!important;}
html[data-theme="dark"] .dashboard-action-center{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .dashboard-action-title{color:#eef3f8!important;}
html[data-theme="dark"] .dashboard-action-count{background:#c8434a!important;}
html[data-theme="dark"] .dashboard-alert-card{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .dashboard-alert-label{color:#7fb2ef!important;}
html[data-theme="dark"] .dashboard-alert-total{color:#eef3f8!important;}
html[data-theme="dark"] .dashboard-alert-row{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .dashboard-alert-invoice{color:#7fb2ef!important;}
html[data-theme="dark"] .dashboard-alert-meta{color:#7fb2ef!important;}
html[data-theme="dark"] .dashboard-alert-empty{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#4bd499!important;}
html[data-theme="dark"] .inventory-count-stat{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .inventory-count-table{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .inventory-count-note{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #inlineScanLaser{background:#c8434a!important;}
html[data-theme="dark"] #inlineScanBadge{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#eef3f8!important;}
html[data-theme="dark"] #inlineScanStatus{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #inlineScanCtrl{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #inlineScanPhotoBtn{background:#13a968!important;color:#aab7c6!important;}
html[data-theme="dark"] #inlineScanPhotoStatus{color:#f0b862!important;}
html[data-theme="dark"] #inlineScanDiag{color:#7fb2ef!important;}
html[data-theme="dark"] #inlineScanCropHead{color:#aab7c6!important;}
html[data-theme="dark"] .inlineScanHandle{background:#13a968!important;}
html[data-theme="dark"] #inlineScanCropGo{background:#13a968!important;}
html[data-theme="dark"] #inlineScanCropCancel{background:#c8434a!important;}
html[data-theme="dark"] #inlineScanCropStatus{color:#f0b862!important;}
html[data-theme="dark"] #inlineScanCandidates{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #quaggaFlash{background:#13a968!important;}
html[data-theme="dark"] #quaggaBadge{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#eef3f8!important;}
html[data-theme="dark"] #quaggaStatus{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #quaggaLastCode{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#eef3f8!important;}
/* تاکید مستقیم روی مواردی که در اسکرین‌شات دیده شد */
html[data-theme="dark"] .dashboard-alert-card{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border:1px solid rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .dashboard-alert-empty{background:rgba(19,169,104,.16)!important;color:#4bd499!important;}
html[data-theme="dark"] .dashboard-alert-label{color:#aab7c6!important;}
html[data-theme="dark"] .dashboard-alert-total{color:#eef3f8!important;}
html[data-theme="dark"] .dashboard-recent-card,html[data-theme="dark"] .dashboard-action-center{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border:1px solid rgba(78,108,139,.42)!important;}

/* ---------------- پوشش inline — رنگ‌های ساخته‌شده در جاوااسکریپت (ردیف جدول‌ها/بج‌ها) ---------------- */
html[data-theme="dark"] [style*="background-color: #e2e8f0"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background-color: #eff6ff"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background-color: #f1f5f9"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background-color: #f8fafc"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background-color: #fefeff"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background-color:#ecfdf5"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background: #e2e8f0"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background: #fef3c7"]{background:rgba(226,154,50,.16)!important;}
html[data-theme="dark"] [style*="background: #fff5f5"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#b8c5d5"]{background:rgba(58,110,163,.18)!important;}
html[data-theme="dark"] [style*="background:#dfe5ed"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#dfe6ee"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#dfe6ef"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#dfe7f1"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e2e8f0"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e5ebf3"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e6eefb"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e7f0ff"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e8edf3"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e8edf4"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e8eef5"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e8eef6"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e8f8f1"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e9eef5"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#e9f8f1"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#eaf1fa"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#eaf1fb"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#edf1f5"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#edf1f6"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#edf2f8"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#eef2f6"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#eef3f8"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f0f5fb"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f1f4f7"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f2f5f8"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f3f7fd"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f4f7fb"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f6f8fb"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f7f9fc"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f7faff"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#f9fafc"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#faf5ff"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fef2f2"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fef3c7"]{background:rgba(226,154,50,.16)!important;}
html[data-theme="dark"] [style*="background:#fff0e6"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fff2df"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fff3e5"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fff5df"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fff7e8"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="background:#fffaf0"]{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;}
html[data-theme="dark"] [style*="color: #b45309"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#000"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#047857"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#059669"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#065f46"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#080d14"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#087a54"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#0a9f70"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#0b1220"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#1557b0"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#1e3a8a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#1f2937"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#1f2d42"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#214f9f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#223149"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#233149"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#243650"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#263449"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#26354b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#26364d"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#26394e"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#273852"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#273b52"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2a3a52"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2a3d53"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2c425b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2c9765"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#2d3c52"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2f465f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#30475e"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#30475f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#31435f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#328a63"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#334766"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#344258"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#39516b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3a4b64"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3a536e"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3b526b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3e4c62"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#40546b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#405873"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#41526a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#41617f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#42506a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#44536a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#446784"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#45536a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#48627d"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#486681"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#694414"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#7f1d1d"]{color:#f28b90!important;}
html[data-theme="dark"] [style*="color:#825c28"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#8a5a24"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#92400e"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#966d2e"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#991b1b"]{color:#f28b90!important;}
html[data-theme="dark"] [style*="color:#9a3412"]{color:#f28b90!important;}
html[data-theme="dark"] [style*="color:#a65a00"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b45309"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b56200"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b86a00"]{color:#f0b862!important;}

/* ---------------- پوشش تکمیلی دوم — آستانه بازتر برای متن‌های نیمه‌تیره ---------------- */
html[data-theme="dark"] [style*="color: #0f172a"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color: #111827"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color: #172033"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color: #1e293b"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color: #1e40af"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color: #25324a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color: #334155"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color: #475569"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color: #64748b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color: #7a879a"]{color:#aab7c6!important;}
html[data-theme="dark"] [style*="color: #b45309"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#000"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#047857"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#059669"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#065f46"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#080d14"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#087a54"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#0a9f70"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#0b1220"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#0f172a"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#111827"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#14b8a6"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#1557b0"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#172033"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#1d4ed8"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#1e293b"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#1e3a8a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#1e40af"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#1e5ab6"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#1f2937"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#1f2d42"]{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#214f9f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#223149"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#22c55e"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#233149"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#243650"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#245cc2"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#25324a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2563eb"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#263449"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#26354b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#26364d"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#26394e"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#273852"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#273b52"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2a3a52"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2a3d53"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2c425b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2c9765"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#2d3c52"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#2f465f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#30475e"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#30475f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#31435f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#328a63"]{color:#4bd499!important;}
html[data-theme="dark"] [style*="color:#334155"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#334766"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#344258"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#39516b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3975d6"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3a4b64"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3a536e"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3b526b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3c78ad"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3d75aa"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#3e4c62"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#40546b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#405873"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#41526a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#41617f"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#42506a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#44536a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#446784"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#45536a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#466a8d"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#475569"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#48627d"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#486681"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#4e7ca9"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#51637b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#52647a"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#527494"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#557fa9"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#5b21b6"]{color:#c9a6f5!important;}
html[data-theme="dark"] [style*="color:#5b84ad"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#5b86b0"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#64748b"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#694414"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#6b7280"]{color:#aab7c6!important;}
html[data-theme="dark"] [style*="color:#6b8dac"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#6d28d9"]{color:#c9a6f5!important;}
html[data-theme="dark"] [style*="color:#6f7f94"]{color:#aab7c6!important;}
html[data-theme="dark"] [style*="color:#71839d"]{color:#7fb2ef!important;}
html[data-theme="dark"] [style*="color:#748198"]{color:#aab7c6!important;}
html[data-theme="dark"] [style*="color:#7a879a"]{color:#aab7c6!important;}
html[data-theme="dark"] [style*="color:#7b8799"]{color:#aab7c6!important;}
html[data-theme="dark"] [style*="color:#7f1d1d"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#825c28"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#8a5a24"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#92400e"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#966d2e"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#991b1b"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#9a3412"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#a52a2a"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#a65a00"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#ad7b35"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b45309"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b56200"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b86a00"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#b91c1c"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#c2410c"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#c93434"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#d17a12"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#d97706"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#dc2626"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#f59e0b"]{color:#f0b862!important;}
html[data-theme="dark"] [style*="color:#f97316"]{color:#f0b862!important;}
/* ---------------- رفع موارد مشخص گزارش‌شده توسط کاربر ---------------- */
/* ردیف‌های لیست تنظیمات (کاربران/مشتریان/انبارها/تامین‌کننده‌ها) که سفید مانده بودند */
html[data-theme="dark"] .settings-list li{
    background:rgba(255,255,255,.05)!important;
    border-color:rgba(78,108,139,.42)!important;
    color:#eef3f8!important;
}
html[data-theme="dark"] .settings-list li b{color:#eef3f8!important;}

/* اطمینان مضاعف روی دو تیتر گزارش‌شده در داشبورد */
html[data-theme="dark"] .dashboard-recent-card h3,
html[data-theme="dark"] .dashboard-recent-card span{color:#eef3f8!important;}
html[data-theme="dark"] [style*="color:#b91c1c"]{color:#ff9195!important;}
html[data-theme="dark"] [style*="color:#7f1d1d"]{color:#f2b3b6!important;}

/* هشدار «رسید ثبت‌نشده» — حالا واقعاً قرمز و برجسته (هم روشن هم تاریک) */
.m-doc-card:has(.m-receipt-alert){
    border:2px solid #dc2626!important;
    box-shadow:0 0 0 1px rgba(220,38,38,.20), 0 8px 20px rgba(220,38,38,.14)!important;
}
.m-receipt-alert{
    background:linear-gradient(90deg,#fee2e2,#fef2f2)!important;
    border-bottom:1px solid #fca5a5!important;
}
.m-receipt-alert strong{color:#dc2626!important; font-size:11px!important;}
.m-receipt-alert span{color:#b91c1c!important; font-weight:900!important;}

html[data-theme="dark"] .m-doc-card:has(.m-receipt-alert){
    border:2px solid #e24a52!important;
    box-shadow:0 0 0 1px rgba(226,74,82,.35), 0 10px 26px rgba(226,74,82,.20)!important;
}
html[data-theme="dark"] .m-receipt-alert{
    background:linear-gradient(90deg,rgba(226,74,82,.22),rgba(226,74,82,.10))!important;
    border-bottom:1px solid rgba(226,74,82,.45)!important;
}
html[data-theme="dark"] .m-receipt-alert strong{color:#ff8a90!important; font-size:11px!important;}
html[data-theme="dark"] .m-receipt-alert span{color:#ffb3b6!important; font-weight:900!important;}



/* ---------------- یکدست‌کردن «آخرین فعالیت‌ها» با ظاهر «خروج بدون رسید» ---------------- */
html[data-theme="dark"] .recent-item{
    background:linear-gradient(180deg,rgba(25,40,59,.55),rgba(15,25,39,.55))!important;
    border:1px solid rgba(78,108,139,.30)!important;
    border-radius:8px!important;
    padding:8px 10px!important;
    margin-bottom:6px!important;
}
html[data-theme="dark"] .recent-activity-row .recent-doc-sub,
html[data-theme="dark"] .recent-activity-row .qty-secondary,
html[data-theme="dark"] .recent-activity-row .qty-weight{
    color:#bcd6f5!important;
}
html[data-theme="dark"] .recent-activity-row div[style*="var(--text-muted)"]{color:#bcd6f5!important;}



/* ---------------- رفع ریشه‌ای: قانون‌های ویژه‌ی «#tab-dashboard>.card» ---------------- */
/* پیدا شد: چند قانون قدیمی در فایل با سلکتور #tab-dashboard>.card (همراه با
   !important) پس‌زمینه را صریحاً سفید می‌کردند. چون این سلکتور یک ID دارد،
   از نظر اولویت CSS از تمام قانون‌های عمومی «.card» در تم شب (که ID ندارند)
   قوی‌تر است و همیشه برنده می‌شد — even با !important بودن هر دو طرف.
   این دقیقاً همان چیزی بود که باعث می‌شد کارت «کالاهای نیازمند شارژ»،
   «آخرین فعالیت‌ها» و نمودار (هر سه به‌طور مستقیم داخل #tab-dashboard هستند)
   همچنان سفید بمانند. راه‌حل: یک قانون هم‌سطح ولی با یک ID اضافه (خود
   html[data-theme="dark"]) که از نظر اولویت از نسخه سفید قوی‌تر است. */
html[data-theme="dark"] #tab-dashboard>.card{
    background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94)) !important;
    border-color:rgba(78,108,139,.42) !important;
    color:#eef3f8 !important;
}
html[data-theme="dark"] #tab-dashboard .table-responsive{
    background:rgba(255,255,255,.04) !important;
}


/* ---------------- پوشش نهایی — تمام سلکتورهای مبتنی بر ID که قبلاً از قلم افتاده بودند ---------------- */
html[data-theme="dark"] .group-row:hover{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex #cardexTitleLabel{color:#eef3f8!important;}
html[data-theme="dark"] #cardexFilterCard .quick-filter-select{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex .cardex-main-table{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex .cardex-main-table th{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex .group-row:hover{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex .doc-id-mini{color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex .office-doc-main{color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex .office-doc-user{color:#eef3f8!important;}
html[data-theme="dark"] #tab-cardex .receipt-inline{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#4bd499!important;}
html[data-theme="dark"] #tab-cardex .receipt-inline.pending{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#ff9195!important;}
html[data-theme="dark"] #tab-cardex .cardex-item-table th{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-dashboard>.card{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-dashboard .table-responsive{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #cardexFilterCard .doc-status-select{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex .doc-action-primary{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #cardexFilterCard .radio-label{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex .cardex-main-table td{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex .doc-action-primary:hover{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex .barcode-detail-label{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] #tab-cardex .barcode-count{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#4bd499!important;}
html[data-theme="dark"] #tab-cardex .cardex-main-table tr.group-row td{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #tab-cardex .cardex-main-table tr.group-row:hover td{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .m-doc-type.done{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#4bd499!important;}
html[data-theme="dark"] .m-doc-type.pending{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#f0b862!important;}
html[data-theme="dark"] .m-doc-type.in{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#7fb2ef!important;}
html[data-theme="dark"] .m-receipt.ok{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#4bd499!important;}
html[data-theme="dark"] .m-receipt.wait{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#f0b862!important;}
html[data-theme="dark"] .m-doc-card.receipt-missing .m-receipt.wait{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#ff9195!important;}
html[data-theme="dark"] #tab-cardex .detail-row.exact-search-row{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .m-item.exact-search-item{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .m-barcode-chip.exact-search-hit{color:#eef3f8!important;}
html[data-theme="dark"] .inventory-count-table th{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .inventory-count-row.diff{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] .inventory-count-row.match{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #inlineScanCtrl span{color:#7fb2ef!important;}
html[data-theme="dark"] #inlineScanCropBox::after{color:#4bd499!important;}
html[data-theme="dark"] #inlineScanCandidates .hdr{color:#f0b862!important;}
html[data-theme="dark"] #inlineScanCandidates button{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;color:#eef3f8!important;}
html[data-theme="dark"] #inlineScanCandidates button:active{background:linear-gradient(180deg,rgba(25,40,59,.90),rgba(15,25,39,.94))!important;border-color:rgba(78,108,139,.42)!important;}
html[data-theme="dark"] #quaggaBadge b{color:#c9a6f5!important;}


/* ---------------- رفع نهایی: پس‌زمینه‌های گرادیانی که regex قبلی (فقط رنگ تخت) نمی‌دید ---------------- */
/* این سه مورد background:linear-gradient(...) داشتند، نه یک رنگ ساده؛ برای
   همین در اسکن‌های قبلی (که فقط دنبال background:#hex می‌گشتند) دیده نشدند.
   دقیقاً همین یکی («کارهای فوری») در اسکرین‌شات گوشی سفید مانده بود. */
html[data-theme="dark"] .dashboard-action-head{
    background:linear-gradient(135deg,rgba(25,40,59,.92),rgba(15,25,39,.92))!important;
    border-color:rgba(78,108,139,.42)!important;
}
html[data-theme="dark"] .m-doc-head{
    background:linear-gradient(135deg,rgba(25,40,59,.85),rgba(15,25,39,.85))!important;
    border-color:rgba(78,108,139,.35)!important;
}



/* ---------------- رفع قطعی چیدمان تب‌ها در حالت شب (موبایل) ---------------- */
/* به‌جای وابستگی به زنجیره پیچیده چند قانون قدیمی @media که اندازه تب‌ها را
   تعیین می‌کردند (که مشخص شد در تداخل با هم رفتار غیرقابل‌پیش‌بینی دارند)،
   یک قانون صریح و مستقل گذاشته شد که اندازه تب‌ها را در حالت شب دقیقاً ثابت
   نگه می‌دارد — بدون وابستگی به عرض صفحه یا هر قانون دیگری. */
html[data-theme="dark"] .tabs{
    display:flex !important;
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
}
html[data-theme="dark"] .tab-btn{
    flex:1 1 auto !important;
    min-width:56px !important;
    max-width:130px !important;
    padding:8px 10px !important;
    font-size:12px !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}
@media(max-width:700px){
    html[data-theme="dark"] .tab-btn{
        padding:7px 8px !important;
        font-size:11px !important;
        min-width:48px !important;
        max-width:100px !important;
        height:36px !important;
    }
}


/* چاپ مستقل از تم */
@media print{
  html[data-theme="dark"] #printArea,
  html[data-theme="dark"] #printArea *{color:#000 !important;text-shadow:none !important;}
  html[data-theme="dark"] #printArea{background:#fff !important;}
  html[data-theme="dark"] #printArea table{background:#fff !important;color:#000 !important;}
  html[data-theme="dark"] #printArea th{background:#f1f5f9 !important;color:#111827 !important;}
  html[data-theme="dark"] #printArea td{background:#fff !important;color:#111827 !important;}
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: dark-mobile-tabs-stability-final */

/* DARK MICA — تب‌ها: دسکتاپ متعادل، موبایل بدون فشرده‌شدن */
html[data-theme="dark"] .tabs{
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:stretch !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;
}

/* ویندوز / دسکتاپ: همان نوار حرفه‌ای و متعادل، با عرض مناسب برای همه تب‌ها */
@media(min-width:701px){
    html[data-theme="dark"] .tabs{
        justify-content:center !important;
        gap:5px !important;
        padding:5px 8px !important;
    }
    html[data-theme="dark"] .tab-btn{
        flex:1 1 0 !important;
        min-width:0 !important;
        width:auto !important;
        max-width:160px !important;
        height:38px !important;
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;
        gap:6px !important;
        padding:8px 10px !important;
        font-size:12px !important;
        white-space:nowrap !important;
        overflow:hidden !important;
        text-overflow:ellipsis !important;
        transform:none !important;
    }
}

/* موبایل: هر تب عرض واقعی خودش را حفظ می‌کند؛ اسکرول افقی به‌جای له‌شدن */
@media(max-width:700px){
    html[data-theme="dark"] .tabs{
        justify-content:flex-start !important;
        gap:6px !important;
        padding:6px 7px !important;
    }
    html[data-theme="dark"] .tab-btn{
        flex:0 0 auto !important;
        min-width:max-content !important;
        width:auto !important;
        max-width:none !important;
        height:40px !important;
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;
        gap:6px !important;
        padding:8px 10px !important;
        font-size:12px !important;
        white-space:nowrap !important;
        overflow:visible !important;
        text-overflow:clip !important;
        transform:none !important;
    }
}

/* آیکون و عنوان مستقل از هم؛ آیکون هیچ‌وقت کوچک یا له نمی‌شود */
html[data-theme="dark"] .tab-btn .tab-icon{
    flex:0 0 21px !important;
    width:21px !important;
    min-width:21px !important;
    max-width:21px !important;
    height:21px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    line-height:1 !important;
    font-family:"Segoe UI Emoji","Noto Color Emoji","Apple Color Emoji",sans-serif !important;
    font-size:18px !important;
    font-weight:normal !important;
    white-space:nowrap !important;
    transform:none !important;
}
html[data-theme="dark"] .tab-btn .tab-label{
    flex:0 0 auto !important;
    min-width:max-content !important;
    width:auto !important;
    display:inline-block !important;
    line-height:1.2 !important;
    white-space:nowrap !important;
}
@media(max-width:700px){
    html[data-theme="dark"] .tab-btn .tab-icon{
        flex-basis:22px !important;
        width:22px !important;
        min-width:22px !important;
        max-width:22px !important;
        height:22px !important;
        font-size:19px !important;
    }
}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */


#v20-launchbar{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin:10px 0;padding:10px;background:linear-gradient(135deg,#0f172a,#1e293b);border-radius:12px;box-shadow:0 5px 16px rgba(15,23,42,.16)}
#v20-launchbar button{border:0;border-radius:8px;padding:8px 11px;color:#fff;font-weight:900;cursor:pointer;font-size:11px}
#v20LaunchReports{background:#2563eb} #v20LaunchReservations{background:#7c3aed} #v20LaunchHealth{background:#059669} #v20LaunchAudit{background:#b45309} #v20LaunchBackup{background:#334155}
#v20CenterModal .v20-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.v20-card{background:#fff;border:1px solid #dbe3ed;border-radius:10px;padding:10px;box-shadow:0 3px 10px rgba(15,23,42,.05)}
.v20-stat{display:flex;justify-content:space-between;gap:7px;align-items:center;padding:8px;border-radius:8px;background:#f8fafc;border:1px solid #e2e8f0}
.v20-stat b{font-size:16px;color:#0f172a}.v20-muted{font-size:10px;color:#64748b;font-weight:800}.v20-table{width:100%;border-collapse:collapse;font-size:10px}.v20-table th,.v20-table td{border-bottom:1px solid #e5e7eb;padding:7px;text-align:right}.v20-table th{background:#f8fafc;font-weight:900;position:sticky;top:0}.v20-chip{display:inline-block;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:900}.v20-ok{background:#dcfce7;color:#166534}.v20-warn{background:#fef3c7;color:#92400e}.v20-danger{background:#fee2e2;color:#991b1b}.v20-info{background:#dbeafe;color:#1d4ed8}
#v20EnterpriseModal .modal-body{max-height:78vh;overflow:auto}
#v20EnterpriseModal .v20-modal-close{display:inline-flex;align-items:center;justify-content:center;gap:5px;width:auto;min-width:96px;margin:0;padding:7px 14px;border:1px solid #fecaca;border-radius:9px;background:#fff1f2;color:#991b1b;font-weight:900;font-size:12px;cursor:pointer;box-shadow:0 2px 6px rgba(15,23,42,.08)}
#v20EnterpriseModal .v20-modal-close:hover{background:#fee2e2}
#v20EnterpriseModal .v20-modal-footer{display:flex;justify-content:flex-start;align-items:center;padding:8px 10px;border-top:1px solid #e5e7eb;background:#f8fafc}
#v20EnterpriseModal .modal-header{position:sticky;top:0;z-index:6;background:#fff}
#v20EnterpriseModal .modal-box{max-height:92vh;display:flex;flex-direction:column}
#v20EnterpriseModal .modal-body{flex:1;min-height:0}
.v20-loading{padding:28px;text-align:center;font-weight:900;color:#475569;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:10px}
@media(max-width:760px){#v20CenterModal .v20-grid{grid-template-columns:1fr}.v20-table{min-width:760px}.v20-scroll{overflow:auto}}


/* ===== ORIGINAL STYLE BLOCK SEPARATOR ===== */

/* Original style id: role-visibility-hardening-v1.10 */

/* Role visibility is security-sensitive UI state. These rules intentionally use !important
   so dark-mode presentation rules can never make a forbidden tab visible again. */
html[data-user-role="loader"] #tabBtnDashboard,
html[data-user-role="loader"] #tabBtnInventory,
html[data-user-role="loader"] #tabBtnEntry,
html[data-user-role="loader"] #tabBtnExit,
html[data-user-role="loader"] #settingsTabBtn,
html[data-user-role="loader"] #tabBtnInventoryCount,
html[data-user-role="loader"] #tabBtnTransfer{display:none !important;}
html[data-user-role="loader"] #tabBtnCardex{display:block !important;}

html[data-user-role="viewer"] #settingsTabBtn,
html[data-user-role="viewer"] #tabBtnEntry,
html[data-user-role="viewer"] #tabBtnExit,
html[data-user-role="viewer"] #tabBtnInventoryCount,
html[data-user-role="viewer"] #tabBtnTransfer{display:none !important;}
html[data-user-role="viewer"] #tabBtnDashboard,
html[data-user-role="viewer"] #tabBtnInventory,
html[data-user-role="viewer"] #tabBtnCardex{display:block !important;}

html[data-user-role="user"] #settingsTabBtn{display:none !important;}
html[data-user-role="admin"] #tabBtnDashboard,
html[data-user-role="admin"] #tabBtnInventory,
html[data-user-role="admin"] #tabBtnCardex,
html[data-user-role="admin"] #tabBtnEntry,
html[data-user-role="admin"] #tabBtnExit,
html[data-user-role="admin"] #settingsTabBtn,
html[data-user-role="admin"] #tabBtnInventoryCount,
html[data-user-role="admin"] #tabBtnTransfer{display:block !important;}
