/**
 * ============================================
 * STILI GLOBALI VOISMART - Font e Colori
 * ============================================
 * Applica Roboto come font principale e aggiorna
 * i colori per un look moderno e coerente
 */

/* ========== IMPORT FONT ROBOTO ========== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* ========== IMPORT FONT AWESOME ========== */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ========== APPLICAZIONE GLOBALE FONT ========== */
* {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
}

body {
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Headings con pesi specifici */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 500;
    line-height: 1.2;
    color: var(--primary-color);
}

/* Titoli su sfondi colorati o con gradiente - sempre bianchi */
.tile-card h1, .tile-card h2, .tile-card h3, 
.tile-card h4, .tile-card h5, .tile-card h6,
.dashboard-header h1, .dashboard-header h2, .dashboard-header h3,
.dashboard-header h4, .dashboard-header h5, .dashboard-header h6,
.omnicx-header h1, .omnicx-header h2, .omnicx-header h3,
.omnicx-header h4, .omnicx-header h5, .omnicx-header h6,
.portal-header-gradient h1, .portal-header-gradient h2, .portal-header-gradient h3,
.portal-header-gradient h4, .portal-header-gradient h5, .portal-header-gradient h6,
[class*="bg-"] h1, [class*="bg-"] h2, [class*="bg-"] h3,
[class*="bg-"] h4, [class*="bg-"] h5, [class*="bg-"] h6,
.has-background-primary h1, .has-background-primary h2, .has-background-primary h3,
.has-background-primary h4, .has-background-primary h5, .has-background-primary h6 {
    color: white !important;
}

h1, .h1 { 
    font-size: 2.5rem; 
    font-weight: 700;
}

h2, .h2 { 
    font-size: 2rem; 
    font-weight: 600;
}

h3, .h3 { 
    font-size: 1.75rem; 
    font-weight: 500;
}

h4, .h4 { 
    font-size: 1.5rem; 
    font-weight: 500;
}

h5, .h5 { 
    font-size: 1.25rem; 
    font-weight: 500;
}

h6, .h6 { 
    font-size: 1rem; 
    font-weight: 500;
}

/* ========== AGGIORNAMENTO COLORI MODERNI ========== */
:root {
    /* Colori Primari - Blu moderno */
    --primary-color: #549FD5;        /* Blu principale */
    --primary-dark: #1F3572;         /* Blu scuro */
    --primary-light: #7AB8E3;        /* Blu chiaro */
    --primary-lighter: #A0CEEC;      /* Blu molto chiaro */
    
    /* Colori Secondari */
    --secondary-color: #4A8CDD;      /* Azzurro secondario */
    --secondary-dark: #306FB4;       /* Azzurro scuro */
    --accent-color: #549FD5;         /* Ciano accent */
    --accent-gradient: #549FD5;      /* Sostituito gradiente con colore solido */
    
    /* Colori UI */
    --success-color: #0A7637;        /* Verde successo */
    --success-dark: #085a2a;         
    --danger-color: #CA150C;         /* Rosso errore */
    --danger-dark: #a01109;          
    --warning-color: #FFCC00;        /* Giallo warning */
    --warning-dark: #e6b800;         
    --info-color: #306FB4;           /* Blu info */
    --info-dark: #245a96;            
    
    /* Grigi moderni */
    --text-primary: #1f2937;         /* Grigio scuro */
    --text-secondary: #6b7280;       /* Grigio medio */
    --text-muted: #9ca3af;           /* Grigio chiaro */
    --text-light: #ffffff;           
    --text-dark: #111827;            
    
    /* Sfondi */
    --bg-primary: #ffffff;           
    --bg-secondary: #f9fafb;         /* Grigio molto chiaro */
    --bg-tertiary: #f3f4f6;          
    --bg-hover: #e5e7eb;             
    --bg-active: #d1d5db;            
    --bg-gradient: #f9fafb;          /* Sostituito gradiente con colore solido */
    
    /* Bordi */
    --border-color: #e5e7eb;         
    --border-light: #f3f4f6;         
    --border-dark: #d1d5db;          
    --border-focus: var(--primary-color);
    
    /* Ombre moderne */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-primary: 0 5px 15px rgba(84, 159, 213, 0.4);
    --shadow-success: 0 5px 15px rgba(10, 118, 55, 0.3);
    --shadow-danger: 0 5px 15px rgba(202, 21, 12, 0.3);
    --shadow-warning: 0 5px 15px rgba(255, 204, 0, 0.3);
    --shadow-info: 0 5px 15px rgba(48, 111, 180, 0.3);
}

/* ========== STILI PER ELEMENTI COMUNI ========== */

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* Buttons */
button, .button, .btn {
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: all var(--transition-normal);
}

/* Forms */
input, textarea, select, .form-control, .form-select {
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

input:focus, textarea:focus, select:focus, 
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Labels */
label, .label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Tables */
table {
}

th {
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

td {
    font-weight: 400;
    color: var(--text-primary);
}

/* Cards/Panels */
.card, .panel, .box {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header, .panel-header, .box-header {
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Navigation */
.navbar, .navigation-bar {
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Tooltips */
.tooltip, .popover {
    font-weight: 400;
    font-size: 0.875rem;
}

/* Modals/Dialogs */
.modal, .dialog {
}

.modal-title, .dialog-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Code blocks */
code, pre, .code {
}

/* ========== OVERRIDE SPECIFICI PER METRO UI ========== */
.metro * {
}

.metro .navigation-bar {
    background-color: var(--primary-color);
}

.metro .navigation-bar .element {
    font-weight: 500;
    color: var(--text-light);
}

.metro .navigation-bar .element:hover {
    background-color: var(--primary-dark);
}

/* ========== OVERRIDE PER BULMA ========== */
.bulma * {
}

.title {
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-weight: 400;
    color: var(--text-secondary);
}

/* ========== BOOTSTRAP OVERRIDES ========== */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: var(--success-dark);
    border-color: var(--success-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-dark);
    border-color: var(--danger-dark);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: var(--warning-dark);
    border-color: var(--warning-dark);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-info:hover {
    background-color: var(--info-dark);
    border-color: var(--info-dark);
}

/* ========== ANIMAZIONI SMOOTH ========== */
* {
    transition: background-color var(--transition-fast), 
                color var(--transition-fast),
                border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}

/* ========== COMPONENTI COMUNI PORTALI ========== */

/* Statistics Containers */
.stats-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    min-width: 150px;
    text-align: center;
}

.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f3572;
    margin-bottom: 0.25rem;
}

/* Filter Sections */
.filters-section {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    display: none;
}

.filters-section.active {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.filter-group {
    flex: 0 0 auto;
    min-width: 0;
}

.filter-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-control {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    background: white;
    transition: all 0.15s;
}

.filter-btn {
    padding: 0.375rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--primary-dark);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.nav-tab {
    position: relative;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-tab:hover {
    color: var(--primary-color);
    background: rgba(84, 159, 213, 0.05);
}

.nav-tab.is-active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Main Content Container */
.main-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1400px;
    min-height: 500px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Header Styles */
.fastweb-header, .portal-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Header con gradiente - stile unificato per tutte le pagine */
.dashboard-header, .omnicx-header, .portal-header-gradient {
    background: linear-gradient(135deg, #1F3572 0%, #549FD5 100%) !important;
    color: white !important;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Header compatto per pagine non-home */
.page-header-slim {
    background: linear-gradient(135deg, #1F3572 0%, #549FD5 100%) !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

.page-header-slim .header-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: white !important;
}

.page-header-slim .header-subtitle {
    font-size: 0.85rem !important;
    margin: 0 !important;
    opacity: 0.9 !important;
    color: white !important;
}

.page-header-slim .header-btn {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.85rem !important;
}

/* Tutti i titoli negli header con gradiente devono essere bianchi */
.dashboard-header h1, .dashboard-header h2, .dashboard-header h3,
.dashboard-header h4, .dashboard-header h5, .dashboard-header h6,
.omnicx-header h1, .omnicx-header h2, .omnicx-header h3,
.omnicx-header h4, .omnicx-header h5, .omnicx-header h6,
.portal-header-gradient h1, .portal-header-gradient h2, .portal-header-gradient h3,
.portal-header-gradient h4, .portal-header-gradient h5, .portal-header-gradient h6,
.page-header-slim h1, .page-header-slim h2, .page-header-slim h3,
.page-header-slim h4, .page-header-slim h5, .page-header-slim h6,
.dashboard-header .header-title,
.omnicx-header .header-title,
.portal-header-gradient .header-title,
.page-header-slim .header-title {
    color: white !important;
}

/* Tutti i testi negli header con gradiente devono essere bianchi */
.dashboard-header *, 
.omnicx-header *, 
.portal-header-gradient *,
.page-header-slim * {
    color: white !important;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Override per header con gradiente */
.dashboard-header .header-title,
.omnicx-header .header-title,
.portal-header-gradient .header-title {
    color: white !important;
    font-size: 1.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: transparent;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
}

.header-btn:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

/* Spinner */
#spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

#spinner.active {
    display: block;
}

.spinner-content {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.table td {
    padding: 0.625rem 0.75rem;
    font-size: 0.813rem;
    color: var(--text-primary);
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}

.action-btn.edit {
    color: var(--primary-color);
}

.action-btn.edit:hover {
    background: rgba(84, 159, 213, 0.1);
}

.action-btn.delete {
    color: var(--danger-color);
}

.action-btn.delete:hover {
    background: rgba(202, 21, 12, 0.1);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-approvato {
    background: rgba(10, 118, 55, 0.1);
    color: var(--success-color);
}

.status-attesa {
    background: rgba(255, 204, 0, 0.1);
    color: var(--warning-color);
}

.status-rifiutato {
    background: rgba(202, 21, 12, 0.1);
    color: var(--danger-color);
}

/* Vendor Badges */
.vendor-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.vendor-badge.voismart {
    background-color: #1f3572;
}

.vendor-badge.mobimesh {
    background-color: #28a745;
}

.vendor-badge.novanext {
    background-color: #17a2b8;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== UTILITY CLASSES ========== */
.font-light { font-weight: 300 !important; }
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-black { font-weight: 900 !important; }

.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.875rem !important; }
.text-4xl { font-size: 2.25rem !important; }
.text-5xl { font-size: 3rem !important; }

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    html {
        background-color: #0f172a !important;
    }
    
    body {
        background-color: #0f172a !important;
        background: #0f172a !important;
        color: #e2e8f0 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #f1f5f9;
    }
    
    /* Override TUTTE le variabili CSS, anche quelle ridefinite nei template */
    :root,
    * {
        /* Variabili standard del progetto */
        --primary-color: #7AB8E3 !important;
        --primary-dark: #549FD5 !important;
        --primary-light: #A0CEEC !important;
        
        --text-primary: #f1f5f9 !important;
        --text-secondary: #cbd5e1 !important;
        --text-muted: #94a3b8 !important;
        
        --bg-primary: #1e293b !important;
        --bg-secondary: #0f172a !important;
        --bg-tertiary: #334155 !important;
        
        --border-color: #334155 !important;
        --border-light: #475569 !important;
        --border-dark: #1e293b !important;
        
        /* Override variabili QuotationView_modern */
        --primary: #7AB8E3 !important;
        --primary-light: #A0CEEC !important;
        --secondary: #7AB8E3 !important;
        --secondary-light: #A0CEEC !important;
        --success: #48c774 !important;
        --warning: #ffdd57 !important;
        --danger: #f14668 !important;
        --info: #3273dc !important;
        
        /* Override grigi QuotationView */
        --gray-50: #0f172a !important;
        --gray-100: #1e293b !important;
        --gray-200: #334155 !important;
        --gray-300: #475569 !important;
        --gray-400: #64748b !important;
        --gray-500: #94a3b8 !important;
        --gray-600: #cbd5e1 !important;
        --gray-700: #e2e8f0 !important;
        --gray-800: #f1f5f9 !important;
        --gray-900: #f8fafc !important;
    }
    
    /* Fix tabelle e sfondi bianchi */
    .table {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    
    .table td {
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-primary);
    }
    
    .table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    
    .table tbody tr:nth-child(even) {
        background: rgba(30, 41, 59, 0.5);
    }
    
    /* Fix filtri e container */
    .filters-section,
    #oda-filters,
    #benestari-filters,
    #progetti-filters {
        background: var(--bg-primary) !important;
        border: 1px solid var(--border-color);
    }
    
    /* Fix bottoni */
    .filter-btn,
    button[style*="background: white"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    .filter-btn:hover,
    button[style*="background: white"]:hover {
        background: var(--border-light) !important;
        border-color: var(--primary-light) !important;
    }
    
    /* Fix select e input */
    select, 
    input[type="text"], 
    input[type="number"], 
    input[type="date"],
    .form-select,
    .category-select,
    .category-selector {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    select option,
    .form-select option,
    .category-select option {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }
    
    /* Fix per select con stili inline */
    select[style*="background: white"],
    select[style*="background-color: white"] {
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix TUTTI gli elementi con sfondo bianco - SUPER AGGRESSIVO */
    *[style*="background: white"],
    *[style*="background-color: white"],
    *[style*="background:#fff"],
    *[style*="background-color:#fff"],
    *[style*="background: #ffffff"],
    *[style*="background-color: #ffffff"],
    *[style*="background:white"],
    *[style*="background-color:white"],
    *[style*="background: rgb(255"],
    *[style*="background-color: rgb(255"] {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per sfondi grigi chiari che dovrebbero essere scuri */
    *[style*="background: #f9fafb"],
    *[style*="background: #f3f4f6"],
    *[style*="background: #e5e7eb"],
    *[style*="background-color: #f9fafb"],
    *[style*="background-color: #f3f4f6"],
    *[style*="background-color: #e5e7eb"] {
        background: var(--bg-tertiary) !important;
    }
    
    /* Modal content specifici */
    .modal-content[style*="background: white"],
    .modal-content {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per container con classi specifiche */
    .filters-container,
    .table-container,
    .card,
    .panel,
    .box {
        background: var(--bg-primary) !important;
    }
    
    /* Override per elementi con !important negli stili inline */
    [style*="background: white !important"] {
        background: var(--bg-primary) !important;
    }
    
    /* Fix modal/dialog */
    #odaDetailsModal {
        background: var(--bg-primary) !important;
    }
    
    /* Fix note/dettagli con sfondo grigio chiaro */
    [style*="background: #f3f4f6"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-secondary) !important;
    }
    
    /* Fix paginazione - universale per tutti i portali */
    .pagination button,
    .page-btn,
    button[onclick*="changePage"],
    button[onclick*="goToPage"],
    button[onclick*="changePageBenestari"],
    button[onclick*="goToPageProgetti"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    .pagination button:hover,
    .page-btn:hover:not(:disabled),
    button[onclick*="changePage"]:hover:not(:disabled),
    button[onclick*="goToPage"]:hover:not(:disabled) {
        background: var(--border-light) !important;
        color: var(--text-primary) !important;
        border-color: var(--primary-light) !important;
    }
    
    /* Bottone attivo */
    .pagination button.active,
    .page-btn.active,
    button[style*="background: #1F3572"] {
        background: var(--primary-color) !important;
        color: white !important;
        border-color: var(--primary-color) !important;
    }
    
    /* Bottone disabilitato */
    .pagination button:disabled,
    .page-btn:disabled,
    button[disabled] {
        background: var(--bg-tertiary) !important;
        opacity: 0.5;
        color: var(--text-muted) !important;
    }
    
    /* Container paginazione */
    .pagination-container,
    div[style*="display: flex"][style*="justify-content: space-between"] {
        background: var(--bg-tertiary) !important;
    }
    
    .pagination-info {
        color: var(--text-secondary) !important;
    }
    
    /* Fix testi in container con sfondo scuro */
    div[style*="background: white"] * {
        color: var(--text-primary);
    }
    
    /* Fix specifico per le statistiche */
    .stat-number, .stat-label {
        color: var(--text-primary) !important;
    }
    
    /* Fix per i link */
    a {
        color: var(--primary-light);
    }
    
    a:hover {
        color: var(--primary-color);
    }
    
    /* Fix dropdown e tooltip */
    .dropdown-content,
    .dropdown-menu,
    .tooltip-content {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    /* Fix items dentro dropdown */
    .dropdown-menu li a,
    .dropdown-item,
    .dropdown-content a {
        color: var(--text-primary) !important;
        background: transparent !important;
    }
    
    .dropdown-menu li a:hover,
    .dropdown-item:hover,
    .dropdown-content a:hover {
        background: var(--border-light) !important;
        color: var(--text-primary) !important;
    }
    
    /* Fix per classi definite nei template */
    .content-wrapper,
    .main-content,
    .page-content,
    .container-fluid,
    .stat-card,
    .info-box,
    .summary-card,
    .detail-card,
    .tile-card,
    .guide-popup,
    .status-portal-content {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per header e section */
    .page-header,
    .section-header,
    .card-header {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Fix per form e input container */
    .form-container,
    .form-wrapper,
    .input-group,
    .form-group {
        background: transparent !important;
    }
    
    /* Fix per elementi con classi Bootstrap/Bulma */
    .has-background-white,
    .bg-light,
    .is-white {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per box e card body */
    .box-body,
    .card-body,
    .panel-body {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Fix per sidebar e navigation */
    .sidebar,
    .nav-tabs,
    .nav-pills {
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix per alert e notifiche */
    .alert,
    .notification,
    .message {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    /* Override specifico per Bulma */
    body.has-navbar-fixed-top,
    html.has-navbar-fixed-top {
        background-color: #0f172a !important;
    }
    
    /* Fix per section e container Bulma */
    .section {
        background-color: transparent !important;
    }
    
    .hero {
        background-color: var(--bg-primary) !important;
    }
    
    /* Override molto specifico per body */
    body[class],
    body:not([class]) {
        background-color: #0f172a !important;
        background: #0f172a !important;
    }
    
    /* Fix per container principali che potrebbero avere sfondo bianco */
    .container:not(.is-fluid),
    .columns,
    .column,
    main,
    #app,
    #root,
    #wrapper,
    #main,
    #content,
    .content-wrapper,
    .page-wrapper,
    .main-wrapper {
        background: transparent !important;
    }
    
    /* Fix specifico per Bulma containers */
    .section,
    .hero-body,
    .container.is-fluid {
        background: transparent !important;
    }
    
    /* Rimuovi sfondi da tutti i div con stili inline */
    div[style*="background: white"],
    div[style*="background-color: white"],
    div[style*="background:#fff"],
    div[style*="background: #fff"],
    section[style*="background"],
    article[style*="background"] {
        background: var(--bg-primary) !important;
    }
    
    /* Card e pannelli devono avere sfondo */
    .table-wrapper,
    .card:not(.tile-card),
    .panel,
    .box,
    .modal-content,
    .filters-section {
        background: var(--bg-primary) !important;
    }
    
    /* Tile cards nella home */
    .tile-card {
        background: var(--bg-tertiary) !important;
    }
    
    /* Override CSS definiti nei template */
    .page-card,
    .content-card,
    .stat-card,
    .filters-container {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per body che usa variabili CSS */
    body[style*="background-color: var(--bg-secondary)"] {
        background-color: #0f172a !important;
    }
    
    /* Override elementi che usano var(--bg-primary) o simili */
    *[style*="background: var(--bg-primary)"],
    *[style*="background-color: var(--bg-primary)"],
    *[style*="background: var(--bg-secondary)"],
    *[style*="background-color: var(--bg-secondary)"] {
        background: var(--bg-primary) !important;
    }
    
    /* Fix specifici per configuratore/quotation */
    .table-wrapper {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per TUTTI gli elementi con sfondi colorati chiari nel configuratore */
    a[style*="background-color: #e0f2fe"],  /* Azzurro chiaro */
    a[style*="background-color: #fee2e2"],  /* Rosa chiaro */
    a[style*="background-color: #dbeafe"],  /* Blu chiaro */
    span[style*="background-color: #e0f2fe"],
    span[style*="background-color: #fee2e2"],
    span[style*="background-color: #dbeafe"],
    div[style*="background: #e0f2fe"],
    div[style*="background: white"][style*="border-radius"],
    .table-wrapper[style*="background: white"] {
        background-color: var(--bg-tertiary) !important;
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix specifico per stat cards nel configuratore */
    div[style*="background: white"][style*="padding: 0.75rem"],
    div[style*="background: white"][style*="padding: 1.25rem"] {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per action icons con background colorati */
    .action-icon-btn,
    a[onclick*="downloadPDF"],
    a[onclick*="downloadExcel"],
    a[onclick*="downloadOdt"],
    a[onclick*="Odoo"],
    a[title*="PDF"],
    a[title*="Excel"],
    a[title*="ODT"],
    a[title*="Odoo"] {
        background-color: var(--bg-tertiary) !important;
        background: var(--bg-tertiary) !important;
    }
    
    /* Mantieni visibilità per icone di stato con colori specifici */
    [style*="background: #3b82f6"],  /* Blu - Aperta */
    [style*="background: #0A7637"],  /* Verde - Chiusa */
    [style*="background: #FFCC00"],  /* Giallo - Warning */
    [style*="background: #CA150C"] { /* Rosso - Errore */
        opacity: 0.85;
    }
    
    /* Fix tabelle configuratore e prodotti */
    #main-form,
    #testata,
    #divQuote,
    #divCategory,
    #category,
    #risultati,
    #linee,
    #requisiti,
    #servizi2,
    #prodottihw,
    .category-section,
    .quote-section,
    .configurator-section {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per tabelle moderne */
    .modern-table {
        background: var(--bg-primary) !important;
    }
    
    .modern-table th,
    .modern-table td {
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .modern-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix elementi che usano var(--gray-*) */
    body[style*="background: var(--gray-50)"] {
        background: #0f172a !important;
    }
    
    [style*="color: var(--gray-800)"] {
        color: var(--text-primary) !important;
    }
    
    /* Fix per elementi quotation con bordi */
    [style*="border: 1px solid #e5e7eb"] {
        border-color: var(--border-color) !important;
    }
    
    [style*="border-bottom: 1px solid #f3f4f6"],
    [style*="border-bottom: 1px solid #e5e7eb"] {
        border-bottom-color: var(--border-color) !important;
    }
    
    /* Fix header tabelle */
    th[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }
    
    /* Fix celle tabelle */
    td[style*="border-bottom"] {
        border-bottom-color: var(--border-color) !important;
    }
    
    /* Fix hover tabelle */
    tr:hover td {
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix per elementi dropdown nel quotation */
    .dropdown-menu[style*="background: white"] {
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix per th con colori hardcoded */
    th[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }
    
    /* Override più aggressivo per tutti i div del configuratore */
    #main-form div[style*="background: white"],
    #divCategory div[style*="background: white"],
    #divQuote div[style*="background: white"] {
        background: var(--bg-primary) !important;
    }
    
    /* Fix specifico per il box dei totali nel dettaglio preventivo */
    .total-box {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Fix per table-controls container */
    .table-controls {
        background: transparent !important;
    }
    
    /* Fix per sezioni nel configuratore */
    .ng-section,
    .configurator-section,
    .lc-section,
    .wfb-section {
        background: var(--bg-primary) !important;
    }
    
    .ng-section h6,
    .configurator-section h6,
    .lc-section h6,
    .wfb-section h6 {
        color: var(--text-primary) !important;
    }
    
    .ng-section .modern-table thead th,
    .configurator-section .modern-table thead th,
    .lc-section .modern-table thead th,
    .wfb-section .modern-table thead th {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    .ng-section .modern-table tbody tr:hover,
    .configurator-section .modern-table tbody tr:hover,
    .lc-section .modern-table tbody tr:hover,
    .wfb-section .modern-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    
    /* Fix per header delle tabelle nel configuratore */
    .modern-table thead,
    .modern-table thead th,
    thead[style*="background: #f9fafb"],
    thead th,
    th[style*="background: #f8f9fa"],
    th[style*="background: transparent"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Fix per il gradient header nella tabella forecast */
    thead tr[style*="background: linear-gradient"] {
        background: var(--bg-tertiary) !important;
    }
    
    thead tr[style*="background: linear-gradient"] th {
        background: transparent !important;
        color: var(--text-primary) !important;
    }
    
    /* Fix per i div contenitori dei totali con padding specifico */
    div[style*="padding: 1rem"][style*="background: white"],
    div[style*="padding: 1.25rem"][style*="background: white"] {
        background: var(--bg-primary) !important;
    }
    
    /* Fix per le stat cards nel forecast */
    div[style*="border-left: 4px solid"] {
        background: var(--bg-primary) !important;
    }
}

/* ============================================
 * STILI PER RIGHE ODA FILTERS
 * ============================================ */

/* Contenitore principale dei filtri Righe ODA */
.righe-oda-filters {
    background: var(--bg-secondary, #f8f9fa) !important;
    padding: 15px !important;
    border-radius: 6px !important;
    margin-bottom: 20px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Container dei filtri dinamici */
#filtri-righe-oda {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 50px !important;
    background: var(--bg-primary, #fff) !important;
    padding: 10px !important;
    border: 2px dashed var(--primary-color, #007bff) !important;
    border-radius: 4px !important;
}

/* Singola riga di filtro */
.righe-oda-filter-row {
    display: flex !important;
    align-items: center !important;
    margin: 10px 0 !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    background: var(--bg-primary, #fff) !important;
    padding: 10px !important;
    border: 1px solid var(--border-color, #ddd) !important;
    border-radius: 4px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Stili per i controlli dei filtri */
.righe-oda-filter-row select,
.righe-oda-filter-row input {
    padding: 6px 12px !important;
    border: 1px solid var(--border-color, #ccc) !important;
    border-radius: 4px !important;
    background: var(--bg-primary, white) !important;
    color: var(--text-primary, #333) !important;
    font-size: 14px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.righe-oda-filter-row select.campo-filtro,
.righe-oda-filter-row select.operatore-filtro {
    width: 150px !important;
}

.righe-oda-filter-row input.valore-filtro {
    width: 200px !important;
}

/* Bottoni dei filtri */
.righe-oda-filter-actions {
    margin: 15px 0 !important;
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.righe-oda-btn {
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.righe-oda-btn-primary {
    background: var(--primary-color, #007bff) !important;
    color: white !important;
}

.righe-oda-btn-success {
    background: var(--success-color, #28a745) !important;
    color: white !important;
}

.righe-oda-btn-secondary {
    background: var(--secondary-color, #6c757d) !important;
    color: white !important;
}

.righe-oda-btn-danger {
    background: var(--danger-color, #dc3545) !important;
    color: white !important;
    padding: 6px 12px !important;
}

/* Logic selector */
.righe-oda-logic {
    margin: 10px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.righe-oda-logic label {
    font-weight: bold !important;
    color: var(--text-primary, #333) !important;
}

.righe-oda-logic select {
    padding: 6px 12px !important;
    border: 1px solid var(--border-color, #ccc) !important;
    border-radius: 4px !important;
    background: var(--bg-primary, white) !important;
    color: var(--text-primary, #333) !important;
    font-size: 14px !important;
}

/* Preset filters section */
.righe-oda-presets {
    margin: 15px 0 !important;
    padding: 10px !important;
    background: var(--bg-tertiary, #e9ecef) !important;
    border-radius: 4px !important;
    border-left: 3px solid var(--primary-color, #007bff) !important;
}

.righe-oda-presets h5 {
    margin: 0 0 10px 0 !important;
    color: var(--text-primary, #333) !important;
    font-size: 14px !important;
    font-weight: bold !important;
}

.righe-oda-preset-buttons {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.righe-oda-btn-preset {
    background: var(--warning-color, #ffc107) !important;
    color: var(--text-primary, #212529) !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.righe-oda-btn-preset:hover {
    background: var(--warning-dark, #e0a800) !important;
    transform: translateY(-1px) !important;
}
