﻿:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1c1e;
    --main-bg: #f8f9fa;
    --accent-color: #6366f1;
}

body {
    background-color: var(--main-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Dashboard Layout Wrapper */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Style (Simile alla foto) */
.sidebar-container {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.sidebar-logo {
    height: 40px;
    width: auto;
}

/* Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
    height: 70px;
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-body {
    padding: 2rem;
    flex: 1;
}

/* Mobile Adjustments */
@media (max-width: 991.98px) {
    .sidebar-container {
        left: -100%;
    }

        .sidebar-container.active {
            left: 0;
        }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Custom scrollbar for sidebar */
.sidebar-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}


/* Sidebar Style */
.sidebar-container {
    width: var(--sidebar-width);
    background-color: var(--bs-primary);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.sidebar-mobile {
    background-color: var(--bs-primary);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
}

.sidebar-logo {
    height: 45px;
    width: auto;
}

/* Navigation Links */
.sidebar-nav {
    list-style: none;
    padding: 0 1rem;
    margin: 0;
}
    .sidebar-nav li { 
        margin: 4px 0px;
    }

.nav-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.5rem 1rem 0.5rem;
    font-weight: 700;
}

.nav-link-custom {
    /*        display: flex;
        align-items: center;
        padding: 0.8rem 1rem;
      
        border-radius: 12px;
        margin-bottom: 0.2rem;
        transition: all 0.2s;
        font-size: 0.95rem; */
    padding: 12px 20px;
    border-radius: 8px;
    /*margin: 4px 15px;*/
    display: flex;
    align-items: center;
    transition: all 0.2s;
    color: #f9f9f9c9;
    text-decoration: none;
    font-weight: 500;
}



    .nav-link-custom i {
        font-size: 1.25rem;
        margin-right: 1rem;
        color: var(--text-muted);
        transition: color 0.2s;
    }

    .nav-link-custom:hover {
        background-color: #4f39f6;
        /* background-color: var(--sidebar-active); */
        color: white;
    }

        .nav-link-custom:hover i {
            color: white;
        }

    .nav-link-custom.active {
        background-color: #4f39f6;
        /* background-color: var(--accent-color); */
        color: white;
    }

        .nav-link-custom.active i {
            color: white;
        }

/* Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.top-bar {
    height: 70px;
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-body {
    padding: 2rem;
    flex: 1;
}

.unread-badge {
    background-color: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: auto;
}

@media (max-width: 991.98px) {
    .sidebar-container {
        left: -100%;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}


/* 1. Firefox (Standard attuale) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-primary) #f8f9fa; /* Colore thumb e colore track */
}

/* 2. Browser Webkit (Chrome, Safari, Edge, Opera) */

/* Dimensioni della scrollbar */
::-webkit-scrollbar {
    width: 8px; /* Larghezza per scrollbar verticale */
    height: 8px; /* Altezza per scrollbar orizzontale */
}
::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}
/* Sfondo della scrollbar (Track) */
::-webkit-scrollbar-track {
    background: var(--bs-primary);
    border-radius: 10px;
}
/* Assicurati che non ci siano residui visivi negli angoli */
::-webkit-scrollbar-corner {
    background-color: transparent;
}
/* La maniglia che si trascina (Thumb) */
::-webkit-scrollbar-thumb {
    background-color: #cbd5e0; /* Un grigio neutro di base */
    border-radius: 10px;
    border: 2px solid #f8f9fa; /* Crea un effetto "staccato" dalla track */
    transition: background-color 0.2s ease;
}

    /* Effetto Hover sulla maniglia */
    ::-webkit-scrollbar-thumb:hover {
        background-color: var(--bg-primary); /* Diventa blu quando ci passi sopra */
    }

/* --- Scrollbar specifica per aree di testo o dropdown (opzionale) --- */
/* Se hai aree come #ComuneList con molto scorrimento */
#ComuneList::-webkit-scrollbar-thumb {
    background-color: rgba(13, 110, 253, 0.3); /* Un blu semitrasparente */
}