.header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                background-color: #6d0d18;
                color: white;
                width: 80%;
                margin: 0 auto;
                font-family: 'Rubik', sans-serif;
                padding: 15px 20px;
                border-bottom: 3px solid #800020; /* granata */
            }
            .header img {
                height: 60px;
                margin-right: 18px;
            }
            .header-left {
                display: flex;
                align-items: center;
                gap: 15px;
                margin-left: 5px;
            }
            .header-accent {
                height: 6px;
                background: linear-gradient(to right, #800020, #a00028);
            }
            .logout {
                background: white;
                color: #6d0d18;
                padding: 8px 16px;
                border-radius: 10px;
                text-decoration: none;
                font-weight: 500;
                transition: 0.3s;
                margin-right: 5px;
            }
            .logout:hover {
                background: #800020; /* granata */
                color: white;
            }
            .top-bar {
                display: flex;
                justify-content: flex-end;
                margin-bottom: 20px;
            }
            .form-row {
                display: flex;
                gap: 20px;
                margin-bottom: 18px;
                flex-wrap: wrap;
            }
            .field {
                display: flex;
                flex-direction: column;
                flex: 1;
                min-width: 180px;
            }
            .field label {
                font-size: 14px;
                margin-bottom: 8px;
                font-weight: 400;
                color: #444;
            }
            .field input,
            .field select {
                padding: 8px 10px;
                border-radius: 6px;
                border: 1px solid #ddd;
                font-family: 'Rubik', sans-serif;
            }
            .container {
                width: 95%;
                max-width: 1200px;
                margin: 5px auto;
                margin-bottom: 10px;
                padding: 15px 60px 20px 60px;
                font-family: 'Rubik', sans-serif;
            }
            h2{
                margin-top: 50px;
                font-weight: 500;
                font-size: 25px;
                font-family: 'Rubik', sans-serif;
            }
            h3 {
                margin-top: 0;      
                margin-bottom: 15px; 
                font-weight: 500;
                font-size: 20px;
            }
            h4{
                font-style: italic;
            }
            button {
                background-color: #6d0d18;   /* granata */
                color: white;
                padding: 10px 22px;
                border: 2px solid #6d0d18;
                border-radius: 25px;        /* bordi arrotondati */
                font-family: 'Rubik', sans-serif;
                font-size: 14px;
                font-weight: 500;
                cursor: pointer;
                transition: all 0.25s ease;
            }
            button:hover {
                background-color: white;
                color: #6d0d18;
            }
            button:active {
                transform: scale(0.97);
                box-shadow: 0 3px 8px rgba(0,0,0,0.1);
            }
            .btn-ritorna {
                display: inline-block;
                margin-top: 25px;
                padding: 10px 20px;
                background-color: #6d0d18;   /* granata */
                color: white;
                text-decoration: none;
                border-radius: 8px;
                font-weight: 500;
                transition: all 0.2s ease;
            }
            .btn-ritorna:hover {
                background-color: white;
                color: #6d0d18;
                border: 1px solid #6d0d18;
            }
            table {
                width: 100%;
                border-collapse: collapse;
                margin-top: 25px;
                font-size: 15px;
            }
            table th {
                background-color: #6d0d18;
                color: white;
                text-align: left;
                padding: 8px 12px;   /* ↓ meno alte */
                font-weight: 500;
                letter-spacing: 0.4px;
                font-size: 12px;
                font-style: italic;
            }
            table td {
                padding: 8px 12px;    /* ↓ più compatte */
                color: #6d0d18;
                background-color: white;
            }
            /* riga separazione elegante */
            table tr:not(:last-child) td {
                border-bottom: 1px solid #f0f0f0;
            }
            /* effetto hover leggero */
            table tr:hover td {
                background-color: #f9f9f9;
                transition: 0.2s ease;
            }
            table a {
                color: #6d0d18;
                text-decoration: none;
                font-weight: 600;
            }
            table a:hover {
                text-decoration: underline;
            }
            /* Intestazioni date centrate */
            table th:nth-child(4),
            table th:nth-child(5) {
                text-align: center;
            }
            table td:nth-child(4),
            table td:nth-child(5) {
                text-align: center;
                font-variant-numeric: tabular-nums;
            }
            /* Righe alternate */
            table tr:nth-child(even) td {
                background-color: #f7f7f7;  /* grigio molto chiaro */
            }
            table tr:nth-child(odd) td {
                background-color: white;
            }
            .scheda-card {
                background: white;
                padding: 35px 40px;
                border-radius: 12px;
                border-left: 2px solid #555;     /* sinistro più marcato */
                border-bottom: 2px solid #555;   /* basso più marcato */
                border-top: 1px solid #e5e5e5;   /* leggero sopra */
                border-right: 1px solid #e5e5e5; /* leggero a destra */
                box-shadow: 0 3px 8px rgba(0,0,0,0.04);
                margin-top: 30px;
            }
            .scheda-header {
                border-bottom: 2px solid #f0f0f0;
                padding-bottom: 15px;
                margin-bottom: 25px;
            }
            .scheda-header h2 {
                margin: 0;
                color: #6d0d18;
                font-weight: 600;
            }
            .scheda-sub {
                color: #777;
                font-size: 14px;
                margin-top: 5px;
            }
            .scheda-section {
                margin-bottom: 25px;
            }
            .scheda-section h4 {
                margin-bottom: 15px;
                color: #6d0d18;
                font-weight: 500;
                font-size: 16px;
            }
            .scheda-grid {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 12px 40px;
            }
            .scheda-grid p {
                margin: 4px 0;
                font-size: 16px;
                font-weight: bold;
            }
            .scheda-grid strong {
                font-weight: 500;
                color: #333;
                font-size: 14px;
            }
            .scheda-back {
                display: inline-block;
                margin-top: 20px;
                text-decoration: none;
                color: #6d0d18;
                font-weight: 500;
            }
            .scheda-back:hover {
                text-decoration: underline;
            }
            /* Certificato scaduto */
            td.scaduto {
                /* background-color: #ffe5e5 !important; */
                color: red;
                font-weight: 600;
            }
            /* Certificato in scadenza */
            td.in-scadenza {
                color: red;
                font-weight: 600;
            }
            /* Badge SCADUTO */
            .badge-scaduto {
                margin-left: 10px;
                padding: 3px 8px;
                /* background-color: #c62828; */
                color: red;
                font-size: 15px;
                border-radius: 12px;
                font-weight: 600;
                animation: lampeggio 1.2s infinite;
            }
            /* Badge IN SCADENZA */
            .badge-scadenza {
                margin-left: 10px;
                padding: 3px 8px;
                /* background-color: #ef6c00; */
                color: red;
                font-size: 15px;
                border-radius: 12px;
                font-weight: 600;
            }
            .filtro-form{
    display:flex;
    gap:20px;
    align-items:center;
    margin-bottom:15px;
}

.filtro-gruppo{
    display:flex;
    align-items:center;
    gap:8px;
}
            .filtro-form label {
                font-weight: 500;
                font-size: 14px;
                color: #6d0d18;
            }
            /* Animazione lampeggio elegante */
            @keyframes lampeggio {
                0% { opacity: 1; }
                50% { opacity: 0.4; }
                100% { opacity: 1; }
            }
            .btn-modifica {
                display: inline-block;
                margin-right: 10px;
                padding: 10px 20px;
                background-color: #163d75;
                color: white;
                text-decoration: none;
                border-radius: 8px;
                font-weight: 500;
                transition: all 0.2s ease;
            }
            .btn-modifica:hover {
                background-color: white;
                color: #163d75;
                border: 1px solid #163d75;
            }
            .btn-elimina {
                background: #b00020;
                color: white;
                padding: 8px 14px;
                border-radius: 8px;
                text-decoration: none;
                margin-left: 10px;
                transition: 0.3s;
            }
            .btn-elimina:hover {
                background: white;
                color: #b00020;
                border: 1px solid #b00020;
            }
            .titolo-elenco{
    display:flex;
    align-items:center;
    margin-bottom:10px;
}

.azioni-stampa{
    margin-left:auto;
}

.azioni-stampa a{
    display:inline-block;
    padding:6px 12px;
    background:#800020;
    color:white;
    text-decoration:none;
    border-radius:4px;
    font-size:13px;
    margin-left:8px;
}

.azioni-stampa a:hover{
    background:#a00030;
}

@media print {
    @page {
        size: A4 landscape;
    }
    .pagina{
    transform: rotate(90deg);
    transform-origin: left top;
    position:absolute;
    top:0;
    left:0;
    width:100vh;
}

    body {
        margin: 1cm;
    }
}
