:root {
    --primary: #1e293b;
    --accent: #d97706;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Titillium Web", sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
	font-size: 1.1rem;
}

ul { list-style: none; }

.RSDB_FLEX_1_2 { margin-top: 20px; width: 100%; display: flex; flex-direction: row; justify-content: space-between; gap: 10px; font-size: 1.0rem; }
.RSDB_FLEX_1_2_1 { width: 50%; display: flex; flex-direction: column; gap: 10px; font-size: 1.0rem; }
.RSDB_FLEX_1_2_2 { width: 50%; display: flex; flex-direction: column; gap: 10px; font-size: 1.0rem; }

.RSDB_ICO_FLAG_SVG_1 { width: 28px; border-radius: 3px; }

/* ==========================================================================
   Écran Connexion (Login)
   ========================================================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    
    /* MODIFS MOBILE : Marge de sécurité 15px D/G + Scroll si écran court */
    padding: 20px 15px; 
    box-sizing: border-box;
    overflow-y: auto;
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    
    /* MODIFS MOBILE : S'assure que le padding n'agrandit pas la boîte */
    box-sizing: border-box;
}

/* Optionnel : réduit un peu le padding interne sur les très petits smartphones */
@media screen and (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
    }
}

/* Choix de langue sous le bouton de connexion. */
.login-card .lang-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}
.login-card .lang-switch a { display: flex; border-radius: 2px; }
.login-card .lang-switch img { display: block; width: 32px; height: 24px; object-fit: contain; border-radius: 2px; }
.login-card .lang-switch a.active { outline: 2px solid var(--accent); outline-offset: 3px; }
.login-card .lang-switch a:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }

.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.login-card h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 6px;
    text-align: center;
}

.subtitle {
    font-size: 0.88rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
}

.form-group input, 
.form-group select {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    background-color: #fff;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--accent);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   Dashboard Layout & Sidebar
   ========================================================================== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--primary); color: white; display: flex; flex-direction: column; }
.sidebar .brand { padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
/* Force le logo dans la sidebar à être blanc */
.sidebar .brand svg {
    filter: brightness(0) invert(1);
    max-width: 190px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Force le logo dans le header mobile à être blanc */
.mobile-header .logo-hor svg {
    filter: brightness(0) invert(1) !important;
}


.nav-menu { flex: 1; padding: 20px 0; }
.nav-menu a { display: block; padding: 10px 20px; color: #94a3b8; text-decoration: none; }
.nav-menu a:hover, .nav-menu a.active { color: #ffffff; background: rgba(255, 255, 255, 0.05); border-left: 4px solid var(--accent); }

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* Switch de langue dans la Sidebar (Relatif, pas d'absolute !) */
.sidebar .sidebar-lang-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar .sidebar-lang-switch a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    transition: color 0.2s;
}

.sidebar .sidebar-lang-switch a:hover,
.sidebar .sidebar-lang-switch a.active {
    color: var(--accent);
    font-weight: 700;
}

.btn-logout { color: #ef4444; text-decoration: none; font-size: 0.9rem; text-align: center; display: block; }

.main-content { flex: 1; }
.app-layout { max-width: 2560px; margin-inline: auto; }

.estimate-background {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #1e293b var(--estimate-image) 72% center / cover no-repeat;
}
.estimate-background--ab {
    --estimate-image: url("../rsdb_iface/illustrations/estimate-background-ab.jpg");
}
.estimate-background--mad {
    --estimate-image: url("../rsdb_iface/illustrations/estimate-background-mad-v4.jpg");
}
.estimate-background .content-body {
    width: 100%;
    max-width: var(--estimate-width, 650px);
    padding: clamp(16px, 2vw, 28px);
    border-radius: 10px;
    background: rgb(255 255 255 / var(--estimate-opacity, 96%));
    flex: 0 0 auto;
}
@media (min-width: 701px) {
    .estimate-background[data-estimate-position^="middle-"] .content-body { margin-block: auto; }
    .estimate-background[data-estimate-position^="bottom-"] .content-body { margin-block-start: auto; }
    .estimate-background[data-estimate-position$="-center"] .content-body { align-self: center; }
    .estimate-background[data-estimate-position$="-right"] .content-body { align-self: flex-end; }
}
@media (max-width: 700px) {
    .estimate-background {
        background-position: 75% top;
    }
    .estimate-background .content-body { margin-top: 100px; }
}
.estimate-chooser .content-body {
    width: min(100%, 76% + 8rem);
    max-width: none;
    margin: auto;
    text-align: center;
}
.dashboard-welcome.estimate-background .content-body {
    width: min(100%, 42rem);
    max-width: none;
    margin: auto;
    padding: 0;
    background: transparent;
}
.dashboard-welcome__panel {
    padding: clamp(16px, 3vw, 28px);
    border-radius: 10px;
    background: rgb(255 255 255 / var(--estimate-opacity, 96%));
    color: #1e293b;
    text-align: center;
    overflow-wrap: anywhere;
}
.dashboard-welcome__panel h1 { margin: 0 0 1rem; font-size: 1.5rem; }
.dashboard-welcome__panel dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .75rem;
    margin: 0;
}
.dashboard-welcome__panel dl div { padding: .75rem; border-radius: 8px; background: rgb(241 245 249 / .55); }
.dashboard-welcome__panel dt { font-size: .9rem; }
.dashboard-welcome__panel dd { margin: .25rem 0 0; font-weight: 700; }
.estimate-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 2vw, 28px);
    margin-top: 16px;
}
.estimate-choice {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.estimate-choice img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.estimate-choice span { padding: 12px; }
.estimate-choice:hover { border-color: var(--accent); }
.estimate-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 700px) {
    .estimate-chooser .content-body { width: 100%; }
    .estimate-choices { grid-template-columns: 1fr; }
}
.topbar { background: #ffffff; padding: 20px 30px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.content-body { padding: 0px; }
.card { background: white; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.map_card_1 { height: 100%; background: white; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }

.flex_card_1 { 
    background: white; 
    padding: 10px; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
    display: flex;
    flex-direction: column;
    gap: 0px; /* Espace minimal entre les lignes géré proprement */
}

/* Chaque ligne est un conteneur Flex indépendant avec sa bordure en bas */
.flex_card_1 .flex-row {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    border-bottom: 1px dashed #e0e0e0;
}

/* Colonne 1 : libellé avec une largeur fixe minimale */
.flex_card_1 .flex-label {
    min-width: 140px;
    flex-shrink: 0;
    color: #555;
}

/* Colonne 2 : la valeur prend tout l'espace restant */
.flex_card_1 .flex-value {
    flex-grow: 1;
    word-break: break-word;
}

/* Titres de sections (Départ / Arrivée) */
.flex_card_1 .flex_section_title {
    margin-top: 12px;
    padding-top: 10px;
    padding-bottom: 6px;
    border-top: 0px dashed var(--border);
    font-size: 1.0rem;
    font-weight: bold;
    color: #222;
}



/* Masquer le bouton X sur grand écran, l'afficher sur mobile */
@media screen and (min-width: 1001px) {
    #close-menu-btn {
        display: none !important;
    }
}

@media screen and (max-width: 1000px) {
    /* Assurer que le logo reste bien centré malgré le bouton à droite */
    .logo-container {
        padding-left: 30px; /* Compense la largeur du bouton pour un centrage visuel */
    }
}


/* --- ADAPTATION MOBILE (Écrans < 992px) --- */
@media screen and (max-width: 992px) {
	
	/* Masquer la scrollbar proprement sur tous les écrans */
	html, body {
		scrollbar-width: none;       /* Firefox */
		-ms-overflow-style: none;    /* IE et Edge */
	}

	html::-webkit-scrollbar, 
	body::-webkit-scrollbar {
		display: none;               /* Chrome, Safari, Edge */
	}
	
    /* 1. On annule la disposition en colonne pour laisser la Sidebar flotter au-dessus */
    .app-layout { flex-direction: column; }

    /* 2. Style de la Sidebar "Slide-in" */
    .sidebar {
        position: fixed;
        top: 0;
        left: -80%; /* Caché initialement */
        width: 80% !important;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        padding: 0;
        overflow-y: auto;
    }
    .sidebar.active { left: 0; } /* État ouvert */

    /* 3. Ajustement du Menu interne pour qu'il soit vertical */
    .sidebar .nav-menu {
        display: flex;
        flex-direction: column; /* Vertical, plus de wrap */
        flex-wrap: nowrap;
        gap: 0;
    }

    /* 4. Overlay grisé derrière le menu */
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    #sidebar-overlay.active { display: block; }

    /* 5. Garder tes réglages de scroll tableau et filtres */
    .table-responsive, .card-body { width: 100%; overflow-x: auto; }
    .filter-grid, .filters-container form { display: flex; flex-direction: column; gap: 10px; }
}
@font-face {
    font-family: "Titillium Web";
    src: url("../fonts/titillium-web/rsdb-titweb-200.woff2") format("woff2");
    font-style: normal;
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: "Titillium Web";
    src: url("../fonts/titillium-web/rsdb-titweb-300.woff2") format("woff2");
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: "Titillium Web";
    src: url("../fonts/titillium-web/rsdb-titweb-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Titillium Web";
    src: url("../fonts/titillium-web/rsdb-titweb-600.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Titillium Web";
    src: url("../fonts/titillium-web/rsdb-titweb-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

button, input, select, textarea, optgroup {
    font-family: inherit;
}



@media (max-width: 700px) {
    .main-content.estimate-form-page,
    .main-content.estimate-reservation-page {
        padding: 18px 10px;
    }

    .estimate-form-page .content-body {
        margin: auto;
        overflow-wrap: anywhere;
    }

    .estimate-reservation-page .RSDB_FLEX_1_2 {
        flex-direction: column;
        gap: 15px;
    }

    .estimate-reservation-page .RSDB_FLEX_1_2_1,
    .estimate-reservation-page .RSDB_FLEX_1_2_2 {
        width: 100%;
        min-width: 0;
    }

    .estimate-reservation-page .flex_card_1 .flex-row {
        flex-wrap: wrap;
    }

    .estimate-reservation-page .flex_card_1 .flex-value {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .estimate-reservation-page .map_card_1 {
        box-sizing: border-box;
        height: clamp(280px, 45dvh, 350px);
        padding: 0;
        overflow: hidden;
    }

    .estimate-reservation-page .zeus-reservation-client-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .estimate-reservation-page .rsdb-client-section {
        overflow-wrap: anywhere;
    }
}


.estimate-reservation-page .reservation-country-flag,
.history-card .history-address__flag img,
.transport-detail-layout .client-info-l .transport-address-flag {
    width: 25px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

.estimate-reservation-page .reservation-country-flag {
    display: block;
}
