
@charset "UTF-8";

html{
    font-size: 12px;
} 

:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active-border: #0ea5e9;
    --sidebar-text: #94a3b8;
    --body-bg: #f1f5f9;
    --text-main: #1e293b;
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    font-size:1.25rem;
}

/* =========================================
   Layout Principale
   ========================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    background-color: var(--body-bg);
    flex-grow: 1;
    margin-left: 260px; /* Spazio per la sidebar fissa */
    display: flex;
    flex-direction: column;
}

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0ea5e9;
    border-bottom: 1px solid rgba(255,255,255,0.1)
}

.sidebar-user {
    padding: 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 17px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
    background-color: rgba(255,255,255,0.02);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-info {
    font-size: 1.3rem;
    color: #cbd5e1;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav .nav-item {
    width: 100%;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--sidebar-active-border);
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================
   Topbar (Header)
   ========================================= */
.topbar {
    background-color: #fff;
    height: 68px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.topbar-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.search-bar {
    background-color: var(--body-bg);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    width: 300px;
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* =========================================
   Componenti Ricorsivi (Cards, Icons, Tables)
   ========================================= */
.custom-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1)
}

.custom-card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.custom-card-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Icone delle statistiche in Dashboard */
.icon-box {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Tabelle */
.custom-table th {
    font-weight: 500;
    color: #64748b;
    border-bottom-width: 1px;
    /*padding: 1rem 0.5rem;*/
    font-size: 1.2rem;
}

.custom-table td {
    /*padding: 1rem 0.5rem;*/
    vertical-align: middle;
    color: #475569;
    font-size: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Badge di stato */
.badge-soft {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 20px;
}

th {
    vertical-align: top;
}

/* =========================================
   Responsive & Mobile Sidebar (Offcanvas)
   ========================================= */

/* Overlay scuro dietro la sidebar aperta (nascosto di default) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5); /* Usa il colore della sidebar con opacità */
    z-index: 999; /* Appena sotto la sidebar (1000) ma sopra il resto */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.sidebar-overlay.show {
    opacity: 1;
}

/* Pulsante Hamburger (nascosto su Desktop) */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}

/* Regole per schermi Tablet e Mobile (sotto i 992px) */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%); /* Nasconde la sidebar a sinistra */
        transition: transform 0.3s ease-in-out;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1); /* Ombra quando è aperta in sovraimpressione */
    }
    
    .sidebar.show {
        transform: translateX(0); /* Mostra la sidebar */
    }

    .main-content {
        margin-left: 0; /* Il contenuto principale prende tutto lo spazio */
    }

    .mobile-toggle {
        display: block; /* Mostra l'hamburger menu */
    }
    
    .topbar {
        padding: 0 1.25rem;
    }
    
    .search-bar {
        width: 180px; /* Riduce la barra di ricerca per farla stare nello schermo */
    }
}

/* Regole per schermi molto piccoli (sotto i 576px) */
@media (max-width: 575.98px) {
    .topbar-title {
        font-size: 1.6rem;
    }
    .search-wrapper {
        display: none; /* Nasconde la ricerca nei telefoni molto piccoli per fare spazio al bottone reset, opzionale */
    }
}