/* ==========================================================================
   VARIABILI CROMATICHE ENTERPRISE
   ========================================================================== */
:root {
    --ent-bg-main-dark: #0f172a; /* Navy Profondo (Header / Sfondi scuri) */
    --ent-bg-sidebar: #1e293b; /* Slate Scuro (Sidebar) */
    --ent-bg-hover: #334155; /* Tonalitą intermedia per interazioni */
    --ent-bg-dropdown: #0b0f19; /* Sotto-livello menu */
    --ent-text-main: #f8fafc; /* Testo chiaro */
    --ent-text-muted: #94a3b8; /* Testo spento / icone secondarie */
    --ent-accent-active: #38bdf8; /* Colore di enfasi (Celeste IT) */
    --ent-border-dark: #334155; /* Bordi scuri */
    --ent-footer-bg: #ffffff; /* Sfondo footer pulito */
    --ent-footer-border: #e2e8f0; /* Bordo superiore del footer */
}
/* Aggiungi questa variabile all'interno del blocco :root in cima al file */
:root {
    /* ... altre variabili esistenti ... */
    --ent-orange: #f97316; /* Arancione Enterprise (stile Tailwind/Modern) */
    --ent-orange-hover: #ea580c; /* Arancione pił scuro per lo stato hover */
}
/* ==========================================================================
   1. STILE DI HEADER & NAV BAR COMPACT
   ========================================================================== */
header.bg-enterprise {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 80px; /*56px;*/
    background-color: white !important;
    padding: 0;
}

.border-bottom-dark {
    border-bottom: 1px solid var(--ent-border-dark);
}

.text-accent {
    color: var(--ent-accent-active);
}

/* Pulsante per comprimere la sidebar */
.btn-toggle-sidebar {
    background: transparent;
    border: 1px solid var(--ent-border-dark);
    color: var(--ent-text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

    .btn-toggle-sidebar:hover {
        background-color: var(--ent-bg-hover);
        color: #fff;
        border-color: var(--ent-text-muted);
    }

.btn-enterprise-orange {
    background-color: var(--ent-orange);
    border: 1px solid var(--ent-orange);
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

    .btn-enterprise-orange:hover {
        background-color: var(--ent-orange-hover);
        border-color: var(--ent-orange-hover);
        color: #ffffff !important;
    }

    .btn-enterprise-orange:active {
        transform: scale(0.96); /* Piccolo feedback visivo al click */
    }
/* Elementi di navigazione header */
header .nav-link {
    color: var(--ent-text-muted) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
}

    header .nav-link:hover {
        color: var(--ent-text-main) !important;
    }

/* Area Utente e Notifiche */
.btn-icon-nav {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    color: var(--ent-text-muted) !important;
    padding: 4px 8px;
}

    .btn-icon-nav:hover {
        color: var(--ent-text-main) !important;
    }

.user-dropdown::after {
    color: var(--ent-text-muted);
    margin-left: 8px;
}

.avatar-header {
    width: 28px;
    height: 28px;
    background-color: var(--ent-accent-active);
    color: var(--ent-bg-main-dark);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ==========================================================================
   2. STRUTTURA E LAYOUT PRINCIPALE
   ========================================================================== */
.main-wrapper {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px - 45px); /* Adattato alla nuova altezza footer */
}

.content-container {
    flex-grow: 1;
    padding: 24px;
    background-color: #f8fafc; /* Area dati asettica e chiara */
}

/* ==========================================================================
   3. STILE DELLA SIDEBAR
   ========================================================================== */
.left-sidebar {
    width: 260px;
    min-width: 260px;
    background-color: var(--ent-bg-sidebar);
    border-right: 1px solid var(--ent-border-dark);
    padding: 16px 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    transition: width 0.25s ease, min-width 0.25s ease;
}

.sidebar-heading {
    padding: 0 24px 16px 24px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ent-text-muted);
    border-bottom: 1px solid var(--ent-border-dark);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

    .sidebar-nav li a,
    .sidebar-nav .dropdown-toggle {
        display: flex;
        align-items: center;
        padding: 12px 24px;
        color: var(--ent-text-main);
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
        transition: background-color 0.15s ease;
        white-space: nowrap;
    }
    .sidebar-nav .menu-text {
        display: inline-block;
        max-width: 200px; /* Una larghezza stimata per i tuoi testi */
        opacity: 1;
        transition: opacity 0.2s ease, max-width 0.2s ease;
        vertical-align: middle;
    }
        .sidebar-nav li a:hover,
        .sidebar-nav .dropdown-toggle:hover {
            background-color: var(--ent-bg-hover);
            color: #fff;
        }

.menu-icon {
    font-size: 1.2rem;
    margin-right: 14px;
    min-width: 24px;
    text-align: center;
    color: var(--ent-text-muted);
}

.sidebar-nav li a:hover .menu-icon,
.sidebar-nav .dropdown-toggle:hover .menu-icon {
    color: var(--ent-accent-active);
}

/* ==========================================================================
   4. INTEGRAZIONE DROPDOWN SIDEBAR
   ========================================================================== */
.left-sidebar .dropdown-toggle::after {
    margin-left: auto;
    color: var(--ent-text-muted);
    transition: transform 0.2s ease;
}

.left-sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.left-sidebar .dropdown-menu {
    position: static !important;
    float: none;
    background-color: var(--ent-bg-dropdown);
    border: none;
    border-radius: 0;
    margin: 0 !important;
    padding: 4px 0 !important;
    box-shadow: none;
    transform: none !important;
}

.left-sidebar .dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 24px 10px 42px;
    color: var(--ent-text-muted);
    font-size: 0.85rem;
}

    .left-sidebar .dropdown-item i {
        margin-right: 10px;
        font-size: 0.95rem;
    }

    .left-sidebar .dropdown-item:hover {
        background-color: var(--ent-bg-hover);
        color: var(--ent-text-main);
    }

/* ==========================================================================
   5. COMPORTAMENTO SIDEBAR RIDOTTA (COLLAPSED)
   ========================================================================== */
.left-sidebar.collapsed {
    width: 68px;
    min-width: 68px;
}

    /* Gestione della scomparsa di testi e freccette */
    .left-sidebar.collapsed .menu-text,
    .left-sidebar.collapsed .heading-text,
    .left-sidebar.collapsed .dropdown-toggle::after {
        opacity: 0;
        max-width: 0;
        display: inline-block;
        overflow: hidden;
        transition: opacity 0.2s ease, max-width 0.2s ease;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* FIX: Rimuove totalmente l'ingombro e i padding dei sottomenu a tendina (dropdown) */
    .left-sidebar.collapsed .dropdown-menu,
    .left-sidebar.collapsed .dropdown-menu.show {
        display: none !important; /* Nasconde completamente il blocco */
        opacity: 0 !important;
        max-height: 0 !important;
        padding: 0 !important; /* Elimina i 4px di padding che causavano le righe vuote */
        margin: 0 !important;
        overflow: hidden !important;
    }

    .left-sidebar.collapsed .sidebar-nav li a,
    .left-sidebar.collapsed .dropdown-toggle {
        justify-content: center;
        padding: 12px 0;
    }

    .left-sidebar.collapsed .menu-icon {
        margin-right: 0 !important;
        color: var(--ent-text-main);
        min-width: 24px;
        text-align: center;
        display: inline-block;
    }

/* ==========================================================================
   6. FOOTER ENTERPRISE CLEAN
   ========================================================================== */
.footer-enterprise {
    background-color: var(--ent-footer-bg);
    border-top: 1px solid var(--ent-footer-border);
    padding: 12px 0;
    font-size: 0.8rem;
    color: #64748b;
}

.text-dark-enterprise {
    color: #334155;
}

.footer-links a {
    color: #64748b;
}

    .footer-links a:hover {
        color: var(--ent-bg-main-dark);
    }

.footer-version {
    font-family: monospace;
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
}

/* ==========================================================================
   7. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }

    .left-sidebar, .left-sidebar.collapsed {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--ent-border-dark);
        padding: 12px 0;
    }

        .left-sidebar.collapsed .menu-text,
        .left-sidebar.collapsed .heading-text,
        .left-sidebar.collapsed .dropdown-toggle::after {
            display: inline-block !important;
        }

    .sidebar-nav li a,
    .sidebar-nav .dropdown-toggle {
        padding: 12px 24px !important;
        justify-content: flex-start !important;
    }

    .menu-icon {
        margin-right: 14px !important;
    }
}
