﻿/* eco - DEVEXPRESS DARK OVERRIDES (Material)
   Richiede: html[data-theme="dark"]
   ============================================================ */

html[data-theme="dark"] .dxeComboBoxEdit_Material,
html[data-theme="dark"] .dxeEdit_Material,
html[data-theme="dark"] .dxeButtonEdit_Material,
html[data-theme="dark"] .dxeTextBox_Material,
html[data-theme="dark"] .dxeMemo_Material,
html[data-theme="dark"] input.dxeEditArea_Material,
html[data-theme="dark"] textarea.dxeMemoEditArea_Material,
html[data-theme="dark"] .dxeListBoxControl_Material {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxeEditArea_Material::placeholder {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .dxeFocused_Material,
html[data-theme="dark"] .dxeButtonEditSys .dxeFocused_Material {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .25) !important;
}

/* Combo button */
html[data-theme="dark"] .dxeButtonEditButton_Material,
html[data-theme="dark"] .dxeButtonEditButtonHover_Material {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Popup/list */
html[data-theme="dark"] .dxpcLite_Material .dxpc-mainDiv,
html[data-theme="dark"] .dxeListBox_Material,
html[data-theme="dark"] .dxeCalendar_Material {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxeListBoxItemRow_Material:hover td,
html[data-theme="dark"] .dxeListBoxItemSelected_Material td {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* SearchLookup (popup grid) */
html[data-theme="dark"] .dxpcLite_Material .dxgvControl_Material,
html[data-theme="dark"] .dxpcLite_Material .dxgvTable_Material,
html[data-theme="dark"] .dxpcLite_Material .dxgvHeader_Material,
html[data-theme="dark"] .dxpcLite_Material .dxgvDataRow_Material td,
html[data-theme="dark"] .dxpcLite_Material .dxgvDetailRow_Material td,
html[data-theme="dark"] .dxpcLite_Material .dxgvFooter_Material td {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxpcLite_Material .dxgvDataRowHover_Material td,
html[data-theme="dark"] .dxpcLite_Material .dxgvFocusedRow_Material td,
html[data-theme="dark"] .dxpcLite_Material .dxgvSelectedRow_Material td {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Grid generale dark */
html[data-theme="dark"] .dxgvControl_Material,
html[data-theme="dark"] .dxgvCSD,
html[data-theme="dark"] .dxgvTable_Material,
html[data-theme="dark"] .dxgvDataRow_Material,
html[data-theme="dark"] .dxgvEmptyDataRow_Material,
html[data-theme="dark"] .dxgvInlineEditRow_Material,
html[data-theme="dark"] .dxgvEditForm_Material,
html[data-theme="dark"] .dxgvPagerBottomPanel_Material,
html[data-theme="dark"] .dxgvPagerTopPanel_Material,
html[data-theme="dark"] .dxgvFilterBar_Material,
html[data-theme="dark"] .dxgvSearchPanel_Material {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxgvHeader_Material,
html[data-theme="dark"] .dxgvFilterRow_Material td,
html[data-theme="dark"] .dxgvCommandColumn_Material {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxgvDataRow_Material td,
html[data-theme="dark"] .dxgvDetailRow_Material td,
html[data-theme="dark"] .dxgvFooter_Material td {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxgvAltRow_Material td {
    background-color: #0b1220 !important;
}

html[data-theme="dark"] .dxgvDataRowHover_Material td,
html[data-theme="dark"] .dxgvFocusedRow_Material td,
html[data-theme="dark"] .dxgvSelectedRow_Material td {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* ── Pager: dropdown PageSize ── */
html[data-theme="dark"] .dxpc-mainDiv,
html[data-theme="dark"] .dxpc-content,
html[data-theme="dark"] .dxpc-contentWrapper,
html[data-theme="dark"] .dxpc-shadow {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Listbox dentro qualsiasi popup DevExpress */
html[data-theme="dark"] .dxeListBoxItem_Material,
html[data-theme="dark"] .dxeListBoxItemRow_Material td,
html[data-theme="dark"] .dxlbd {
    background-color: #111827 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .dxeListBoxItemRow_Material:hover td,
html[data-theme="dark"] .dxeListBoxItemHover_Material,
html[data-theme="dark"] .dxeListBoxItemHover_Material td,
html[data-theme="dark"] .dxeListBoxItemSelected_Material,
html[data-theme="dark"] .dxeListBoxItemSelected_Material td {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Popup container generico (renderizzato come figlio di <body>) */
html[data-theme="dark"] div[id*="DDD_PW"],
html[data-theme="dark"] div[id*="_DDD_PW"] {
    background-color: #111827 !important;
    border-color: #334155 !important;
}

/* Tabella interna listbox del popup */
html[data-theme="dark"] .dxeListBox_Material,
html[data-theme="dark"] .dxeListBox_Material table,
html[data-theme="dark"] .dxeListBoxControl_Material {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Pager: combo edit */
html[data-theme="dark"] .dxgvPagerBottomPanel_Material .dxeEditArea_Material,
html[data-theme="dark"] .dxgvPagerTopPanel_Material .dxeEditArea_Material,
html[data-theme="dark"] .dxgvPagerBottomPanel_Material .dxeButtonEdit_Material,
html[data-theme="dark"] .dxgvPagerTopPanel_Material .dxeButtonEdit_Material {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Pager: freccia dropdown */
html[data-theme="dark"] .dxgvPagerBottomPanel_Material .dxeButtonEditButton_Material,
html[data-theme="dark"] .dxgvPagerTopPanel_Material .dxeButtonEditButton_Material {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* ── Pager: PageSize combobox ── */
html[data-theme="dark"] .dxp-comboBox {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    border-radius: 3px;
}

html[data-theme="dark"] .dxp-comboBox input {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .dxp-dropDownButton {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxp-dropDownButton img {
    filter: invert(85%) sepia(10%) brightness(120%);
}

/* Pager: popup listbox aperto dal PageSize */
html[data-theme="dark"] .dxpc-mainDiv,
html[data-theme="dark"] .dxpc-content,
html[data-theme="dark"] .dxpc-contentWrapper,
html[data-theme="dark"] .dxpc-shadow {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] div[id*="DDD_PW"],
html[data-theme="dark"] div[id*="_DDD_PW"],
html[data-theme="dark"] div[id*="DDDPW"],
html[data-theme="dark"] div[id*="_PSP"] {
    background-color: #111827 !important;
    border-color: #334155 !important;
}

/* Listbox dentro il popup */
html[data-theme="dark"] .dxeListBox_Material,
html[data-theme="dark"] .dxeListBox_Material table,
html[data-theme="dark"] .dxeListBoxControl_Material,
html[data-theme="dark"] .dxlbd {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxeListBoxItem_Material,
html[data-theme="dark"] .dxeListBoxItemRow_Material td {
    background-color: #111827 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .dxeListBoxItemRow_Material:hover td,
html[data-theme="dark"] .dxeListBoxItemHover_Material,
html[data-theme="dark"] .dxeListBoxItemHover_Material td,
html[data-theme="dark"] .dxeListBoxItemSelected_Material,
html[data-theme="dark"] .dxeListBoxItemSelected_Material td {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Pager: testo e link */
html[data-theme="dark"] .dxgvPagerBottomPanel_Material a,
html[data-theme="dark"] .dxgvPagerTopPanel_Material a,
html[data-theme="dark"] .dxgvFilterBar_Material a {
    color: #93c5fd !important;
}

/* GridLookup/Combo/TextBox DevExpress dark: rimuove bordo interno */
html[data-theme="dark"] .dxeButtonEdit_Material .dxeEditArea_Material,
html[data-theme="dark"] .dxeComboBoxEdit_Material .dxeEditArea_Material,
html[data-theme="dark"] .dxeTextBox_Material .dxeEditArea_Material,
html[data-theme="dark"] .dxeMemo_Material .dxeMemoEditArea_Material {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: 0 !important;
}

/* ============================================================
   ASPxGridView Toolbar (Export) - Dark
   ============================================================ */

/* barra toolbar dentro la grid */
html[data-theme="dark"] .dxgvToolbar_Material,
html[data-theme="dark"] .dxgvToolbar_Material td {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* bottoni/link toolbar */
html[data-theme="dark"] .dxgvToolbar_Material a,
html[data-theme="dark"] .dxgvToolbar_Material .dxgvCommandColumnItem_Material,
html[data-theme="dark"] .dxgvToolbar_Material .dxgvToolbarItem_Material {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .dxgvToolbar_Material a:hover,
html[data-theme="dark"] .dxgvToolbar_Material .dxgvCommandColumnItem_Material:hover,
html[data-theme="dark"] .dxgvToolbar_Material .dxgvToolbarItem_Material:hover {
    color: #f8fafc !important;
    background-color: #1e293b !important;
}

/* eventuale menu popup dell'export (renderizzato fuori dalla grid) */
html[data-theme="dark"] .dxmLite_Material .dxm-main,
html[data-theme="dark"] .dxmLite_Material .dxm-item {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxmLite_Material .dxm-hovered,
html[data-theme="dark"] .dxmLite_Material .dxm-selected {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* stesso allineamento in dark */
html[data-theme="dark"] .dxeComboBox_Material,
html[data-theme="dark"] .dxeComboBox_Material .dxeButtonEdit_Material,
html[data-theme="dark"] .dxeComboBox_Material .dxeComboBoxEdit_Material {
    min-height: 36px !important;
    border-radius: var(--ui-radius-sm) !important;
}

html[data-theme="dark"] .dxeComboBox_Material .dxeEditArea_Material {
    padding: .375rem .75rem !important;
    line-height: 1.5 !important;
}

/* ============================================================
   ASPxComboBox dropdown allineato a ASPxGridLookup - Dark
   ============================================================ */
html[data-theme="dark"] .dxeListBox_Material,
html[data-theme="dark"] .dxeListBoxControl_Material {
    border-color: #334155 !important;
    background-color: #111827 !important;
}

html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItemRow_Material td,
html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItem_Material {
    padding: .45rem .7rem !important;
    border-bottom: 1px solid #334155 !important;
    background-color: #111827 !important;
    color: #e5e7eb !important;
    font-size: .82rem !important;
}

html[data-theme="dark"] .dxeListBox_Material tr:last-child .dxeListBoxItemRow_Material td,
html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItem_Material:last-child {
    border-bottom: 0 !important;
}

html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItemRow_Material:hover td,
html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItemHover_Material,
html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItemSelected_Material td,
html[data-theme="dark"] .dxeListBox_Material .dxeListBoxItemSelected_Material {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
/* stesso fix in dark */
html[data-theme="dark"] .dxpcLite_Material .dxgvControl_Material .dxICheckBox_Material {
    background-color: #0f172a !important;
    border-color: #475569 !important;
}

    html[data-theme="dark"] .dxpcLite_Material .dxgvControl_Material .dxICheckBox_Material.dxWeb_edtCheckBoxChecked_Material,
    html[data-theme="dark"] .dxpcLite_Material .dxgvControl_Material .dxgvFocusedRow_Material .dxICheckBox_Material.dxWeb_edtCheckBoxChecked_Material,
    html[data-theme="dark"] .dxpcLite_Material .dxgvControl_Material .dxICheckBox_Material[class*="dxWeb_edtCheckBoxChecked"] {
        background-color: var(--ui-primary) !important;
        border-color: var(--ui-primary) !important;
    }

/* ============================================================
   DevExpress ASPxDateEdit (Material) — Light + Dark
   ============================================================ */

/* Editor */
.dxeDateEdit_Material {
    background: #fff !important;
    color: var(--ui-text) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-sm) !important;
    box-shadow: none !important;
}

    /* Input interno */
    .dxeDateEdit_Material input.dxeEditArea_Material {
        background: transparent !important;
        color: var(--ui-text) !important;
    }

    /* Bottone calendario */
    .dxeDateEdit_Material .dxeButtonEditButton_Material {
        background: var(--ui-surface-soft) !important;
        border-left: 1px solid var(--ui-border) !important;
        color: var(--ui-text-muted) !important;
    }

    /* Focus */
    .dxeDateEdit_Material:focus-within {
        border-color: var(--ui-primary) !important;
        box-shadow: 0 0 0 3px var(--ui-focus-ring) !important;
    }

/* Popup calendario */
.dxpcLite_Material .dxeCalendar_Material {
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-sm) !important;
}

/* Giorno hover/selezionato */
.dxeCalendarDay_Material:hover {
    background: var(--ui-primary-soft) !important;
}

.dxeCalendarSelected_Material {
    background: var(--ui-primary) !important;
    color: #fff !important;
}

/* -------------------- DARK -------------------- */
html[data-theme="dark"] .dxeDateEdit_Material {
    background: #0f172a !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

    html[data-theme="dark"] .dxeDateEdit_Material input.dxeEditArea_Material {
        background: transparent !important;
        color: var(--ui-text) !important;
    }

    html[data-theme="dark"] .dxeDateEdit_Material .dxeButtonEditButton_Material {
        background: #1e293b !important;
        border-left: 1px solid var(--ui-border) !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .dxeDateEdit_Material:focus-within {
        border-color: var(--ui-primary) !important;
        box-shadow: 0 0 0 3px var(--ui-focus-ring) !important;
    }

html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material {
    background: #111827 !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

html[data-theme="dark"] .dxeCalendarDay_Material:hover {
    background: #1e293b !important;
}

html[data-theme="dark"] .dxeCalendarSelected_Material {
    background: var(--ui-primary) !important;
    color: #fff !important;
}
/* ============================================================
   DevExpress DateEdit/Calendar DARK - override completo
   ============================================================ */
html[data-theme="dark"] .dxpcLite_Material,
html[data-theme="dark"] .dxpcLite_Material .dxpc-mainDiv,
html[data-theme="dark"] .dxpcLite_Material .dxpc-content {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* contenitore calendario */
html[data-theme="dark"] .dxeCalendar_Material,
html[data-theme="dark"] [class*="dxeCalendar"] {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* header / footer / barra navigazione */
html[data-theme="dark"] .dxeCalendarHeader_Material,
html[data-theme="dark"] .dxeCalendarFooter_Material,
html[data-theme="dark"] .dxeCalendarFastNav_Material,
html[data-theme="dark"] .dxeCalendarFastNavHeader_Material {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* pulsanti navigazione (prev/next/today/ok/cancel ecc.) */
html[data-theme="dark"] .dxeCalendarButton_Material,
html[data-theme="dark"] .dxeCalendarButtonHover_Material,
html[data-theme="dark"] .dxeCalendarButtonPressed_Material,
html[data-theme="dark"] .dxeButton_Material,
html[data-theme="dark"] [class*="dxeCalendar"] a {
    background: #1e293b !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* intestazione giorni settimana + numeri settimana */
html[data-theme="dark"] .dxeCalendarDayHeader_Material,
html[data-theme="dark"] .dxeCalendarWeekNumber_Material {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

/* celle giorno */
html[data-theme="dark"] .dxeCalendarDay_Material,
html[data-theme="dark"] .dxeCalendarSelected_Material,
html[data-theme="dark"] .dxeCalendarToday_Material,
html[data-theme="dark"] .dxeCalendarWeekend_Material,
html[data-theme="dark"] .dxeCalendarOtherMonth_Material,
html[data-theme="dark"] .dxeCalendarOutOfRange_Material {
    border-color: #334155 !important;
}

/* giorno normale */
html[data-theme="dark"] .dxeCalendarDay_Material {
    background: #111827 !important;
    color: #e5e7eb !important;
}

    /* hover */
    html[data-theme="dark"] .dxeCalendarDayHover_Material,
    html[data-theme="dark"] .dxeCalendarDay_Material:hover {
        background: #1e293b !important;
        color: #f8fafc !important;
    }

/* selezionato */
html[data-theme="dark"] .dxeCalendarSelected_Material {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* oggi */
html[data-theme="dark"] .dxeCalendarToday_Material {
    box-shadow: inset 0 0 0 1px #60a5fa !important;
    color: #bfdbfe !important;
}

/* giorni altro mese */
html[data-theme="dark"] .dxeCalendarOtherMonth_Material {
    color: #64748b !important;
}

/* vista dettagli (mesi/anni/decadi) */
html[data-theme="dark"] .dxeCalendarFastNavItem_Material,
html[data-theme="dark"] .dxeCalendarFastNavItemHover_Material,
html[data-theme="dark"] .dxeCalendarFastNavItemSelected_Material {
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxeCalendarFastNavItem_Material {
    background: #111827 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .dxeCalendarFastNavItemHover_Material {
    background: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .dxeCalendarFastNavItemSelected_Material {
    background: #3b82f6 !important;
    color: #ffffff !important;
}
/* DevExpress Calendar - vista selezione mesi/anni (FastNav): bordo grigio */
html[data-theme="dark"] .dxeCalendarFastNav_Material td,
html[data-theme="dark"] .dxeCalendarFastNav_Material table,
html[data-theme="dark"] .dxeCalendarFastNavItem_Material,
html[data-theme="dark"] .dxeCalendarFastNavItemHover_Material,
html[data-theme="dark"] .dxeCalendarFastNavItemSelected_Material {
    border-color: #475569 !important; /* grigio slate, non bianco */
}

/* stato normale */ 
html[data-theme="dark"] .dxeCalendarFastNavItem_Material {
    border: 1px solid #475569 !important;
}

/* hover */
html[data-theme="dark"] .dxeCalendarFastNavItemHover_Material {
    border: 1px solid #64748b !important;
}

/* selezionato */
html[data-theme="dark"] .dxeCalendarFastNavItemSelected_Material {
    border: 1px solid #3b82f6 !important;
}

/* ============================================================
   FIX FINALE ASPxDateEdit Calendar (weekdays + mesi/anni)
   Mettere QUESTO BLOCCO in fondo al file
   ============================================================ */

/* Popup calendario DateEdit */
html[data-theme="dark"] div[id*="_DDD_PW"],
html[data-theme="dark"] div[id*="_DDD_C"] {
    background-color: #111827 !important;
    border-color: #334155 !important;
}

/* Struttura tabella calendario */
html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material table,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material tbody,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material tr,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material td,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendar_Material th {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Giorni settimana (header) */
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarDayHeader_Material,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarDayHeader_Material td,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarWeekNumber_Material {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

/* Vista mesi/anni/decadi (FastNav) */
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNav_Material,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNav_Material table,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNav_Material td {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #475569 !important; /* grigio richiesto */
}

/* Item mesi/anni */
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItem_Material,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItem_Material a,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItem_Material span {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border: 1px solid #475569 !important;
}

html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItemHover_Material,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItemHover_Material a,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItemHover_Material span {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #64748b !important;
}

html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItemSelected_Material,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItemSelected_Material a,
html[data-theme="dark"] .dxpcLite_Material .dxeCalendarFastNavItemSelected_Material span {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border: 1px solid #3b82f6 !important;
}

/* Fix celle AUX del calendario DateEdit (id dinamici) */
html[data-theme="dark"] td[id*="_DDD_C_AUX_"],
html[data-theme="dark"] td[id*="_DDD_C_AUX_"] *,
html[data-theme="dark"] div[id*="_DDD_C"] td[id*="_AUX_"],
html[data-theme="dark"] div[id*="_DDD_C"] td[id*="_AUX_"] * {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #475569 !important;
}

/* Weekend rossi nel calendario DateEdit (dark) */
html[data-theme="dark"] .dxeCalendarWeekend_Material,
html[data-theme="dark"] .dxeCalendarWeekend_Material a,
html[data-theme="dark"] td.dxeCalendarWeekend_Material,
html[data-theme="dark"] td.dxeCalendarWeekend_Material a {
    color: #ef4444 !important; /* rosso */
}

/* Weekend di altri mesi: rosso più tenue */
html[data-theme="dark"] .dxeCalendarOtherMonth_Material.dxeCalendarWeekend_Material,
html[data-theme="dark"] .dxeCalendarOtherMonth_Material.dxeCalendarWeekend_Material a {
    color: #f87171 !important;
}

/* Se selezionato, resta leggibile (testo bianco sul blu selezione) */
html[data-theme="dark"] .dxeCalendarSelected_Material.dxeCalendarWeekend_Material,
html[data-theme="dark"] .dxeCalendarSelected_Material.dxeCalendarWeekend_Material a {
    color: #ffffff !important;
}

/* ============================================================
   ComboBox / TokenBox DARK
   - default: niente bordo/cella "gridlike"
   - opt-in con classi: cbx-gridlike-editor + cbx-gridlike-list
   ============================================================ */

/* DEFAULT (senza classe): niente bordo celle/padding gridlike nel dropdown */
html[data-theme="dark"] .dxeListBox_Material:not(.cbx-gridlike-list) .dxeListBoxItemRow_Material td,
html[data-theme="dark"] .dxeListBox_Material:not(.cbx-gridlike-list) .dxeListBoxItem_Material {
    border: 0 !important;
    padding: .45rem .7rem !important;
}

/* DEFAULT editor Combo/TokenBox */
html[data-theme="dark"] .dxeComboBoxEdit_Material:not(.cbx-gridlike-editor) .dxeEditArea_Material,
html[data-theme="dark"] .dxeTokenBox_Material:not(.cbx-gridlike-editor) .dxeEditArea_Material {
    padding: .375rem .75rem !important;
}

/* OPT-IN editor (ComboBox e TokenBox) */
html[data-theme="dark"] .cbx-gridlike-editor.dxeComboBoxEdit_Material,
html[data-theme="dark"] .cbx-gridlike-editor.dxeTokenBox_Material,
html[data-theme="dark"] .cbx-gridlike-editor .dxeButtonEdit_Material {
    border-color: #334155 !important;
}

html[data-theme="dark"] .cbx-gridlike-editor .dxeEditArea_Material {
    padding: 16px 10px !important;
    line-height: 1.35 !important;
}

/* OPT-IN dropdown list (ComboBox e TokenBox) */
html[data-theme="dark"] .cbx-gridlike-list,
html[data-theme="dark"] .cbx-gridlike-list table,
html[data-theme="dark"] .cbx-gridlike-list .dxlbd {
    border-color: #334155 !important;
    background-color: #111827 !important;
}

html[data-theme="dark"] .cbx-gridlike-list .dxeListBoxItemRow_Material td,
html[data-theme="dark"] .cbx-gridlike-list .dxeListBoxItem_Material {
    padding: 16px 10px !important;
    border: 1px solid #334155 !important;
    box-sizing: border-box;
}

/* ============================================================
   ASPxGridView Header Filter - Dark
   Classi: dxgv__hfc (container popup), dxgv__hfe (input testo)
   ============================================================ */

/* Popup del filtro header */
html[data-theme="dark"] .dxgv__hfc,
html[data-theme="dark"] .dxgv__hfc table,
html[data-theme="dark"] .dxgv__hfc td {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Campo testo di ricerca dentro il popup */
html[data-theme="dark"] .dxgv__hfe,
html[data-theme="dark"] .dxgv__hfc input[type="text"],
html[data-theme="dark"] .dxgv__hfc .dxeEditArea_Material {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxgv__hfc input[type="text"]::placeholder,
html[data-theme="dark"] .dxgv__hfe::placeholder {
    color: #94a3b8 !important;
}

/* Voci lista del filtro header */
html[data-theme="dark"] .dxgv__hflt,
html[data-theme="dark"] .dxgv__hflt td {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Voce hover / selezionata */
html[data-theme="dark"] .dxgv__hflt tr:hover td,
html[data-theme="dark"] .dxgv__hflts td {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Pulsanti OK / Cancella in fondo al popup */
html[data-theme="dark"] .dxgv__hfb,
html[data-theme="dark"] .dxgv__hfb td {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .dxgv__hfb a,
html[data-theme="dark"] .dxgv__hfb input[type="button"] {
    color: #93c5fd !important;
}

html[data-theme="dark"] .dxgv__hfb a:hover,
html[data-theme="dark"] .dxgv__hfb input[type="button"]:hover {
    color: #f8fafc !important;
    background-color: #1e293b !important;
}

/* ── Header filter: input variante MaterialCompact ── */
html[data-theme="dark"] .dxeEditArea_MaterialCompact,
html[data-theme="dark"] .dxeEditArea_MaterialCompact.dxeEditAreaSys,
html[data-theme="dark"] input.dxeEditArea_MaterialCompact {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dxeEditArea_MaterialCompact::placeholder {
    color: #94a3b8 !important;
}

/* Disabled DevExpress - dark */
html[data-theme="dark"] .dxeDisabled_Material.dxeTextBox_Material,
html[data-theme="dark"] .dxeDisabled_Material.dxeButtonEdit_Material,
html[data-theme="dark"] .dxeDisabled_Material.dxeComboBoxEdit_Material {
    background-color: #1f2937 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .dxeDisabled_Material td.dxic,
html[data-theme="dark"] .dxeDisabled_Material .dxeEditArea_Material,
html[data-theme="dark"] .dxeDisabled_Material input.dxeEditArea_Material {
    background-color: #1f2937 !important;
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}
/* ============================================================
   ASPxUploadControl Material - DX 25.x
   ============================================================ */

html[data-theme="dark"] .dxucControl_Material,
html[data-theme="dark"] .dxucControl_Material table,
html[data-theme="dark"] .dxucControl_Material td {
    background: transparent !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

/* Area upload */
html[data-theme="dark"] .dxucDragZone_Material,
html[data-theme="dark"] .dxucDropZone_Material,
html[data-theme="dark"] .dxucDZTextContainer_Material {
    background: #111827 !important;
    color: #e5e7eb !important;
    border: 2px dashed #475569 !important;
    border-radius: var(--ui-radius-sm);
}

    html[data-theme="dark"] .dxucDragZone_Material:hover,
    html[data-theme="dark"] .dxucDropZone_Material:hover {
        background: #1e293b !important;
        border-color: #60a5fa !important;
    }

/* Testi */
html[data-theme="dark"] .dxucTextCell_Material,
html[data-theme="dark"] .dxucFileName_Material,
html[data-theme="dark"] .dxucFileSize_Material {
    color: #e5e7eb !important;
}

/* Pulsante Sfoglia */
html[data-theme="dark"] .dxucBrowseButton_Material,
html[data-theme="dark"] .dxucButton_Material {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #e5e7eb !important;
}

    html[data-theme="dark"] .dxucBrowseButton_Material:hover,
    html[data-theme="dark"] .dxucButtonHover_Material,
    html[data-theme="dark"] .dxucButton_Material:hover {
        background: #334155 !important;
        color: #fff !important;
    }

/* Lista file */
html[data-theme="dark"] .dxucFileList_Material,
html[data-theme="dark"] .dxucFilesContainer_Material {
    background: #111827 !important;
    border-color: #334155 !important;
}

    html[data-theme="dark"] .dxucFileList_Material li,
    html[data-theme="dark"] .dxucFile_Material {
        border-bottom: 1px solid #334155 !important;
        color: #e5e7eb !important;
    }

/* Progress */
html[data-theme="dark"] .dxucProgressBar_Material {
    background: #1f2937 !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .dxucProgressBarIndicator_Material {
    background: var(--ui-primary) !important;
}

/* Link rimuovi */
html[data-theme="dark"] .dxucRemoveButton_Material,
html[data-theme="dark"] .dxucCancelButton_Material {
    color: #f87171 !important;
}

    html[data-theme="dark"] .dxucRemoveButton_Material:hover,
    html[data-theme="dark"] .dxucCancelButton_Material:hover {
        color: #ef4444 !important;
    }