/* XX8 Tools — chế độ tối dùng chung cho mọi trang (bật bằng <html data-theme="dark">) */
html[data-theme=dark]{
  --bg:#0e1014;--panel:#161a21;--panel-2:#1c212a;--ink:#e6e8ee;--muted:#9aa3b3;--pink:#f0466e;--soft:rgba(240,70,110,.14);--line:#272d38;--shadow:none;
  color-scheme:dark
}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] ::selection{background:#5a2236}

/* Khung chung */
html[data-theme=dark] header{background:var(--panel);border-color:var(--line)}
html[data-theme=dark] .wordmark{color:#f4f5f8}
html[data-theme=dark] .panel,
html[data-theme=dark] .metric{background:var(--panel);border-color:var(--line);box-shadow:none}
html[data-theme=dark] .metric>span{color:#a7afbd}
html[data-theme=dark] .metric>strong{color:var(--ink)}
html[data-theme=dark] .metric small{color:#7f8898}
html[data-theme=dark] .private-badge{background:rgba(40,123,86,.18);color:#5fd19c}
html[data-theme=dark] .section-label>span,
html[data-theme=dark] .upload-icon{background:var(--soft);color:var(--pink)}
html[data-theme=dark] .dropzone{background:#1a1418;border-color:#5a2c3b}
html[data-theme=dark] .dropzone:hover,html[data-theme=dark] .dropzone.drag{background:#24161d;border-color:var(--pink)}
html[data-theme=dark] .dropzone strong{color:var(--ink)}
html[data-theme=dark] .secondary{background:var(--panel-2);border-color:var(--line);color:#c3c9d4}
html[data-theme=dark] .secondary:hover{background:#232935}
html[data-theme=dark] .text-button{background:transparent;color:var(--pink)}
html[data-theme=dark] .empty{background:rgba(22,26,33,.6);border-color:var(--line)}
html[data-theme=dark] .empty-icon{background:var(--panel-2);color:#b08a9c}
html[data-theme=dark] .notice{background:rgba(238,183,80,.1);border-color:#6b5427;color:#e9c77e}
html[data-theme=dark] .error{background:rgba(240,70,110,.12);border-color:#6d2a3d;color:#ff8fa8}
html[data-theme=dark] .status-list li:before{background:rgba(39,138,100,.2);color:#5fd19c}
html[data-theme=dark] .logic-note{border-color:var(--line)}
html[data-theme=dark] .logic-note b{background:rgba(128,98,173,.2);color:#c3a8f0}
html[data-theme=dark] progress,html[data-theme=dark] progress::-webkit-progress-bar{background:#2a2f3a}
html[data-theme=dark] .guide b{color:#d9c3cf}
html[data-theme=dark] footer{color:#7f8898}
html[data-theme=dark] footer b{color:#a7afbd}
html[data-theme=dark] .toast{background:#e6e8ee;color:#12151b}

/* Ô nhập */
html[data-theme=dark] input:not([type=checkbox]):not([type=radio]),
html[data-theme=dark] select,
html[data-theme=dark] textarea{background:#0f1218!important;border-color:#2c3340!important;color:var(--ink)!important}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#6c7586}
html[data-theme=dark] .filters label,html[data-theme=dark] .pl-password label:first-child{color:#a7afbd}

/* Bảng & tab */
html[data-theme=dark] .report-toolbar,html[data-theme=dark] .table-footer{border-color:var(--line)}
html[data-theme=dark] .tabs span{background:#262c37;color:#c3c9d4}
html[data-theme=dark] th{background:#1a1f27;color:#98a1b1}
html[data-theme=dark] td{border-color:#222833}
html[data-theme=dark] tr:hover td{background:#1b2029}
html[data-theme=dark] td.code{color:#b9a4c4}
html[data-theme=dark] .table-wrap{scrollbar-color:#3a4150 #161a21}

/* Riêng trang Báo cáo khuyến mãi */
html[data-theme=dark] .password-box{background:#1a1418;border-color:#4a2a35}
html[data-theme=dark] .paste-card-top p b{color:#d0d5de}
html[data-theme=dark] .paste-range{background:rgba(42,120,80,.2);color:#6fd3a0}
html[data-theme=dark] .nd-range{background:rgba(69,100,139,.25);color:#9dbbe4}
html[data-theme=dark] .paste-preview summary{color:#a7afbd}
html[data-theme=dark] .paste-preview thead tr:first-child th{background:#16241c;color:#8fd1a6;border-color:#24392b}
html[data-theme=dark] .nd-paste-table{border-color:#2a3442}
html[data-theme=dark] .nd-paste-table th{background:#172030;color:#9dbbe4}
html[data-theme=dark] .nd-paste-table td,html[data-theme=dark] .main-paste-table td{background:#141921}
html[data-theme=dark] .main-paste-table tbody tr:hover td{background:#17221b}
html[data-theme=dark] .mapping-panel p{color:#a7afbd}

/* Trang Phân loại tài khoản */
html[data-theme=dark] .dropzone.img-zone{background:#18151f;border-color:#43345e}
html[data-theme=dark] .img-zone .upload-icon{background:rgba(124,77,222,.18);color:#b99cf5}
html[data-theme=dark] .img-zone .choose-file{color:#b99cf5}
html[data-theme=dark] .tier-chips span{background:rgba(240,70,110,.12);border-color:#5a2c3b;color:#ff8fa8}
html[data-theme=dark] .ocr-panel{background:#17141f;border-color:#3a2f52}
html[data-theme=dark] .ocr-top .tag{background:rgba(124,77,222,.22);color:#c9b2ff}
html[data-theme=dark] .ocr-top #ocrStatus{color:#c3b6dd}
html[data-theme=dark] .filter-bar{background:#141820;border-color:var(--line)}
html[data-theme=dark] button.chip{background:#1f2530;border-color:#2f3644;color:#c9cfda}
html[data-theme=dark] button.chip b{color:#8f98a8}
html[data-theme=dark] button.chip.active{background:#7c4dde;border-color:#7c4dde;color:#fff}
html[data-theme=dark] tr.rejected td{background:#21151a}
html[data-theme=dark] tr.rejected:hover td{background:#2a1820}
html[data-theme=dark] .user{color:var(--ink)}
html[data-theme=dark] td.nowrap{color:#c3c9d4}
html[data-theme=dark] .badge-mini{background:rgba(124,77,222,.22);color:#c9b2ff}
html[data-theme=dark] .reason{color:#ff8fa8}
html[data-theme=dark] .reason-empty{color:#4a5160}
html[data-theme=dark] button.tick{background:#0f1218;border-color:#3a4150}
html[data-theme=dark] button.tick.on{background:#278a64;border-color:#278a64}
html[data-theme=dark] button.mini-btn{background:#1f2530;border-color:#2f3644;color:#c3c9d4}
html[data-theme=dark] button.reward-btn{background:rgba(238,183,80,.12);border-color:#6b5427;color:#e9c77e}
html[data-theme=dark] .reward{color:var(--ink)}
html[data-theme=dark] .metric .range{color:#e9c77e}
html[data-theme=dark] .modal{background:var(--panel);color:var(--ink)}
html[data-theme=dark] .modal .presets button{background:rgba(240,70,110,.12);border-color:#5a2c3b;color:#ff8fa8}

/* Trang Lọc lạm dụng */
html[data-theme=dark] .rule{background:var(--panel-2);border-color:var(--line)}
html[data-theme=dark] .lvl.strong,html[data-theme=dark] .sig.strong{background:rgba(240,70,110,.13);border-color:#5a2c3b;color:#ff8fa8}
html[data-theme=dark] .lvl.batch,html[data-theme=dark] .sig.batch{background:rgba(238,183,80,.12);border-color:#6b5427;color:#e9c77e}
html[data-theme=dark] .rule-count{background:#262c37;color:#c3c9d4}
html[data-theme=dark] .rule-count.hit{background:rgba(240,70,110,.16);color:#ff8fa8}
html[data-theme=dark] tr.flagged td{background:#1a1519}
html[data-theme=dark] tr.flagged:hover td{background:#231a20}
html[data-theme=dark] .verdict.clean{background:rgba(39,138,100,.18);color:#5fd19c}
html[data-theme=dark] button.cl{background:rgba(124,77,222,.22);color:#c9b2ff}
html[data-theme=dark] button.chip.cluster{background:rgba(124,77,222,.22);border-color:#43345e;color:#c9b2ff}
html[data-theme=dark] .lvl-head{color:#a7afbd}
html[data-theme=dark] .dim{color:#5c6474}
