/* --- RESET E BASI --- */
@import url(https://fonts.googleapis.com/css?family=Lato:300,400,700,900,100italic,300italic,400italic);
@import url("https://fonts.googleapis.com/css?family=Montserrat");
@import url(https://fonts.googleapis.com/css?family=Oswald:700,400,300);

* { 
    box-sizing: border-box; 
}

:root {
		--container-width: 1200px;

   
    --primary-color: #0d47a1;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --container-width: 1200px;
    --sidebar-width: 280px;
    --navbar-height: 65px;
    
    /* Palette Material 3 Custom */
    --m3-nav-bg: #1e293b;        /* Navbar Blu Notte */
    --m3-sidebar-bg: #f1f5f9;    /* Sidebar Grigio Fumo */
    --m3-bg: #f8fafc;            /* Sfondo Body */
    --m3-surface: #ffffff;       /* Card e Fogli */
    --m3-primary: #0b57d0;       /* Blu Google */
    --m3-primary-container: #d3e3fd;
    --m3-on-primary-container: #041e49;
    --m3-outline: #c4c7c5;
    --m3-error: #b3261e;
    --m3-error-container: #f9dedc;
	
	 --slate-800: #1e293b;         /* Il tuo colore */
    --slate-700: #334155;         /* Variante per hover */
    --slate-900: #0f172a;         /* Variante per dropdown */
    --accent-blue: #38bdf8;       /* Celeste brillante per elementi attivi */
    --text-slate-100: #f1f5f9;
}
body {
        font-family: "Montserrat", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif!important;
    background: #f4f7f9;
    margin: 0;
    color: #1e293b;
    line-height: 1.5;
}

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
}

a {
    text-decoration: none;
    color: inherit;
}
.text-danger {
    color: #ef4444;
}

.text-success {
    color: #22c55e;
}

.text-primary {
    color: var(--primary-color)!important;
}

.text-warning {
    color: #f59e0b;
}

/* --- FORM ELEMENTI --- */

label {
    font-size: 0.85em;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 15px;
}

input,
select,
textarea {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85em;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: 0.2s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* --- TABELLE --- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    text-align: left;
    font-size: 0.75em;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px;
    border-bottom: 2px solid #f1f5f9;
}

td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95em;
}
.btn-outline-danger:hover{ background: #fee2e2;
    color: #b91c1c;}
/* --- ALERT E BADGES --- */

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
    margin: 20px 0;
    padding: 15px;
    border-radius: 12px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    margin: 20px 0;
    padding: 15px;
    border-radius: 12px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: bold;
}

.badge-admin {
    background: #fee2e2;
    color: #991b1b;
}

.badge-user {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-files {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.count-badge {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
}

.line-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.line-row:hover {
    background: #f8fafc;
}

.col-nome {
    flex: 0 0 180px;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.col-path {
    flex-grow: 1;
    color: #64748b;
    font-family: monospace;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-check {
    flex: 0 0 100px;
    text-align: right;
}











/* --- LAYOUT PRINCIPALE --- */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: all 0.3s ease;
}

/* --- SIDEBAR E NAVBAR --- */

#sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
box-shadow: 4px 0 12px rgba(0, 0, 0, 0.03) !important;
    z-index: 1000;
    min-width: 260px;
	padding-top:20px
}

/* Titoli e Label - Grigio azzurrato tenue */
#sidebar .text-muted {
    color: #94a3b8 !important; 
    font-size: 0.7rem;
    letter-spacing: 0.8px;
    padding-left: 15px;
    text-transform: uppercase;
    font-weight: 700;
}

.nav-custom-link, 
.sidebar-acc-btn, 
.card-link-wrapper {
    display: flex !important;
    flex-direction: row !important; /* Forza la disposizione orizzontale */
    align-items: flex-start !important; /* Icona allineata alla prima riga */
    flex-wrap: nowrap !important; /* Impedisce all'icona di finire sopra il testo */
    white-space: normal !important;
    padding: 10px 15px !important;
    text-decoration: none !important;
}

/* 2. Blocca l'icona a sinistra */
.nav-custom-link i, 
.sidebar-acc-btn i, 
.card-icon-box {
    flex-shrink: 0 !important; /* Fondamentale: impedisce all'icona di rimpicciolirsi */
    margin-right: 15px !important;
    margin-top: 2px !important; /* Allineamento estetico con la prima riga */
}

/* 3. Gestisci il testo affinché occupi lo spazio rimanente e vada a capo */
.card-title-text, 
.nav-custom-link span, 
.sidebar-acc-btn span,
#sidebar .text-truncate {
    flex: 1 1 auto !important; /* Prende tutto lo spazio a destra dell'icona */
    min-width: 0 !important;   /* Trucco CSS per forzare il wrapping in flexbox */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: block !important;
    text-align: left !important;
    line-height: 1.4 !important;
}



/* Link del Menu - Testo ammorbidito (Slate 500/600) */
.nav-custom-link {
    color: #64748b !important; /* Grigio fumo più dolce del precedente */
    font-weight: 500;
    font-size: 0.8rem;
    padding: 10px 18px 10px 25px !important;
    border-radius: 25px !important;
    margin-bottom: 4px;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    display: flex;
    align-items: center;
}

.nav-custom-link:hover {
    background-color: rgba(26, 115, 232, 0.04) !important;
    color: #1a73e8 !important;
}

/* Stato Attivo - Ripristinato come piaceva a te */
.nav-custom-link.active {
    background-color: rgba(26, 115, 232, 0.08) !important; 
    color: #1a73e8!important; /* Qui il blu scuro serve per il contrasto sul celeste */
    font-weight: 600;
}

.nav-custom-link.active .i-menu {
    color: #1a73e8 !important;
}

.nav-custom-link:hover i, 
.nav-custom-link:hover .i-menu {
    color: #1a73e8 !important;
}



.btn-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}



/* Accordion */
.sidebar-acc-btn {
    background-color: transparent !important;
    color: #64748b !important; /* Testo ammorbidito anche qui */
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    padding: 10px 18px 10px 25px !important;
    border: none !important;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    border-radius: 25px !important;
	    box-shadow: none !important;
}

.sidebar-acc-btn:not(.collapsed) {
    color: #1a73e8 !important;
    background-color: rgba(26, 115, 232, 0.08) !important;
}
.sidebar-acc-btn:not(.collapsed) i {
    color: #1a73e8 !important;
}



/* Sottomenu */
.sub-link {
    font-size: 0.75rem !important;
    padding: 8px 18px 8px 45px !important;
    margin-left: 5px;
    color: #94a3b8 !important; /* Ancora più leggero per i sotto-livelli */
}

.sub-link.active {
    color: #1a73e8 !important;
    font-weight: 700;
	background-color: rgba(26, 115, 232, 0.04) !important;
}
.sub-link:hover {
    color: #1a73e8 !important;
 
}
/* Divider */
.sidebar-divider {
    border-top: 1px solid #f1f5f9 !important;
    margin: 1rem 0;
    height: 1px;
    background-color: #e2e8f0;
}

/* Scrollbar Sidebar */
#sidebar .flex-grow-1::-webkit-scrollbar { width: 4px; }
#sidebar .flex-grow-1::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 10px; }











.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    z-index: 1040;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}


.i-menu {
    width: 20px;
    text-align: center;
    color: var(--text-muted) !important;
    transition: color 0.2s;
    display: inline-block;
}





/* Base Navbar */
.navbar-slate {
    background-color: var(--slate-800) !important;
    height: 72px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-dot {
    width: 10px;
    height: 10px;
    background-color: var(--accent-blue);
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Link in stile Pill */
.nav-material-link {
    color: var(--text-slate-100) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.nav-material-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 1;
}

.nav-material-link.active {
    background-color: var(--slate-700) !important;
    color: var(--accent-blue) !important;
    opacity: 1;
	padding: 12px 18px!important;
}

/* Dropdown coerente con lo Slate */
.dropdown-menu-slate {
    background-color: var(--slate-900) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 8px !important;
}

.dropdown-menu-slate .dropdown-item {
    color: var(--text-slate-100);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.dropdown-menu-slate .dropdown-item:hover {
    background-color: var(--slate-700);
    color: white;
}

/* Bottone Logout */
.btn-slate-logout {
    background-color: rgba(239, 68, 68, 0.15); /* Rosso trasparente */
    color: #f87171;
   /* border: 1px solid rgba(239, 68, 68, 0.3);*/
    font-weight: 600;
    font-size: 0.75rem;
    padding: 8px 20px;
    border-radius: 100px!important;
    transition: all 0.2s;
}

.btn-slate-logout:hover {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Sidebar Mobile Header */
@media (max-width: 991.98px) {
    #sidebar .sidebar-mobile-header {
        background-color: var(--slate-800);
        color: white;
    }
}



.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}




.btn-logout {
    color: #dc3545;
    border: 1px solid #fee2e2;
    background: #fff;
    font-weight: 500;
}

.btn-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
}



.login-body .error-msg {
    background: #fee2e2;
    color: #dc3545;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9em;
    text-align: center;
    border: 1px solid #fecaca;
}

.fs-5 {
    font-size: 1rem !important;
}

/*--- MODAL ---*/

#Modal .modal-body .d-flex {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
}

#Modal .modal-body .btn-custom-secondary,
#Modal .modal-body .btn-danger {
    flex: 1 !important;
    max-width: 140px !important;
    border-radius: 10px !important;
    padding: 10px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    text-decoration: none !important;
}

.btn-modal {
    flex: 1;
    height: 46px;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
    cursor: pointer !important;
    border: none;
    transition: 0.2s;
    text-decoration: none !important;
}

.btn-modal-cancel {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.btn-modal-delete {
    background: #ef4444 !important;
    color: white !important;
}

.btn-modal:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


.modal-custom {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0px);
    transition: all 0.3s ease;
    justify-content: center;
    align-items: center;
}

.modal-custom.active {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
}

.modal-custom.active .modal-content {
    transform: scale(1);
    opacity: 1;
}
.btn-custom-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.btn-custom-danger {
    background-color: #ef4444 !important;
    color: white !important;
}

.btn-custom-secondary:hover {
    background-color: #e2e8f0 !important;
}

.btn-custom-danger:hover {
    background-color: #dc2626 !important;
}

body.modal-open {
    padding-right: 0 !important;
    overflow-y: scroll !important;
}


.btn-new-main {
    background: var(--m3-primary-container) !important;
    color: var(--m3-on-primary-container) !important;
    padding: 12px 24px;
    border-radius: 16px !important; 
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-new-main:hover {
    background: #c2d7f7 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}
/*
.btn-new-main {
 
    color: var(--primary-color) !important;
    padding: 12px 24px;
    border: none!important; 
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
   
}

.btn-new-main:hover {
    color: var(--m3-on-primary-container) !important;
transform: translateY(-1px);
}*/



/* --- NAVBAR --- */

.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    padding: 12px 30px;
    z-index: 1000;
}

.navbar-toggler:focus,
.navbar-toggler:active,
.btn:focus,
.btn:active,
.dropdown-item:focus {
    outline: none !important;
    box-shadow: none !important;
}

.navbar-brand {
    font-size: 1.5rem !important;
    padding: 0;
    transition: transform 0.2s;
    color: #1e293b !important;
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-brand:hover {
    transform: scale(1.05);
}


.tabs-menu {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-link {
    padding: 12px 25px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #64748b;
    transition: 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tab-link:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

.tab-link.active {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid white;
    color: var(--primary-color);
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}



@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.file-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s;
    cursor: pointer;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#mini-map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
}

/* --- BOTTONI --- */

.btn {
    padding: 11px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Bottoni Stile Tab / Switcher */
.tab-style-btn {
    padding: 8px 20px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: #444746;
    background: transparent;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.tab-style-btn.active,
.tab-style-btn.btn-new-style {
    background: var(--m3-primary-container) !important;
    color: var(--m3-on-primary-container) !important;
}

.btn-view-standard {
    background: #f1f5f9;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    border: 1px solid #e2e8f0;
}

.btn-view-standard:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.btn-new {
    background: var(--primary-color) !important;
    color: white !important;
}

.btn-new:hover {
    background: #1557b0 !important;
}

.btn-upload {
    background: #10b981 !important;
    color: white !important;
}

.btn-conn {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
}

.btn-conn:hover {
    background: #e2e8f0;
}

.btn-save {
    background: #10b981;
    color: white !important;
}

.btn-test {
    background: white !important;
    border: 1px solid #cbd5e1 !important;
}

.btn-danger,
.btn-confirm {
    background: #ef4444 !important;
    color: white !important;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b !important;
    border: 1px solid #e2e8f0;
}

.btn-logout {
    color: #dc3545 !important;
    font-weight: bold;
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-logout:hover {
    background: #fee2e2;
}

.btn-min {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.2s;
}

.btn-min.edit {
    background: #f1f5f9;
    color: #64748b;
}

/*.btn-min.clone { background: #f5f3ff; color: #8b5cf6; }*/

.btn-min.delete {
    background: #fff1f2;
    color: #ef4444;
}

.btn-min.download {
    background: #eff6ff;
    color: var(--primary-color);
}

.btn-min.clone {
    background: #f0f9ff;
    color: #0369a1;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.view-switcher, .tabs-menu-alt {
    display: flex;
    background: #e9eef6;
    padding: 4px;
    border-radius: 100px; /* Pill shape container */
    gap: 4px;
    border: none;
    width: fit-content;
}

.btn-min:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-min.edit:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-min.clone:hover {
    background: #e0f2fe;
    color: #075985;
}

.btn-min.download:hover {
    background: #dbeafe;
    color: #1e40af;
}

.btn-min.delete:hover {
    background: #ffe4e6;
    color: #be123c;
}

.btn-min:active {
    transform: translateY(0);
    box-shadow: none;
}
.btn-del-cat {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    padding: 5px 12px;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: 0.2s;
}

.btn-del-cat:hover {
    border-color: #fecaca;
    color: #ef4444;
    background: #fff1f2;
}





.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}




/* --- LAYOUT E CARDS --- */



.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
}

.card-link-wrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    width: 100%;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-self: flex-end;
    margin-top: 15px;
}

.card-icon-box {
    width: 45px;
    height: 45px;
    background: #eff6ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-right: 18px;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.card-title-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
	text-transform:uppercase;
    line-height: 1.4;
    word-break: break-word;
	padding-top:7px
}

.card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.empty-state-card {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 2px dashed #e2e8f0;
    padding: 30px;
    border-radius: 14px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}



/*--- SEZIONI ---*/

.view-section,
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-section.active,
.tab-content.active {
    display: block;
}

.section-title {
    margin: 40px 0 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-left h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}





/* --- SPECIFICI: LISTA REPORT --- */

.group-section-header {
    margin: 40px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}

.group-section-header::after {
    content: "";
    height: 2px;
    background: #e2e8f0;
    flex-grow: 1;
}

/* --- GRIGLIA E CARD 
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}*/

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    /*align-items: start;*/
}

.report-card {
    background: #f8fafc;
    padding: 15px 20px;
    /* Ridotto il padding verticale da 20 a 15 */
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
    transition: 0.3s;
}
/* 1. IL CONTENITORE: deve essere un flex-column per separare Titolo (sopra) e Tasti (sotto) */
.report-item-card {
    position: relative;
    overflow: hidden; 
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 24px !important;
    min-height: 160px;
    
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important; /* Spinge il titolo su e i tasti giù */
    align-items: stretch !important;
    
    z-index: 1;
    transition: all 0.3s ease;
}

/* 2. L'ICONA GIGANTE: oversize e in alto a sinistra */
.background-icon-watermark {
    position: absolute !important;
    top: -40px !important; 
    left: -50px !important;
    font-size: 9rem !important; /* Molto grande per far uscire un pezzo fuori */
    color: #1a73e8 !important;
    opacity: 0.05 !important;
    pointer-events: none;
    z-index: 0 !important;
    transform: rotate(-5deg);
    transition: all 0.5s ease;
}

/* 3. IL TITOLO: deve stare sopra l'icona */
.report-card-main-link {
    text-decoration: none !important;
    z-index: 2 !important;
    position: relative !important;
}

.report-card-title {
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    line-height: 1.4;
    text-align: left !important;
    display: block !important;
}

/* 4. I TASTI: Forziamo la riga orizzontale a destra */
.report-card-actions {
    position: relative !important;
    z-index: 3 !important; /* Il livello più alto per essere sempre cliccabile */
    
    display: flex !important;
    flex-direction: row !important;      /* FORZA ORIZZONTALE */
    justify-content: flex-end !important; /* FORZA A DESTRA */
    align-items: center !important;
    gap: 8px !important;
    
    margin-top: auto !important; /* Assicura che stiano in fondo */
    width: 100% !important;      /* Prende tutta la larghezza per poter allineare a destra */
}

/* 5. FIX PER I TASTINI: evitiamo che ereditino larghezze strane */
.btn-min {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important; /* Impedisce che si schiaccino */
    border-radius: 10px !important;
}

/* Effetto Hover Card */
.report-item-card:hover .background-icon-watermark {
    opacity: 0.1 !important;
    transform: scale(1.1) rotate(0deg);
}
/* Sostituisci o aggiungi questo stile per il tasto user */
.btn-view-standard {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    padding: 8px 16px !important;
    background-color: rgba(26, 115, 232, 0.05) !important; /* Blu chiarissimo trasparente */
    color: #1a73e8 !important;
    border: 1px solid rgba(26, 115, 232, 0.2) !important;
    border-radius: 20px !important; /* Pill shape */
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.btn-view-standard:hover {
    background-color: #1a73e8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.3) !important;
    transform: translateY(-1px);
}

/* Se vuoi renderlo ancora più minimale (solo icona come gli admin) */
.btn-view-minimal {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #1a73e8;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.map-card {
    display: block;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    margin-bottom: 10px;
    transition: 0.3s;
}

.tab-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.map-card:hover,
.report-card:hover {
    transform: translateY(-3px);
    /* border-color: var(--primary-color);*/
    background: white;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
}

.tab-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.report-link {
    text-decoration: none;
    color: inherit;
    z-index: 2;
    flex-grow: 1;
}

.report-title {
    font-weight: bold;
    font-size: 1.1em;
    display: block;
    margin-bottom: 5px;
    color: #0f172a;
}

.report-meta {
    font-size: 0.85em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon-bg {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 60px;
    color: rgba(0, 0, 0, 0.03);
    z-index: 1;
    pointer-events: none;
}

/* --- AZIONI (ALLINEAMENTO PERFETTO) --- */

.admin-actions {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    z-index: 3;
    align-items: center;
}

.action-item {
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

.btn-edit-link {
    color: var(--primary-color) !important;
}

.btn-delete-link {
    color: #ef4444 !important;
}

/* --- SPECIFICI: DESIGNER --- */

.sql-main {
    font-family: "Cascadia Code", monospace;
    font-size: 0.9em;
    background: #fdfdfd;
    min-height: 250px;
    resize: vertical;
    border: 1px solid #cbd5e1;
}

.sql-filter {
    font-family: "Cascadia Code", monospace;
    background: #ffffff;
    /* Modificato da #f8fafc a bianco */
    min-height: 110px;
    resize: vertical;
    font-size: 0.8em;
    border: 1px solid #cbd5e1;
    resize: vertical;
}

/* Aggiungiamo questa per i suggerimenti sql */

.sql-hint {
    font-size: 0.78em;
    color: #92400e;
    /* Marrone scuro per il testo (molto leggibile) */
    margin-top: 8px;
    background: #fffbeb;
    /* Giallo crema chiarissimo */
    padding: 8px 12px;
    border-radius: 6px;
    display: block;
    font-family: "Cascadia Code", monospace;
    border: 1px solid #fde68a;
    /* Bordo giallo tenue */
    border-left: 4px solid #f59e0b;
    /* Linea ambra decisa a sinistra */
    line-height: 1.4;
}

.mult-check input[type="checkbox"] {
    width: 18px !important;
    /* Dimensione fissa per il quadratino */
    height: 18px !important;
    margin: 0 !important;
    /* Toglie i margini che lo spostano */
    cursor: pointer;
}

.chart-config-box {
    color: #0369a1;
    /* Blu scuro */
    background: #f0f9ff;
    /* Azzurro chiarissimo */
    border-radius: 6px;
    display: block;
    border-left: 4px solid #0ea5e9;
    /* Linea azzurra viva */
    line-height: 1.4;
    padding: 20px;
    margin-top: 25px;
}

/* Intestazione del singolo filtro */

.f-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.f-number {
    background: var(--m3-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
}

.f-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.f-row {
    background: #f8fafc;
    padding: 20px;
    margin-bottom: 25px;
    /*border-radius: 10px;*/
    border-radius: 0 10px 10px 0;
    border-left: 4px solid var(--primary-color);
}

.actions-bar-container {
    left: 0;
    width: 100%;
}

.actions-bar-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: var(--sidebar-width);
}

/* --- SPECIFICI: VIEW REPORT (LAYOUT CORE) --- */

.app-container {
    display: flex;
    height: calc(100vh - 72px);
    overflow: hidden;
}

.sidebar {
    background: #fff;
    border-right: 1px solid #e0e0e0;
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
    /*background: #f8fafc; border-right: 1px solid #e2e8f0;*/
}

.sidebar-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: white;
}

.filter-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.main-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: white;
    overflow: hidden;
}

.view-header h2 {
    font-weight: 700;
    color: #0f172a;
}

#map {
    height: 600px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    z-index: 1;
}

.map-legend-overlay {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    border: 1px solid #e2e8f0;
}

.main-content {
    flex-grow: 1;
    overflow-y: auto;
    background: #f4f7f9;
}

/* Evidenzia la pagina corrente */

.btn-conn.active {
    background: white;
    color: var(--primary-color) !important;
    border-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* background-color: #f0f7ff !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color);*/
}

/* Header Titolo nella View (Correzione Trasparente) */

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

.view-header h2 {
    margin: 0;
    font-size: 1.6em;
    color: #0f172a;
    font-weight: 700;
}

.view-header .btn-conn {
    background: white !important;
    border: 1px solid #cbd5e1 !important;
}

/* --- SPECIFICI: LOGIN --- */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
}

/* --- BOTTONE RUN SIDEBAR --- */

.btn-run {
    width: 100%;
    background: var(--primary-color);
    color: white !important;
    border: none;
    padding: 12px;
    border-radius: 8px;
    margin-top: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(26, 115, 232, 0.2);
}

.btn-run:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(26, 115, 232, 0.3);
}

/* --- ICONE AZIONI NELLE TABELLE (Admin Users / Connections) --- */

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 1.1em;
    text-decoration: none !important;
}

.btn-edit-icon {
    color: var(--primary-color) !important;
}

.btn-edit-icon:hover {
    background: rgba(26, 115, 232, 0.1);
}

.btn-del-icon {
    color: #ef4444 !important;
}

.btn-del-icon:hover {
    background: rgba(239, 68, 68, 0.1);
}

td .action-icon+.action-icon {
    margin-left: 8px;
}

/* --- GRIGLIA FORM --- */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: span 2;
}


.db-info {
    font-family: monospace;
    color: #0369a1;
    background: #f0f9ff;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #e0f2fe;
    font-size: 0.9em;
}





.sidebar-card.sticky-lg-top {
    top: 90px !important;
    /* Aumentato per stare sotto la navbar (che è alta circa 70-80px) */
    z-index: 900 !important;
    /* Più basso dei 1030 della navbar */
}





/* --- LOADING ANIMATION --- */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    z-index: 999999 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.loading-active {
    overflow: hidden;
}




/* --- STILIZZAZIONE DATATABLES --- */

.dataTables_scrollBody thead tr {
    visibility: collapse !important;
    line-height: 0 !important;
    height: 0 !important;
}

.dataTables_scrollBody thead th {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    height: 0 !important;
}

.dataTables_scrollHead table {
    margin-bottom: 0 !important;
}

.dataTables_scrollBody {
    border-top: none !important;
}

.clickable-row {
    cursor: pointer
}

.dataTables_wrapper {
    display: flex;
    flex-direction: column;
}

.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_filter {
    display: inline-block;
    margin-bottom: 15px;
}

.dataTables_wrapper {
    display: block !important;
}

.dt-buttons {
    float: left;
}

.dataTables_filter {
    float: right;
}

.dataTables_scroll,
#resTable_wrapper .dataTables_scroll {
    clear: both;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: white !important;
}

.dt-buttons {
    margin-bottom: 15px;
    display: flex;
    gap: 8px;
}

.dt-button.buttons-excel {
    background-color: #16a34a !important;
    color: white !important;
    border: none !important;
}

.dt-button.buttons-pdf {
    background-color: #dc2626 !important;
    color: white !important;
    border: none !important;
}

.dt-button.buttons-print {
    background-color: #64748b !important;
    color: white !important;
    border: none !important;
}

.dt-button {
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    margin-right: 5px !important;
    transition: opacity 0.2s;
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.dt-button:hover {
    opacity: 0.9 !important;
    color: white !important;
}

table.dataTable thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.85em;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px !important;
}

.dataTables_filter {
    margin-bottom: 20px !important;
}

.dataTables_filter label {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    font-size: 0.9em !important;
    color: #64748b !important;
    text-transform: none !important;
    margin-top: 0 !important;
}

.dataTables_filter input {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    background: #f8fafc !important;
    margin-left: 10px !important;
    outline: none !important;
    width: 250px !important;
}

.dataTables_filter input:focus {
    border-color: var(--primary-color) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 6px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    color: #475569 !important;
    margin: 0 2px !important;
    transition: 0.2s;
}

div.dataTables_wrapper {
    padding: 15px;
}

div.dataTables_wrapper div.dataTables_filter {
    text-align: right;
    padding: 15px 0px;
}

.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner table {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
}

.dataTables_scrollFootInner table {
    margin-top: 0 !important;
}

#resTable tfoot td {
    padding: 8px 10px !important;
    border-top: none !important;
    white-space: nowrap;
    background: #fff;
}


.dataTables_scrollHead {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.dataTables_scrollBody {
    border-top: none !important;
    margin-top: -1px !important;
}

.dataTables_scrollHeadInner table thead tr {
    height: auto !important;
}


.dataTables_scrollHeadInner table.table-bordered th {
    border-bottom-width: 0 !important;
}

.dt-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
    flex-wrap: wrap;
}

#resTable {
    visibility: hidden;
    width: 100% !important;
    border-collapse: collapse !important;
}

#resTable td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_scroll {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    padding: 15px;
}


.dataTables_filter {
    margin-top: 0 !important;
}

.dataTables_filter input {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    outline: none !important;
    background: white !important;
}

.dt-buttons .btn {
    margin-right: 5px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border: none !important;
    transition: all 0.2s;
}

.btn-excel {
    background-color: #16a34a !important;
    color: white !important;
}

.btn-pdf {
    background-color: #dc2626 !important;
    color: white !important;
}

.btn-print {
    background-color: #64748b !important;
    color: white !important;
}



.dataTables_wrapper {
    width: 100% !important;
    overflow-x: hidden !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin-left: 5px !important;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
    background: white !important;
    color: #475569 !important;
    text-decoration: none;
    cursor: pointer
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f1f5f9 !important;
    color: var(--primary-color) !important;
}

div.dataTables_wrapper div.dataTables_paginate {
    margin-top: 15px;
}

/* --- LOGIN --- */
     
         body.login-body {
         font-family: 'Inter', sans-serif;
         background: #f8fafc;
         margin: 0;
         display: flex;
         align-items: center;
         justify-content: center;
         min-height: 100vh;
         padding: 15px; 
         }
         .login-container {
         width: 100%;
         max-width: 400px; /* Non farà mai diventare la card più larga di 400px */
         }
         .login-card {
         background: white;
         padding: 30px; /* Padding ridotto per sicurezza */
         border-radius: 16px;
         box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
         width: 100%;
         animation: fadeIn 0.5s ease-out;
         }
         /* Input puliti e realmente responsive */
         .form-control-custom {
         width: 100%; /* Senza !important se il reset box-sizing è attivo */
         padding: 12px;
         border: 1px solid #e2e8f0;
         border-radius: 8px;
         display: block;
         font-size: 16px; /* 16px evita lo zoom forzato su iPhone */
         }
         .form-group {
         margin-bottom: 20px;
         }
         .btn-login {
         width: 100%;
         background: var(--primary-color);
         color: white;
         border: none;
         padding: 14px;
         border-radius: 8px;
         cursor: pointer;
         font-weight: bold;
         display: flex;
         align-items: center;
         justify-content: center;
         transition: 0.3s;
         }
         .btn-login:hover { background: #1557b0; }
    

         @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
         @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

         @media (max-width: 400px) {
         .login-card { padding: 20px; }
         .login-logo h2 { font-size: 1.3rem; }
         }


.mult-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    cursor: pointer;
    margin-top: 15px;
    padding: 10px;
    width: fit-content !important;
    text-transform: none !important;
}


 .admin-section {
	 background: white;
	 border: 1px solid #dee2e6;
	 border-radius: 8px;
	 padding: 20px;
	 height: var(--admin-height); /* Altezza fissa identica alla sinistra */
	 overflow-y: auto; /* Scroll interno se i file sono tanti */
 }
   

.list-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.list-header {
    background: #f8fafc;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.list-header:hover {
    background: #f1f5f9;
}

.list-content {
    display: none;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.inner-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
    overflow-x: auto;
}

.inner-tab {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
}

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

.tab-pane {
    display: none;
}

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f8fafc;
}

.file-row:last-child {
    border-bottom: 0;
}

.group-header {
    margin: 20px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 10px 0;
    width: 100%;
    transition: 0.2s;
}

.group-header span {
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8em;
    white-space: nowrap;
}

.group-header::after {
    content: "";
    height: 2px;
    background: #e2e8f0;
    flex-grow: 1;
}


.group-header .arrow-icon {
    order: 3;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.group-header.active {
    border-bottom: none;
}

.f-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.btn-remove-f {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: 0.2s;
    line-height: 1;
}

.btn-remove-f:hover {
    color: #ef4444;
    transform: scale(1.1);
}


#f-cont .f-row:only-child .btn-remove-f {
    display: none;
}

.sidebar h3 {
    margin-top: 0;
    color: var(--m3-on-surface);
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--m3-outline);
}

.filter-item {
    margin-bottom: 15px;
}

.filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
}

.filter-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.btn-reset {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.dropdown-check-list {
    display: block;
    width: 100%;
    position: relative;
    font-family: inherit;
}

.dropdown-check-list .anchor {
    position: relative;
    cursor: pointer;
    display: block;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.85rem;
}
.form-control {
    font-size: 0.85rem!important;
}
.dropdown-check-list .anchor:after {
    position: absolute;
    content: "";
    border-left: 2px solid #64748b;
    border-top: 2px solid #64748b;
    padding: 3px;
    right: 15px;
    top: 40%;
    transform: rotate(-135deg);
}

.dropdown-check-list ul.items {
    padding: 5px 0;
    display: none;
    margin: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    position: absolute;
    width: 100%;
    background: #fff;
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}


.dropdown-check-list ul.items li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-check-list ul.items li label {
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 15px !important;
    width: 100%;
    margin: 0 !important;
    transition: background 0.2s;
    text-align: left !important;
}

.dropdown-check-list ul.items li:hover {
    background: #f8fafc;
}


.dropdown-check-list ul.items li input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
}

/* Mostra la lista quando cliccata */

.dropdown-check-list.visible ul.items {
    display: block;
}


/*--- DIVIDER ACCORDION ---*/

.driver-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 5px 0 15px 0;
    padding-left: 12px;
    cursor: pointer;
}

.divider-label {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e293b;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    margin-left: 15px;
}

.divider-count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 24px;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: bold;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 10px;
    margin-left: 10px;
}

.btn-action-minimal {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action-minimal:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}


/*--- LOG CONTAINER ---*/

#console-section {
    padding: 0;
    overflow: hidden;
    margin-top: 30px;
}

#console-header {
    padding: 12px 20px;
    background: #1e293b;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#log-container {
    background: #0f172a;
    height: 470px;
    overflow-y: scroll;
    padding: 20px;
}

#log-output {
    color: #34d399;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#log-container::-webkit-scrollbar {
    width: 8px;
}

#log-container::-webkit-scrollbar-track {
    background: #0f172a;
}

#log-container::-webkit-scrollbar-thumb {
    background: #34d399;
    border-radius: 10px;
    border: 2px solid #0f172a;
}

#log-container::-webkit-scrollbar-thumb:hover {
    background: #10b981;
}

#log-container::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}



/*--- FORM STYLING ---*/

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #475569;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
}

.arrow-icon {
    margin-left: 10px;
    transition: transform 0.3s;
    color: #cbd5e1;
}

.btn-full {
    width: 100%;
    justify-content: center;
}


.split-container {
    display: flex;
    gap: 25px;
    align-items: stretch;
    width: 100%;
    margin-top: 20px;
    flex-wrap: nowrap;
}



/*--- COLONNA DESTRA ---*/

.list-side {
    flex: 1;
    min-width: 0;
}

.list-side .info-box {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}



.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.file-card,
.server-card,
.user-card,
.file-card {
    background: #fff;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    gap: 15px;
}

.file-card:hover,
.server-card:hover,
.user-card:hover,
.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.info-box {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.info-box h4 {
    margin: 0 0 15px 0;
    font-size: 0.85rem;
    color: #1e40af;
    border-bottom: 1px solid #eff6ff;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box .scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.info-box ::-webkit-scrollbar {
    width: 6px;
}

.info-box ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.list-side .admin-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: var(--admin-height);
}

.admin-section h3.sticky-title {
    position: sticky;
    top: -20px;
    background: #fff;
    z-index: 20;
    padding: 15px 0 20px 0;
    border-bottom: 2px solid #f8f9fa;
    margin-bottom: 20px;

}
   
.admin-section::-webkit-scrollbar {
    width: 10px;
}

.admin-section::-webkit-scrollbar-track {
    background: #f8fafc;
}

.admin-section::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid #f8fafc;
}

.admin-section::-webkit-scrollbar-button:single-button {
    background-color: #f8fafc;
    display: block;
    height: 12px;
    background-size: 10px;
    background-repeat: no-repeat;
}

.admin-section::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-position: center bottom;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%2364748b'><polygon points='50,0 0,100 100,100'/></svg>");
}

.admin-section::-webkit-scrollbar-button:single-button:vertical:increment {
    background-position: center top;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%2364748b'><polygon points='0,0 100,0 50,100'/></svg>");
}

/*--- COLONNA SINISTRA ---*/

.config-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-side .card {
    margin: 0;
    width: 100%;
    height: 100%;
    /* Pareggia l'altezza della sezione a destra */
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.list-side .admin-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.config-side .card:last-child {
    flex: 1;
}

/*--- MENU ---*/

.dropdown {
    position: relative;
    display: inline-block;
    border-radius: 8px;
}

.dropdown-toggle {
    cursor: pointer;
    border: none;
    outline: none;
}

.dropdown-content {
    display: block;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}


.dropdown-content a {
    color: #334155;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-content a i {
    width: 20px;
    text-align: center;
    color: #64748b;
}

.dropdown-content a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.dropdown-content a:hover i {
    color: var(--primary-color);
}

.dropdown-content a.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
}


.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 20px;
    width: 10px;
    height: 10px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}


/*--- LEAFLET ---*/

.leaflet-control-layers {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
}


.leaflet-control-layers-list label {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 4px;
    white-space: nowrap;
}

.leaflet-control-layers-selector {
    margin: 0 !important;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.legend-blob {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.map-legend-overlay {
    position: absolute;
    bottom: 30px;
    left: 40px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    max-width: 250px;
    font-size: 12px;
    border: 1px solid #999;
    pointer-events: auto;
}



/*--- MEDIA QUERIES ---*/


@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-width);
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        height: calc(100vh - var(--navbar-height));
        z-index: 1000;
        border-right: 1px solid var(--m3-outline);
    }

    .main-content {
        margin-left: 280px; 
        padding-top: 20px; 
        width: calc(100% - 280px);
    }
	
	.navbar-nav .nav-item .btn-light {
    background-color: transparent;
    border-color: transparent;
    color: #64748b;
}


.navbar-nav .nav-item .btn-light:hover {
    background-color: #f8fafc;
    color: #1a73e8;
}


.navbar-nav .nav-item.dropdown .btn-primary.dropdown-toggle::after {
    border-top-color: #1a73e8; 
}
    .container-fluid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .navbar-nav .nav-item .btn-sm {
        min-width: 120px;
        justify-content: center;
        display: flex;
        align-items: center;
        padding: 10px 15px !important;
        margin: 0 4px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
    }

    .navbar-nav .nav-item.dropdown .dropdown-menu {
        display: block; 
        visibility: hidden;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.3s ease-in-out;
        margin-top: 0;
        pointer-events: none;
    }

    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }

    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -10px;
        left: 0;
        width: 100%;
        height: 10px;
    }
 
.dropdown-item {
color:#64748b}

.dropdown-item.active, 
.dropdown-item:active {
    background-color: #f8fafc !important; 
    color: #1a73e8 !important;           
    font-weight: 600;                     
}


.dropdown-item:hover {
    background-color: #f1f5f9;
    color: #1a73e8;
}


.dropdown-item.active {
    border-left: 3px solid #1a73e8;
    padding-left: calc(var(--bs-dropdown-item-padding-x) - 3px);
}

}



@media (max-width: 991.98px) {
    .container-fluid {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .navbar-brand {
        font-size: 1.3rem !important;
    }

    .navbar-brand i {
        font-size: 1.5rem;
    }

    .navbar-toggler {
        margin-right: 0 !important;
        padding-right: 0 !important;
        border: none !important;
    }

    .navbar-nav .btn-sm, 
    .navbar-nav .btn-outline-danger,
    .navbar-nav .dropdown-toggle {
        background: transparent !important;
        border: none !important;
        color: #475569 !important;
        text-align: left !important;
        width: 100% !important;
        padding: 12px 15px !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center;
    }

    .navbar-nav .btn-primary {
        color: #1a73e8 !important;
        font-weight: 700 !important;
        background: #f1f5f9 !important; 
        border-radius: 8px !important;
    }

    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        background-color: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        padding-left: 25px !important;
        margin: 0 !important;
    }

    .dropdown-item {
        padding: 10px 0 !important;
        font-size: 15px !important;
        color: #64748b !important;
        background: transparent !important;
    }

    .dropdown-item.active, .dropdown-item:active {
        color: #1a73e8 !important;
        background: transparent !important;
        font-weight: 600;
    }

    .nav-divider { display: none; }
    .sidebar {
        left: -100%;
        width: 100%;
        height: 100vh;
        top: 0;
        z-index: 2000;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.show {
        transform: translateX(100%);
    }


    .main-content {
        margin-left: 0; 
		padding: 0rem;
		margin-left: 0px;
        width: 100%;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

      @media (max-width: 767.98px) {

         .dataTables_wrapper .dataTables_paginate .paginate_button.numbers {
         display: none !important;
         }

         .dataTables_wrapper .dataTables_paginate {
         display: flex !important;
         justify-content: center !important;
         width: 100% !important;
         padding: 10px 0 !important;
         margin: 0 !important;
         }

         .dataTables_wrapper .dataTables_paginate .paginate_button {
         flex: 1;
         text-align: center;
         padding: 8px 4px !important;
         font-size: 11px !important;
         margin: 0 2px !important;
         white-space: nowrap;
         }

    .header-container h2 {
        font-size: 1.4rem;
        margin-bottom: 10px !important;
    }

 
    .w-100-mobile {
        width: 100%;
        flex-direction: row !important; 
        display: flex;
    }
    
    .w-100-mobile .btn-flex {
        flex: 1;
        padding: 0 10px;
        font-size: 0.8rem; 
    }


  .view-switcher {
        display: flex;
        width: 100%;
        background: var(--m3-primary-container);
        padding: 4px;
        border-radius: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
    }
    
    .view-switcher::-webkit-scrollbar {
        display: none; 
    }
    
    .view-switcher .tab-style-btn {
        flex: 1;
        justify-content: center;
        border-radius: 12px;
        padding: 8px;
        font-size: 0.85rem;
        background: transparent;
        color: var(--m3-on-primary-container);
        border: none;
    }
	 
        .main-content .d-flex.justify-content-between {
            align-items: center !important; 
            text-align: center;
        }
        
        .btn-new-style {
            width: 90% !important; 
            margin: 0 auto;        
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #filterForm .d-flex.justify-content-center {
            flex-direction: column !important;
            align-items: center !important; 
            width: 100%;
        }

        #filterForm .btn {
            width: 100% !important;
            display: flex;
            justify-content: center; 
            align-items: center;
            margin-bottom: 10px;    
            padding: 12px;          
        }
    .header-container h2 {
        font-size: 1.5rem;
        text-align: left;
    }
    
    .view-switcher {
        display: flex;
        width: 100%;
        background: #f1f5f9;
        padding: 4px;
        border-radius: 12px;
    }
    
    .view-switcher .tab-style-btn {
        flex: 1;
        justify-content: center;
    }
    
    .btn-new-main {
        width: 100%; 
    }
	.sidebar {
  
        z-index: 1050!important;

    }
	.navbar {
 
    padding: 12px 0px!important;

}
}




@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
}
   