:root {
    --header-height: 64px;
    --sidebar-width: 250px;
}
header {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10; 
}

footer {
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.responsive-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: #293955;
    color: #ffffff;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background-color: #293955;
    padding: 1rem;
    border-bottom: 1px solid #1b2533;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav .nav-link {
    color: #69A7FF;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease, color 0.2s ease;
    width: 100%;
}

/* évite que le titre centré bloque les clics sur le burger */
.nav-title-center {
    pointer-events: none;
    z-index: 1;
}
/* le bouton burger passe au-dessus sans souci */
#sidebarToggle {
    position: relative;
    z-index: 2;
}

/* Ne plus surligner le lien parent */
.sidebar-nav .nav-link[data-bs-toggle="collapse"].active {
    background-color: transparent !important;
    color: #69A7FF !important;
}

/* Keep le style active sur les vrais liens de page (Détails, Site, Réservations) */
.sidebar-nav .nav-link.active:not([data-bs-toggle="collapse"]) {
    background-color: #1b2b45;
    color: #ffffff;
    font-weight: 600;
}


.sidebar-nav .nav-link:hover {
    background-color: #1b2b45;
    color: #ffffff;
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.sidebar-footer .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    font-weight: bold;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.sidebar-footer .btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}
.nav-link.active {
    background-color: #1b2b45;
/*    font-weight: 600;
    color: #0d6efd !important;
    border-radius: 5px;*/
}

/* et pas .nav-link.active global ! */
.sidebar-nav .nav-link.active {
    background: #1b2b45;
    color: #fff;
    font-weight: 600;
}

/* -------- Floating Fields -------- */

.floating-field {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
}

.floating-field input,
.floating-field select,
.floating-field textarea {
    width: 100%;
    padding: 1rem 0.75rem 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-sizing: border-box;
 }
.floating-field input::placeholder {
    color: transparent;
}

.floating-field label {
    position: absolute;
    top: 1rem;
    left: 0.75rem;
    background: #fff;
    padding: 0 .25rem;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
    transition: transform .2s, top .2s, font-size .2s, color .2s;
    transform-origin: left top;
}
.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label,
.floating-field select:focus + label,
.floating-field select:valid + label,
.floating-field textarea:focus + label,
.floating-field textarea:not(:placeholder-shown) + label {
    top: -0.4rem;
    transform: scale(0.85);
    color: #007bff;
}

.floating-field .toggle-password {
    position: absolute;
    top: 1rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.25rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-bar {
/*    max-width: 400px; */
    margin: 0 auto;
    margin-bottom: 2rem;
}
.search-bar .input-group {
    display: flex;
}

.search-bar .input-group .form-control {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0 !important;
    margin: 0;
}

.search-bar .input-group .btn {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0 !important;
    margin-left: -1px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar .input-group .bi-search {
  font-size: 1.25rem;
}

@media (min-width: 1280px) {
    .floating-field .toggle-password {
        right: 1.5rem;
    }
}

/* -------- Autres styles -------- */

.construction-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    background-color: #f9fafb;
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}
.construction-page h1 {
    font-size: 2.5rem;
    color: #e67e22;
}

.construction-page p {
    font-size: 1.2rem;
    color: #555;
}

/* Social logins */
.social-login {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    display: flex;
}
/* chaque <form> reste à la taille du bouton */
.social-login form {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
}
/* le bouton garde sa taille fixe */
.social-login .social-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
}
/* le libellé ne casse pas la ligne */
.social-login .social-title {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-right: .25rem;
}
.social-title {
    color: #6c757d;
    margin-right: .25rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}
.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

/* Boutons d'action principaux : taille/rayon homogènes */
.auth-form .btn {
    height: 44px;
    border-radius: 10px;
    font-weight: 600;
}

.social-title {
    color: #6c757d;
/*    margin-right: .25rem;*/
    margin-right: .5rem;
}

/* Bouton rond */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: .5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, opacity .15s ease;
    cursor: pointer;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: transparent;
    padding: .35rem .5rem;
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,.06);
    border-color: #d1d5db;
}

.social-btn img {
    pointer-events: none;
}

/* État désactivé pour les providers non configurés */
.social-btn.is-disabled {
    opacity: .4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.social-btn.is-disabled:hover {
    box-shadow: none;
    border-color: #e5e7eb;
}

/* Ajustements de layout */
.auth-links a {
    white-space: nowrap;
}

/* Boutons d'action: même largeur que les inputs (400px) */
.auth-form .btn-primary,
.auth-form .btn-success {
    width: 100%;
    max-width: 400px; /* = .floating-field max-width */
    display: block; /* évite l'effet inline qui s'étire bizarrement */
    margin: 0; /* aligne à gauche comme les champs */
}

/* Layout principal */
.auth-flex {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    min-height: 70vh;
    transition: all .4s ease;
}

.auth-panel {
    flex: 1 1 0;
    background: #fff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
    outline: none;
    transition: flex .35s ease, transform .35s ease, box-shadow .35s ease, background .35s ease;
    border: 1px solid var(--bs-border-color,#eee);
}

.auth-title {
    font-weight: 700;
    margin-bottom: 1rem;
}

.auth-form {
    max-width: 560px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Effet de focus (état initial basé sur la classe focus-*) */
.auth-flex.focus-login .login-panel {
    flex: 1.6;
    transform: translateX(0);
}

.auth-flex.focus-login .register-panel {
    flex: .9;
    opacity: .98;
}

.auth-flex.focus-register .register-panel {
    flex: 1.6;
    transform: translateX(0);
}

.auth-flex.focus-register .login-panel {
    flex: .9;
    opacity: .98;
}

/* Barre centrale */
.auth-divider {
/*    width: 8px;*/
    border-radius: 8px;
    background: linear-gradient(180deg,#E9ECEF 0%, #DEE2E6 100%);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
    width: 2px;
/*    background: var(--bs-border-color, #eee);*/
    margin: 0 1rem;
}
.focus-login .login-panel, .focus-register .register-panel {
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.15);
}

#pwd-checklist.is-hidden {
    display: none;
}

#pwd-checklist .pwd-req {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .25rem 0;
}

#pwd-checklist .pwd-req.ko {
    color: #dc3545;
}

#pwd-checklist .pwd-req.ok {
    color: #198754;
}

#pwd-checklist .pwd-req i {
    font-size: 1rem;
}

.account-type-block {
    max-width: 400px;
    margin-bottom: 1.25rem;
}

.field-label-pill {
    display: inline-block;
    font-weight: 600;
    color: #334155;
    background: #f6f8fb;
    border: 1px solid var(--bs-border-color,#e5e7eb);
    border-radius: 12px;
    padding: .4rem .75rem;
    margin-bottom: .5rem;
}

.segmented-radio {
    display: flex;
    gap: .75rem;
    width: 100%;
}

.segmented-radio .segmented-btn {
    flex: 1 1 0;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--bs-border-color,#dbe1ea);
    background: #fff;
    color: #1f2a44;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease,border-color .15s ease,box-shadow .15s ease,transform .08s ease;
}

.btn-check + .segmented-btn:hover {
    background: #f8fafc;
    border-color: #cfd8e3;
}

.btn-check:focus + .segmented-btn,
.segmented-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .15rem rgba(37,99,235,.25);
}

/* checked */
.btn-check:checked + .segmented-btn {
    background: #eef5ff;
    border-color: #bcd7ff;
    color: #1a56db;
    box-shadow: inset 0 0 0 1px #9ec5fe, 0 4px 12px rgba(37,99,235,.08);
    transform: translateY(-1px);
}

/* disabled */
.btn-check:disabled + .segmented-btn {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
/* Centrer la page auth */
main:has(#authRoot) {
    display: grid;
    place-items: center;
    padding: 0;
    min-height: 100%;
}

/* Largeur max du bloc d'auth (garde ton layout 2 colonnes) */
#authRoot {
    width: 100%;
    max-width: 1200px; 
}
/* Pastille "Type de compte" */
.account-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    border: 1px solid var(--bs-info);
    background: rgba(var(--bs-info-rgb,13,202,240), .08);
    color: var(--bs-info);
    font-size: .8rem;
    line-height: 1;
}
.account-badge .label {
    text-transform: uppercase;
    opacity: .9;
    letter-spacing: .02em;
}

.account-badge .value {
    font-weight: 600;
    color: var(--bs-info);
}

/* Bouton discret, neutre, pas look "lien" */
.btn-soft-secondary {
    display: inline-block;
    background: #f6f8fb;
    color: #334155;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .4rem .75rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}
.btn-soft-secondary:hover {
    background: #eef2f7;
    border-color: #d1d5db;
}
.btn-soft-secondary:active {
    background: #e9ecef;
}
.btn-soft-secondary:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .15rem rgba(13,110,253,.25);
}

/* Grille 3 colonnes : gauche | centre | droite */
.navbar-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .5rem;
}

/* Le centre reste **au milieu** du header */
.nav-center {
    justify-self: center;
}

.nav-title {
    max-width: min(60vw, 640px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-left, .nav-right {
    min-width: 0;
}

.nav-right {
    white-space: nowrap;
}

:root {
    --qty-h: 30px;
    --qty-w: 56px;
}

.qty-cell {
    text-align: center !important;
    vertical-align: middle !important;
    width: 90px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.qty-cell .input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin-left:2rem;
}

.qty-input {
    height: 28px !important;
    line-height: 28px !important;
    padding: 0 !important;
    text-align: center;
    margin: 0 !important;
    vertical-align: middle !important;
}

table.table.table-stacked {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

table.table.table-stacked td,
table.table.table-stacked th {
    vertical-align: middle;
    letter-spacing: normal;
    word-spacing: normal;
    white-space: normal;
}


#sidebarToggle {
    display: none !important;
}

/* ===== Second sidebar (desktop inline) ===== */
.second-sidebar {
    width: 250px;
    background-color: #f8f9fa;
}

.second-sidebar-nav .nav-link {
    color: #334155;
    font-weight: 500;
    padding: .5rem .75rem;
    border-radius: .5rem;
    transition: background .2s, color .2s;
}

.second-sidebar-nav .nav-link:hover {
    background: #e9ecef;
    color: #111827;
}

    .second-sidebar-nav .nav-link.active {
        background: #1b2b45;
        color: #fff;
        font-weight: 600;
    }

/* ===== Mobile: passe en off-canvas sous 1000px ===== */
@media (max-width: 1000px) {
    .second-sidebar {
        position: fixed !important;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100vw; 
        max-width: 340px;
        transform: translateX(100%);
        transition: transform .25s ease;
        z-index: 1045;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0,0,0,.25);
        overflow-y: auto;
        margin: 0 !important;
        padding-right: 1.25rem; 
    }

    .second-sidebar.show {
        transform: translateX(0);
    }

    #secondSidebarOverlay.sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
        z-index: 1040;
    }

    body.second-sidebar-open #secondSidebarOverlay {
        opacity: 1;
        visibility: visible;
    }

    body.second-sidebar-open {
        overflow: hidden;
    }
}

/* ====== Stacked ====== */
@media (max-width: 1444px) {
    
    table.table:not(.no-stacked).table-stacked thead {
        display: none;
    }

    /* chaque ligne devient une carte en grille 2 colonnes */
    table.table:not(.no-stacked).table-stacked tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: .5rem .75rem;
        padding: .75rem;
        margin-bottom: .75rem;
        border: 1px solid var(--bs-border-color, #e9ecef);
        border-radius: .75rem;
        background: #fff;
    }

    table.table:not(.no-stacked).table-stacked tbody tr > th,
    table.table:not(.no-stacked).table-stacked tbody tr > td {
        display: contents; 
    }

    table.table:not(.no-stacked).table-stacked tbody tr > th::before,
    table.table:not(.no-stacked).table-stacked tbody tr > td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #334155;
        display: block;
        align-self: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw; 
    }


    table.table:not(.no-stacked).table-stacked .cell-val {
        grid-column: 2; 
        align-self: center;
        min-width: 0; 
        overflow-wrap: anywhere; 
        word-break: break-word;
        display: block;
    }

    table.table:not(.no-stacked).table-stacked td.text-end .cell-val {
        justify-self: end;
        text-align: right;
    }

    table.table:not(.no-stacked).table-stacked .actions-cell {
        grid-column: 1 / -1;
        margin-top: .25rem;
    }

    table.table:not(.no-stacked).table-stacked .actions-cell .btn-group,
    table.table:not(.no-stacked).table-stacked .actions-cell .btn-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: .375rem;
    }

    table.table:not(.no-stacked).table-stacked .badge {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    table.table:not(.no-stacked).table-stacked tbody tr {
        grid-template-columns: minmax(0, 45%) minmax(0, 55%);
    }
}


@media (max-width: 767.98px) {
    .navbar-grid {
        grid-template-columns: auto 1fr;
    }
    .navbar.px-4 {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }
    #sidebarToggle {
        display: inline-flex !important;
    }
}

/* -------- Responsive Sidebar -------- */
@media (max-width: 768px) {
    #sidebar.responsive-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80vw;
        max-width: 320px;
        transform: translateX(-100%) !important;
        transition: transform .25s ease;
        z-index: 1040;
        box-shadow: 0 0 20px rgba(0,0,0,.25);
        background: #293955; /* assure la visibilité */
        will-change: transform;
    }

    #sidebar.responsive-sidebar.show {
        transform: translateX(0) !important;
    }

    /* overlay */
    #sidebarOverlay.sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
        z-index: 1030;
    }

    body.sidebar-open #sidebarOverlay {
        opacity: 1;
        visibility: visible;
    }

    /* navbar au-dessus de l’overlay, sous le bouton si besoin */
    header .navbar.sticky-top {
        position: relative;
        z-index: 1100;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    main {
        padding-top: var(--header-height);
    }

    .navbar-nav.flex-row .nav-item:not(:last-child) {
        margin-right: 1rem;
    }
    .slot-past {
        opacity: .5;
        border-style: dashed;
        cursor: not-allowed;
    }
}

/* Auth: empile les blocs et 1 colonne de champs et barre passe en horizontal */
@media (max-width: 992px) {
    .auth-flex {
        flex-direction: column;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
    .auth-divider {
        height: 8px;
        width: auto;
    }
}

/* Effet hover (desktop) : si on survole une zone, elle prend le focus visuel */
@media (hover:hover) {
    .auth-panel:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 28px rgba(0,0,0,.08);
    }

    .auth-flex:hover .auth-panel {
        flex: 1;
    }
    /* reset */
    .auth-flex:hover .auth-panel:hover {
        flex: 1.7;
        background: #fbfbff;
    }
}

/* Sur petit écran, commence en haut pour éviter l'effet "au milieu" */
@media (max-width: 576px) {
    main:has(#authRoot) {
        place-items: start center;
    }
}

/* ——— motion/accessibility ——— */
@media (prefers-reduced-motion: no-preference) {
    .btn-method {
        transition: transform .08s ease;
    }

    .btn-method:active {
        transform: translateY(1px);
    }
}
@media (max-width: 480px) {
    /* ex: Email (2), Téléphone (3), Étage (7) */
    .table-stacked td:nth-child(2), .table-stacked th:nth-child(2),
    .table-stacked td:nth-child(3), .table-stacked th:nth-child(3),
    .table-stacked td:nth-child(7), .table-stacked th:nth-child(7) {
        display: none;
    }
}