/* ======================================================
   RESET BASE
====================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background-color: #f5f7fa;
    color: #2c3e50;
}

/* ======================================================
   LAYOUT
====================================================== */
.container {
    max-width: 1450px;
    margin: auto;
    padding: 25px;
}

/* ======================================================
   HEADER
====================================================== */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 15px 25px;
    border-bottom: 8px solid #2c3e50;
}

.header-left,
.header-right {
    width: 120px;
}

.header-center {
    flex-grow: 1;
    text-align: center;
}

.logo {
    height: 55px;
}

/* ======================================================
   MENU
====================================================== */
.main-menu {
    background: #2c3e50;
    padding: 10px 20px;
}

.main-menu a {
    color: #fff;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 600;
}

.main-menu a:hover {
    color: #3498db;
}

/* ======================================================
   TITOLI
====================================================== */
h2 {
    margin-bottom: 20px;
}

h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* ======================================================
   CARD
====================================================== */
.card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* ======================================================
   BOTTONI (PULITI E COERENTI)
====================================================== */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
}

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

/* colori standard */
.btn-primary { background:#3498db; }
.btn-primary:hover { background:#2980b9; }

.btn-success { background:#2ecc71; }
.btn-success:hover { background:#27ae60; }

.btn-danger { background:#e74c3c; }
.btn-danger:hover { background:#c0392b; }

.btn-secondary { background:#5169ee; }
.btn-secondary:hover { background:#3e54d3; }

/* navigazione */
.btn-nav { background:#2c3e50; }
.btn-nav:hover { background:#1a252f; }

/* personalizzati */
.btn.btn-raw {
    background: #3498db !important;
    color: #fff !important;
    border: 1px solid #2980b9;
}

.btn.btn-raw:hover {
    background: #2980b9 !important;
}

.btn-home { background:#2c3e50; }
.btn-home:hover { background:#1a252f; }

/* dimensioni */
.btn-small {
    font-size: 12px;
    padding: 6px 10px;
}

.btn-large {
    font-size: 16px;
    padding: 12px 20px;
}

/* ======================================================
   FORM
====================================================== */
input, select {
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

input:focus, select:focus {
    border-color: #3498db;
    outline: none;
}

.form-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ======================================================
   TABELLE
====================================================== */
.table {
    width:100%;
    border-collapse:collapse;
    font-size:14px;
    background:#fff;
}

.table thead {
    background:#2c3e50;
    color:#fff;
}

.table th {

    padding:12px 10px;

    text-align:left;

    vertical-align:middle;

    font-size:14px;

    font-weight:700;

    color:#fff;
}

.table td {

    padding:10px 9px;

    vertical-align:middle;

    border-bottom:1px solid #ddd;

    color:#2c3e50;

    font-size:14px;

    font-weight:500;
}

.table tbody tr:nth-child(even){

    background:#f8fafc;
}

.table tbody tr:hover {

    background:#eef3f7;
}

.col-small {
    width:60px;
    text-align:center;
}

.col-actions {
    text-align:center;
}

/* ======================================================
   RIGHE COLORATE
====================================================== */
.tr-ok { border-left: 4px solid #2ecc71; }
.tr-warning { border-left: 4px solid #f39c12; }
.tr-error { border-left: 4px solid #e74c3c; }
.tr-info { border-left: 4px solid #3498db; }

/* ======================================================
   GAME LABEL
====================================================== */

.game-label{

    font-weight:700;

}

.gl-annullata{

    color:#e74c3c !important;

    font-weight:700;

}

.gl-rinviata{

    color:#f39c12 !important;

    font-weight:700;

}

.gl-archiviata{

    color:#4f6fa8 !important;

    font-weight:700;

    text-decoration:line-through;

    text-decoration-thickness:2px;

}

.gl-abbinata{

    color:#8e44ad !important;

    font-weight:700;

}

.gl-arrivata{

    color:#27ae60 !important;

    font-weight:700;

}

/* ======================================================
   BADGE ARRIVATA
====================================================== */

.badge {

    display:inline-block;

    min-width:40px;

    padding:4px 8px;

    border-radius:12px;

    text-align:center;

    font-size:12px;

    font-weight:700;

    color:#fff;

    text-decoration:none;
}

.b-green{

    background:#27ae60;

}

.b-gray{

    background:#95a5a6;

}

/* ======================================================
   ALERT
====================================================== */
.alert-ok {
    background:#d4edda;
    padding:10px;
    border-radius:6px;
}

.alert-ko {
    background:#f8d7da;
    padding:10px;
    border-radius:6px;
    font-weight:bold;
}

/* ======================================================
   FOOTER
====================================================== */
.footer {
    text-align:center;
    padding:12px;
    font-size:12px;
    color:#fff;
    background:#2c3e50;
    margin-top:30px;
}

/* ======================================================
   VARIE
====================================================== */


.riga-focus {
    background-color: #fff3cd !important;
}

.tr-annullata { background-color: #fdecea; }
.tr-rinviata { background-color: #fff6e5; }
.tr-archiviata { background-color: #eefafa; }
.tr-abbinata { background-color: #f4ecf7; }
.tr-arrivata { background-color: #eafaf1; }

.btn.btn-small.btn-raw {
    background-color: #3498db !important;
    color: #fff !important;
    border: 1px solid #2980b9;
}
.btn.btn-small.btn-raw:hover {
    background-color: #2980b9 !important;
}

/* ======================================================
   RIEPILOGO SERIE CLASSIFICATORE
====================================================== */

.serie-box {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0 25px 0;
}

.serie-item {
    background: #ffffff;
    border: 1px solid #dfe6ec;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 170px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    transition: 0.2s;
}

.serie-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}

.serie-nome {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.serie-tot {
    font-size: 24px;
    font-weight: bold;
    color: #2980b9;
}
/* ======================================================
   MATRIX STORICO CNC
====================================================== */

.matrix-info{

    max-width:920px;

    margin:
        0 auto 18px auto;

    background:#f8fafc;

    border:1px solid #dbe4ee;

    border-radius:12px;

    padding:12px 18px;

    color:#4b5563;

    font-size:13px;

    line-height:1.5;

    text-align:center;

    box-shadow:0 2px 6px rgba(0,0,0,.03);
}

.page-title{

    text-align:center;

    margin-bottom:14px;

    color:#2c3e50;
}

/* ======================================================
   TABLE MATRIX
====================================================== */

.table-wrap{

    overflow-x:auto;

    overflow-y:auto;

    max-height:520px;

    margin-bottom:22px;

    border-radius:12px;

    box-shadow:0 2px 10px rgba(0,0,0,.05);
}

.table-wrap table{

    width:100%;

    min-width:950px;

    border-collapse:collapse;

    background:#fff;
}

.table-wrap th,
.table-wrap td{

    padding:8px 10px;

    border:1px solid #dcdcdc;

    text-align:center;

    font-size:13px;
}

.table-wrap th{

    color:#fff;

    position:sticky;

    top:0;

    z-index:5;
}

/* ======================================================
   HEADERS
====================================================== */

.head-default{
    background:#2c3e50;
}

.head-baseball{
    background:#2c5aa0;
}

.head-softball{
    background:#d97b00;
}

.head-ciechi{
    background:#2e8b57;
}

/* ======================================================
   TOTALI
====================================================== */

.total-row{

    background:#eef2f7;

    font-weight:bold;
}

.total-col{

    background:#f8f9fa;

    font-weight:bold;
}

/* ======================================================
   CELLE VUOTE
====================================================== */

.empty{
    color:#bbb;
}

/* ======================================================
   LEGENDA
====================================================== */

.legend-box{

    margin-top:20px;

    margin-bottom:30px;
}

.legend-title{

    font-size:20px;

    font-weight:bold;

    margin-bottom:18px;

    color:#2c3e50;
}

.legend-grid{

    display:grid;

    grid-template-columns:
        repeat(auto-fit,minmax(220px,1fr));

    gap:12px;
}

.legend-card{

    display:flex;

    align-items:center;

    gap:12px;

    background:#fff;

    border:1px solid #dfe6ee;

    border-radius:10px;

    padding:12px;

    transition:.2s;

    box-shadow:0 2px 5px rgba(0,0,0,.05);
}

.legend-card:hover{

    transform:translateY(-2px);

    box-shadow:0 4px 10px rgba(0,0,0,.10);
}

.legend-baseball{
    border-left:5px solid #2c5aa0;
}

.legend-softball{
    border-left:5px solid #d97b00;
}

.legend-ciechi{
    border-left:5px solid #2e8b57;
}

.legend-default{
    border-left:5px solid #2c3e50;
}

.legend-icon{

    font-size:24px;

    min-width:34px;

    text-align:center;
}

.legend-code{

    font-size:18px;

    font-weight:bold;

    color:#2c3e50;
}

.legend-name{

    font-size:12px;

    color:#666;

    margin-top:2px;
}

/* ======================================================
   MATRIX MOBILE
====================================================== */

@media(max-width:768px){

    .table-wrap th,
    .table-wrap td{

        padding:6px 8px;

        font-size:11px;
    }

    .legend-grid{

        grid-template-columns:1fr;
    }

    .matrix-info{

        font-size:12px;

        padding:10px 12px;
    }
}
/* ======================================================
   SCROLL REPORT AUDIT
====================================================== */

.report-scroll {

    max-height: 550px;
    overflow-y: auto;
    border: 1px solid #dcdcdc;
    border-radius: 6px;

}

.report-scroll thead th {

    position: sticky;
    top: 0;
    background: #34495e;
    color: #fff;
    z-index: 5;

}
/* ======================================================
   SCROLL TABELLE
====================================================== */

.table-scroll {

    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;

}

.table-scroll thead th {

    position: sticky;
    top: 0;
    background: #2c3e50;
    color: #fff;
    z-index: 5;

}
/* ======================================================
   COLONNE AZIONI - TABELLA GARE
====================================================== */

.table th:nth-child(8),
.table th:nth-child(9),
.table th:nth-child(10),
.table th:nth-child(11),
.table td:nth-child(8),
.table td:nth-child(9),
.table td:nth-child(10),
.table td:nth-child(11) {

    text-align: center;

}