/* CSS Document*/ 

body{
  background-image:url('../img/sfondo_pattern.gif');
  background-repeat: repeat;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: "Ubuntu", Helvetica, Arial, sans-serif!important;
}

.fa-ul li{
font-size: 8px;
}

.nav .nav-tabs .col-md-2 .col-sm-1 .col-xs-1{
  background-color: #ddd;
}

.panel-body{
  border-color: #555;
}

.margine-dx{
  margin-right: 15px;
}

.margine_sopra{
  margin-top: 15px;
}

.margine_sotto{
  margin-bottom: 20px;
}

.gia_attivato{
  color: #5bc0de;
 }
 
 .attivabile{
 color: #82abfa;
 }
 
 .attivato_ora{
  color: #5cb85c;
 }
 
 .non_attivabile{
    color: #999999;
 }
 .colore_base_menu{
     border: solid 1px #c0d14d;
 }

/* custom inclusion of right, left and below tabs */

.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
  border-bottom: 0;
}

.tab-content > .tab-pane,
.pill-content > .pill-pane {
  display: none;
}

.tab-content > .active,
.pill-content > .active {
  display: block;
}

.tabs-below > .nav-tabs {
  border-top: 1px solid #ddd;
}

.tabs-below > .nav-tabs > li {
  margin-top: -1px;
  margin-bottom: 0;
}

.tabs-below > .nav-tabs > li > a {
  -webkit-border-radius: 0 0 4px 4px;
     -moz-border-radius: 0 0 4px 4px;
          border-radius: 0 0 4px 4px;
}

.tabs-below > .nav-tabs > li > a:hover,
.tabs-below > .nav-tabs > li > a:focus {
  border-top-color: #ddd;
  border-bottom-color: transparent;
}

.tabs-below > .nav-tabs > .active > a,
.tabs-below > .nav-tabs > .active > a:hover,
.tabs-below > .nav-tabs > .active > a:focus {
  border-color: transparent #ddd #ddd #ddd;
}

.tabs-left > .nav-tabs > li,
.tabs-right > .nav-tabs > li {
  float: none;
}

.tabs-left > .nav-tabs > li > a,
.tabs-right > .nav-tabs > li > a {
  min-width: 74px;
  margin-right: 0;
  margin-bottom: 3px;
}

.tabs-left > .nav-tabs {
  float: left;
  padding-right: 19px;
  /* border-right: 1px solid #ddd; */
}

.tabs-left > .nav-tabs > li > a {
  margin-right: -1px;
  -webkit-border-radius: 4px 0 0 4px;
     -moz-border-radius: 4px 0 0 4px;
          border-radius: 4px 0 0 4px;
}

.tabs-left > .nav-tabs > li > a:hover,
.tabs-left > .nav-tabs > li > a:focus {
  border-color: #eeeeee #dddddd #eeeeee #eeeeee;
}

.tabs-left > .nav-tabs .active > a,
.tabs-left > .nav-tabs .active > a:hover,
.tabs-left > .nav-tabs .active > a:focus {
  border-color: #ddd transparent #ddd #ddd;
  *border-right-color: #ffffff;
}

.tabs-right > .nav-tabs {
  float: right;
  margin-left: 19px;
  border-left: 1px solid #ddd;
}

.tabs-right > .nav-tabs > li > a {
  margin-left: -1px;
  -webkit-border-radius: 0 4px 4px 0;
     -moz-border-radius: 0 4px 4px 0;
          border-radius: 0 4px 4px 0;
}

.tabs-right > .nav-tabs > li > a:hover,
.tabs-right > .nav-tabs > li > a:focus {
  border-color: #eeeeee #eeeeee #eeeeee #dddddd;
}

.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover,
.tabs-right > .nav-tabs .active > a:focus {
  border-color: #ddd #ddd #ddd transparent;
  *border-left-color: #ffffff;
}

.marginTop15{
    margin-top: 15px!important;
}

.navbar-desktop {
    background-color: #fff;
    border-bottom: 2px solid #c0d14d;
    margin-bottom: 0;
    padding: 10px 0;
}

.navbar-desktop > li {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}

/* ===== Logo ===== */
.navbar-logo {
    padding-right: 10px;
}

/* ===== Lingue ===== */
.navbar-lang .btn-lang {
    background-color: #fff;
    border: 1px solid #c0d14d;
    padding: 4px 6px;
    margin-top: 5px;
    transition: all 0.2s ease;
}
.navbar-lang .btn-lang:hover {
    background-color: #c0d14d;
}
.navbar-lang img {
    height: 18px;
}

/* ===== Voci di menu ===== */
.colore_base_menu {
    display: inline-block;
    border: 1px solid #c0d14d;
    border-radius: 4px;
    color: #c0d14d !important;
    font-weight: bold;
    padding: 10px 18px;
    background-color: #fff;
    transition: all 0.25s ease;
    text-decoration: none !important;
}

.colore_base_menu:hover,
.navbar-desktop > li.active > a.colore_base_menu {
    background-color: #c0d14d !important;
    color: #fff !important;
    border-color: #c0d14d;
}

.navbar-desktop i {
    vertical-align: middle;
    margin-right: 6px;
}

/* Countdown */
.navbar-countdown {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    padding-top: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .navbar-desktop {
        display: none;
    }
}

.navbarColor {
    background-color: #fff;
    border-bottom: 2px solid #c0d14d;
    border-radius: 0;
    margin-bottom: 0;
    padding: 8px 0;
}

/* Layout flessibile */
.navbar-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 20px;
}

/* Sezioni */
.nav-section {
    display: flex;
    align-items: center;
}

/* Logo */
.nav-logo img {
    height: 45px;
    margin-left: 10px;
}

/* Lingue */
.btn-lang {
    background: #fff;
    border: 1px solid #c0d14d;
    padding: 3px 5px;
    margin: 0 3px;
    transition: 0.2s;
}
.btn-lang:hover {
    background: #c0d14d;
}
.btn-lang img {
    height: 18px;
}

/* Menu */
.nav-menu ul {
    margin: 0;
}
.nav-menu li {
    display: inline-block;
    margin: 0 3px;
}
.nav-menu a.colore_base_menu {
    border: 1px solid #c0d14d;
    border-radius: 4px;
    color: #c0d14d !important;
    background-color: #fff;
    font-weight: bold;
    padding: 8px 15px;
    transition: 0.2s;
}
.nav-menu a.colore_base_menu:hover,
.nav-menu li.active a {
    background-color: #c0d14d !important;
    color: #fff !important;
}

/* Countdown */
.nav-timer countdown {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    min-width: 90px;
    text-align: center;
}

/* Logout */
.nav-logout a {
    border: 1px solid #c0d14d;
    border-radius: 4px;
    color: #c0d14d !important;
    background-color: #fff;
    font-weight: bold;
    padding: 8px 15px;
    transition: 0.2s;
}
.nav-logout a:hover {
    background-color: #c0d14d !important;
    color: #fff !important;
}

/* Responsive fix */
@media (max-width: 991px) {
    .navbar-flex {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-menu ul {
        text-align: center;
    }
    .nav-section {
        margin: 5px 0;
    }
}

/* ======== MOBILE COMPACT MODE ======== */
@media (max-width: 767px) {
    .navbar-flex {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    /* Logo */
    .nav-logo img {
        height: 38px;
        margin-bottom: 2px;
    }

    /* Lingue */
    .nav-lang {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-bottom: 6px;
    }

    .btn-lang {
        padding: 2px 4px;
        border-width: 1px;
    }

    /* Menu più compatto (2 righe max) */
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        margin: 0 auto 4px;
    }

    .nav-menu ul {
        padding: 0;
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-menu li {
        margin: 2px;
    }

    .nav-menu a.colore_base_menu {
        font-size: 12px;
        padding: 5px 9px;
        line-height: 1.2;
    }

    /* Countdown */
    .nav-timer countdown {
        font-size: 16px;
        font-weight: bold;
        color: red !important;
        margin: 2px 0;
    }

    /* Logout */
    .nav-logout {
        margin-top: 2px;
    }

    .nav-logout a {
        padding: 5px 12px;
        font-size: 12px;
        line-height: 1.2;
    }
}

/* Tabs layout normale */
.tabs-left > .nav-tabs {
    float: left;
    width: 22%;
}

@media (max-width: 767px) {
    .tabs-left > .nav-tabs {
        float: none;
        width: 100%;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        border-bottom: 2px solid #c0d14d;
    }

    .tabs-left > .nav-tabs > li {
        float: none;
        display: inline-block;
    }

    .tabs-left > .nav-tabs > li > a {
        border: 1px solid #c0d14d;
        color: #c0d14d;
        background: #fff;
        border-radius: 4px;
        margin: 3px;
        font-size: 13px;
        padding: 6px 10px;
    }

    .tabs-left > .nav-tabs > li.active > a {
        background: #c0d14d;
        color: #fff;
    }

    .tab-content {
        width: 100% !important;
        padding-top: 10px;
    }
}
/* Contenitore grafici responsive */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    text-align: center;
}

/* Canvas grafici responsive */
.chart-container canvas,
.chart-container div[chart] {
    display: block;
    max-width: 100%;
    height: auto !important;
}

@media (max-width: 767px) {
    table.table {
        overflow-x: auto;
        white-space: nowrap;
    }

    .well {
        padding: 10px;
    }

    h2, h3 {
        font-size: 16px;
        text-align: center;
    }

    /* Grafici più compatti su mobile */
    .chart-container {
        padding: 5px;
        margin-top: 10px;
    }

    .chart-container canvas {
        max-height: 250px !important;
    }
}
.risultati-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

/* Grafico responsive */
.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 10px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 400px;
}

/* Tabelle fluide */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile: impila le sezioni */
@media (max-width: 767px) {
    .risultati-section {
        flex-direction: column;
    }

    .chart-wrapper canvas {
        max-height: 250px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 15px;
        margin-top: 10px;
    }

    .table > thead > tr > th,
    .table > tbody > tr > td {
        font-size: 13px;
        padding: 6px;
    }
}

/* === Contenitore grafico === */
.chart-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 60%; /* rapporto 16:9 dinamico */
    margin: 0 auto;
    overflow: visible;
}

.chart-container canvas,
.chart-container div[chart] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}


/* Fix extra margin da Chart.js wrapper */
.chart-container > div {
    margin: 0 auto !important;
    padding: 0 !important;
}

/* Mobile fix */
@media (max-width: 767px) {
    .chart-container {
        padding: 0 5px;
    }
    .chart-container canvas {
        max-height: 250px;
    }
}

/* ====== TABS DEFAULT (DESKTOP) ====== */
.nav-tabs > li {
    float: none;
    display: block;
    width: 100%;
    margin-bottom: 5px;
}

.nav-tabs > li > a {
    display: block;
    padding: 10px 15px;
    border: 1px solid #c0d14d;
    border-radius: 4px;
    text-align: left;
    color: #a3b93c;
    font-weight: bold;
    background-color: #fff;
}

.nav-tabs > li.active > a {
    background-color: #c0d14d;
    color: white;
}

/* ====== MOBILE: card orizzontali compatte con pallini ====== */
@media (max-width: 767px) {

    /* Nasconde il titolo SOSTENIBILITÀ */
    .tabs-left > .nav-tabs > li:first-child {
        display: none !important;
    }

    /* Contenitore scrollabile orizzontale */
    .tabs-left > .nav-tabs {
        float: none;
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #c0d14d #f9f9f9;
        padding: 8px 0;
        border: none;
        background: transparent;
        gap: 8px;
    }

    /* Scrollbar estetica */
    .tabs-left > .nav-tabs::-webkit-scrollbar {
        height: 6px;
    }
    .tabs-left > .nav-tabs::-webkit-scrollbar-thumb {
        background: #c0d14d;
        border-radius: 3px;
    }

    /* Ogni card più compatta */
    .tabs-left > .nav-tabs > li {
        flex: 0 0 auto;
        min-width: 180px; /* 🔹 prima era 240px */
        max-width: 200px;
        border-radius: 8px;
    }

    .tabs-left > .nav-tabs > li > a {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
        border: 1px solid #c0d14d;
        border-radius: 8px;
        background: #fff;
        color: #a3b93c;
        padding: 10px 12px;
        font-weight: bold;
        min-height: 100px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .tabs-left > .nav-tabs > li.active > a {
        background-color: #c0d14d;
        color: #fff;
    }

    /* Lettera (A, B, C…) */
    .tabs-left > .nav-tabs .label {
        background: #c0d14d;
        color: white;
        font-size: 12px;
        min-width: 20px;
        text-align: center;
        border-radius: 3px;
        margin-bottom: 4px;
        padding: 2px 5px;
    }

    /* Titolo principale */
    .tabs-left > .nav-tabs span {
        font-size: 12px;
        font-weight: bold;
        margin-bottom: 6px;
        line-height: 1.1;
    }

    /* Pallini orizzontali */
    action-summary {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
        gap: 5px;
        width: 100%;
        margin-top: 4px;
    }

    action-summary i,
    action-summary span {
        display: inline-block !important;
        font-size: 11px !important;
        margin: 0 !important;
        line-height: 1;
    }

    /* Contenuto principale */
    .tab-content {
        width: 100%;
        float: none;
        padding-top: 15px;
    }
}

/* ====== Stile base per actionSummary ====== */
action-summary .fa-ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* ====== Mobile: pallini orizzontali ====== */
@media (max-width: 767px) {
    action-summary .fa-ul {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
        gap: 8px; /* spazio tra i pallini */
    }

    action-summary .fa-ul li {
        display: inline-block;
        margin: 0;
        padding: 0;
    }

    action-summary .fa-stack {
        font-size: 14px;
    }
}

/* ====== MOBILE: pallini orizzontali dentro le card ====== */
@media (max-width: 767px) {
    action-summary .fa-ul {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    action-summary .fa-ul li {
        display: inline-block !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    action-summary .fa-stack {
        font-size: 14px !important;
        width: auto !important;
        height: auto !important;
    }

    /* rimuove padding-left aggiunto automaticamente da .fa-ul */
    action-summary ul.fa-ul {
        padding-left: 0 !important;
    }
}
@media (max-width: 767px) {
    .summary-icons { display: flex; justify-content: center; }
}

/* === MOBILE FIX: card più compatte e scrollabili === */
@media (max-width: 767px) {
    /* lista tab (colonna sinistra) */
    .tabs-left > .nav-tabs {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        padding: 6px !important;
        border-bottom: 2px solid #c0d14d;
    }

    /* singola card */
    .tabs-left > .nav-tabs > li {
        flex: 0 0 165px !important;  /* larghezza ridotta */
        min-width: 155px !important;
        max-width: 180px !important;
        margin: 0 3px !important;
    }

    /* contenuto card */
    .tabs-left > .nav-tabs > li > a {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        background-color: #fff !important;
        border: 1px solid #c0d14d !important;
        border-radius: 8px !important;
        padding: 8px 10px !important; /* meno spazio interno */
        font-size: 12px !important;
        line-height: 1.2 !important;
        min-height: 110px !important; /* più compatta in verticale */
        text-overflow: ellipsis;
        white-space: normal;
        overflow: hidden;
    }

    /* card attiva */
    .tabs-left > .nav-tabs > li.active > a {
        background-color: #c0d14d !important;
        color: #fff !important;
    }

    /* etichetta tipo A, B, C */
    .tabs-left > .nav-tabs .label {
        font-size: 12px !important;
        padding: 2px 5px !important;
        margin-bottom: 4px !important;
    }

    /* titolo principale */
    .tabs-left > .nav-tabs span {
        font-size: 11px !important;
        font-weight: 600 !important;
        margin-bottom: 4px !important;
    }

    /* pallini orizzontali già sistemati */
    action-summary .fa-ul {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 5px !important;
    }

    action-summary .fa-ul li {
        font-size: 12px !important;
    }
}
/* === MOBILE FIX: card compatte e testo centrato verticalmente === */
@media (max-width: 767px) {
    /* contenitore delle tab */
    .tabs-left > .nav-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding: 6px 0 !important;
        border-bottom: 2px solid #c0d14d;
        scrollbar-width: thin;
        scrollbar-color: #c0d14d #f9f9f9;
    }

    /* ogni card */
    .tabs-left > .nav-tabs > li {
        flex: 0 0 150px !important;
        min-width: 150px !important;
        max-width: 170px !important;
        height: 110px !important; /* altezza ridotta */
        margin: 0 4px !important;
    }

    /* contenuto card */
    .tabs-left > .nav-tabs > li > a {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* centra verticalmente */
        align-items: center !important;
        text-align: center !important;
        height: 100% !important;
        border: 1px solid #c0d14d !important;
        border-radius: 10px !important;
        background: #fff !important;
        color: #a3b93c !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        padding: 6px 8px !important;
    }

    /* card attiva */
    .tabs-left > .nav-tabs > li.active > a {
        background: #c0d14d !important;
        color: #fff !important;
    }

    /* etichetta (A, B, C...) */
    .tabs-left > .nav-tabs .label {
        background: #c0d14d !important;
        color: #fff !important;
        font-size: 11px !important;
        border-radius: 4px !important;
        padding: 2px 5px !important;
        margin-bottom: 4px !important;
    }

    /* titolo principale */
    .tabs-left > .nav-tabs span {
        font-size: 11px !important;
        font-weight: 700 !important;
        margin-bottom: 4px !important;
    }

    /* i tre pallini in orizzontale */
    action-summary ul.fa-ul {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 4px 0 0 0 !important;
    }

    action-summary ul.fa-ul li {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    action-summary ul.fa-ul li .fa-stack {
        font-size: 14px !important;
        line-height: 1 !important;
    }

    action-summary ul.fa-ul > li::before {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .navbarColor {
        padding: 4px 0 !important; /* riduce lo spazio verticale */
        border-bottom: 1px solid #c0d14d;
    }

    .navbar-flex {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important; /* meno spazio tra elementi */
    }

    /* logo più piccolo */
    .nav-logo img {
        height: 32px !important;
        margin: 0 !important;
    }

    /* lingue più piccole */
    .btn-lang {
        padding: 1px 3px !important;
        border-width: 1px;
    }
    .btn-lang img {
        height: 14px !important;
    }

    /* menu compatto */
    .nav-menu ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-menu a.colore_base_menu {
        font-size: 11px !important;
        padding: 3px 7px !important;
        line-height: 1.1 !important;
        border-width: 1px;
    }

    /* countdown più piccolo */
    .nav-timer countdown {
        font-size: 13px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* logout compatto */
    .nav-logout a {
        font-size: 11px !important;
        padding: 3px 8px !important;
        line-height: 1.2 !important;
    }

    /* riduce margine globale */
    .nav-section {
        margin: 0 !important;
    }
}

@media (max-width: 767px) {
    .tabs-left > .nav-tabs .label {
        margin-bottom: 6px !important; /* 🔹 aumenta lo spazio sotto */
        display: inline-block !important;
    }
}

/* === RANKING TABLE FIX === */
.ranking-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 6px;
    padding: 5px;
}

/* tabella fluida */
.ranking-table table {
    width: 100% !important;
    min-width: 420px; /* per scroll orizzontale se necessario */
    margin-bottom: 0;
    border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
    padding: 8px;
    white-space: nowrap; /* evita righe spezzate */
}

/* evidenzia la riga dell'utente */
.ranking-table tr.info {
    background-color: #c0d14d !important;
    color: #fff !important;
    font-weight: bold;
}

/* === MOBILE FIX: Tabella ranking a piena larghezza === */
@media (max-width: 767px) {
    /* Contenitore della tabella */
    .ranking-table {
        width: 100vw !important;              /* tutta la larghezza dello schermo */
        margin-left: calc(-50vw + 50%) !important;  /* elimina padding del parent */
        margin-right: calc(-50vw + 50%) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        background: #fff;
        padding: 0;
    }

    /* Tabella */
    .ranking-table table {
        width: 100% !important;
        min-width: 420px;                     /* scroll orizzontale se serve */
        margin: 0;
        border-collapse: collapse;
    }

    /* Celle */
    .ranking-table th,
    .ranking-table td {
        text-align: center;
        vertical-align: middle;
        font-size: 13px;
        padding: 6px 4px;
        white-space: nowrap;
    }

    /* Riga dell'utente */
    .ranking-table tr.info {
        background-color: #c0d14d !important;
        color: #fff !important;
        font-weight: bold;
    }

    /* Titoli più compatti */
    .ranking-table th {
        font-size: 12px;
        background: #f7f7f7;
    }
}

/* === FIX DEFINITIVO: Tabella ranking full width su mobile === */
@media (max-width: 767px) {
    /* Contenitore principale */
    .ranking-table {
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        border-radius: 0;
        padding: 0;
    }

    /* Tabella a tutta larghezza */
    .ranking-table table {
        display: table;
        table-layout: fixed !important;   /* forza le colonne a usare tutta la larghezza */
        width: 100% !important;
        min-width: 100% !important;
        border-collapse: collapse !important;
        margin: 0;
    }

    /* Righe */
    .ranking-table tr {
        width: 100% !important;
        display: table-row;
    }

    /* Celle */
    .ranking-table th,
    .ranking-table td {
        width: 33.33% !important;         /* divide equamente le 3 colonne */
        text-align: center !important;
        vertical-align: middle !important;
        font-size: 13px !important;
        padding: 8px 4px !important;
        white-space: normal !important;   /* consente andare a capo su mobile */
        word-wrap: break-word !important;
    }

    /* Intestazioni */
    .ranking-table th {
        background-color: #f9f9f9 !important;
        font-weight: bold;
    }

    /* Riga evidenziata */
    .ranking-table tr.info {
        background-color: #c0d14d !important;
        color: #fff !important;
        font-weight: bold;
    }
}

.chart-container {
    width: 100%;
    max-width: 600px;
    height: 400px;       /* fissa altezza per il calcolo corretto */
    margin: 0 auto;
    overflow: hidden;    /* taglia eventuali overflow */
}

#isto {
    width: 100%;
    height: 100%;
}

/* Contenitore jqPlot */
.chart-container {
    display: block !important;
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 20px auto;
    text-align: center;
    overflow: visible;
}

/* jqPlot deve gestire il layout da solo */
.jqplot-target {
    display: block !important;
    position: relative !important;
    margin: 0 auto !important;
    clear: both !important;
}

/* Evita che Bootstrap flexbox distorca gli assi */
.row .chart-container {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Centra la legenda */
.jqplot-table-legend {
    margin: 0 auto !important;
    float: none !important;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto;
    padding: 10px;
}

canvas#isto {
    display: block;
    width: 100% !important;
    height: 100% !important;
    background-color: #fff;
    border-radius: 6px;
}


