body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f8fb;
}

.navbar {
    background: linear-gradient(90deg, #1f5fa8, #1fb59b);
}

.navbar-brand {
    font-weight: 600;
    color: #fff !important;
}

.btn-primary {
    background-color: #1f5fa8;
    border: none;
}

.btn-primary:hover {
    background-color: #0f3c73;
}

.btn-accent {
    background-color: #1fb59b;
    color: #fff;
    border: none;
}

.btn-accent:hover {
    background-color: #15967f;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.form-control:focus {
    border-color: #1fb59b;
    box-shadow: 0 0 0 0.2rem rgba(31,181,155,0.25);
}

.page-title {
    color: #1f5fa8;
    font-weight: 600;
}

.footer {
    background-color: #0f3c73;
    color: #fff;
    padding: 20px 0;
    margin-top: 50px;
}

.navbar .nav-link {
    font-weight: 500;
    margin-left: 10px;
}

.navbar .nav-link:hover {
    opacity: 0.85;
}

.navbar .dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.navbar-toggler {
    border: none;
}/* ==========================================================================
   Risultati Evento
   Pagina: risultati_evento.php
   ========================================================================== */

.risultati-evento-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.risultati-evento-page .page-header {
    margin-bottom: 24px;
}

.risultati-evento-page .page-header h1 {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 700;
}

.evento-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 12px 16px;
    border: 1px solid #dcdfe3;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
}

.risultati-evento-content {
    width: 100%;
    overflow-x: auto;
}

.risultati-evento-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.risultati-evento-table th,
.risultati-evento-table td {
    padding: 12px;
    border: 1px solid #dcdfe3;
    vertical-align: top;
    text-align: left;
}

.risultati-evento-table th {
    background: #f1f3f5;
    font-weight: 700;
    white-space: nowrap;
}

.risultati-evento-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.test-id-list-cell {
    min-width: 280px;
}

.test-id-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-classifica-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.3;
}

.test-classifica-ok {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.test-classifica-ko {
    background: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.test-classifica-empty {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f1f3f5;
    color: #6c757d;
    font-size: 14px;
}

.test-id-label {
    font-weight: 600;
}

.test-classifica-status {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.azioni-cell {
    white-space: nowrap;
}

.azioni-cell .btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.azioni-cell .btn-primary {
    background: #0d6efd;
    border: 1px solid #0d6efd;
    color: #ffffff;
}

.azioni-cell .btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .risultati-evento-page {
        padding: 16px 10px;
    }

    .risultati-evento-page .page-header h1 {
        font-size: 22px;
    }

    .evento-info {
        flex-direction: column;
        gap: 8px;
    }

    .risultati-evento-table th,
    .risultati-evento-table td {
        padding: 10px;
        font-size: 13px;
    }

    .test-classifica-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .test-classifica-status {
        white-space: normal;
    }
}
/* ==========================================================================
   Classifica
   Pagina: classifica.php
   ========================================================================== */

.classifica-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.ranking-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.ranking-back-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f1f3f5;
    color: #212529;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.ranking-back-link:hover {
    background: #e9ecef;
    color: #000000;
}

/* Card generiche */

.ranking-context-card,
.ranking-path-card,
.ranking-stats-card,
.ranking-results-card {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid #dcdfe3;
    border-radius: 10px;
    background: #ffffff;
}

.ranking-context-card h2,
.ranking-path-card h2,
.ranking-stats-card h2,
.ranking-results-card h2 {
    margin: 0 0 16px 0;
    font-size: 22px;
    font-weight: 700;
}

/* Contesto gara */

.ranking-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ranking-context-item {
    padding: 12px;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    background: #f8f9fa;
}

.ranking-context-label {
    display: block;
    margin-bottom: 4px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ranking-context-item strong {
    display: block;
    color: #212529;
    font-size: 15px;
    font-weight: 700;
}

/* Caratteristiche percorso */

.ranking-path-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ranking-path-item {
    padding: 12px;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    background: #f8f9fa;
}

.ranking-path-label {
    display: block;
    margin-bottom: 4px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ranking-path-item strong {
    display: block;
    color: #212529;
    font-size: 15px;
    font-weight: 700;
}

/* Statistiche */

.ranking-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.ranking-stat-item {
    padding: 16px;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: center;
}

.ranking-stat-label {
    display: block;
    margin-bottom: 6px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ranking-stat-item strong {
    display: block;
    color: #212529;
    font-size: 26px;
    font-weight: 800;
}

.ranking-qualification-stats {
    margin-top: 12px;
}

.ranking-qualification-stats h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
}

.ranking-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-stats-table th,
.ranking-stats-table td {
    padding: 10px 12px;
    border: 1px solid #dcdfe3;
    text-align: left;
}

.ranking-stats-table th {
    background: #f1f3f5;
    font-weight: 700;
}

/* Tabella risultati */

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.ranking-table th,
.ranking-table td {
    padding: 10px 12px;
    border: 1px solid #dcdfe3;
    vertical-align: middle;
    text-align: left;
}

.ranking-table th {
    background: #f1f3f5;
    font-weight: 700;
    white-space: nowrap;
}

.ranking-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.ranking-table tbody tr:hover {
    background: #f5f7f9;
}

/* Responsive */

@media (max-width: 992px) {
    .ranking-context-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranking-path-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranking-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .classifica-page {
        padding: 16px 10px;
    }

    .ranking-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ranking-header h1 {
        font-size: 24px;
    }

    .ranking-back-link {
        text-align: center;
    }

    .ranking-context-card,
    .ranking-path-card,
    .ranking-stats-card,
    .ranking-results-card {
        padding: 14px;
    }

    .ranking-context-card h2,
    .ranking-path-card h2,
    .ranking-stats-card h2,
    .ranking-results-card h2 {
        font-size: 20px;
    }

    .ranking-context-grid,
    .ranking-path-grid,
    .ranking-stats-grid {
        grid-template-columns: 1fr;
    }

    .ranking-results-card {
        overflow-x: auto;
    }

    .ranking-table th,
    .ranking-table td,
    .ranking-stats-table th,
    .ranking-stats-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .ranking-stat-item strong {
        font-size: 22px;
    }
}