/* Couleurs de la charte iAssure (reprises de legacy/css/app.css) */
:root {
    --iassure-primary: #004a6c;
    --iassure-primary-dark: #00344d;
    --iassure-success: #00d37c;
    --iassure-border: #ddd;
}

body {
    background-color: #fff;
}

.container {
    padding-left: 0;
    padding-right: 0;
}

/* espace identique au-dessus et en dessous des titres de page */
.container h1 {
    margin-top: 15px;
    margin-bottom: 25px;
    font-size: 28px;
}

/* ---- En-tête de page (titre + action alignés sur la même ligne) ---- */
.page-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header-inline h1 {
    margin: 0;
}

/* ---- Formulaires : label et champ sur la même ligne, labels alignés ---- */
.form-inline-label .form-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.form-inline-label .form-group > label {
    width: 220px;
    flex: 0 0 220px;
    margin-bottom: 0;
    font-weight: normal;
}

.form-inline-label .form-group > .form-control {
    flex: 1;
}

.form-inline-label .password-field {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
}

.form-inline-label .password-field .form-control {
    flex: 1;
}

/* sous-titres de section : espace doublé au-dessus, ligne de séparation en dessous */
.form-inline-label h3 {
    font-size: 16px;
    margin-top: 40px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--iassure-border);
}

.form-inline-label button[type="submit"] {
    display: block;
    margin-top: 24px;
    margin-left: auto;
}

/* ---- Barre d'outils 3 colonnes : recherche à gauche, case à cocher au centre, action à droite ---- */
.toolbar-3col {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.toolbar-3col > div {
    flex: 1;
}

.toolbar-3col .toolbar-center {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-bottom: 0;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-3col .toolbar-right {
    display: flex;
    justify-content: flex-end;
    text-align: right;
}

.toolbar-3col .toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-3col .toolbar-left .table-filter-input {
    width: 300px;
    max-width: calc(100% - 28px);
}

.toolbar-3col .toolbar-left .table-filter-input::placeholder {
    font-size: 12px;
}

.table-filter-clear {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
}

.table-count {
    font-size: 12px;
    color: #666;
}

/* interrupteur (remplace les cases à cocher pour les filtres d'affichage) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
    margin: 0 8px 0 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 22px;
    transition: background-color .2s;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform .2s;
}

.switch input:checked + .switch-slider {
    background-color: var(--iassure-success);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}

/* variante compacte de l'interrupteur (filtre secondaire au-dessus du tableau) */
.switch-sm {
    width: 30px;
    height: 16px;
    margin-right: 6px;
}

.switch-sm .switch-slider::before {
    height: 12px;
    width: 12px;
}

.switch-sm input:checked + .switch-slider::before {
    transform: translateX(14px);
}

/* barre sous le tableau : pagination alignée à droite, comme celle du haut */
.table-footer-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-top: 10px;
}

.table-footer-pagination {
    display: flex;
    justify-content: flex-end;
}

.table-count {
    text-align: right;
}

.toolbar-right .pagination-controls,
.table-footer-pagination .pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-controls select {
    display: inline-block;
    width: auto;
    min-width: 72px;
    padding: 4px 10px;
    border: 1px solid #c9d4dc;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    color: #333;
}

.pagination-stack-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.pagination-icon {
    cursor: pointer;
    color: var(--iassure-primary);
    font-size: 15px;
}

.pagination-icon.disabled {
    cursor: not-allowed;
    color: #ccc;
}

.pagination-info {
    color: #666;
}

/* au-dessus du tableau : bascule "afficher les inactifs" à gauche, compteur à droite, même ligne */
.table-pagination-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    gap: 15px;
}

.toggle-inactifs {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
}

.table-count {
    margin-left: auto;
    text-align: right;
    flex: 0 0 auto;
}

.badge-light {
    background-color: #f1f3f5;
    color: #55606b;
    font-weight: normal;
}

.pagination-with-count {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ---- Navigation ---- */
.navbar-brand {
    font-weight: 700;
    padding-top: 12px;
    padding-bottom: 12px;
    height: auto;
}

.navbar-logo {
    height: 60px;
    width: auto;
}

.footer-logo {
    height: 32px;
    width: auto;
    vertical-align: middle;
    margin-left: 4px;
}

.navbar-inverse {
    background-color: var(--iassure-primary);
    border: none;
    min-height: 84px;
}

.navbar-inverse .navbar-nav > li > a {
    height: 50px;
    max-height: 50px;
    line-height: 50px;
    box-sizing: border-box;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 13px;
}

.navbar-inverse .navbar-nav > li > a > i {
    font-size: 12px;
}

@media (min-width: 768px) {
    .navbar-inverse .navbar-nav {
        margin-top: 34px;
    }
}

.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
    color: #fff;
}

.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
    color: #fff;
    background-color: var(--iassure-primary-dark);
}

/* onglet blanc indiquant la page actuellement affichée */
.navbar-inverse .navbar-nav > li.active > a,
.navbar-inverse .navbar-nav > li.active > a:hover,
.navbar-inverse .navbar-nav > li.active > a:focus {
    color: var(--iassure-primary);
    background-color: #fff;
    border-top: 3px solid var(--iassure-success);
    border-radius: 6px 6px 0 0;
}

/* ---- Titres et textes ---- */
.text-primary {
    color: var(--iassure-primary) !important;
}

.text-success {
    color: var(--iassure-success) !important;
}

h1, h2, h3 {
    color: var(--iassure-primary);
}

.marginPrimary {
    margin-top: 5px;
}

/* ---- Boutons ---- */
.btn-primary {
    background-color: var(--iassure-primary);
    border-color: var(--iassure-primary-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--iassure-primary-dark);
    border-color: var(--iassure-primary-dark);
}

.btn-success {
    background-color: var(--iassure-success);
    border-color: #00b56a;
}

.btn-outline-primary {
    color: var(--iassure-primary);
    background-color: #fff;
    border-color: var(--iassure-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff;
    background-color: var(--iassure-primary);
    border-color: var(--iassure-primary);
}

/* ---- Onglets (nav-tabs) : style souligné plat, sans boîte, à la iAssure ---- */
.nav-tabs {
    border-bottom: 1px solid #e2e2e2;
}

.nav-tabs > li {
    margin-bottom: -1px;
}

.nav-tabs > li > a {
    color: #8a8a8a;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .03em;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    padding: 12px 16px;
}

.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
    color: var(--iassure-primary);
    background: transparent;
    border-color: transparent transparent #cfe3ec;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--iassure-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--iassure-primary);
}

.tab-content {
    background-color: #fff;
    padding: 20px 0 0;
}

/* ---- Tableaux : contraste et bordures inspirés de l'existant ---- */
.table {
    background-color: #fff;
}

.table > thead > tr > th {
    background-color: #fff;
    color: #55606b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .02em;
    border: none;
    border-bottom: 2px solid var(--iassure-primary);
    padding-top: 12px;
    padding-bottom: 12px;
}

.table > tbody > tr > td {
    border: none;
    border-bottom: 1px solid #ececec;
    color: #333;
    vertical-align: middle;
}

.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border: none;
}

.table-bordered > thead > tr > th {
    border-bottom: 2px solid var(--iassure-primary);
}

.table-bordered > tbody > tr > td {
    border-bottom: 1px solid #ececec;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

.table-hover > tbody > tr:hover {
    background-color: #eef6f9;
}

/* lignes actives : alternance de 2 verts proches et peu vifs, indépendante des lignes inactives */
.table > tbody > tr.row-actif-impair {
    background-color: #e7f4ea;
}

.table > tbody > tr.row-actif-pair {
    background-color: #dcede1;
}

.table > tbody > tr.row-statistique-impair {
    background-color: #e7f4ea;
}

.table > tbody > tr.row-statistique-pair {
    background-color: #dcede1;
}

.table > tbody > tr.row-actif:hover,
.table > tbody > tr.row-statistique-impair:hover,
.table > tbody > tr.row-statistique-pair:hover {
    background-color: #d0e7d6;
}

/* lignes inactives : alternance de 2 gris proches, indépendante des lignes actives */
.table > tbody > tr.row-inactif-impair > td {
    background-color: #f4f5f6;
    color: #999;
}

.table > tbody > tr.row-inactif-pair > td {
    background-color: #ebedee;
    color: #999;
}

.table > tbody > tr.row-inactif:hover > td {
    background-color: #e2e4e6;
}

.icon-actif {
    color: var(--iassure-success);
    font-weight: 700;
}

.icon-inactif {
    color: #c2c8cd;
    font-weight: 700;
}

/* bouton ne contenant qu'une icône (actions de type "réinitialiser", "modifier"...) */
.btn-icon {
    background: none;
    border: none;
    padding: 0;
    color: var(--iassure-primary);
    font-size: 15px;
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--iassure-primary-dark);
}

.badge-actif, .badge-inactif {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-actif {
    color: #0a7a3d;
    background-color: #d8f3e0;
}

.badge-inactif {
    color: #7a7f85;
    background-color: #eceef0;
}

.panel-body h2 {
    margin: 0;
}

table td.text-muted, table tr.text-muted td {
    color: #999;
}

/* ---- Messages flash : bandeau plein contraste, sans arrondi ---- */
.alert {
    border: none;
    border-radius: 0;
    font-weight: 600;
}

.alert-success {
    background-color: var(--iassure-success);
    color: #fff;
}

.alert-danger {
    background-color: #e2434f;
    color: #fff;
}
