:root {
    --header-bg: #002E60;
    --table-header-bg: #1C6EA4;
    --action-button-bg: #0078D4;
    --border-color: black;
    --selected-bg: #17f517;
    --empty-yellow-bg: #FFFACD;
    --body-bg: #F0F2F5;
    --container-bg: #FFFFFF;
    --text-dark: #212121;
    --text-light: #FFFFFF;
    --tab-inactive-bg: #e0e0e0;
    --tab-active-bg: #004C8A;
}


body {
    background-color: var(--body-bg);
    color: var(--text-dark);
    margin: 0;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    font-size: 14px;
}

/* Header e Controlli */
.fixed-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--header-bg);
    padding: 10px 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    color: var(--text-light);
}
h1 {
    text-align: center;
    font-size: 1.4em;
    margin: 0 0 10px 0;
    font-weight: 600;
}
.header-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.header-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #004C8A;
    padding: 8px 12px;
    border-radius: 6px;
}
.controls-row {
    justify-content: space-around;
}
.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
}
.control-group label {
    margin: 0;
    font-weight: normal;
    white-space: nowrap;
}
/*
select, input[type="number"] {
    padding: 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.9em;
    width: auto;
    flex-grow: 1;
    max-width: 150px;
}
    */
.score-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
    gap: 5px 15px;
    font-size: 0.9em;
}
.score-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.score-line.total {
    font-weight: 700;
    font-size: 1.2em;
}
.score-line strong {
    font-size: 1.1em;
}
.ec-details {
    grid-column: 1 / -1; /* Occupa tutta la larghezza della seconda riga della griglia */
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-around;
    font-size: 0.85em;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.3);
}
.actions-row {
    justify-content: center;
}
.actions-row button {
    flex: 0 1 120px;
}

/* Tabs */
.tab-navigation { display: flex; gap: 5px; margin-bottom: 15px; }
.tab-button { padding: 10px 20px; font-size: 1em; font-weight: 600; border: none; border-radius: 5px 5px 0 0; cursor: pointer; background-color: var(--tab-inactive-bg); color: var(--text-dark); }
.tab-button.active { background-color: var(--tab-active-bg); color: var(--text-light); }
.tab-content { display: none; }
.tab-content.active { display: block; }


/* Layout Tabella */
.scrollable-content { padding: 20px; }
.table-container { width: 100%; overflow-x: auto; }
table.blueTable { width: 100%; border-collapse: collapse; }
table.blueTable th { background: var(--table-header-bg); font-size: 11px; font-weight: bold; color: var(--text-light); padding: 4px 2px; text-align: center; border: 1px solid var(--border-color); }
table.blueTable tbody td { border: 1px solid var(--border-color); padding: 0; vertical-align: middle; }

/* ---- NUOVA REGOLA PER EVIDENZIARE LE RIGHE ---- */
.logical-row-start td {
    border-top: 2px solid #333; /* Bordo superiore scuro per iniziare una riga logica */
}
/* La prima riga in assoluto non ha bisogno del bordo superiore extra */
table.blueTable tbody tr:first-child td {
    border-top: 1px solid var(--border-color);
}


/* Prima colonna */
table.blueTable tbody td:first-child { font-size: 11px; font-weight: bold; text-align: center; padding: 2px; width: 140px; vertical-align: middle; }

/* Cella cliccabile */
td.checkbox-cell { padding: 0; }
td.checkbox-cell label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 8px 2px;
    margin: 0;
    cursor: pointer;
    font-size: 9px;
    text-align: center;
    font-weight: bold;
    line-height: 1.1;
    min-height: 30px;
}


table.blueTable input[type="checkbox"] {
    display: none;
}

table.blueTable input[type="checkbox"]:checked + label {
    background-color: var(--selected-bg);
}

table.blueTable input[type="checkbox"]:disabled + label {
    background-color: #F5F5F5;
    color: #BDBDBD;
    cursor: not-allowed;
}


.empty-yellow-cell { background-color: var(--empty-yellow-bg); }
#exercise-summary { margin-top: 20px; background: var(--container-bg); padding: 15px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
#exercise-summary h3 { margin-top: 0; border-bottom: 1px solid #ccc; padding-bottom: 10px; }


/* Incolla questo in fondo a prova_griglia.css */
table.blueTable tbody tr td {
    border-bottom: 1px solid #d3d3d3; /* Linea di divisione interna molto leggera */
}

/* Linea spessa nera alla fine di ogni gruppo */
table.blueTable tbody tr:not(:has(td[rowspan])) td,
table.blueTable tbody td[rowspan] {
    border-bottom: 2.5px solid var(--border-color) !important;
}
