/* Default versioned ERP skin. Existing Classic and Professional rules remain unchanged. */
html[data-platform-design="unified"] {
    --bg:#f4f7fa; --card-bg:#ffffff; --border:#c4cfdc;
    --text-primary:#172b41; --text-secondary:#475d73; --text-muted:#52677d;
    --primary:#166649; --primary-dark:#104d37; --success:#137449;
    --warning:#925100; --danger:#b42335; --info:#1d5ca8;
    --surface-soft:#eaf0f5; --input-bg:#ffffff; --text:var(--text-primary);
    --sidebar-bg:#152c3d; --sidebar-hover:#234356; --sidebar-active:#166649;
    --sidebar-text:#cadbe8; --sidebar-text-active:#ffffff;
    --radius:14px; --radius-sm:9px; --radius-md:10px; --radius-lg:14px;
    --shadow-sm:0 2px 8px rgb(23 43 65 / .04); --shadow:0 8px 24px rgb(23 43 65 / .07);
    --bg-base:var(--bg); --bg-surface:var(--card-bg); --bg-elevated:var(--surface-soft);
    --bg-card:var(--card-bg); --bg-hover:var(--surface-soft); --bg-selected:#e3f2eb;
    --border-dim:var(--border); --border-mid:var(--border); --border-bright:#748ca4;
    --text-faint:var(--text-secondary); --accent-blue:#1d5ca8; --accent-blue-l:#1d5ca8;
    --accent-green:var(--success); --accent-green-l:var(--success);
    --accent-amber:var(--warning); --accent-amber-l:var(--warning);
    --accent-red:var(--danger); --accent-red-l:var(--danger);
    --accent-purple:#6945a3; --accent-purple-l:#6945a3; --accent-teal:#117575; --accent-orange:#a44e14;
    --positive-bg:#e4f4eb; --negative-bg:#fce8ec; --warning-bg:#fff1d8; --info-bg:#e5effc;
    color-scheme:light;
}
    html[data-platform-design="unified"][data-color-mode="dark"] {
        --bg:#10202e; --card-bg:#192e3f; --border:#526b80;
        --text-primary:#eff5fa; --text-secondary:#c6d6e3; --text-muted:#b3c7d8;
        --surface-soft:#243d50; --input-bg:#122737; --bg-selected:#234b3c;
        --primary:#166649; --primary-dark:#104d37; --success:#8bdfb3;
        --warning:#ffce80; --danger:#ffafb9; --info:#a4cafa;
        --accent-blue:#a4cafa; --accent-blue-l:#a4cafa;
        --accent-purple:#d1b8fa; --accent-purple-l:#d1b8fa;
        --accent-teal:#94e1dd; --accent-orange:#ffc193;
        --positive-bg:#193f31; --negative-bg:#492a36; --warning-bg:#483c25; --info-bg:#243f5d;
        --shadow-sm:none; --shadow:none;
        color-scheme:dark;
    }
@media screen {
    html[data-platform-design="unified"] body { font-family:'Tajawal','Segoe UI',Arial,sans-serif; color:var(--text-primary); line-height:1.65 }
    html[data-platform-design="unified"] :is(h1,h2,h3,h4) { letter-spacing:0; text-wrap:balance; color:var(--text-primary) }
    html[data-platform-design="unified"] :is(.page-content,.orders-body) { min-width:0; color:var(--text-primary) }
    html[data-platform-design="unified"] .page-content { padding:28px; background:var(--bg) }
    html[data-platform-design="unified"] .sidebar { background:var(--sidebar-bg) !important; border:0; border-inline-end:1px solid #35556b; box-shadow:none }
    html[data-platform-design="unified"] .sidebar-logo { height:72px; border-bottom:1px solid #35556b }
    html[data-platform-design="unified"] .logo-circle { background:var(--primary); box-shadow:none }
    html[data-platform-design="unified"] :is(.nav-item-link,.nav-group-hdr) { min-height:46px; color:var(--sidebar-text); border-radius:9px; text-align:start }
    html[data-platform-design="unified"] :is(.nav-item-link.active,.nav-item-link:hover) { color:#fff; background:var(--sidebar-hover) }
    html[data-platform-design="unified"] .nav-item-link.active { box-shadow:inset -3px 0 #86dfb1 }
    html[data-platform-design="unified"] .topbar { min-height:68px; background:var(--card-bg); border-bottom:1px solid var(--border); box-shadow:none }
    html[data-platform-design="unified"] .sb-toggle { min-width:44px; min-height:44px; color:var(--text-primary) }
    html[data-platform-design="unified"] :is(.topbar-brand,.topbar-user) { color:var(--text-primary) }
    html[data-platform-design="unified"] .topbar-logout { min-height:44px; color:var(--danger); border-color:var(--danger) }
    html[data-platform-design="unified"] .orders-shell { background:var(--bg); color:var(--text-primary) }
    html[data-platform-design="unified"] .orders-account-bar { background:var(--sidebar-bg); min-height:56px; border-bottom:1px solid #35556b }
    html[data-platform-design="unified"] :is(.orders-user,.orders-user-wrap small) { color:#cadbe8; font-size:13px }
    html[data-platform-design="unified"] .orders-logout button { min-width:44px; min-height:44px }
    html[data-platform-design="unified"] .mtab { background:var(--card-bg); border-top:1px solid var(--border); box-shadow:none }
    html[data-platform-design="unified"] .mtab-item { color:var(--text-secondary) }
    html[data-platform-design="unified"] .mtab-item.on { color:var(--success) }
    /* Explicit screen roots keep camera pixels, chart marks and receipts out of blanket recoloring. */
    html[data-platform-design="unified"] :is(.itl-wrap,.bk-wrap,.dz-page,.remote-licenses,.bl-wrap,.bd-wrap,.bp-wrap,.mw-wrap,.pt-wrap,.cf,.bso-wrap,.bcf-wrap,.bds-wrap,.bdd-wrap,.bte-wrap,.bvd-wrap,.uc-wrap,.do-wrap,.ord-wrap,.acl-shell,.exp-shell,.ber-wrap,.bp-shell,.br-wrap,.bub-wrap,.cb-wrap,.ca-wrap,.cd-wrap,.cm-wrap,.cw-wrap,.cr-wrap,.dc-wrap,.da-wrap,.dl-wrap,.emp-wrap,.eod-wrap,.fx-wrap,.gj-shell,.it-wrap,.bs-page,.ci-wrap,.ds-wrap,.dsm-wrap,.ll-wrap,.mesh-page,.sec-wrap,.tm-wrap,.iub-wrap,.ium-wrap,.mnt-wrap,.asi-page,.mm,.od-wrap,.rr-wrap,.wpc-page,.wps-page,.ra-wrap,.rq-wrap,.re-wrap,.rl-wrap,.rs-wrap,.sw-wrap,.sp-wrap,.sd-shell,.sl,.ss,.sync-page,.sh-wrap,.tv-wrap,.vo-wrap,.vr-wrap,.mo-wrap,.ap-wrap,.iv-wrap,.fi-wrap,.wa,.wc-wrap,.wgd-wrap,.wd-wrap,.ac,.au-wrap,.bcx) {
        background-color:var(--bg) !important; color:var(--text-primary) !important; direction:inherit; min-width:0;
    }
    html[data-platform-design="unified"] :is(.card,.stat-card,.dash-card,.da-kpi,.da-chart-card,.da-branch-card,.da-table-card,.da-compare-card,.da-type-card,.itl-card,.bk-card,.bso-card,.bso-kpi,.bso-donut-card,.bso-result-strip,.dz-controls,.dz-dialog,.remote-licenses .upload,.remote-licenses .connection,.remote-licenses .table-tools,.remote-licenses .data-card) {
        background:var(--card-bg) !important; color:var(--text-primary); border:1px solid var(--border) !important; border-radius:var(--radius); box-shadow:var(--shadow-sm);
    }
    html[data-platform-design="unified"] :is(.dash-card,.itl-card) { padding:22px; transition:border-color .15s; transform:none !important }
    html[data-platform-design="unified"] :is(.dash-card,.itl-card):hover { border-color:var(--primary) !important; box-shadow:var(--shadow-sm) }
    html[data-platform-design="unified"] :is(.dash-label,.stat-value,.da-title,.da-branch-name,.da-kpi-val,.da-card-title,.itl-title-main,.itl-card-t,.bso-title,.bso-kpi-val,.bso-card-hd,.bso-leg-name,.bso-result-title,.bso-donut-total,.bk-card h2) { color:var(--text-primary) !important }
    html[data-platform-design="unified"] :is(.dash-sub,.stat-label,.da-kpi-lbl,.da-branch-db,.itl-title-sub,.itl-card-d,.bso-section-label,.bso-kpi-lbl,.bso-donut-sub,.bk-card p,.bk-card small,.dz-head p,.remote-licenses small) { color:var(--text-secondary) !important; font-size:14px }
    html[data-platform-design="unified"] :is(.dash-icon,.itl-ico,.bso-title>svg) { color:var(--info); background:var(--info-bg); box-shadow:none }
    html[data-platform-design="unified"] .itl-grid { gap:18px; margin:24px; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)) }
    html[data-platform-design="unified"] :is(.itl-header,.bso-header) { padding:24px; border-bottom-color:var(--border) }
    html[data-platform-design="unified"] :is(.btn,.form-control,.form-select,button,input,select,textarea) { font-family:inherit }
    html[data-platform-design="unified"] :is(.btn,.orders-body button,.rpt-shell button,.page-shell button) { min-height:44px; border-radius:9px; letter-spacing:0 }
    html[data-platform-design="unified"] :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=submit]):not([type=button]) {
        min-height:46px; background-color:var(--input-bg) !important; color:var(--text-primary) !important; border-color:var(--border) !important; border-radius:9px; font-size:15px;
    }
    html[data-platform-design="unified"] :is(input,textarea)::placeholder { color:var(--text-secondary) !important; opacity:1 }
    html[data-platform-design="unified"] :is(input[type=date],input[type=datetime-local]) { background-image:url('/icons/tabler/calendar.svg') !important; color-scheme:inherit }
    html[data-platform-design="unified"] :is(button,a,input,select,textarea,[tabindex]):focus-visible { outline:3px solid var(--info); outline-offset:3px }
    html[data-platform-design="unified"] :is(.btn-primary,.lp-btn,.cc-primary,.mm-add,.bk-primary,.bso-btn-run,.dz-page button,.ord-search-btn) { background:var(--primary) !important; border-color:var(--primary) !important; color:#fff !important; box-shadow:none }
    html[data-platform-design="unified"] :is(.btn-outline-primary,.bso-btn-export,.bso-back,.itl-back,.ord-back,.remote-licenses header button) { background:var(--card-bg); color:var(--text-primary); border-color:var(--border); box-shadow:none }
    html[data-platform-design="unified"] :is(.bso-preset,.type-pill,.ord-sel,.ord-inp) { background-color:var(--input-bg); color:var(--text-primary); border-color:var(--border); min-height:44px }
    html[data-platform-design="unified"] :is(.bso-preset.act,.type-pill.pactive) { background:var(--primary); border-color:var(--primary); color:#fff }
    html[data-platform-design="unified"] :is(.btn-danger,.btn-outline-danger) { --bs-btn-color:var(--danger); --bs-btn-border-color:var(--danger) }
    html[data-platform-design="unified"] .btn-danger { background:var(--negative-bg); color:var(--danger); border-color:var(--danger) }
    html[data-platform-design="unified"] :is(.text-success,.rpt-table .cell-hi) { color:var(--success) !important }
    html[data-platform-design="unified"] :is(.text-danger,.rpt-table .cell-lo) { color:var(--danger) !important }
    html[data-platform-design="unified"] :is(.text-muted,.ord-lbl) { color:var(--text-secondary) !important }
    html[data-platform-design="unified"] :is(.dz-error,.remote-licenses .notice.error) { background:var(--negative-bg); color:var(--danger); border:1px solid var(--danger) }
    html[data-platform-design="unified"] :is(.dz-success,.remote-licenses .notice.success) { background:var(--positive-bg); color:var(--success); border:1px solid var(--success) }
    html[data-platform-design="unified"] :is(.page-content,.orders-body) :is(.table,.data-table,.rpt-table,.da-table,.bso-table,.dz-page table,.remote-licenses table,.bk-table table) {
        --bs-table-bg:var(--card-bg); --bs-table-color:var(--text-primary); --bs-table-border-color:var(--border);
        --bs-table-striped-bg:var(--surface-soft); --bs-table-striped-color:var(--text-primary);
        --bs-table-hover-bg:var(--surface-soft); --bs-table-hover-color:var(--text-primary);
        background:var(--card-bg); color:var(--text-primary); font-size:14px; font-variant-numeric:tabular-nums;
    }
    html[data-platform-design="unified"] :is(.table,.data-table,.rpt-table,.da-table,.bso-table,.dz-page table,.remote-licenses table,.bk-table table) thead th { background:var(--surface-soft) !important; color:var(--text-secondary) !important; border-color:var(--border) !important; font-size:13px; letter-spacing:0; text-transform:none; padding:14px 16px }
    html[data-platform-design="unified"] :is(.table,.data-table,.rpt-table,.da-table,.bso-table,.dz-page table,.remote-licenses table,.bk-table table) tbody td { color:var(--text-primary); border-color:var(--border) !important; padding:13px 16px }
    html[data-platform-design="unified"] :is(.table,.data-table,.rpt-table,.da-table,.bso-table,.dz-page table,.remote-licenses table,.bk-table table) tfoot td { background:var(--surface-soft) !important; color:var(--text-primary); border-color:var(--border) }
    html[data-platform-design="unified"] :is(.dz-table-wrap,.remote-licenses .table-wrap,.bk-table,.bso-card,.rpt-table-wrap) { border-color:var(--border); background-color:var(--card-bg) }
    html[data-platform-design="unified"] :is(.table,.data-table,.rpt-table,.da-table,.bso-table,.dz-page table,.remote-licenses table,.bk-table table) :is(th,td) { text-align:start }
    html[data-platform-design="unified"] :is(input[type=email],input[type=tel],input[type=url],input[type=number],[dir=ltr]) { unicode-bidi:isolate }
    html[data-platform-design="unified"] :is(input[type=email],input[type=tel],input[type=url]) { direction:ltr; text-align:start }
    html[data-platform-design="unified"] .design-settings {
        --design-bg:var(--bg); --design-surface:var(--card-bg); --design-input:var(--input-bg);
        --design-text:var(--text-primary); --design-muted:var(--text-secondary); --design-border:var(--border);
        --design-accent:var(--primary); --design-tint:var(--positive-bg);
    }
    html[data-platform-design="unified"] .design-options { grid-template-columns:repeat(3,minmax(0,1fr)) }
    html[data-platform-design="unified"] .design-primary { background:var(--primary); border-color:var(--primary) }
    html[data-platform-design="unified"] .design-notice.error { background:var(--negative-bg); color:var(--danger); border-color:var(--danger) }
    /* Only navigation arrows mirror. Logos, printers, charts and status glyphs keep their orientation. */
    html[data-platform-design="unified"] .directional-icon { width:20px; height:20px; flex-shrink:0 }
    html[data-platform-design="unified"]:dir(rtl) .directional-icon { transform:scaleX(-1) }
    html[data-platform-design="unified"]:dir(rtl) .nav-item-link.active { box-shadow:inset -3px 0 #86dfb1 }
    html[data-platform-design="unified"]:dir(ltr) .nav-item-link.active { box-shadow:inset 3px 0 #86dfb1 }
    html[data-platform-design="unified"] .page-shell { direction:inherit; text-align:start }
    html[data-platform-design="unified"] :is(.d-field label,.rpt-field label,.design-date-fields label) { text-align:start }
    html[data-platform-design="unified"] .mtab-item svg { flex-shrink:0 }
    @media(max-width:767px) {
        html[data-platform-design="unified"] .page-content { padding:16px }
        html[data-platform-design="unified"] :is(.itl-header,.bso-header) { padding:20px 16px }
        html[data-platform-design="unified"] .itl-grid { grid-template-columns:minmax(0,1fr); margin:16px; gap:12px }
        html[data-platform-design="unified"] .design-options { grid-template-columns:minmax(0,1fr) }
        html[data-platform-design="unified"] :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]) { font-size:16px }
        html[data-platform-design="unified"] :is(.orders-user-wrap,.topbar-actions) { min-width:0; gap:8px; flex-wrap:wrap }
        html[data-platform-design="unified"] .orders-user-wrap small { font-size:11px }
        html[data-platform-design="unified"] :is(.dz-controls label,.remote-licenses .format) { min-width:0; width:100% }
    }
    @media(prefers-reduced-motion:reduce) {
        html[data-platform-design="unified"] :is(button,a,.dash-card,.itl-card) { transition:none !important }
    }
}
