/* =====================================================================
   Vortex Web – DevExpress ASP.NET (22.2) overrides
   Base theme is set globally in Web.config (<themes theme="Office365" baseColor="#2563eb">).
   Selectors use [class*="..._"] so they hold for any DX theme suffix
   (Office365 today, Moderno as a fallback).
   ===================================================================== */

/* ---------- Typography everywhere ---------- */
[class*="dxgvControl_"], [class*="dxgvControl_"] td,
[class*="dxeEditArea_"], [class*="dxeTextBox_"], [class*="dxeMemo_"], [class*="dxeButtonEdit_"],
[class*="dxflFormLayout_"], [class*="dxflCaption_"], [class*="dxpcLite_"], [class*="dxbButton_"],
[class*="dxtcLite_"], [class*="dxmLite_"], [class*="dxpgControl_"], [class*="dxtlControl_"],
[class*="dxeBase_"], [class*="dxeListBox_"], [class*="dxucControl_"] {
    font-family: var(--vx-font) !important;
    font-size: var(--vx-font-size);
}

/* ---------- Grid (ASPxGridView) ---------- */
[class*="dxgvControl_"] {
    border: 0 !important;
    background: var(--vx-surface) !important;
    color: var(--vx-text);
    width: 100%;
}
.vx-card [class*="dxgvControl_"] { border-radius: 0 0 var(--vx-radius) var(--vx-radius); }
[class*="dxgvTable_"] { border-color: var(--vx-border) !important; background: var(--vx-surface) !important; }

[class*="dxgvHeader_"] {
    background: var(--vx-surface-muted) !important;
    color: var(--vx-text-muted) !important;
    font-weight: 600 !important;
    font-size: .8rem !important;
    border-color: var(--vx-border) !important;
    border-width: 0 0 1px 0 !important;
    padding: 10px 12px !important;
    white-space: nowrap;
}
[class*="dxgvHeader_"] td { color: inherit !important; font-size: inherit !important; }

[class*="dxgvDataRow_"] > td, [class*="dxgvFocusedRow_"] > td, [class*="dxgvSelectedRow_"] > td,
[class*="dxgvGroupRow_"] > td, [class*="dxgvEditFormDisplayRow_"] > td {
    height: 44px;
    padding: 6px 12px !important;
    border-color: var(--vx-border) !important;
    border-width: 0 0 1px 0 !important;
    vertical-align: middle;
}
[class*="dxgvDataRow_"] { background: var(--vx-surface) !important; color: var(--vx-text) !important; }
[class*="dxgvDataRowAlt_"] { background: var(--vx-surface) !important; } /* zebra off */
[class*="dxgvDataRowHover_"], [class*="dxgvDataRow_"]:hover { background: var(--vx-surface-muted) !important; }
[class*="dxgvFocusedRow_"], [class*="dxgvSelectedRow_"] {
    background: var(--vx-primary-soft) !important;
    color: var(--vx-text) !important;
}
[class*="dxgvFocusedRow_"] a, [class*="dxgvSelectedRow_"] a { color: var(--vx-primary) !important; }
[class*="dxgvGroupRow_"] { background: var(--vx-surface-muted) !important; font-weight: 600; }

[class*="dxgvFilterRow_"] > td {
    background: var(--vx-surface) !important;
    border-color: var(--vx-border) !important;
    border-width: 0 0 1px 0 !important;
    padding: 6px 8px !important;
}
[class*="dxgvGroupPanel_"] {
    background: var(--vx-surface) !important;
    color: var(--vx-text-muted) !important;
    border-bottom: 1px dashed var(--vx-border) !important;
    padding: 10px 12px !important;
}
[class*="dxgvTitlePanel_"] { background: var(--vx-surface) !important; color: var(--vx-text) !important; font-weight: 600; text-align: start; }
[class*="dxgvFooter_"] > td { background: var(--vx-surface-muted) !important; border-color: var(--vx-border) !important; font-weight: 600; }
[class*="dxgvEmptyDataRow_"] > td {
    padding: 36px 12px !important;
    text-align: center; color: var(--vx-text-muted) !important;
    background: var(--vx-surface) !important;
}
[class*="dxgvPagerBottomPanel_"], [class*="dxgvPagerTopPanel_"] {
    background: var(--vx-surface) !important;
    border-top: 1px solid var(--vx-border);
    padding: 10px 12px !important;
}
[class*="dxgvPagerBottomPanel_"] [class*="dxpLite_"] { float: right; }
[class*="dxgvCommandColumn_"] a { color: var(--vx-primary) !important; }

/* Toolbar of the grid */
[class*="dxgvToolbarContainer"], .dxgvToolbarContainer {
    background: var(--vx-surface) !important;
    border-bottom: 1px solid var(--vx-border) !important;
    padding: 8px 10px !important;
}

/* ---------- Pager ---------- */
[class*="dxpLite_"] { background: transparent !important; color: var(--vx-text-muted) !important; }
[class*="dxpLite_"] .dxp-num, [class*="dxpLite_"] .dxp-button, [class*="dxpLite_"] .dxp-current {
    min-width: 32px; height: 32px; line-height: 30px !important;
    padding: 0 8px !important; margin: 0 2px !important;
    border-radius: 8px !important; border: 1px solid transparent !important;
    text-align: center; text-decoration: none !important;
    color: var(--vx-text) !important;
}
[class*="dxpLite_"] .dxp-num:hover, [class*="dxpLite_"] .dxp-button:hover { background: var(--vx-neutral-soft) !important; }
[class*="dxpLite_"] .dxp-current { background: var(--vx-primary) !important; color: #fff !important; border-color: var(--vx-primary) !important; }
[class*="dxpLite_"] .dxp-disabledButton { opacity: .4; }

/* ---------- Editors ---------- */
[class*="dxeTextBox_"], [class*="dxeButtonEdit_"], [class*="dxeMemo_"], [class*="dxeTextBoxSys"][class*="dxeTextBox_"] {
    border: 1px solid var(--vx-border-strong) !important;
    border-radius: 8px !important;
    background: var(--vx-surface) !important;
    color: var(--vx-text) !important;
    overflow: hidden;
}
[class*="dxeTextBox_"] input, [class*="dxeButtonEdit_"] input, [class*="dxeMemo_"] textarea, [class*="dxeEditArea_"] {
    background: transparent !important;
    color: var(--vx-text) !important;
    font-family: var(--vx-font) !important;
}
[class*="dxeTextBox_"] input, [class*="dxeButtonEdit_"] input { min-height: 34px; padding-inline: 10px !important; }
[class*="dxeFocused_"] {
    border-color: var(--vx-primary) !important;
    box-shadow: var(--vx-focus) !important;
}
[class*="dxeButtonEditButton_"], [class*="dxeSpinIncButton_"], [class*="dxeSpinDecButton_"] {
    background: transparent !important;
    border: 0 !important;
    color: var(--vx-text-muted) !important;
}
[class*="dxeButtonEditButton_"]:hover { background: var(--vx-neutral-soft) !important; }
[class*="dxeDisabled_"] { opacity: .65; background: var(--vx-surface-muted) !important; }
[class*="dxeReadOnly_"] { background: var(--vx-surface-muted) !important; }
.dxeErrorFrame, [class*="dxeErrorFrame"] { border-color: var(--vx-danger) !important; }
[class*="dxeErrorCell_"], .dxeErrorCellSys { color: var(--vx-danger) !important; font-size: .82rem; }

/* Drop-down lists */
[class*="dxeListBox_"], [class*="dxpcDropDown_"] {
    border-color: var(--vx-border) !important;
    border-radius: 8px;
    box-shadow: var(--vx-shadow-md);
    background: var(--vx-surface) !important;
}
[class*="dxeListBoxItem_"] { padding: 7px 10px !important; color: var(--vx-text) !important; }
[class*="dxeListBoxItemHover_"] { background: var(--vx-surface-muted) !important; }
[class*="dxeListBoxItemSelected_"] { background: var(--vx-primary-soft) !important; color: var(--vx-primary) !important; }

/* Calendar */
[class*="dxeCalendar_"] { border-color: var(--vx-border) !important; border-radius: 8px; }
[class*="dxeCalendarSelected_"] { background: var(--vx-primary) !important; color: #fff !important; }
[class*="dxeCalendarToday_"] { outline: 1px solid var(--vx-primary); }

/* Check boxes */
[class*="dxeBase_"] { color: var(--vx-text); }

/* ---------- Buttons ---------- */
[class*="dxbButton_"] {
    border-radius: 8px !important;
    font-weight: 500 !important;
    border: 1px solid var(--vx-border-strong) !important;
    background-color: var(--vx-surface) !important;
    color: var(--vx-text) !important;
    box-shadow: none !important;
    transition: background var(--vx-transition), border-color var(--vx-transition);
}
[class*="dxbButton_"] .dxb { padding: 7px 14px !important; }
[class*="dxbButton_"]:hover, [class*="dxbButtonHover_"] { background-color: var(--vx-neutral-soft) !important; }
[class*="dxbButton_"].vx-btn-primary, .vx-btn-primary[class*="dxbButton_"] {
    background-color: var(--vx-primary) !important; border-color: var(--vx-primary) !important; color: #fff !important;
}
[class*="dxbButton_"].vx-btn-primary:hover { background-color: var(--vx-primary-hover) !important; border-color: var(--vx-primary-hover) !important; }
[class*="dxbButton_"].vx-btn-danger { background-color: var(--vx-danger) !important; border-color: var(--vx-danger) !important; color: #fff !important; }
[class*="dxbButton_"].vx-btn-primary .dxb, [class*="dxbButton_"].vx-btn-danger .dxb { color: #fff !important; }
[class*="dxbDisabled_"] { opacity: .55; }
/* icon buttons that Office365 draws with a white icon on the base colour (e.g. pivot field-list layout button) */
[class*="dxpgFLButton_"][class*="dxbButton_"] { background-color: var(--vx-primary) !important; border-color: var(--vx-primary) !important; }
[class*="dxpgFLButton_"][class*="dxbButton_"]:hover { background-color: var(--vx-primary-hover) !important; }
/* command links inside grids (Edit / Update / Cancel as links) stay links */
[class*="dxgvCommandColumn_"] a[class*="dxbButton_"], [class*="dxgvCommandColumnItem_"][class*="dxbButton_"] {
    border: 0 !important; background: transparent !important; color: var(--vx-primary) !important; padding: 0 4px !important;
}

/* ---------- Popups (ASPxPopupControl) ---------- */
[class*="dxpcLite_"] .dxpc-mainDiv, [class*="dxpcLite_"].dxpc-mainDiv {
    border: 1px solid var(--vx-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25) !important;
    background: var(--vx-surface) !important;
    overflow: hidden;
    max-width: calc(100vw - 24px);
}
[class*="dxpcLite_"] .dxpc-header {
    background: var(--vx-surface) !important;
    color: var(--vx-text) !important;
    border-bottom: 1px solid var(--vx-border) !important;
    padding: 14px 20px !important;
}
[class*="dxpcLite_"] .dxpc-headerText { font-weight: 600 !important; font-size: 1rem !important; color: var(--vx-text) !important; }
[class*="dxpcLite_"] .dxpc-content { padding: 20px !important; color: var(--vx-text); }
[class*="dxpcLite_"] .dxpc-footer {
    background: var(--vx-surface-muted) !important;
    border-top: 1px solid var(--vx-border) !important;
    padding: 12px 20px !important;
}
[class*="dxpcModalBackLite_"], [class*="dxpcModalBack_"] { background-color: #0f172a !important; opacity: .5 !important; }

/* ---------- Form layout ---------- */
[class*="dxflFormLayout_"] { color: var(--vx-text); }
[class*="dxflCaption_"], [class*="dxflCaptionCell_"] { color: var(--vx-text-muted) !important; font-weight: 500; }
[class*="dxflGroupBox_"] {
    border: 1px solid var(--vx-border) !important;
    border-radius: var(--vx-radius) !important;
    background: var(--vx-surface) !important;
    padding-top: 8px;
}
[class*="dxflGroupBoxCaption_"] {
    background: var(--vx-surface) !important;
    color: var(--vx-text) !important;
    font-weight: 600 !important;
    padding: 0 8px !important;
}
[class*="dxflHeadingLineGroupBoxSys"] > [class*="dxflGroupBoxCaption_"] { padding-inline: 0 !important; }

/* ---------- Page control / tabs ---------- */
[class*="dxtcLite_"] > .dxtc-stripContainer { border-bottom: 1px solid var(--vx-border) !important; }
[class*="dxtcLite_"] > .dxtc-stripContainer .dxtc-tab,
[class*="dxtcLite_"] > .dxtc-stripContainer .dxtc-activeTab {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    color: var(--vx-text-muted) !important;
    font-weight: 500;
}
[class*="dxtcLite_"] > .dxtc-stripContainer .dxtc-activeTab {
    color: var(--vx-primary) !important;
    border-bottom-color: var(--vx-primary) !important;
}
[class*="dxtcLite_"] > .dxtc-content { border: 0 !important; background: transparent !important; padding: 16px 0 0 !important; }

/* ---------- Menus / toolbars ---------- */
[class*="dxmLite_"] .dxm-main { background: transparent !important; border: 0 !important; }
[class*="dxmLite_"] .dxm-item { border-radius: 8px; }
[class*="dxmLite_"] .dxm-hovered { background: var(--vx-neutral-soft) !important; }
[class*="dxmLite_"] .dxm-popup { border-color: var(--vx-border) !important; border-radius: 8px; box-shadow: var(--vx-shadow-md); }

/* ---------- Loading panel ---------- */
[class*="dxlpLoadingPanel_"] {
    border: 1px solid var(--vx-border) !important;
    border-radius: var(--vx-radius) !important;
    box-shadow: var(--vx-shadow-md) !important;
    background: var(--vx-surface) !important;
    color: var(--vx-text) !important;
    font-family: var(--vx-font) !important;
}
[class*="dxlpLoadingDiv_"] { background: rgba(248, 250, 252, .55) !important; }

/* ---------- Upload control ---------- */
[class*="dxucControl_"] .dxucInputs_Office365, [class*="dxucControl_"] [class*="dxucTextBox_"] {
    border-radius: 8px !important; border-color: var(--vx-border-strong) !important;
}

/* ---------- Pivot grid / tree list ---------- */
[class*="dxpgControl_"], [class*="dxtlControl_"] { border-color: var(--vx-border) !important; }
[class*="dxpgHeader_"] { border-radius: 6px !important; }
[class*="dxpgColumnFieldValue_"], [class*="dxpgRowFieldValue_"], [class*="dxtlHeader_"] {
    background: var(--vx-surface-muted) !important; color: var(--vx-text) !important; border-color: var(--vx-border) !important;
}
[class*="dxpgCell_"], [class*="dxtlDataRow_"] > td { border-color: var(--vx-border) !important; }

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
    [class*="dxpcLite_"] .dxpc-content { padding: 16px !important; }
    [class*="dxgvDataRow_"] > td { height: 40px; }
}

/* ---------- Dark theme (shell-level adaptation of the light DX theme) ---------- */
[data-bs-theme="dark"] [class*="dxgvControl_"],
[data-bs-theme="dark"] [class*="dxgvTable_"],
[data-bs-theme="dark"] [class*="dxgvDataRow_"],
[data-bs-theme="dark"] [class*="dxgvDataRowAlt_"],
[data-bs-theme="dark"] [class*="dxgvEmptyDataRow_"] > td,
[data-bs-theme="dark"] [class*="dxgvFilterRow_"] > td,
[data-bs-theme="dark"] [class*="dxgvPagerBottomPanel_"],
[data-bs-theme="dark"] [class*="dxgvGroupPanel_"],
[data-bs-theme="dark"] [class*="dxgvTitlePanel_"],
[data-bs-theme="dark"] [class*="dxflGroupBox_"],
[data-bs-theme="dark"] [class*="dxflGroupBoxCaption_"],
[data-bs-theme="dark"] [class*="dxpcLite_"] .dxpc-mainDiv,
[data-bs-theme="dark"] [class*="dxpcLite_"] .dxpc-header,
[data-bs-theme="dark"] [class*="dxeListBox_"],
[data-bs-theme="dark"] [class*="dxeCalendar_"],
[data-bs-theme="dark"] [class*="dxpgControl_"],
[data-bs-theme="dark"] [class*="dxtlControl_"] {
    background-color: var(--vx-surface) !important;
    color: var(--vx-text) !important;
}
[data-bs-theme="dark"] [class*="dxgvDataRow_"] td,
[data-bs-theme="dark"] [class*="dxflCaption_"],
[data-bs-theme="dark"] [class*="dxeBase_"],
[data-bs-theme="dark"] [class*="dxeListBoxItem_"],
[data-bs-theme="dark"] [class*="dxpcLite_"] .dxpc-content,
[data-bs-theme="dark"] [class*="dxpcLite_"] .dxpc-headerText { color: var(--vx-text) !important; }
[data-bs-theme="dark"] [class*="dxgvHeader_"],
[data-bs-theme="dark"] [class*="dxgvFooter_"] > td,
[data-bs-theme="dark"] [class*="dxgvGroupRow_"],
[data-bs-theme="dark"] [class*="dxpcLite_"] .dxpc-footer,
[data-bs-theme="dark"] [class*="dxpgColumnFieldValue_"],
[data-bs-theme="dark"] [class*="dxpgRowFieldValue_"] { background-color: var(--vx-surface-muted) !important; }
[data-bs-theme="dark"] [class*="dxgvDataRowHover_"],
[data-bs-theme="dark"] [class*="dxgvDataRow_"]:hover { background-color: #1e293b !important; }
[data-bs-theme="dark"] [class*="dxeTextBox_"],
[data-bs-theme="dark"] [class*="dxeButtonEdit_"],
[data-bs-theme="dark"] [class*="dxeMemo_"],
[data-bs-theme="dark"] [class*="dxbButton_"]:not(.vx-btn-primary):not(.vx-btn-danger) {
    background-color: var(--vx-surface-muted) !important;
    color: var(--vx-text) !important;
}
[data-bs-theme="dark"] [class*="dxbButton_"]:not(.vx-btn-primary):not(.vx-btn-danger) .dxb { color: var(--vx-text) !important; }
[data-bs-theme="dark"] [class*="dxlpLoadingDiv_"] { background: rgba(11, 18, 32, .55) !important; }

/* ---------- Coloured icons in DevExpress grid headers ----------
   Put HeaderStyle-CssClass="vx-hi vx-hi-<kind>" on a column: the icon is drawn before the caption, so the caption
   (from the resx), sorting and filtering are untouched. Same icons/colours as the AssignmentsCustomer table headers. */
.vx-hi td.dx-wrap::before {
    font-family: "bootstrap-icons"; font-weight: normal; font-style: normal; line-height: 1;
    display: inline-block; vertical-align: -0.15em; margin-inline-end: .4em;
    content: var(--vx-hi-icon, ""); color: var(--vx-hi-color, var(--vx-text-muted));
}
.vx-hi-number   { --vx-hi-icon: "\f40a"; --vx-hi-color: var(--vx-primary); }
.vx-hi-date     { --vx-hi-icon: "\f102"; --vx-hi-color: #db2777; }
.vx-hi-code     { --vx-hi-icon: "\f602"; --vx-hi-color: #0891b2; }
.vx-hi-customer { --vx-hi-icon: "\f4da"; --vx-hi-color: var(--vx-primary); }
.vx-hi-site     { --vx-hi-icon: "\f1d6"; --vx-hi-color: #0d9488; }
.vx-hi-product  { --vx-hi-icon: "\f1c8"; --vx-hi-color: #ea580c; }
.vx-hi-address  { --vx-hi-icon: "\f3e8"; --vx-hi-color: #ca8a04; }
.vx-hi-phone    { --vx-hi-icon: "\f5c1"; --vx-hi-color: #ca8a04; }
.vx-hi-tech     { --vx-hi-icon: "\f4d7"; --vx-hi-color: var(--vx-info); }
.vx-hi-service  { --vx-hi-icon: "\f621"; --vx-hi-color: #7c3aed; }
.vx-hi-contact  { --vx-hi-icon: "\f4db"; --vx-hi-color: #0891b2; }
.vx-hi-status   { --vx-hi-icon: "\f3cc"; --vx-hi-color: var(--vx-success); }
.vx-hi-ticket   { --vx-hi-icon: "\f6ca"; --vx-hi-color: #9333ea; }
.vx-hi-solution { --vx-hi-icon: "\f28b"; --vx-hi-color: #16a34a; }
.vx-hi-vat      { --vx-hi-icon: "\f50f"; --vx-hi-color: #64748b; }
.vx-hi-city     { --vx-hi-icon: "\f87d"; --vx-hi-color: #0d9488; }
.vx-hi-zip      { --vx-hi-icon: "\f47c"; --vx-hi-color: #ca8a04; }
.vx-hi-mobile   { --vx-hi-icon: "\f4e7"; --vx-hi-color: #ea580c; }
.vx-hi-email    { --vx-hi-icon: "\f32f"; --vx-hi-color: #db2777; }
.vx-hi-cf       { --vx-hi-icon: "\f5f9"; --vx-hi-color: var(--vx-text-muted); }
