/* mod_carto_stats.css — Styles du module Statistiques carto (sliders, toggles).
   Convention CSS : voir CLAUDE.md, "## CSS". */

/* réduction espace entre toggle et slider */
.filter-slider-container {
    margin-top: -30px;
    /* réduit l'espace entre le toggle et le slider */
    margin-left: 0px;
    /* indenté légèrement pour aligner avec le switch */
}

/* optionnel: réduire encore la hauteur du slider */
.filter-slider-container .irs {
    margin-top: -6px;
    margin-bottom: -4px;
}

/* barre de fond du slider */
.filter-slider-container .irs-bar,
.filter-slider-container .irs-line {
    height: 6px;
    /* réduit épaisseur de la barre */
}

/* aligner le label verticalement avec le toggle */
.filter-item .switch+span {
    line-height: 1.2;
    /* ajuste la hauteur du texte */
    font-size: 0.9rem;
    margin-left: 4px;
}

/* labels min/max plus petits */
.filter-slider-container .irs-min,
.filter-slider-container .irs-max {
    font-size: 0.7rem;
}

.filter-item .switch {
    transform: scale(0.75);
    /* réduit la taille du toggle à 75% */
    transform-origin: left center;
    /* garde alignement gauche */
    margin-bottom: 0px;
}

/* slider plus compact */
.filter-slider-container .irs {
    margin-top: -6px;
    margin-bottom: -4px;
}


/* module stats */
.carto-stats-panel {
    padding: 15px 15px;
    position: relative;
    height: calc(100vh - var(--headerHeight)) !important;
    overflow-y: scroll;
}

.carto-stats-panel>.row {
    margin: 0
}

/* Carte : regroupe un titre et son contenu, séparée des autres blocs */
.carto-stats-card {
    margin-bottom: 20px;
}

.carto-stats-card-head {
    margin-bottom: 6px;
}

/* Sous-titre en italique (balise em) sous le titre de carte */
.carto-stats-card-head em {
    font-size: 12px;
}

/* Enveloppe du panneau à onglets graphique/tableau */
.carto-stats-tabwrap {
    position: relative;
}

/* Bascule graphique/tableau : onglets soulignés (texte + trait actif) */
.carto-stats-tabwrap .nav-pills {
    display: flex;
    gap: 24px;
    margin: 0 0 10px;
    border: none;
    border-bottom: 1px solid #dedede;
    background: transparent;
    border-radius: 0;
}

.carto-stats-tabwrap .nav-pills>li {
    margin-left: 0;
}

.carto-stats-tabwrap .nav-pills li a {
    border-radius: 0;
    color: #666;
    background: transparent;
    padding: 6px 2px 10px;
    margin-bottom: -1px;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.carto-stats-tabwrap .nav-pills li a:hover,
.carto-stats-tabwrap .nav-pills li a:focus {
    background: transparent;
    color: var(--color1);
}

.carto-stats-tabwrap .nav-pills li.active a,
.carto-stats-tabwrap .nav-pills li.active a:hover,
.carto-stats-tabwrap .nav-pills li.active a:focus {
    background: transparent;
    color: var(--color1);
    border-bottom: 2px solid var(--color1);
}

/* Espace au-dessus du graphique (le trait de séparation est porté par .nav-pills) */
.carto-stats-tabwrap .tab-content {
    /* padding-top: 14px; */
}

/* Trait de séparation sous le graphique (avant « Données de la carte ») */
.carto-stats-panel .carto-stats-card:first-child {
    border-bottom: 1px solid #c9c9c9;
    /* padding-bottom: 16px; */
    margin-bottom: 7px;
}

/* Compacte l'en-tête « Données de la carte » et la zone du bouton Télécharger
   pour laisser plus de place au graphique */
.carto-stats-card-head p {
    margin: 2px 0 0;
    line-height: 1.3;
}

.carto-stats-table .tabbable {
    min-height: 480px;
}

.carto-stats-table .dt-buttons {
    margin: 0 0 6px;
}

.carto-stats-table .dataTables_wrapper {
    margin-top: 0;
}

.carto-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
}

.carto-stats-title-row {
    padding-right: 65px;
    min-height: 31px;
}

.carto-stats-title {
    font-size: 16px !important;
    font-weight: 600;
    color: var(--color1);
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 16px;
}

.carto-stats-switch {
    flex: 0 0 auto;
}

.carto-stats-title:before {
    content: none;
}

.carto-stats-table .dataTables_wrapper>.row:first-child>div {
    width: auto;
    flex: 0 0 auto;
}

.carto-stats-title-row {
    text-align: left;
}

.carto-stats-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color1);
}

.carto-stats-table table.dataTable input.form-control {
    border: 1px solid #CCC !important;
    border-radius: 4px
}

.carto-stats-table #DataTables_Table_1,
.carto-stats-table .dataTables_wrapper .dataTables_scroll {
    border-radius: 5px 5px 0 0 !important;
    overflow: hidden
}

.carto-stats-table table.dataTable {
    border-radius: 5px 5px 0 0 !important;
    /* overflow: hidden; */
}

.carto-stats-table table.dataTable thead {
    background-color: var(--color1) !important;
    color: var(--color1-text) !important;
    font-weight: 400;
    font-size: 13px;
    border-radius: 5px 5px 0 0;
}

.carto-stats-table .datatables .dataTables_scrollBody,
.carto-stats-table .datatables .dataTable tr:last-child {
    border-radius: 0 0 7px 7px !important;
    overflow: hidden;
}

.carto-stats-table table.dataTable thead th:first-child {
    border-top-left-radius: 5px;
}

.carto-stats-table table.dataTable thead th:last-child {
    border-top-right-radius: 5px;
}

.table_indic.carto-stats-table .dt-button {
    background: var(--color2) !important;
    color: var(--color2-text) !important;
}

.table_indic.carto-stats-table caption {
    padding: 0
}