/* --- Navbar moderne améliorée --- */
.modern-navbar {
    padding: 0.5rem 1.2rem;  
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    background: linear-gradient(90deg, #0d6efd, #6610f2);
}

.modern-navbar .navbar-brand .logo {
    height: 60px;
    width: auto;
    border-radius: 50%;
}

.modern-navbar .brand-text {
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
}

.modern-navbar .nav-link {
    color: #ffffff;
    font-weight: 500;
    margin-right: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.modern-navbar .nav-link:hover {
    background-color: rgba(255,255,255,0.2);
    color: #ffd966;
}

.modern-navbar .btn-light {
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.modern-navbar .btn-light:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.modern-navbar .user-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: #f1f1f1;
}

/* --- Cartes totaux et importation --- */
.card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.card h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* --- Tables et listes --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    background: transparent;
}

table th, table td {
    vertical-align: middle;
    text-align: center;
    padding: 0.6rem 0.75rem;
}

table thead th {
    background-color: #f0f0f0;
    font-weight: 600;
}

table tbody tr {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- Formulaires --- */
input, select, textarea {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.55rem;
    font-size: 0.95rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 6px rgba(13,110,253,0.25);
    outline: none;
}

/* --- Boutons --- */
.btn-primary {
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.btn-outline-secondary {
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.btn-outline-secondary:hover {
    background-color: #f0f0f0;
}

/* --- Footer --- */
footer {
    font-size: 0.85rem;
    text-align: center;
    color: #6c757d;
}

/* --- SweetAlert2 --- */
.swal2-html-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.swal2-html-container input.swal2-input,
.swal2-html-container select.swal2-input {
    width: 100% !important;
    min-height: 38px;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-size: 0.95rem;
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .modern-navbar .navbar-nav {
        text-align: center;
    }
    .modern-navbar .nav-link, .modern-navbar .btn-light {
        margin: 0.3rem 0;
    }
    table th, table td {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
}

.input-group-text {
    background-color: #e9ecef;
    font-weight: bold;
    min-width: 60px;
    justify-content: center;
}

/* Ajout css pour test mobile --*/

.members-table thead th:last-child,
.members-table tbody td:last-child {
    position: -webkit-sticky;
    position: sticky;
    right: 0;
    z-index: 5;
    background: #fff;
    box-shadow: -6px 0 12px rgba(0,0,0,0.06);
}

/* --- Tables responsives globales --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;                     /* scroll horizontal sur mobile */
    -webkit-overflow-scrolling: touch;    /* défilement fluide sur iOS */
}

.table-responsive table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    table-layout: auto;
    width: 100%;       /* s’adapte à la largeur de l’écran */
    min-width: unset;  /* désactive le min-width fixe */
}

/* Texte tronqué uniquement sur petit écran */
@media (max-width: 768px) {
    .table-responsive table th,
    .table-responsive table td {
        white-space: nowrap;       /* empêche le retour à la ligne */
        overflow: hidden;          /* cache le débordement */
        text-overflow: ellipsis;   /* tronque le texte trop long */
        vertical-align: middle;
    }
}


/* --- Tables responsives globales --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    table-layout: auto;
}

/* --- Desktop : tableau classique --- */
.table-responsive table th,
.table-responsive table td {
    vertical-align: middle;
    text-align: center;
    padding: 0.6rem 0.75rem;
}

/* --- Mobile : cartes --- */
@media (max-width: 768px) {

    .table-responsive table thead {
        display: none; /* cacher les en-têtes */
    }

    .table-responsive table,
    .table-responsive table tbody,
    .table-responsive table tr,
    .table-responsive table td {
        display: block;
        width: 100%;
    }

    .table-responsive table tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.6rem;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

    .table-responsive table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-left: 50%;
        position: relative;
        font-size: 0.9rem;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .table-responsive table td:last-child {
        border-bottom: none;
    }

    /* Labels à gauche */
    .table-responsive table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 0.75rem;
        font-weight: bold;
        text-align: left;
        color: #495057;
    }

    /* --- Actions --- */
    .table-responsive td.text-end {
        display: flex;
        flex-wrap: wrap;          /* permet de passer à la ligne si trop de boutons */
        gap: 0.25rem;             /* espace entre boutons */
        justify-content: flex-end; /* alignement à droite */
        padding-left: 50%;        /* conserve l’espace pour label */
    }

    .table-responsive td.text-end > form {
        display: inline-block;    /* ne casse pas la ligne */
        margin: 0;
    }

    .table-responsive td.text-end button {
        white-space: nowrap;      /* texte ne se casse pas */
    }
}


/* Style de la barre de scroll (optionnel, plus joli) */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.hidden-content {
    display: block;
}

.map-tooltip {
    background-color: white;
    color: black;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    font-size: 14px;
}

/* Notifications flottantes */
/* --- Toast simple et universel --- */
.toast-custom {
    background-color: #0d6efd; /* bleu Bootstrap */
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    font-size: 1rem;

    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: calc(env(safe-area-inset-top, 0px) + 20px); /* prend en compte l’encoche iPhone */
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(90vw, 400px); /* max 400px, mais flexible sur mobile */
}

/* Corps */
.toast-custom .toast-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Icône */
.toast-custom .toast-body i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Bouton X */
.toast-custom .btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #fff;
    cursor: pointer;
    margin-left: 1rem;
}

.toast-custom .btn-close:hover {
    color: #ffdddd;
}

/* Bouton X universel */
.toast-custom .btn-close {
    position: relative;
    width: 1.2rem;
    height: 1.2rem;
    margin-left: 1rem;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

/* On remplace le SVG Bootstrap par notre propre ✕ */
.toast-custom .btn-close::before {
    content: "✕";
    font-size: 1.2rem;
    color: #fff;
    display: block;
    line-height: 1.2rem;
    text-align: center;
}

.toast-custom .btn-close:hover::before {
    color: #ffdddd;
}
