/* --- RESET E BASI --- */
body {
    font-family: "Segoe UI", sans-serif;
    background: #f4f7f9;
    margin: 0;
    color: #1e293b;
    line-height: 1.5;
}
a {
    text-decoration: none;
    color: inherit;
}
.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;
}
/* --- NAVBAR UNIFICATA --- */
.navbar {
    background: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}
.navbar h1 {
    margin: 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.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: #1a73e8;
}
.tab-link.active {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid white;
    color: #1a73e8;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}
.file-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.text-danger {
    color: #ef4444;
}
.text-success {
    color: #22c55e;
}
.text-primary {
    color: #3b82f6;
}
.text-warning {
    color: #f59e0b;
}
@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: 120px;
    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: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-new {
    background: #1a73e8;
    color: white !important;
}
.btn-new:hover {
    background: #1557b0;
}
.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: #6366f1; color: white !important;*/
    background: white !important;
    border: 1px solid #cbd5e1 !important;
}
.btn-danger,
.btn-confirm {
    background: #ef4444;
    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;
}

/* --- LAYOUT E CARDS --- */
.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}
.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;
}

/* --- 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.95em;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: 0.2s;
    font-family: inherit;
}
input:focus,
select:focus,
textarea:focus {
    border-color: #1a73e8;
    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;
}

/* --- 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;
}
.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;
}
/* --- MODALI --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: 0.3s;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    transition: 0.3s;
}
.modal-overlay.active .modal {
    transform: scale(1);
}
.modal i {
    font-size: 3.5em;
    color: #ef4444;
    margin-bottom: 20px;
    display: block;
    /* AGGIUNGI QUESTE DUE RIGHE: */
    margin-left: auto;
    margin-right: auto;
    width: fit-content; /* Assicura che il blocco si stringa attorno all'icona */
}

/* Centratura e stile tasti Modal */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
}

/* Usiamo classi nuove per evitare conflitti con i .btn globali */
.btn-modal {
    flex: 1;
    height: 46px;
    border-radius: 50px !important; /* Forza la pillola */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
    cursor: pointer !important; /* Forza la manina */
    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);
}
/* Modals Common */
.modal-custom {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-custom.active {
    display: flex;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* --- 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-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;
}

.report-card:hover {
    transform: translateY(-3px);
    border-color: #1a73e8;
    background: white;
    box-shadow: 0 10px 15px 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: #1a73e8 !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: #1a73e8;
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #e2e8f0;
}

.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 #1a73e8;
}
.actions-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
}
.actions-bar-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- SPECIFICI: VIEW REPORT (LAYOUT CORE) --- */
.app-container {
    display: flex;
    height: calc(100vh - 72px);
    overflow: hidden;
}
.sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 25px;
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
    /*background: #f8fafc; border-right: 1px solid #e2e8f0;*/
}
.main-content {
    flex-grow: 1;
    padding: 0 30px 30px 30px;
    overflow-y: auto;
    background: #f4f7f9;
}

/* Evidenzia la pagina corrente */
.btn-conn.active {
    background-color: #f0f7ff !important;
    color: #1a73e8 !important;
    border: 1px solid #1a73e8;
}
/* 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: #1a73e8;
    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: #1a73e8 !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;
}
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
}

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

/* --- STILIZZAZIONE DATATABLES --- */
.dt-buttons {
    margin-bottom: 15px;
    display: flex;
    gap: 8px;
}
button.dt-button {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition: 0.2s !important;
}
button.dt-button:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !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: #1a73e8 !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: #1a73e8 !important;
    color: white !important;
    border: 1px solid #1a73e8 !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;
}
/* --- FIX BOTTONE LOGIN --- */
.btn-login {
    width: 100%;
    background: #1a73e8;
    color: white !important;
    border: none;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-login:hover {
    background: #1557b0;
}
/* --- FIX CHECKBOX DESIGNER --- */
.mult-check {
    display: flex !important;
    flex-direction: row !important; /* Forza la riga invece della colonna */
    align-items: center !important;
    gap: 10px;
    cursor: pointer;
    margin-top: 15px;
    padding: 10px;

    /*background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;*/

    width: fit-content !important; /* Non occupa tutta la riga */
    text-transform: none !important; /* Toglie il maiuscolo se presente */
}
.admin-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}
.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 per File */
.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: #1a73e8;
    border-bottom-color: #1a73e8;
}
.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;
}

/* --- STILE TITOLO GRUPPO CON RIGA --- */
.group-header {
    margin: 20px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 15px; /* Spazio tra icona, testo e riga */
    cursor: pointer;
    background: transparent; /* Rimuove lo sfondo bianco */
    border: none; /* Rimuove i bordi del box */
    padding: 10px 0;
    width: 100%;
    transition: 0.2s;
}

.group-header span {
    font-weight: 600;
    color: #64748b; /* Grigio chiaro professionale */
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8em;
    white-space: nowrap; /* Impedisce al testo di andare a capo */
}

/* La riga che si estende a destra */
.group-header::after {
    content: "";
    height: 2px;
    background: #e2e8f0; /* Colore della riga */
    flex-grow: 1; /* Spinge la riga a occupare tutto lo spazio */
}
/*
.group-header:hover span {
    color: #1a73e8; /* Il titolo diventa blu al passaggio 
}
*/
.group-header .arrow-icon {
    order: 3; /* Sposta la freccia dopo la riga se vuoi, oppure togli questa riga */
    color: #94a3b8;
    transition: transform 0.3s ease;
}

/* Rimuoviamo gli stili del vecchio box active */
.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; /* Grigio discreto */
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: 0.2s;
    line-height: 1;
}

.btn-remove-f:hover {
    color: #ef4444; /* Diventa rosso al passaggio */
    transform: scale(1.1);
}

/* Evitiamo di mostrare la X se c'è un solo filtro (opzionale) */
#f-cont .f-row:only-child .btn-remove-f {
    display: none;
}

.sidebar h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 1.1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.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;
}
/* Container principale */
.dropdown-check-list {
  display: block;
  width: 100%;
  position: relative;
  font-family: inherit;
}

/* La "finta" select */
.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.95rem;
}

/* La freccetta a destra */
.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);
}

/* La lista che appare */
.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; /* Sopra a tutto */
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
}

/* Singola riga della lista */
.dropdown-check-list ul.items li {
  list-style: none;
  padding: 0; /* Reset */
  margin: 0;  /* Reset */
}

/* Il label che contiene checkbox e testo */
.dropdown-check-list ul.items li label {
  cursor: pointer;
  display: flex !important;    /* Forza l'allineamento orizzontale */
  align-items: center !important; 
  gap: 12px !important;        /* Spazio fisso tra check e testo */
  padding: 10px 15px !important;
  width: 100%;
  margin: 0 !important;
  transition: background 0.2s;
  white-space: nowrap;         /* Impedisce al testo di andare a capo */
  text-align: left !important;
}

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

/* Il checkbox vero e proprio */
.dropdown-check-list ul.items li input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;       /* Rimuove margini strani del browser */
  flex-shrink: 0;             /* Impedisce al checkbox di schiacciarsi */
  cursor: pointer;
}

/* Mostra la lista quando cliccata */
.dropdown-check-list.visible ul.items {
  display: block;
}