:root {
    --ipr-primary: #1F4E79;
    --ipr-secondary: #2E75B6;
    --ipr-light: #D6E4F0;
}

.bg-ipr { background-color: var(--ipr-primary) !important; }
.text-ipr { color: var(--ipr-primary) !important; }
.btn-ipr {
    background-color: var(--ipr-primary);
    color: white;
    border-color: var(--ipr-primary);
}
.btn-ipr:hover {
    background-color: var(--ipr-secondary);
    border-color: var(--ipr-secondary);
    color: white;
}

.navbar.bg-ipr { background-color: var(--ipr-primary) !important; }

body { background-color: #f8f9fa; }
.container, .container-fluid { padding-top: 0.5rem; padding-bottom: 2rem; }

.table th { white-space: nowrap; }
.sticky-top { z-index: 1; }

.card { border: 1px solid #dee2e6; }
.card-header.bg-ipr { border-bottom: none; }

.badge { font-size: 0.75em; }

/* Points désactivés — visibles uniquement pour ADMIN */
.ligne-desactivee {
    background-color: #ffe5e5 !important;
    color: #888;
}
.ligne-desactivee a {
    color: #999;
}

/* Points désactivés — visibles uniquement pour ADMIN */
.ligne-desactivee {
    background-color: #ffe5e5 !important;
    color: #888;
}
.ligne-desactivee a {
    color: #999;
}

/* ── Double barre de défilement horizontal (recherche) ────────────────────── */
/* ── Wrapper tableau de recherche ─────────────────────────────────────────── */
/* Barre horizontale supérieure synchronisée */
.table-scrollbar-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 18px;
    margin-bottom: 2px;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    font-size: 0;
    line-height: 0;
    color: transparent;
}.table-scrollbar-top::-webkit-scrollbar { height: 6px; }
.table-scrollbar-top::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.table-scrollbar-top::-webkit-scrollbar-track { background: #f1f1f1; }
.table-scrollbar-top::-webkit-scrollbar-thumb { background: #adb5bd; border-radius: 3px; }

.table-scrollbar-top-inner {
    height: 1px;
}

.resultats-table-wrapper {
    height: 60vh;
    min-height: 500px;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #dee2e6;
    width: 100%;
    position: relative;
    padding-bottom: 24px;
    scrollbar-gutter: stable;
}

.resultats-table-wrapper table {
    width: max-content;
    min-width: unset;
    table-layout: auto;
    margin-bottom: 24px;
    white-space: nowrap;
}

.resultats-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #212529;
    color: #fff;
}

/* Largeurs minimales des colonnes */
.table-recherche th,
.table-recherche td           { min-width:  90px; }
.table-recherche .col-id      { min-width:  50px; }
.table-recherche .col-nom     { min-width: 160px; }
.table-recherche .col-date    { min-width: 110px; }
.table-recherche .col-coord   { min-width: 110px; }
.table-recherche .col-bk      { min-width:  70px; }
.table-recherche .col-existe  { min-width:  80px; }

/* Lignes désactivées (ADMIN uniquement) */
.ligne-desactivee > td {
    background-color: #ffe5e5 !important;
    color: #777 !important;
}

/* ── Tableau historique ────────────────────────────────────────────────────── */
.historique-table-wrapper {
    height: 65vh;
    min-height: 500px;
    max-height: 75vh;
    overflow: auto;
    border: 1px solid #dee2e6;
    width: 100%;
    position: relative;
    padding-bottom: 24px;
    scrollbar-gutter: stable;
}
.historique-table-wrapper table {
    min-width: 1800px;
    width: max-content;
    margin-bottom: 24px;
    white-space: nowrap;
}
.historique-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #212529;
    color: #fff;
}
.table-historique th,
.table-historique td          { white-space: nowrap; min-width: 120px; }
.table-historique td.col-desc,
.table-historique td.col-val  { white-space: normal; min-width: 250px; max-width: 450px; }

/* ── Barre horizontale supérieure — Historique ─────────────────────────────── */
.historique-scrollbar-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 18px;
    margin-bottom: 2px;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}
.historique-scrollbar-top-inner {
    height: 1px;
}

/* ── Tom Select : intégration Bootstrap ──────────────────────────────────── */
.ts-wrapper.form-control, .ts-wrapper.form-select {
    padding: 0;
}
.ts-control {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-height: calc(1.5em + 0.75rem + 2px);
}
.ts-dropdown {
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border-color: #dee2e6;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.1);
}
.ts-dropdown .option:hover, .ts-dropdown .option.active {
    background-color: #0d6efd;
    color: #fff;
}
