/* =========================================================
   RENTALPARK — FEUILLE DE STYLE COMPLÈTE (maquette)
   ========================================================= */

:root {
    --rp-navy: #29235c;
    --rp-navy-dark: #1e1a45;
    --rp-orange: #f39200;
    --rp-orange-dark: #d97f00;
    --rp-light: #e9ecef;
    --rp-gray-text: #6c757d;
    --navbar-height: 70px;
}

body {
    font-family: Moncerrat, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #212529;
}

/* =========================================================
   WAITING GLOBAL
   ========================================================= */
#global-waiting {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(3px);
}

#global-waiting.d-none {
    display: none !important;
}

.waiting-box {
    width: 360px;
    max-width: 90%;

    padding: 35px 40px;

    background: var(--bs-body-bg, #fff);
    border-radius: 15px;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.20);

    text-align: center;
}

/* Zone contenant le logo + spinner */
.waiting-logo-container {
    position: relative;

    width: 180px;
    height: 100px;

    margin: 0 auto 25px auto;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo */
.waiting-logo {
    display: block;

    width: 160px;
    max-width: 100%;
    height: auto;

    position: relative;
    z-index: 1;
}

/* Cercle superposé au logo */
.waiting-spinner-overlay {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cercle */
.waiting-spinner-overlay .spinner-border {
    width: 3.5rem;
    height: 3.5rem;

    border-width: 0.35rem;

    /* légèrement transparent pour voir le logo */
    opacity: 0.85;
}

/* Message */
.waiting-message {
    text-align: center;

    margin-top: 10px;

    font-size: 15px;
    font-weight: 500;

    color: var(--bs-secondary-color, #6c757d);
}

/* =========================================================
   1. TOPBAR SOCIAL (fine bande orange au-dessus de la navbar)
   ========================================================= */
.topbar-social {
    background-color: var(--rp-orange);
    padding: 6px 0;
}
.topbar-social .container {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}
.topbar-social a {
    color: #fff;
    font-size: 1rem;
    opacity: 0.9;
    transition: opacity .2s ease;
}
.topbar-social a:hover { opacity: 1; }

/* =========================================================
   2. NAVBAR
   ========================================================= */
/* Bande orange pleine largeur (mesurée : ~9.4% de la largeur totale de la maquette) */
.site-header {
    background-color: var(--rp-orange);
    padding: 0.5vw 0 0;
}
.header {
    margin-left: 150px !important; 
    margin-right: 150px !important;
}
/* Icônes sociales, au-dessus de la pilule navy, alignées à droite */
.header-social {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 0 10px;
}
.header-social a {
    color: #fff;
    font-size: 1rem;
    opacity: 0.95;
}
.header-social a:hover { opacity: 1; }

/* La navbar elle-même = pilule navy arrondie, centrée dans la bande orange
   (mesuré : marge gauche/droite ≈ 11.9% de la largeur totale de chaque côté) */
.bg-blue-custom {
    background-color: var(--rp-navy) !important;
    border-radius: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
    margin: 0 auto;
}

.bg-navy {
    background-color: var(--rp-navy) !important;
    color: #fff;
}

.bg-orange {
    background-color: var(--rp-orange) !important;
}

.border-navy {
    border: solid 1px var(--rp-navy);
}

.border-orange {
    border: solid 1px var(--rp-orange);
}

.navbar-brand img { height: 38px; }

/* Structure générale : logo | liens centrés | pays + thème */
.navbar > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.navbar-collapse {
    flex-grow: 1;
    justify-content: center;
}
.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-link {
    color: #fff !important;
    font-weight: 500;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 0.95rem;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--rp-orange) !important;
}.navbar-nav .dropdown-toggle::after {
    vertical-align: 2px;
}

.navbar-nav .dropdown-menu {
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    margin-top: 20px;
    overflow: hidden;
}

.text-navy {
    color: var(--rp-navy);
}

.text-orange {
    color: var(--rp-orange);
}

.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item:focus {
    background-color: rgba(255,255,255,0.08);
    color: inherit;
}

.navbar-nav .dropdown-item i {
    color: inherit;
}

.dropdown-menu li {
    border: solid 1px #fff !important; 
}

.header-wallet .border {
    border: solid 1px var(--rp-navy) !important;
}

/* Bloc de droite : Pays + toggle thème, jamais wrappé sous le burger */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    order: 3;
}
.navbar-right .nav-link {    
    background: #fff;
    color: var(--rp-navy);
    padding: 0 16px 0 16px;
    border-radius: 16px;
    font-weight: 500;
}
/* Sélecteur "Pays" (dropdown avec drapeau), stylé en forme de pilule/switch */
.pays-dropdown .pays-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 5px 12px;
    transition: all .2s ease;
}
.pays-dropdown .pays-toggle-wrap:hover {
    border-color: var(--rp-orange);
}
.pays-dropdown .pays-toggle-wrap img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}
.pays-dropdown .pays-toggle-wrap span {
    font-size: 0.85rem;
}
.pays-dropdown .dropdown-toggle::after {
    display: none;
}

/* Toggle thème sombre/clair */
#themeToggle {
    border-color: var(--rp-orange);
    color: var(--rp-orange);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#themeToggle:hover {
    background-color: var(--rp-orange);
    color: #fff;
}

/* Le burger mobile doit rester avant le bloc de droite */
.navbar-toggler {
    order: 2;
    border: none;
    color: #fff;
}
.navbar-toggler:focus {
    box-shadow: none;
}

@media (max-width: 991px) {
    .navbar-collapse { order: 4; width: 100%; }
    .navbar-nav { align-items: flex-start; }
    .navbar-right { order: 2; }
}

/* =========================================================
   3. HERO
   ========================================================= */
/* Mesuré : la photo n'est pas un fond plein cadre avec dégradé CSS —
   c'est une image qui s'estompe elle-même vers le blanc côté gauche,
   collée au bord droit de l'écran. On reproduit ça avec un fond blanc
   + une image positionnée à droite + un masque de fondu en CSS. */
.hero-section {
    position: relative;
    min-height: 19.5vw;   /* ratio mesuré : hauteur hero ≈ 19.6% de la largeur totale */
    background-color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: solid 1px #adb5bd;
}
.hero-photo {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 68%;            /* la photo occupe la partie droite, mesuré ≈ 67% */
    object-fit: cover;
    object-position: right center;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 50px 0;
}
.hero-title {
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1.15;
    color: var(--rp-navy);
    margin: 0;
}
.hero-title .text-orange {
    color: var(--rp-orange);
}

/* Boutons CTA à cheval sur le bas du hero */
.hero-cta-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: -35px;
    margin-bottom: 15px;
    position: relative;
    z-index: 3;
}
.btn-hero-cta {
    background: #fff;
    border: 10px solid var(--rp-orange);
    color: var(--rp-navy);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    transition: all .2s ease;
    text-decoration: none;
}
.btn-hero-cta:hover {
    background: var(--rp-orange);
    color: #fff;
}

/* =========================================================
   4. NOS CATÉGORIES
   ========================================================= */
.section {
    padding: 20px 0;
}
.cats-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 15px 40px;
}
.cats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
/* Titre entièrement navy (mesuré sur la maquette : pas de mot en orange ici) */
.section-title {
    font-weight: 800;
    font-size: 2.0rem;
    color: var(--rp-navy);
    margin: 0;
    font-style: 'Montserrat Extra Bold';
}
.section-sub {
    color: var(--rp-navy);
    font-weight: 600;
    font-size: 1.0rem;
    margin: 0;
}
.see-all {
    color: var(--rp-orange);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.see-all:hover {
    color: var(--rp-orange-dark);
}

.cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* Chaque catégorie = UNE carte avec bordure globale (icône en haut,
   libellé en dessous, séparés par un simple filet interne). Seule
   cette bordure globale réagit au survol. */
.cat-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: #fff;
    border: 1px solid #d9dbe1;
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.cat-icon-box {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cat-icon-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.cat-label-box {
    /*border-top: 1px solid #d9dbe1;*/
    padding: 10px 4px;
    text-align: center;
}
.cat-card:hover {
    border-color: var(--rp-orange);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.cat-name {
    font-size: 1rem;
    color: var(--rp-navy);
    font-weight: 700;
    line-height: 1.25;
}

/* =========================================================
   5. BANDEAU "NOTRE CATALOGUE"
   ========================================================= */
.catalogue-band {
    background: var(--rp-navy);
    padding: 10px 0;
    margin-top: 20px;
    text-align: center;
    height: 180px;
}
.catalogue-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.9rem;
    margin-bottom: 4px;
}
.catalogue-sub {
    color: #cfd0e0;
    margin: 0;
    font-size: 0.95rem;
}

/* =========================================================
   6. CARTES PUBLICATION
   ========================================================= */
.publication-card {
    /*border: none !important;*/
    border: solid 1px var(--rp-navy-dark) !important;
    border-radius: 25px;
    box-shadow: none !important;
    background: transparent;
    overflow: visible;
}
.hover-lift.transition-all {
    transition: transform .2s ease, box-shadow .2s ease;
}
.hover-lift.transition-all:hover {
    transform: translateY(-4px);
}
 
.publication-card .carousel,
.publication-card .carousel-inner {
    border-radius: 25px 25px 0 0;
    overflow: hidden;
}
.publication-card .carousel-inner img {
    height: 200px;
    object-fit: cover;
}
.publication-card .carousel-control-prev,
.publication-card .carousel-control-next {
    width: 12%;
    opacity: 0;
    transition: opacity .2s ease;
}
.publication-card:hover .carousel-control-prev,
.publication-card:hover .carousel-control-next {
    opacity: 0.8;
}
 
/* Le corps de carte chevauche le bas de la photo : bloc blanc arrondi
   avec une marge négative, ce qui laisse voir la photo dans les coins
   arrondis (exactement ce que montre la maquette). */
.publication-card .card-body {
    background: #fff;
    /*border: solid 1px rgb(223, 217, 217) !important;
    border-radius: 25px;
    margin-top: -20px;*/
    position: relative;
    z-index: 2;
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.05);*/
    text-align: center;
    align-items: center;
}
.publication-card .card-body .d-flex.align-items-start {
    justify-content: center;
}
.publication-card .card-body .d-flex.align-items-baseline {
    justify-content: center;
}
.publication-card .card-body h6 {
    font-size: 1.3rem;
    color: var(--rp-navy) !important;
    /*white-space: nowrap;*/
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Localisation : icône orange, texte navy (pas rouge) */
.publication-card .card-body .geo {
    background: #fff;
    align-items: center;
    text-align: center;
}
.publication-card .card-body .bi-geo-alt-fill {
    color: var(--rp-orange);
}
.publication-card .card-body span.geo-text {
    color: var(--rp-orange) !important;
    /*font-size: 1.0rem;*/
}
/* Prix : tout en navy (pas vert), pas de ligne de séparation au-dessus */
.publication-card .card-body .mt-auto.border-top {
    border-top: none !important;
}
.publication-card .card-body .text-success {
    color: var(--rp-navy) !important;
}
 
.publication-card .card-footer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 16px 16px !important;
    margin-top: 8px;
}
.publication-card .card-footer .btn-outline-dark {
    background: var(--rp-orange);
    border-color: var(--rp-orange);
    color: #fff;/*#212529;*/
    border-radius: 10px;
    font-weight: 500;
}
.publication-card .card-footer .btn-outline-dark:hover {
    background: var(--rp-orange-dark);
    border-color: var(--rp-orange-dark);
    color: #fff;
}
.publication-card .card-footer .contact-btn {
    border-radius: 10px;
    background: #198754 !important;
    color: #fff !important;
    border: 1px solid #198754 !important;
    font-weight: 500;
}
.publication-card .card-footer .contact-btn i,
.publication-card .card-footer .contact-btn .bi-whatsapp {
    border: none !important;
    background: transparent !important;
    color: inherit !important;
}
.publication-card .card-footer .contact-btn:hover {
    background: #198754 !important;
    color: #fff !important;
}
 
/* =========================================================
   7. PAGINATION
   ========================================================= */
.pagination .page-link {
    color: var(--rp-navy);
    border-color: var(--rp-light);
}
.pagination .page-item.active .page-link {
    background-color: var(--rp-orange);
    border-color: var(--rp-orange);
}
.pagination .page-link:hover {
    color: var(--rp-orange);
}
 
/* =========================================================
   8. FOOTER
   ========================================================= */
footer.bg-body-tertiary {
    background-color: var(--rp-navy) !important;
    padding-top: 32px;
    padding-bottom: 0;
}
 
/* Carte blanche pleine largeur, coins arrondis en haut uniquement,
   pas de marge gauche/droite : le navy ne dépasse qu'au-dessus. */
.footer-card {
    background: #fff;
    border-radius: 32px 32px 0 0;
    /*padding: 48px 0 32px;
    width: 100%;*/
    margin: 20px;
}
 
footer h6 {
    color: var(--rp-navy);
    font-weight: 700;
}
footer p,
footer li,
footer .text-muted {
    color: #6c757d !important;
}
footer a {
    color: #6c757d;
    text-decoration: none;
}
footer a:hover,
footer a.text-muted:hover {
    color: var(--rp-orange) !important;
}
footer .social-icons a {
    color: var(--rp-navy);
}
footer .social-icons a:hover {
    color: var(--rp-orange);
}
footer hr {
    border-color: #e9ecef;
    opacity: 1;
}
 
@media (max-width: 576px) {
    .footer-card { padding: 32px 0 24px; border-radius: 20px 20px 0 0; }
}
 
/* =========================================================
   9. SIDEBAR ADMIN / USER (dashboard layout)
   ========================================================= */
.sidebar {
    background-color: var(--rp-navy) !important;
    min-height: calc(100vh - var(--navbar-height));
    border-right: none;
    padding: 20px 14px !important;
}
.sidebar .nav-link {
    color: #cfd0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.sidebar .nav-link i {
    color: #fff;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}
.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.08);
    color: var(--rp-orange);
}
.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.12);
    color: var(--rp-orange) !important;
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
    color: var(--rp-orange);
}
.content-wrapper {
    background: transparent;
    padding: 0;
}
 
/* ---- En-tête de page ("Tableau de bord ...") ---- */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dashboard-header-icon {
    color: var(--rp-orange);
    font-size: 2rem;
    line-height: 1;
}
.dashboard-title {
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--rp-navy);
    margin: 0;
}
.dashboard-subtitle {
    color: var(--rp-gray-text);
    font-size: 0.9rem;
    margin: 0;
}
.btn-add-material {
    background: var(--rp-navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-weight: 600;
    white-space: nowrap;
}
.btn-add-material:hover {
    background: var(--rp-navy-dark);
    color: #fff;
}

/* ---- En-tête de page ("Page header ...") ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.page-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.page-header-icon {
    color: var(--rp-orange);
    font-size: 2rem;
    line-height: 1;
}
.page-title {
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--rp-navy);
    margin: 0;
}
.page-subtitle {
    color: var(--rp-gray-text);
    font-size: 0.9rem;
    margin: 0;
}
.btn-add-el {
    background: var(--rp-navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-weight: 600;
    white-space: nowrap;
}
.btn-add-el:hover {
    background: var(--rp-navy-dark);
    color: #fff;
}
/* ---- Cartes statistiques (navy, icône orange qui déborde à gauche) ---- */
.stat-card {
    position: relative;
    background: var(--rp-navy);
    border-radius: 18px;
    padding: 20px 24px 20px 50px;
    margin-bottom: 20px;
    margin-left: 26px;
    color: #fff;
}
.stat-card .stat-icon {
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--rp-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.stat-card .stat-label {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
}
 
/* ---- Carte "Mon Portefeuille" ---- */
.wallet-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--rp-light);
    border-radius: 18px;
    padding: 24px 24px 50px 50px;
    margin-left: 26px;
    margin-bottom: 20px;
    color: var(--rp-navy);
}
.wallet-card .stat-icon {
    background: var(--rp-orange);
}
.wallet-card h5 {
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.wallet-card .wallet-line {
    font-size: 1rem;
    margin-bottom: 4px;
}
.wallet-card .wallet-balance-label {
    font-weight: 800;
    font-size: 1.2rem;
    margin-top: 14px;
}
.wallet-card .wallet-balance-value {
    font-weight: 800;
    font-size: 2rem;
}
.btn-recharge {
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%);
    background: var(--rp-orange);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 24px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
}
.btn-recharge:hover {
    background: var(--rp-orange-dark);
    color: #fff;
}
 
/* ---- Panneau "Matériels les plus sollicités" ---- */
.top-materials-panel {
    background: var(--rp-navy);
    border-radius: 20px;
    padding: 24px;
    height: 100%;
}
.top-materials-title {
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 20px;
}
.material-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.material-row:last-child {
    margin-bottom: 0;
}
.material-thumb {
    width: 48px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.material-name {
    flex-grow: 1;
    font-weight: 700;
    color: var(--rp-navy);
    font-size: 0.85rem;
    line-height: 1.2;
}
.material-badge {
    background: var(--rp-orange);
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}
 
 
/* =========================================================
   10. RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .hero-title { font-size: 1.9rem; }
    .hero-cta-row { flex-direction: column; align-items: center; margin-top: -16px; }
    .btn-hero-cta { width: 90%; text-align: center; }
    .cats-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
    .catalogue-title { font-size: 1.5rem; }
}
 
@media (max-width: 576px) {
    .topbar-social .container { justify-content: center; }
    .cats-header { flex-direction: column; align-items: flex-start; }
}
 
/* =========================================================
   11. MODE SOMBRE (data-bs-theme="dark")
   ========================================================= */
[data-bs-theme="dark"] body {
    background-color: #16142e;
    color: #e9e9f2;
}
[data-bs-theme="dark"] .cat-card,
[data-bs-theme="dark"] .publication-card,
[data-bs-theme="dark"] .content-wrapper {
    background-color: #1e1a45;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .cat-name,
[data-bs-theme="dark"] .publication-card h6 {
    color: #fff;
}
[data-bs-theme="dark"] .sidebar {
    background-color: #1e1a45 !important;
    border-right-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .sidebar .nav-link {
    color: #cfd0e0;
}

/* ---- En-tête de page ("Tableau de bord ...") ---- */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dashboard-header-icon {
    color: var(--rp-orange);
    font-size: 2rem;
    line-height: 1;
}
.dashboard-title {
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--rp-navy);
    margin: 0;
}
.dashboard-subtitle {
    color: var(--rp-gray-text);
    font-size: 0.9rem;
    margin: 0;
}
.btn-add-material {
    background: var(--rp-navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-weight: 600;
    white-space: nowrap;
}
.btn-add-material:hover {
    background: var(--rp-navy-dark);
    color: #fff;
}
 
/* ---- Cartes statistiques (navy, icône orange qui déborde à gauche) ---- */
.stat-card {
    position: relative;
    background: var(--rp-navy);
    border-radius: 18px;
    padding: 20px 24px 20px 50px;
    margin-bottom: 20px;
    margin-left: 26px;
    color: #fff;
}
.stat-card .stat-icon {
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--rp-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.stat-card .stat-label {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
}
 
/* ---- Carte "Mon Portefeuille" ---- */
.wallet-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--rp-light);
    border-radius: 18px;
    padding: 24px 24px 50px 50px;
    margin-left: 26px;
    margin-bottom: 20px;
    color: var(--rp-navy);
}
.wallet-card .stat-icon {
    background: var(--rp-orange);
}
.wallet-card h5 {
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.wallet-card .wallet-line {
    font-size: 1rem;
    margin-bottom: 4px;
}
.wallet-card .wallet-balance-label {
    font-weight: 800;
    font-size: 1.2rem;
    margin-top: 14px;
}
.wallet-card .wallet-balance-value {
    font-weight: 800;
    font-size: 2rem;
}
.btn-recharge {
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%);
    background: var(--rp-orange);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 24px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
}
.btn-recharge:hover {
    background: var(--rp-orange-dark);
    color: #fff;
}
 
/* ---- Panneau "Matériels les plus sollicités" ---- */
.top-materials-panel {
    background: var(--rp-navy);
    border-radius: 20px;
    padding: 24px;
    height: 100%;
}
.top-materials-title {
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 20px;
}
.material-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.material-row:last-child {
    margin-bottom: 0;
}
.material-thumb {
    width: 48px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.material-name {
    flex-grow: 1;
    font-weight: 700;
    color: var(--rp-navy);
    font-size: 0.85rem;
    line-height: 1.2;
}
.material-badge {
    background: var(--rp-orange);
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}
 
/* =========================================================
   10. RESPONSIVE
   ========================================================= */

@media (min-width: 992px) {
    .container, .container-lg, .container-md, .container-sm {
        max-width: 90% !important;
    }
}

@media (max-width: 768px) {
    .hero-title { font-size: 1.9rem; }
    .hero-cta-row { flex-direction: column; align-items: center; margin-top: -16px; }
    .btn-hero-cta { width: 90%; text-align: center; }
    .cats-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
    .catalogue-title { font-size: 1.5rem; }
}
 
@media (max-width: 576px) {
    .topbar-social .container { justify-content: center; }
    .cats-header { flex-direction: column; align-items: flex-start; }
}
 
/* =========================================================
   11. MODE SOMBRE (data-bs-theme="dark")
   ========================================================= */
[data-bs-theme="dark"] body {
    background-color: #16142e;
    color: #e9e9f2;
}
[data-bs-theme="dark"] .cat-card,
[data-bs-theme="dark"] .publication-card,
[data-bs-theme="dark"] .content-wrapper {
    background-color: #1e1a45;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .cat-name,
[data-bs-theme="dark"] .publication-card h6 {
    color: #fff;
}
[data-bs-theme="dark"] .sidebar {
    background-color: #1e1a45 !important;
    border-right-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .sidebar .nav-link {
    color: #cfd0e0;
}


/*---------------------------------*/

/* Layout deux colonnes */
.catalogue-layout {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 5px;
}

.catalogue-layout .catalogue-main .catalogue-title {
    color: var(--rp-navy);
    text-align: left;
}

.catalogue-layout .catalogue-main .catalogue-sub {
    color: var(--rp-navy);
    text-align: left;
}

/* Sidebar */
.catalogue-sidebar {
    width: 250px;
    flex-shrink: 0;
    /*background: var(--rp-navy);
    border-radius: 8px;
    padding: 1.25rem;*/
    position: sticky;
    top: 1.5rem;          /* colle au viewport lors du scroll */
    text-align: center;
}

.sidebar-title {
    font-size: 1.8rem;
    font-weight: 700;
    /*text-transform: uppercase;*/
    letter-spacing: 0.06em;
    color: #ffff;
    padding: 15px;
}

.category-header {
    background: var(--rp-navy);
}

.category-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    background: #fff;
    border: solid 1px var(--rp-navy);
}

.category-item a {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    border-bottom: solid 1px #29235c;
    /*border-radius: 6px;*/
    transition: background 0.2s;
}

.category-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.category-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    background-image: url('/images/toute-categorie-60x60.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 16px;
}

.category-name {
    flex: 1;          /* pousse le count tout à droite */
    font-size: 14px;
    color: #29235c;
}

.category-count {
    margin-left: auto;
    background: #e8e8e8;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

.category-item a:hover {
    background: var(--rp-orange);
    color: var(--rp-navy);
}

.category-item.active a {
    background: var(--rp-orange);
    color: var(--rp-navy);
}

.category-item.active .category-count {
    background: #29235c;
    color: #fff;
}

.category-search {
    padding: 0 12px 12px;
}

.category-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.category-search-input:focus {
    border-color: #6200ea;
}

/* Zone principale */
.catalogue-main {
    flex: 1;
    min-width: 0;          /* évite le débordement en flex */
    margin-left: 5px;
}

.catalogue-body {
    margin: 10px;
}
/* Responsive : sidebar au-dessus sur mobile */
@media (max-width: 768px) {
    .catalogue-layout {
        flex-direction: column;
    }

    .catalogue-sidebar {
        width: 100%;
        position: static;
    }
}

/*----------------------------------*/

.card img {
    height: 200px;
    object-fit: cover;
}

/* Image gauche */
.bg-login-image {
    background: /*linear-gradient(
        rgba(0,0,0,0.5),
        rgba(0,0,0,0.5)*/
    url('/images/login-bg.jpg') center/cover no-repeat;
}

/* Dark mode */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .card {
    background-color: #1e1e1e;
}

.dark-mode .form-control,
.dark-mode .input-group-text {
    background-color: #2a2a2a;
    color: #fff;
    border-color: #444;
}

.dark-mode .btn-outline-secondary {
    color: #fff;
    border-color: #666;
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: .5px;
}
.readonly-field {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.photo-box {
    position: relative;
    width: 100%;
    padding-top: 100%; /* carré */
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.photo-box img.photo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* remplit tout le cadre */
    z-index: 1;
}

.photo-empty {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e9ecef; /* gris clair */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #adb5bd; /* couleur icône */
    font-size: 2rem;
    z-index: 0;
    border: 2px dashed #ced4da; /* effet cadre photo vide */
    border-radius: 5px;
}

.photo-empty i {
    pointer-events: none;
}

.photo-buttons {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 2; /* devant l'image */
    display: flex;
    gap: 5px;
}

.categorie-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: var(--navbar-height, 70px);
    align-self: flex-start;
    max-height: calc(100vh - var(--navbar-height, 70px) - 2rem);
    overflow-y: auto;
}

.categorie-sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.categorie-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categorie-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
}

.categorie-sidebar-btn:hover {
    background: #f8f9fa;
}

.categorie-sidebar-btn.active {
    background: #f5f0ff;
    color: #29235c;
    font-weight: 600;
    border-left: 3px solid #29235c;
}

.categorie-sidebar-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.categorie-sidebar-placeholder {
    width: 28px;
    height: 28px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #6c757d;
}

.type-info-panel {
    width: 220px;
    flex: 0 0 auto;
    text-align: center;
}
.type-info-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}
.type-info-placeholder {
    width: 100%;
    height: 160px;
    background: #f1f3f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #adb5bd;
}
.type-info-nom {
    font-weight: 600;
    margin-top: .5rem;
}

/*----------------payment--------------*/
.payment-option {
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.payment-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    padding: 8px 6px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    transition: all 0.15s ease;
    gap: 6px;
}

.payment-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 28px;
    overflow: hidden;
}

.payment-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.payment-text {
    font-weight: 600;
    font-size: 0.7rem;
    color: #333;
    text-align: center;
    line-height: 1.1;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
}

.payment-option:hover .payment-badge {
    border-color: #adb5bd;
}

.mode-radio:checked + .payment-badge {
    border-color: #1a1a4b;
    background: #f0f0f8;
    box-shadow: 0 0 0 2px rgba(26,26,75,0.15);
}

.wizard-steps {
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #adb5bd;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 0.8rem;
    color: #adb5bd;
    font-weight: 600;
    text-align: center;
}

/*----------------------------------------------------*/
.wizard-step.active .step-circle {
    border-color: #1a1a4b;
    background: #1a1a4b;
    color: #fff;
}

.wizard-step.active .step-label {
    color: #1a1a4b;
}

.wizard-step.completed .step-circle {
    border-color: #198754;
    background: #198754;
    color: #fff;
}

.wizard-step.completed .step-circle::after {
    content: '✓';
}

.mode-logo-preview {
    width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.mode-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.table-logo-thumb { width: 40px; height: 32px; object-fit: contain; }