/* =========================================
    LIGHT AZURE THEME SIDEBAR & AUTH BUTTONS
   ========================================= */

/* Sidebar di base (overlay per mobile e tablet) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background-color: #ffffff; /* Sfondo bianco/chiaro */
    color: #1e293b;
    height: 100vh;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.08);
    border-right: 1px solid #e2e8f0;
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    transform: translateX(0); /* Aperta di default su mobile se non ha la classe collapsed */
}

    /* Quando è chiusa, scivola completamente a sinistra fuori dallo schermo */
    .sidebar.collapsed {
        transform: translateX(-260px) !important;
    }

    .sidebar .logo {
        padding: 20px 16px;
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: 0.5px;
        border-bottom: 1px solid #f1f5f9;
    }

        .sidebar .logo a {
            color: #0284c7 !important; /* Azzurro brand */
        }

.sidebar-category-title {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* Voci di menù con palette azzurra */
.sidebar .nav-link {
    color: #475569;
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
}

    .sidebar .nav-link:hover {
        background-color: #e0f2fe; /* Azzurro chiaro soft al passaggio */
        color: #0284c7;
        transform: translateX(4px);
    }

    .sidebar .nav-link.active {
        background: linear-gradient(135deg, #0284c7, #0369a1); /* Sfumatura azzurra professionale */
        color: #ffffff;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    }

/* =========================================
   STYLING AREA LOGIN / LOGOUT NELLA SIDEBAR
   ========================================= */
.sidebar-auth-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

    .sidebar-auth-box .user-name {
        font-size: 0.85rem;
        color: #334155;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-auth-box .btn-auth-custom {
        width: 100%;
        font-size: 0.875rem;
        font-weight: 500;
        padding: 0.4rem 0.75rem;
        border-radius: 6px;
        transition: all 0.2s;
    }

.btn-auth-login {
    background-color: #0284c7;
    color: white;
    border: none;
}

    .btn-auth-login:hover {
        background-color: #0369a1;
        color: white;
    }

.btn-auth-logout {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

    .btn-auth-logout:hover {
        background-color: #e2e8f0;
        color: #1e293b;
    }

/* =========================================
   STILI GLOBALI STATI E PRIORITÀ TICKET
   ========================================= */

/* Stati */
.badge-aperto {
    background-color: #0ea5e9 !important;
    color: #fff !important;
}

.badge-in-lavorazione {
    background-color: #f97316 !important;
    color: #fff !important;
}

.badge-sospeso {
    background-color: #c084fc !important;
    color: #fff !important;
}

.badge-risolto {
    background-color: #2563eb !important;
    color: #fff !important;
}

.badge-chiuso {
    background-color: #16a34a !important;
    color: #fff !important;
}

.badge-annullato {
    background-color: #111827 !important;
    color: #fff !important;
}

/* Priorità / Gravità */
.badge-critica {
    background-color: #dc2626 !important;
    color: #fff !important;
}

.badge-alta {
    background-color: #fb923c !important;
    color: #111827 !important;
}

.badge-media {
    background-color: #facc15 !important;
    color: #111827 !important;
}

.badge-bassa {
    background-color: #f472b6 !important;
    color: #111827 !important;
}

/* =========================================
   STILE MINIMAL CON BORDO LATERALE (STATUS & PRIORITY)
   ========================================= */
.status-indicator {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    color: #212529;
    background-color: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
}

.status-aperto {
    border-left-color: #0ea5e9 !important;
}

.status-in-lavorazione {
    border-left-color: #f97316 !important;
}

.status-sospeso {
    border-left-color: #c084fc !important;
}

.status-risolto {
    border-left-color: #2563eb !important;
}

.status-chiuso {
    border-left-color: #16a34a !important;
}

.status-annullato {
    border-left-color: #111827 !important;
}

.status-critica {
    border-left-color: #dc2626 !important;
}

.status-alta {
    border-left-color: #fb923c !important;
}

.status-media {
    border-left-color: #facc15 !important;
}

.status-bassa {
    border-left-color: #f472b6 !important;
}

/* =========================================
   LAYOUT & CONTAINER FIXES
   ========================================= */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    margin: 0;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

main.content {
    flex: 1 0 auto;
}

.top-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hamburger-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

    .hamburger-btn:hover {
        background-color: #f1f5f9;
        color: #0f172a;
    }

/* =========================================
   LINGUETTA LATERALE PERSISTENTE (SIDEBAR TAB)
   ========================================= */
.sidebar-tab {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1040;
    width: 28px;
    height: 70px;
    background-color: #ffffff;
    color: #0284c7;
    border: 1px solid #e2e8f0;
    border-left: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease, width 0.2s ease;
}

    .sidebar-tab:hover {
        background-color: #f1f5f9;
        width: 32px;
    }

.sidebar-tab-icon {
    font-size: 14px;
    font-weight: bold;
}

/* Nasconde la linguetta quando la sidebar è aperta */
#sidebar:not(.collapsed) ~ .sidebar-tab {
    display: none;
}

/* =========================================
   MEDIA QUERY RESPONSIVE (DESKTOP VS MOBILE/TABLET)
   ========================================= */

/* Su desktop (schermi >= 992px): Sidebar fissa e sempre visibile, linguetta nascosta */
@media (min-width: 992px) {
    .sidebar {
        position: relative !important;
        transform: translateX(0) !important;
        height: auto !important;
        min-height: 100vh;
        box-shadow: none !important;
    }

        /* Annulla l'effetto collapsed su desktop bloccandola in posizione aperta */
        .sidebar.collapsed {
            transform: translateX(0) !important;
        }

    /* Nasconde completamente la linguetta laterale su desktop */
    .sidebar-tab {
        display: none !important;
    }

    #sidebarCloseBtn {
        display: none !important;
    }
}
