/* =====================================================================
   Vortex Web – design system
   Tokens, app shell (sidebar / topbar / content / footer) and page patterns.
   Loaded after Bootstrap 5.3 by every master page and standalone page.
   DevExpress overrides live in vortex-dx.css.
   ===================================================================== */

/* ---------- Font (local, no CDN dependency) ---------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/inter/InterVariable.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
    --vx-primary: #2563eb;
    --vx-primary-hover: #1d4ed8;
    --vx-primary-soft: #eff6ff;
    --vx-primary-rgb: 37, 99, 235;

    --vx-sidebar-bg: #0f172a;
    --vx-sidebar-fg: #cbd5e1;
    --vx-sidebar-fg-muted: #94a3b8;
    --vx-sidebar-hover: rgba(148, 163, 184, .12);
    --vx-sidebar-active: rgba(37, 99, 235, .18);
    --vx-sidebar-active-fg: #ffffff;

    --vx-bg: #f1f5f9;
    --vx-surface: #ffffff;
    --vx-surface-muted: #f8fafc;
    --vx-border: #e2e8f0;
    --vx-border-strong: #cbd5e1;
    --vx-text: #0f172a;
    --vx-text-muted: #64748b;

    --vx-success: #16a34a;
    --vx-success-soft: #dcfce7;
    --vx-warning: #d97706;
    --vx-warning-soft: #fef3c7;
    --vx-danger: #dc2626;
    --vx-danger-soft: #fee2e2;
    --vx-info: #0891b2;
    --vx-info-soft: #cffafe;
    --vx-neutral-soft: #f1f5f9;

    --vx-radius: 10px;
    --vx-radius-sm: 6px;
    --vx-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --vx-shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
    --vx-focus: 0 0 0 3px rgba(37, 99, 235, .35);

    --vx-sidebar-w: 260px;
    --vx-sidebar-w-collapsed: 72px;
    --vx-topbar-h: 60px;
    --vx-content-pad: 24px;
    --vx-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --vx-font-size: 14px;
    --vx-transition: .2s ease;

    /* Bootstrap 5.3 bridge */
    --bs-primary: var(--vx-primary);
    --bs-primary-rgb: var(--vx-primary-rgb);
    --bs-link-color: var(--vx-primary);
    --bs-link-color-rgb: var(--vx-primary-rgb);
    --bs-link-hover-color: var(--vx-primary-hover);
    --bs-body-font-family: var(--vx-font);
    --bs-body-font-size: var(--vx-font-size);
    --bs-body-color: var(--vx-text);
    --bs-body-bg: var(--vx-bg);
    --bs-border-color: var(--vx-border);
    --bs-border-radius: var(--vx-radius-sm);
    --bs-border-radius-lg: var(--vx-radius);
    --bs-secondary-color: var(--vx-text-muted);
    --bs-success: var(--vx-success);
    --bs-warning: var(--vx-warning);
    --bs-danger: var(--vx-danger);
    --bs-info: var(--vx-info);
}

[data-bs-theme="dark"] {
    --vx-primary: #3b82f6;
    --vx-primary-hover: #60a5fa;
    --vx-primary-soft: rgba(59, 130, 246, .15);
    --vx-primary-rgb: 59, 130, 246;

    --vx-sidebar-bg: #0b1220;
    --vx-sidebar-active: rgba(59, 130, 246, .22);

    --vx-bg: #0b1220;
    --vx-surface: #111827;
    --vx-surface-muted: #0f172a;
    --vx-border: #1f2937;
    --vx-border-strong: #334155;
    --vx-text: #e2e8f0;
    --vx-text-muted: #94a3b8;

    --vx-success-soft: rgba(22, 163, 74, .18);
    --vx-warning-soft: rgba(217, 119, 6, .18);
    --vx-danger-soft: rgba(220, 38, 38, .18);
    --vx-info-soft: rgba(8, 145, 178, .18);
    --vx-neutral-soft: rgba(148, 163, 184, .14);

    --vx-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --vx-shadow-md: 0 4px 12px rgba(0, 0, 0, .45);

    --bs-body-color: var(--vx-text);
    --bs-body-bg: var(--vx-bg);
    --bs-border-color: var(--vx-border);
    --bs-secondary-color: var(--vx-text-muted);
    --bs-tertiary-bg: var(--vx-surface-muted);
    --bs-emphasis-color: #f8fafc;
}

/* ---------- Base ---------- */
html { font-size: var(--vx-font-size); }
body {
    font-family: var(--vx-font);
    font-size: var(--vx-font-size);
    line-height: 1.5;
    color: var(--vx-text);
    background: var(--vx-bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { color: var(--vx-text); font-weight: 600; letter-spacing: -.01em; }
h1, .h1 { font-size: 1.6rem; }
h2, .h2 { font-size: 1.4rem; }
h3, .h3 { font-size: 1.2rem; }
h4, .h4 { font-size: 1.07rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: .93rem; }
a { color: var(--vx-primary); text-decoration: none; }
a:hover { color: var(--vx-primary-hover); text-decoration: underline; }
.vx-nav a:hover, .dropdown-item:hover, .btn:hover { text-decoration: none; }
:focus-visible { outline: none; box-shadow: var(--vx-focus); border-radius: var(--vx-radius-sm); }
.text-muted, .vx-muted { color: var(--vx-text-muted) !important; }

/* ---------- App shell ---------- */
.vx-shell { min-height: 100vh; }

.vx-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--vx-sidebar-w);
    display: flex; flex-direction: column;
    background: var(--vx-sidebar-bg); color: var(--vx-sidebar-fg);
    transition: width var(--vx-transition), transform var(--vx-transition);
    overflow: hidden;
}
.vx-brand {
    height: var(--vx-topbar-h); flex: 0 0 auto;
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px; border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.vx-brand img { max-height: 34px; max-width: 170px; }
.vx-brand .vx-brand-mark { display: none; height: 32px; width: 32px; object-fit: contain; }

.vx-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.vx-user img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #1e293b; flex: 0 0 auto; }
.vx-user-name { color: #f8fafc; font-weight: 600; font-size: .93rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-user-role { color: var(--vx-sidebar-fg-muted); font-size: .8rem; }
.vx-user-text { min-width: 0; }

.vx-nav { list-style: none; margin: 0; padding: 12px 12px 24px; overflow-y: auto; flex: 1 1 auto; scrollbar-width: thin; }
.vx-nav-item { margin: 2px 0; }
.vx-nav-item:not(:has(> a)) { display: none; }          /* anchor hidden server-side (Visible=false) */
.vx-nav-group:not(:has(.vx-subnav a)) { display: none; } /* every child hidden */
.vx-nav a, .vx-nav button.vx-nav-link {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 9px 12px; border: 0; border-radius: 8px; background: none;
    color: var(--vx-sidebar-fg); font-size: .93rem; font-weight: 500; text-align: start; text-decoration: none;
    white-space: nowrap; transition: background var(--vx-transition), color var(--vx-transition);
}
.vx-nav a:hover, .vx-nav button.vx-nav-link:hover { background: var(--vx-sidebar-hover); color: #fff; }
.vx-nav a.active { background: var(--vx-sidebar-active); color: var(--vx-sidebar-active-fg); box-shadow: inset 3px 0 0 var(--vx-primary); }
.vx-nav .bi { font-size: 1.1rem; width: 22px; text-align: center; flex: 0 0 22px; }
/* Shell icons always follow their link/button: page rules such as "i.bi.bi-geo-alt { color }" or ".bi { font-size }"
   (AssignementDetails, AssignementDetailsCustomer) must not leak into the sidebar or the topbar. */
.vx-sidebar .bi, .vx-topbar .bi { color: inherit !important; margin-right: 0 !important; }
.vx-nav .bi:not(.vx-chevron) { font-size: 1.1rem !important; }
.vx-nav .vx-chevron { font-size: .8rem !important; }
.vx-nav .vx-chevron { margin-inline-start: auto; font-size: .8rem; width: auto; flex: 0 0 auto; transition: transform var(--vx-transition); }
.vx-nav-group.open .vx-chevron { transform: rotate(90deg); }
.vx-subnav { list-style: none; margin: 2px 0 4px; padding: 0 0 0 34px; display: none; }
.vx-nav-group.open .vx-subnav { display: block; }
.vx-subnav a { padding: 7px 12px; font-size: .88rem; font-weight: 400; }
.vx-nav-label { overflow: hidden; text-overflow: ellipsis; }

.vx-main {
    margin-inline-start: var(--vx-sidebar-w);
    min-height: 100vh; display: flex; flex-direction: column;
    transition: margin var(--vx-transition);
}

.vx-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--vx-topbar-h); flex: 0 0 auto;
    display: flex; align-items: center; gap: 12px;
    padding: 0 var(--vx-content-pad);
    background: var(--vx-surface); border-bottom: 1px solid var(--vx-border);
}
.vx-topbar-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.vx-topbar-title .page-title, .vx-topbar-title h1, .vx-topbar-title h2, .vx-topbar-title h3 {
    margin: 0; font-size: 1.15rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vx-topbar-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.vx-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 0; border-radius: 8px;
    background: transparent; color: var(--vx-text-muted); font-size: 1.15rem;
}
.vx-icon-btn:hover { background: var(--vx-neutral-soft); color: var(--vx-text); }
.vx-lang-btn { width: auto; padding: 0 10px; gap: 6px; font-size: .85rem; font-weight: 600; }

.vx-user-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 6px 4px 4px; border: 0; border-radius: 999px; background: transparent; color: var(--vx-text);
}
.vx-user-btn:hover { background: var(--vx-neutral-soft); }
.vx-user-btn img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--vx-neutral-soft); }
.vx-user-btn .vx-user-btn-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown-menu {
    --bs-dropdown-border-color: var(--vx-border);
    --bs-dropdown-border-radius: var(--vx-radius);
    --bs-dropdown-link-active-bg: var(--vx-primary);
    --bs-dropdown-font-size: .93rem;
    box-shadow: var(--vx-shadow-md); padding: 6px;
}
.dropdown-item { border-radius: 6px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; }
.dropdown-item .bi { font-size: 1rem; color: var(--vx-text-muted); }
.dropdown-item.active .bi, .dropdown-item:active .bi { color: inherit; }
.vx-dropdown-header { padding: 8px 12px 10px; border-bottom: 1px solid var(--vx-border); margin-bottom: 6px; }
.vx-dropdown-header strong { display: block; }
.vx-dropdown-header small { color: var(--vx-text-muted); }

.vx-content { flex: 1 1 auto; padding: var(--vx-content-pad); min-width: 0; }
.vx-content > form { min-width: 0; }

.vx-footer {
    flex: 0 0 auto; padding: 14px var(--vx-content-pad);
    color: var(--vx-text-muted); font-size: .82rem;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--vx-border);
}

.vx-backdrop { display: none; }

/* Collapsed sidebar (desktop) */
@media (min-width: 992px) {
    .vx-sidebar-collapsed .vx-sidebar { width: var(--vx-sidebar-w-collapsed); }
    .vx-sidebar-collapsed .vx-main { margin-inline-start: var(--vx-sidebar-w-collapsed); }
    .vx-sidebar-collapsed .vx-brand { padding: 0; justify-content: center; }
    .vx-sidebar-collapsed .vx-brand .vx-brand-full { display: none !important; }
    .vx-sidebar-collapsed .vx-brand .vx-brand-mark { display: block; }
    .vx-sidebar-collapsed .vx-user { justify-content: center; padding: 16px 0; }
    .vx-sidebar-collapsed .vx-user-text,
    .vx-sidebar-collapsed .vx-nav-label,
    .vx-sidebar-collapsed .vx-chevron { display: none; }
    .vx-sidebar-collapsed .vx-nav { padding-inline: 10px; }
    .vx-sidebar-collapsed .vx-nav a, .vx-sidebar-collapsed .vx-nav button.vx-nav-link { justify-content: center; padding-inline: 0; }
    .vx-sidebar-collapsed .vx-subnav { padding-left: 0; }
    .vx-sidebar-collapsed .vx-subnav a::before { content: "\2022"; }
}

/* Off-canvas drawer (< 992px) */
@media (max-width: 991.98px) {
    .vx-sidebar { transform: translateX(-100%); box-shadow: var(--vx-shadow-md); }
    [dir="rtl"] .vx-sidebar { transform: translateX(100%); }
    .vx-main { margin-inline-start: 0; }
    .vx-sidebar-open .vx-sidebar { transform: none; }
    .vx-sidebar-open .vx-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15, 23, 42, .5);
    }
    .vx-sidebar-open { overflow: hidden; }
    :root { --vx-content-pad: 16px; }
    .vx-user-btn .vx-user-btn-name { display: none; }
}
@media (max-width: 575.98px) {
    .vx-topbar { gap: 6px; }
    .vx-hide-xs { display: none !important; }
}

/* ?noMenu=1 – the server removes the sidebar */
.vx-shell:not(:has(.vx-sidebar)) .vx-main { margin-inline-start: 0 !important; }
.vx-shell:not(:has(.vx-sidebar)) .vx-sidebar-toggle { display: none; }
.vx-nomenu .vx-main { margin-inline-start: 0 !important; }
.vx-nomenu .vx-sidebar-toggle { display: none; }

/* RTL */
[dir="rtl"] .vx-sidebar { inset: 0 0 0 auto; }
[dir="rtl"] .vx-nav a.active { box-shadow: inset -3px 0 0 var(--vx-primary); }
[dir="rtl"] .vx-subnav { padding: 0 34px 0 0; }
[dir="rtl"] .vx-nav-group.open .vx-chevron { transform: rotate(-90deg); }

/* ---------- Page patterns ---------- */
.vx-page-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.vx-page-header:empty, .vx-page-header:not(:has(*)) { display: none; }
.vx-page-title { font-size: 1.45rem; font-weight: 600; margin: 0; }
.vx-page-subtitle { color: var(--vx-text-muted); margin: 4px 0 0; }
.vx-page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-inline-start: auto; }
.vx-page-actions:empty { display: none; }

/* every card (also the ones built as HTML by code-behind) uses the theme surface */
.card { --bs-card-bg: var(--vx-surface); --bs-card-border-color: var(--vx-border); --bs-card-border-radius: var(--vx-radius); }
/* Bootstrap 5 check boxes that replaced the 4-alpha custom-control ones (code-behind + Handlebars templates) */
.vx-check { display: inline-flex; align-items: center; gap: .4rem; padding-left: 0; cursor: pointer; }
.vx-check .form-check-input { margin: 0; float: none; }

.card.vx-card, .vx-card {
    --bs-card-bg: var(--vx-surface);
    --bs-card-border-color: var(--vx-border);
    --bs-card-border-radius: var(--vx-radius);
    --bs-card-inner-border-radius: calc(var(--vx-radius) - 1px);
    --bs-card-spacer-y: 20px;
    --bs-card-spacer-x: 20px;
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: 14px;
    background: var(--vx-surface);
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius);
    box-shadow: var(--vx-shadow-sm);
    margin-bottom: 20px;
}
.vx-card > .card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-bottom: 1px solid var(--vx-border);
}
.vx-card-title { font-size: 1rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.vx-card-title .bi { color: var(--vx-primary); }
.vx-card-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vx-card-flush > .card-body { padding: 0; }
.vx-card-fill { display: flex; flex-direction: column; min-height: calc(100vh - var(--vx-topbar-h) - 2 * var(--vx-content-pad) - 60px); }
.vx-card-fill > .card-body { flex: 1 1 auto; display: flex; flex-direction: column; }

.vx-filters .card-body { padding: 16px 20px; }
.vx-filters .form-label, .vx-field-label {
    display: block; font-size: .8rem; font-weight: 600; color: var(--vx-text-muted);
    text-transform: none; margin-bottom: 4px;
}
.vx-filters-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

.vx-kpi { display: flex; align-items: center; gap: 16px; padding: 18px 20px; height: 100%; }
.vx-kpi-icon {
    width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
    background: var(--vx-primary-soft); color: var(--vx-primary);
}
.vx-kpi-value { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.vx-kpi-label { color: var(--vx-text-muted); font-size: .85rem; }

.vx-narrow { max-width: 560px; margin-inline: auto; }

/* DevExpress WebChartControl (server-rendered image) inside a card: centred, scales down on narrow screens */
.vx-chart { display: flex; justify-content: center; align-items: center; overflow: hidden; }
.vx-chart > div { max-width: 100% !important; height: auto !important; }
.vx-chart img { max-width: 100% !important; height: auto !important; }

/* Form sections inside a card */
.vx-form-section + .vx-form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--vx-border); }
.vx-section-title { font-size: .95rem; font-weight: 600; margin: 0 0 10px; color: var(--vx-text); }
.vx-section-help { color: var(--vx-text-muted); font-size: .85rem; margin: -4px 0 12px; }
.vx-form-section .vx-field-label, span.vx-field-label { display: block; margin: 10px 0 4px; }
.vx-form-section .vx-field-label:first-child { margin-top: 0; }
.vx-required, .vx-field-label span[style*="red"] { color: var(--vx-danger) !important; }
.vx-form-actions {
    display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
    padding: 4px 0 8px;
}
@media (max-width: 767.98px) {
    .vx-form-actions {
        position: sticky; bottom: 0; z-index: 20;
        margin: 0 calc(-1 * var(--vx-content-pad));
        padding: 12px var(--vx-content-pad);
        background: var(--vx-surface); border-top: 1px solid var(--vx-border);
        box-shadow: 0 -4px 12px rgba(15, 23, 42, .06);
    }
    .vx-form-actions .btn { flex: 1 1 auto; }
}

/* Dropzone (assets/plugins/dropzone) restyled as a drop area */
.vx-dropzone.dropzone {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
    min-height: 140px; padding: 20px;
    border: 2px dashed var(--vx-border-strong); border-radius: var(--vx-radius);
    background: var(--vx-surface-muted); color: var(--vx-text-muted);
    transition: background var(--vx-transition), border-color var(--vx-transition);
}
.vx-dropzone.dropzone:hover, .vx-dropzone.dropzone.dz-drag-hover { border-color: var(--vx-primary); background: var(--vx-primary-soft); }
.vx-dropzone .dz-message { margin: 0; font-weight: 500; }
.vx-dropzone .dz-message::before { content: "\f297"; font-family: "bootstrap-icons"; display: block; font-size: 1.8rem; color: var(--vx-primary); text-align: center; }

/* DataTables (pages use 1.10 + bootstrap4 integration, SiteTech 1.13 + bootstrap5) and HTML tables built by code-behind */
.vx-dt-host .card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius); box-shadow: var(--vx-shadow-sm); }
.dataTables_wrapper .dt-buttons { margin-bottom: 12px; }
.dataTables_wrapper .dt-buttons .btn {
    font-size: .85rem; padding: .35rem .75rem;
    background: var(--vx-surface); color: var(--vx-text); border: 1px solid var(--vx-border-strong);
}
.dataTables_wrapper .dt-buttons .btn:hover, .dataTables_wrapper .dt-buttons .btn.active { background: var(--vx-neutral-soft); color: var(--vx-text); }
.dataTables_wrapper .dataTables_filter label { color: var(--vx-text-muted); font-size: .85rem; }
.dataTables_wrapper .dataTables_filter input {
    margin-inline-start: .5rem; min-height: 36px; padding: 4px 10px;
    border: 1px solid var(--vx-border-strong); border-radius: 8px; background: var(--vx-surface); color: var(--vx-text);
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--vx-primary); box-shadow: var(--vx-focus); }
.dataTables_wrapper .dataTables_info { color: var(--vx-text-muted); font-size: .85rem; padding-top: 14px; }
.dataTables_wrapper .dataTables_paginate { padding-top: 10px; }
.dataTables_wrapper .pagination { --bs-pagination-border-radius: 8px; --bs-pagination-active-bg: var(--vx-primary); --bs-pagination-active-border-color: var(--vx-primary); --bs-pagination-color: var(--vx-text); margin: 0; justify-content: flex-end; }
.dataTables_wrapper .pagination .page-link { border-color: var(--vx-border); }
.dataTables_wrapper .pagination .page-item.disabled .page-link { background: transparent; color: var(--vx-text-muted); }
table.dataTable { border-collapse: collapse !important; }
table.dataTable.table-bordered, table.dataTable.table-bordered > :not(caption) > * > * { border-color: var(--vx-border) !important; }
table.dataTable thead th, table.dataTable thead td {
    background: var(--vx-surface-muted); color: var(--vx-text-muted);
    font-size: .8rem; font-weight: 600; vertical-align: bottom; white-space: nowrap;
}
table.dataTable thead th select, table.dataTable thead th input {
    width: 100%; min-width: 60px; padding: 3px 6px; font-size: .82rem;
    border: 1px solid var(--vx-border-strong); border-radius: 6px; background: var(--vx-surface); color: var(--vx-text);
}
table.dataTable tbody td { vertical-align: middle; font-size: .88rem; color: var(--vx-text); }
table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: transparent; --bs-table-accent-bg: transparent; }
table.dataTable.table-hover > tbody > tr:hover > *, table.dataTable tbody tr:hover > * { --bs-table-bg-state: var(--vx-surface-muted); }
table.dataTable .bi { font-size: 1rem; margin-inline-end: .35em; }

/* HTML built by code-behind (legacy card / text markup) inside a redesigned page */
.vx-legacy-host > .card, .vx-legacy-host .card.mb-3, .vx-legacy-host .card.mb-2 {
    background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius);
    box-shadow: var(--vx-shadow-sm); margin-bottom: 20px !important;
}
.vx-legacy-host .header-title { font-size: 1.1rem; font-weight: 600; color: var(--vx-primary); margin-bottom: 0; display: flex; align-items: center; gap: 6px; }
.vx-legacy-host hr { border-color: var(--vx-border); opacity: 1; margin: 12px 0; }
.vx-legacy-host p.text-muted { color: var(--vx-text) !important; margin-bottom: 6px !important; font-size: .9rem !important; }
.vx-legacy-host p.text-muted > .bi:first-child { color: var(--vx-text-muted); font-size: 1rem; width: 1.4em; display: inline-block; }
.vx-card-body-flush > .card-body { padding: 0; }
.vx-map { height: 320px; border-radius: 8px; overflow: hidden; }
.vx-actions-card:not(:has(.flex-fill)) { display: none; }
.mandatory-header { cursor: pointer; }
.vx-pivot { overflow-x: auto; }
/* compact filter card (many small filters, e.g. technician Assignments) */
.vx-filters-compact > .card-header { padding-block: 10px; }
.vx-filters-compact .card-body { padding: 12px 16px 14px; }
.vx-filters-compact .form-label { margin-bottom: 2px; }
.vx-filters-compact .form-select, .vx-filters-compact .form-control { min-height: 36px; padding-block: 5px; font-size: .9rem; }
.vx-count-badge { font-size: .85rem; padding: 4px 12px; }
.vx-count-badge::before { display: none; }

/* Document tree (Docs / DocsPublic: <ul class="mytree"> + assets/plugins/treemenu) */
ul.mytree.vx-doc-tree, ul.mytree.vx-doc-tree ul { list-style: none; margin: 0; }
ul.mytree.vx-doc-tree { padding: 0 0 8px; border: 0 !important; background: none !important; }
ul.mytree.vx-doc-tree ul { padding-inline-start: 22px; }
ul.mytree.vx-doc-tree li { padding: 2px 0; }
ul.mytree.vx-doc-tree a { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; color: var(--vx-text) !important; text-decoration: none; }
ul.mytree.vx-doc-tree a:hover { background: var(--vx-neutral-soft); }
ul.mytree.vx-doc-tree a::before { font-family: "bootstrap-icons"; font-size: 1rem; color: #ca8a04; content: "\f3d9"; }
ul.mytree.vx-doc-tree li.tree-opened > a::before { content: "\f3d8"; }
ul.mytree.vx-doc-tree a.link-down::before { content: "\f356"; color: var(--vx-primary); }
ul.mytree.vx-doc-tree a.link-down { color: var(--vx-primary) !important; }
.vx-pivot > * + * { margin-top: 16px; }

/* Buttons */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary {
    --bs-btn-bg: var(--vx-primary); --bs-btn-border-color: var(--vx-primary);
    --bs-btn-hover-bg: var(--vx-primary-hover); --bs-btn-hover-border-color: var(--vx-primary-hover);
    --bs-btn-active-bg: var(--vx-primary-hover); --bs-btn-active-border-color: var(--vx-primary-hover);
    --bs-btn-disabled-bg: var(--vx-primary); --bs-btn-disabled-border-color: var(--vx-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--vx-primary); --bs-btn-border-color: var(--vx-primary);
    --bs-btn-hover-bg: var(--vx-primary); --bs-btn-hover-border-color: var(--vx-primary);
    --bs-btn-active-bg: var(--vx-primary-hover);
}
.btn-outline-secondary {
    --bs-btn-color: var(--vx-text); --bs-btn-border-color: var(--vx-border-strong);
    --bs-btn-hover-bg: var(--vx-neutral-soft); --bs-btn-hover-color: var(--vx-text); --bs-btn-hover-border-color: var(--vx-border-strong);
    --bs-btn-active-bg: var(--vx-neutral-soft); --bs-btn-active-color: var(--vx-text);
}

/* Forms (native) */
.form-control, .form-select { background-color: var(--vx-surface); color: var(--vx-text); border-color: var(--vx-border-strong); border-radius: 8px; min-height: 38px; }
.form-control:focus, .form-select:focus { border-color: var(--vx-primary); box-shadow: var(--vx-focus); }

/* Badges for status / priority */
.vx-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
    background: var(--vx-neutral-soft); color: var(--vx-text-muted);
}
.vx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vx-badge-primary { background: var(--vx-primary-soft); color: var(--vx-primary); }
.vx-badge-success { background: var(--vx-success-soft); color: var(--vx-success); }
.vx-badge-warning { background: var(--vx-warning-soft); color: var(--vx-warning); }
.vx-badge-danger  { background: var(--vx-danger-soft);  color: var(--vx-danger); }
.vx-badge-info    { background: var(--vx-info-soft);    color: var(--vx-info); }
.vx-badge-neutral { background: var(--vx-neutral-soft); color: var(--vx-text-muted); }

/* Tables (plain HTML) */
.table { --bs-table-bg: transparent; --bs-table-color: var(--vx-text); --bs-table-border-color: var(--vx-border); --bs-table-hover-bg: var(--vx-surface-muted); }
.table > thead th { font-size: .8rem; font-weight: 600; color: var(--vx-text-muted); background: var(--vx-surface-muted); }

/* Empty state */
.vx-empty { text-align: center; padding: 40px 20px; color: var(--vx-text-muted); }
.vx-empty .bi { font-size: 2.2rem; display: block; margin-bottom: 8px; color: var(--vx-border-strong); }

/* Toasts */
.vx-toasts {
    position: fixed; z-index: 2000; top: calc(var(--vx-topbar-h) + 12px); inset-inline-end: 16px;
    display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.vx-toast {
    pointer-events: auto;
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--vx-radius);
    background: var(--vx-surface); color: var(--vx-text);
    border: 1px solid var(--vx-border); border-inline-start: 4px solid var(--vx-info);
    box-shadow: var(--vx-shadow-md);
    animation: vx-toast-in .2s ease-out;
}
.vx-toast .bi { font-size: 1.15rem; line-height: 1.3; }
.vx-toast-body { flex: 1 1 auto; white-space: pre-line; word-break: break-word; }
.vx-toast-close { border: 0; background: none; color: var(--vx-text-muted); padding: 0 2px; font-size: 1.1rem; line-height: 1; }
.vx-toast-success { border-inline-start-color: var(--vx-success); } .vx-toast-success .bi:first-child { color: var(--vx-success); }
.vx-toast-error   { border-inline-start-color: var(--vx-danger); }  .vx-toast-error .bi:first-child { color: var(--vx-danger); }
.vx-toast-warning { border-inline-start-color: var(--vx-warning); } .vx-toast-warning .bi:first-child { color: var(--vx-warning); }
.vx-toast-info .bi:first-child { color: var(--vx-info); }
.vx-toast.hiding { opacity: 0; transform: translateY(-6px); transition: all .2s ease; }
@keyframes vx-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Global loading overlay */
.vx-loading {
    position: fixed; inset: 0; z-index: 1990; display: none;
    align-items: center; justify-content: center;
    background: rgba(248, 250, 252, .55); backdrop-filter: blur(1px);
}
[data-bs-theme="dark"] .vx-loading { background: rgba(11, 18, 32, .55); }
.vx-loading.show { display: flex; }
.vx-spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid rgba(var(--vx-primary-rgb), .2); border-top-color: var(--vx-primary);
    animation: vx-spin .8s linear infinite;
}
@keyframes vx-spin { to { transform: rotate(360deg); } }

/* Popup / public pages (no app chrome) */
.vx-popup-body { padding: 16px; background: var(--vx-bg); min-height: 100vh; }
.vx-public {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px 16px; background: var(--vx-bg);
}
.vx-public-card { width: 100%; max-width: 640px; }
.vx-public-logo { display: block; max-height: 48px; margin: 0 auto 20px; }

/* Utilities */
.vx-gap { gap: 12px; }
.vx-sticky-actions { position: sticky; bottom: 0; z-index: 10; background: var(--vx-surface); border-top: 1px solid var(--vx-border); padding: 12px 16px; }
.vx-full-height { height: calc(100vh - var(--vx-topbar-h) - 2 * var(--vx-content-pad) - 52px); min-height: 420px; }

/* Reduced motion: make transitions/animations (near) instant instead of removing them.
   "transition: none" broke DevExpress drop-downs: the combo box unlocks list clicks only when its popup
   transition ends (OnPopupControlShown), so with no transition the customer list ignored every click. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important; transition-delay: 0s !important;
        animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .vx-sidebar, .vx-topbar, .vx-footer, .vx-toasts, .vx-loading, .vx-backdrop { display: none !important; }
    .vx-main { margin: 0 !important; }
}

/* Document links inside the DevExpress tree list (Docs / DocsPublic) */
[class*="dxtlControl_"] a.link-down { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
[class*="dxtlControl_"] a.link-down::before { font-family: "bootstrap-icons"; content: "\f356"; font-size: 1rem; }
[class*="dxtlControl_"] a.link-down:hover { text-decoration: underline; }

/* technician work-order cards (HTML from Assignments.aspx.cs) */
.vx-wo-list .header-title { font-size: .98rem; line-height: 1.45; flex-wrap: wrap; }
@media (max-width: 575.98px) { .vx-wo-list .header-title { font-size: .9rem; } }
/* x-editable inline select (Assignments "pending acceptance") */
.editableform select.form-control {
    min-width: 200px; padding-right: 2.25rem;
    background-image: var(--bs-form-select-bg-img); background-repeat: no-repeat;
    background-position: right .75rem center; background-size: 16px 12px;
}

/* FullCalendar 2.9 (Calendar.aspx) */
.vx-calendar .fc-toolbar { margin-bottom: 16px; }
.vx-calendar .fc-toolbar h2 { font-size: 1.2rem; font-weight: 600; color: var(--vx-text); }
.vx-calendar .fc-button {
    height: 36px; padding: 0 12px; margin: 0 !important;
    background: var(--vx-surface) !important; color: var(--vx-text) !important;
    border: 1px solid var(--vx-border-strong) !important; box-shadow: none !important; text-shadow: none !important;
    font-family: var(--vx-font); font-size: .88rem; font-weight: 500; text-transform: capitalize;
}
.vx-calendar .fc-button:hover { background: var(--vx-neutral-soft) !important; }
.vx-calendar .fc-button.fc-state-active, .vx-calendar .fc-button.fc-state-down { background: var(--vx-primary) !important; border-color: var(--vx-primary) !important; color: #fff !important; }
.vx-calendar .fc-button.fc-state-disabled { opacity: .5; }
.vx-calendar .fc-button-group .fc-button:not(:first-child) { margin-left: -1px !important; }
.vx-calendar .fc-corner-left { border-radius: 8px 0 0 8px !important; }
.vx-calendar .fc-corner-right { border-radius: 0 8px 8px 0 !important; }
.vx-calendar .fc-corner-left.fc-corner-right { border-radius: 8px !important; }
.vx-calendar .fc-toolbar .fc-left > * + *, .vx-calendar .fc-toolbar .fc-right > * + * { margin-left: 8px !important; }
.vx-calendar th, .vx-calendar td, .vx-calendar .fc-row, .vx-calendar .fc-divider, .vx-calendar hr { border-color: var(--vx-border) !important; }
.vx-calendar .fc-day-header { padding: 8px 0; font-size: .8rem; font-weight: 600; color: var(--vx-text-muted); background: var(--vx-surface-muted); text-transform: uppercase; }
.vx-calendar .fc-day-number { padding: 6px 8px !important; font-size: .85rem; color: var(--vx-text-muted); }
.vx-calendar .fc-today { background: var(--vx-primary-soft) !important; }
.vx-calendar .fc-today .fc-day-number { color: var(--vx-primary); font-weight: 700; }
.vx-calendar .fc-other-month .fc-day-number { opacity: .45; }
.vx-calendar .fc-event { border: 0; border-radius: 6px; padding: 2px 6px; font-size: .78rem; background: var(--vx-primary); color: #fff; }
.vx-calendar .fc-day { cursor: pointer; }
.vx-calendar .fc-day:hover { background: var(--vx-surface-muted); }
.vx-calendar .event-count { display: inline-block; margin: 4px 6px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--vx-primary-soft); color: var(--vx-primary); }
@media (max-width: 575.98px) {
    .vx-calendar .fc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
    .vx-calendar .fc-toolbar .fc-center { order: -1; width: 100%; text-align: center; }
    .vx-calendar .fc-toolbar > * { float: none !important; }
    .vx-calendar .fc-clear { display: none; }
}
@media (max-width: 767.98px) {
    .vx-calendar .fc-scroller { height: auto !important; overflow: visible !important; }
    .vx-calendar .fc-day-grid .fc-row { min-height: 64px !important; }
    .vx-calendar .event-count { display: none; }          /* the event pill already marks the day */
    .vx-calendar .fc-event { font-size: .68rem; padding: 1px 3px; }
}

/* ion.rangeSlider (skinModern) in the tokens (AssignmentsCounter) */
.irs-bar, .irs-bar-edge, .irs-from, .irs-to, .irs-single { background: var(--vx-primary) !important; border-color: var(--vx-primary) !important; }
.irs-from::after, .irs-to::after, .irs-single::after { border-top-color: var(--vx-primary) !important; }
.irs-line { background: var(--vx-neutral-soft) !important; border-color: var(--vx-border) !important; }
.irs-min, .irs-max, .irs-grid-text { color: var(--vx-text-muted) !important; background: transparent !important; }

/* AssignementDetails (technician) */
.vx-wo-details .js-signature canvas { max-width: 100%; }
@media (max-width: 1199.98px) {
    /* the "Submit info" card (Save / Send report / Escalate) stays reachable at the bottom while the actions column scrolls */
    .vx-wo-side .latest {
        position: sticky; bottom: 0; z-index: 20; margin-bottom: 0;
        border-radius: var(--vx-radius) var(--vx-radius) 0 0;
        box-shadow: 0 -6px 18px rgba(15, 23, 42, .12);
    }
    .vx-wo-side .latest .card-body { padding: 12px 16px; }
    .vx-wo-side .latest .vx-card-title { display: none; }
}
/* side (actions) column: label above, field + its "now" button on one line */
.vx-wo-side .vx-form-row { --bs-gutter-x: .5rem; row-gap: 4px; }
.vx-wo-side .vx-form-row > .col-form-label { flex: 0 0 100%; max-width: 100%; padding-bottom: 2px; font-weight: 500; white-space: normal; }
.vx-wo-side .vx-form-row > .col-sm-8, .vx-wo-side .vx-form-row > .col-sm-10 { flex: 1 1 0; width: auto; max-width: none; }
.vx-wo-side .vx-form-row > div.col-sm-2 { flex: 0 0 auto; width: auto; }
.vx-wo-side .vx-form-row > div.col-sm-2 .btn { min-width: 44px !important; width: 44px; height: 38px; padding: 0; }
.vx-wo-side #svt-schedule { height: 38px; white-space: nowrap; }

/* Phones: wide generated tables / tree lists scroll inside their card instead of widening the page */
.vx-dt-host { max-width: 100%; overflow-x: auto; }
@media (max-width: 767.98px) {
    table[class*="dxtlControl_"] { display: block; max-width: 100%; overflow-x: auto; }
}
/* Check In / Check Out: label to the left of the date field (saves height) */
.vx-wo-side .vx-form-row.vx-inline-label { align-items: center; }
.vx-wo-side .vx-form-row.vx-inline-label > .col-form-label { flex: 0 0 96px; max-width: 96px; padding-top: 0; padding-bottom: 0; white-space: nowrap; }

/* Work order info card (AssignementDetails, built by the code-behind): two columns, "label  value" on one line */
.vx-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.vx-info-item { min-width: 0; display: flex; align-items: baseline; gap: 10px; font-size: .9rem; line-height: 1.45; }
.vx-info-wide { grid-column: 1 / -1; }
.vx-info-label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--vx-text-muted); white-space: nowrap; }
.vx-info-label .bi { font-size: .95rem; margin: 0; }
.vx-info-value { flex: 1 1 auto; min-width: 0; color: var(--vx-text); font-weight: 500; overflow-wrap: anywhere; }
.vx-info-value.is-empty { color: var(--vx-text-muted); font-weight: 400; opacity: .55; }
/* one colour per field icon (same palette as the grid header icons, .vx-hi-*) */
.vx-info-label .bi.bi-alarm { color: #db2777; }
.vx-info-label .bi.bi-arrow-right-circle-fill { color: var(--vx-primary); }
.vx-info-label .bi.bi-wrench { color: #7c3aed; }
.vx-info-label .bi.bi-archive { color: #ea580c; }
.vx-info-label .bi.bi-upc { color: #0891b2; }
.vx-info-label .bi.bi-pin-map { color: #0d9488; }
.vx-info-label .bi.bi-person-badge { color: var(--vx-primary); }
.vx-info-label .bi.bi-receipt { color: #6366f1; }
.vx-info-label .bi.bi-geo { color: #0d9488; }
.vx-info-label .bi.bi-person { color: #0891b2; }
.vx-info-label .bi.bi-geo-alt { color: #ca8a04; }
.vx-info-label .bi.bi-telephone { color: #ca8a04; }
.vx-info-label .bi.bi-phone { color: #ea580c; }
.vx-info-label .bi.bi-exclamation-octagon { color: #d97706; }
.vx-info-label .bi.bi-list-check { color: #16a34a; }
@media (max-width: 575.98px) { .vx-info-grid { grid-template-columns: 1fr; gap: 6px; } }

/* label + field pairs on one line (AssignementDetails Charge / Paid); wraps when there is no room */
.vx-inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vx-inline-fields .form-label { margin: 0; font-weight: 500; white-space: nowrap; }
.vx-inline-fields .form-control { flex: 1 1 70px; min-width: 0; width: auto; }

/* AssignementDetails consumables grid: scroll inside its card on very narrow phones instead of widening the page */
@media (max-width: 400px) { .vx-wo-details table[id$="grdConsumables"] { display: block; max-width: 100%; overflow-x: auto; } }

/* AssignementDetails products (one <table> per product, built by the code-behind; JS adds rows to its tbody):
   two columns on wide screens, compact rows, no red title */
.allproducts h4.header-title.text-danger { color: var(--vx-text) !important; }
#productsList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: start; }
#productsList > table { margin: 0 !important; border: 1px solid var(--vx-border); border-radius: var(--vx-radius); overflow: hidden; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
#productsList > table > :not(caption) > * > * { padding: .32rem .6rem; }
#productsList > table > thead th { background: var(--vx-surface-muted, rgba(148, 163, 184, .08)); font-weight: 600; font-size: .82rem; line-height: 1.3; border-bottom: 1px solid var(--vx-border); }
#productsList > table > thead .btn-sm { padding: 0 .45rem; line-height: 1.4; }
#productsList > table > tbody > tr:last-child > * { border-bottom: 0; }
/* rows as flex lines: header "name | +", body "attribute | value" (rows added later by the page JS get the same layout) */
#productsList > table, #productsList > table > thead, #productsList > table > tbody { display: block; width: 100%; }
#productsList > table > thead > tr, #productsList > table > tbody > tr { display: flex; align-items: center; }
#productsList > table > thead > tr > th:first-child { flex: 1 1 auto; width: auto !important; }   /* the code-behind sets width:50% */
#productsList > table > thead > tr > th:last-child { flex: 0 0 auto; }
#productsList > table > tbody > tr > td { border-top: 0; }
#productsList > table > tbody > tr > td:first-child { flex: 0 0 42%; color: var(--vx-text-muted); }
#productsList > table > tbody > tr > td:not(:first-child) { flex: 1 1 auto; min-width: 0; text-align: start !important; overflow-wrap: anywhere; }
#productsList > table > tbody > tr + tr { border-top: 1px solid var(--vx-border); }
@media (max-width: 991.98px) { #productsList { grid-template-columns: 1fr; } }

/* AssignementDetails "Submit Info": the main save of the page stands out and stays reachable */
.card.vx-card.vx-submit-card {
    border: 1px solid rgba(var(--vx-primary-rgb), .35); border-top: 3px solid var(--vx-primary);
    background: linear-gradient(180deg, rgba(var(--vx-primary-rgb), .07), rgba(var(--vx-primary-rgb), .02)), var(--vx-surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .10);
}
.vx-submit-card .vx-card-title .bi { color: var(--vx-primary); }
.vx-submit-main { display: flex; flex-direction: column; gap: 10px; }
.vx-submit-main > table { align-self: flex-start; width: auto !important; }   /* DevExpress check box (Send Report) */
.vx-submit-card .vx-submit-btn {
    width: 100%; min-height: 50px; margin: 0 !important; font-size: 1.05rem; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 6px 16px rgba(var(--vx-primary-rgb), .35);
}
.vx-submit-card .vx-submit-btn .bi { font-size: 1.2rem; margin: 0; }
.vx-submit-secondary { margin-top: 12px; }
.vx-submit-secondary:empty { display: none; }
.vx-submit-secondary .btn { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; }
@media (min-width: 1200px) {
    /* desktop: sticks to the bottom of the screen while the actions column scrolls */
    .vx-wo-side .latest.vx-submit-card { position: sticky; bottom: 16px; z-index: 20; }
}

/* Main submit bar of a form page (Default.aspx "Create Workorder"): same look as the AssignementDetails Submit Info card */
.vx-form-actions.vx-submit-bar {
    position: sticky; bottom: 16px; z-index: 20; margin: 16px 0 0; align-items: center;
    padding: 12px 16px; border-radius: var(--vx-radius);
    border: 1px solid rgba(var(--vx-primary-rgb), .35); border-top: 3px solid var(--vx-primary);
    background: linear-gradient(180deg, rgba(var(--vx-primary-rgb), .07), rgba(var(--vx-primary-rgb), .02)), var(--vx-surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.vx-submit-bar .vx-submit-btn {
    min-height: 50px; padding-inline: 28px; font-size: 1.05rem; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 6px 16px rgba(var(--vx-primary-rgb), .35);
}
.vx-submit-bar .vx-submit-btn .bi { font-size: 1.2rem; margin: 0; }
@media (min-width: 768px) {
    /* desktop: a floating card bottom-right, only as wide as its buttons (covers less of the form) */
    .vx-form-actions.vx-submit-bar { width: fit-content; margin-left: auto; }
}
@media (max-width: 767.98px) {
    .vx-form-actions.vx-submit-bar { bottom: 8px; margin-inline: 0; }
    .vx-submit-bar .vx-submit-btn { width: 100%; }
}

/* ---------- AssignementDetails in dark theme: page CSS hard-codes white backgrounds ----------
   Signature: the canvas is transparent (white came from CSS) - dark pad + light ink here, and vxSignatureTheme()
   (AssignementDetails.aspx) recolours the saved image back to the usual dark ink, so the stored signature is unchanged. */
[data-bs-theme="dark"] .vx-wo-details .js-signature { background: transparent !important; }
[data-bs-theme="dark"] .vx-wo-details canvas#jq-signature-canvas-1 { background: var(--vx-surface-muted) !important; border-color: var(--vx-border-strong) !important; }   /* light ink in dark: see vxSignatureTheme() */
[data-bs-theme="dark"] .vx-wo-details .dropzone { background: var(--vx-surface-muted); border-color: var(--vx-border-strong); color: var(--vx-text-muted); }
[data-bs-theme="dark"] .vx-wo-details .dropzone.dz-drag-hover { background: rgba(var(--vx-primary-rgb), .12); border-color: var(--vx-primary); color: var(--vx-primary); }
[data-bs-theme="dark"] .vx-wo-details .photo-zone { background: var(--vx-surface-muted) !important; border-color: var(--vx-border-strong) !important; color: var(--vx-text-muted); }
[data-bs-theme="dark"] .vx-wo-details .upload-btn { background: var(--vx-surface); color: var(--vx-text); border-color: var(--vx-border-strong); }
[data-bs-theme="dark"] .vx-wo-details .new_atts_table,
[data-bs-theme="dark"] .vx-wo-details #datatable-toolbar { background: var(--vx-surface-muted); border-color: var(--vx-border); }
[data-bs-theme="dark"] .vx-wo-details select { background-color: var(--vx-surface) !important; color: var(--vx-text) !important; border-color: var(--vx-border-strong) !important; }
/* DevExtreme date boxes (schedule / check in / check out) and their calendar pop-up use the light dx theme */
[data-bs-theme="dark"] .dx-texteditor,
[data-bs-theme="dark"] .dx-texteditor .dx-texteditor-input { background: var(--vx-surface) !important; color: var(--vx-text) !important; }
[data-bs-theme="dark"] .dx-texteditor { border-color: var(--vx-border-strong) !important; }
[data-bs-theme="dark"] .dx-dropdowneditor-button .dx-dropdowneditor-icon { background: transparent !important; color: var(--vx-text-muted) !important; }
[data-bs-theme="dark"] .dx-overlay-content.dx-popup-normal,
[data-bs-theme="dark"] .dx-overlay-content .dx-popup-content,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-body,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-navigator .dx-button,
[data-bs-theme="dark"] .dx-overlay-content .dx-popup-bottom,
[data-bs-theme="dark"] .dx-overlay-content .dx-toolbar,
[data-bs-theme="dark"] .dx-overlay-content .dx-list,
[data-bs-theme="dark"] .dx-overlay-content .dx-numberbox,
[data-bs-theme="dark"] .dx-overlay-content .dx-texteditor-input { background: var(--vx-surface) !important; color: var(--vx-text) !important; border-color: var(--vx-border-strong) !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-cell,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-caption-button .dx-button-text,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-navigator .dx-icon,
[data-bs-theme="dark"] .dx-overlay-content .dx-list-item { color: var(--vx-text) !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-other-view,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-body thead th { color: var(--vx-text-muted) !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-cell.dx-calendar-selected-date span,
[data-bs-theme="dark"] .dx-overlay-content .dx-calendar-cell.dx-calendar-selected-date.dx-calendar-today span { background: var(--vx-primary) !important; color: #fff !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-button,
[data-bs-theme="dark"] .dx-overlay-content .dx-numberbox-spin-button { background: var(--vx-surface-muted) !important; border-color: var(--vx-border-strong) !important; color: var(--vx-text) !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-button .dx-button-text,
[data-bs-theme="dark"] .dx-overlay-content .dx-button .dx-icon,
[data-bs-theme="dark"] .dx-overlay-content .dx-numberbox-spin-button .dx-numberbox-spin-up-icon,
[data-bs-theme="dark"] .dx-overlay-content .dx-numberbox-spin-button .dx-numberbox-spin-down-icon { color: var(--vx-text) !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-popup-done.dx-button { background: var(--vx-primary) !important; border-color: var(--vx-primary) !important; }
[data-bs-theme="dark"] .dx-overlay-content .dx-popup-done.dx-button .dx-button-text { color: #fff !important; }

/* Dark theme: cells coloured from the database (status colours, inline background) keep dark text so they stay readable */
[data-bs-theme="dark"] td[style*="background-color"], [data-bs-theme="dark"] td[style*="background-color"] * { color: #0f172a !important; }
/* ...and keep their colour on row hover / striping: Bootstrap and DataTables paint those with an inset box-shadow over the cell */
td[style*="background-color"] { box-shadow: none !important; }
tr:hover > td[style*="background-color"] { filter: saturate(1.4) brightness(.95); }
/* Dark theme: DevExpress tree list nodes (Docs) */
[data-bs-theme="dark"] [class*="dxtlNode_"], [data-bs-theme="dark"] [class*="dxtlNode_"] > td,
[data-bs-theme="dark"] [class*="dxtlIndent"] { background-color: var(--vx-surface) !important; color: var(--vx-text) !important; }
[data-bs-theme="dark"] [class*="dxtlNode_"]:hover > td { background-color: var(--vx-surface-muted) !important; }
[data-bs-theme="dark"] [class*="dxtlSelectedNode_"] > td { background-color: rgba(var(--vx-primary-rgb), .18) !important; }
/* Dark theme: DevExpress grid empty header cell, pivot grid field list (customization form) and its field headers */
[data-bs-theme="dark"] [class*="dxgvHEC"] { background-color: var(--vx-surface-muted) !important; }
[data-bs-theme="dark"] [class*="dxpgCustForm_"], [data-bs-theme="dark"] [class*="dxpgCustForm_"] div,
[data-bs-theme="dark"] [class*="dxpgCustForm_"] table, [data-bs-theme="dark"] [class*="dxpgCustForm_"] td { background-color: var(--vx-surface) !important; color: var(--vx-text) !important; border-color: var(--vx-border) !important; }
[data-bs-theme="dark"] [class*="dxpgHeader_"], [data-bs-theme="dark"] [class*="dxpgHeader_"] td { background-color: var(--vx-surface-muted) !important; color: var(--vx-text) !important; border-color: var(--vx-border-strong) !important; }
[data-bs-theme="dark"] [class*="dxpgCell_"] { background-color: var(--vx-surface) !important; color: var(--vx-text) !important; border-color: var(--vx-border) !important; }
[data-bs-theme="dark"] [class*="dxpgTotalCell_"], [data-bs-theme="dark"] [class*="dxpgGrandTotalCell_"],
[data-bs-theme="dark"] [class*="dxpgFieldValue_"], [data-bs-theme="dark"] [class*="dxpgArea_"] { background-color: var(--vx-surface-muted) !important; color: var(--vx-text) !important; border-color: var(--vx-border) !important; }
