/* Applique une mise en page sans marges ni restrictions */
html,
body {
    /*margin: 0;*/
    padding: 0;
    width: 100%;
    height: 100%;
}

/* Conteneur de la grille DevExtreme */
#gridContainer {
    width: 100%;
    /* S'tend sur toute la largeur disponible */
    height: auto;
    /* Ajuste automatiquement la hauteur selon le contenu */
    min-height: 400px;
    /* Ajoute une hauteur minimale pour garantir l'affichage */
    /*margin: 0 auto;*/
}

/* Supprime les restrictions ventuelles de largeur imposes par un parent (si Bootstrap ou autres sont utiliss) */
.container {
    width: 100%;
    max-width: none;
    /* Dsactive toute largeur maximale par dfaut */
    padding: 0;
    /* Supprime les marges intrieures */
}

.navbar-custom {
    background-color: #0a1f44 !important;
    /* Bleu marine */
    border-bottom: 2px solid #ffffff;
    /* Ligne blanche fine en bas */
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
    color: white !important;
    /* Texte blanc */
}

.navbar-custom .nav-link:hover {
    color: #cccccc !important;
    /* Effet survol en gris clair */
}

.dx-navbar,
.dx-toolbar.dx-widget {
    background-color: #0a1f44 !important;
}

.dx-popup-title {
    color: white !important;
}

.dx-datagrid-group-panel .dx-group-panel-message {
    color: white !important;
}

.dx-datagrid-group-panel .dx-group-item {
    color: white !important;
}

.dx-datagrid-headers .dx-header-row,
.dx-datagrid-headers .dx-header-row>td,
.dx-datagrid-headers .dx-datagrid-text-content,
.dx-datagrid-column-chooser .dx-popup-title .dx-toolbar-label>div {
    color: white !important;
    background-color: #0a1f44 !important;
    font-weight: 600;
}

#gridContainerLots .dx-datagrid-rowsview .dx-row>td {
    color: black;
}

/* =====================================================
   NAVIGATION - STYLES MODERNES
   ===================================================== */

.nav-portail-cee {
    background-color: #0a1f44 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #4facfe;
    padding: 0.6rem 1.5rem;
    min-height: 60px;
}

.nav-portail-cee .navbar-nav {
    gap: 0.5rem;
    align-items: center;
}

/* Style des liens de navigation */
.nav-portail-cee .nav-link {
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.7rem 1.2rem !important;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.nav-portail-cee .nav-link:hover {
    background: rgba(79, 172, 254, 0.3);
    color: #ffffff !important;
    transform: translateY(-2px);
    border-color: rgba(79, 172, 254, 0.5);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.nav-portail-cee .nav-link.active,
.nav-portail-cee .nav-link:focus {
    background: rgba(79, 172, 254, 0.35);
    color: #ffffff !important;
    border-color: #4facfe;
}

/* Icônes dans la navigation */
.nav-icon {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.dropdown-icon {
    font-size: 1.1rem;
    margin-right: 0.6rem;
}

/* Lien Portail Power Pages */
.nav-link-portail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.nav-link-portail:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* Lien Accueil (maison) */
.nav-link-home {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(17, 153, 142, 0.4);
}

.nav-link-home:hover {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(56, 239, 125, 0.5);
}

.nav-link-home .nav-icon,
.nav-link-portail .nav-icon {
    font-size: 1.2rem;
}

/* Lien Messagerie avec badge */
.nav-link-messagerie {
    position: relative;
    background: rgba(240, 147, 251, 0.15) !important;
    border-color: rgba(240, 147, 251, 0.3) !important;
}

.nav-link-messagerie:hover {
    background: rgba(240, 147, 251, 0.3) !important;
    border-color: #f093fb !important;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 3px 12px rgba(255, 65, 108, 0.6);
    border: 2px solid #0a1f44;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Lien Admin */
.nav-link-admin {
    color: #ffd43b !important;
    background: rgba(255, 193, 7, 0.15) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
}

.nav-link-admin:hover {
    color: #ffffff !important;
    background: rgba(255, 193, 7, 0.35) !important;
    border-color: #ffc107 !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3) !important;
}

/* Menu déroulant */
.nav-portail-cee .dropdown-menu {
    background: linear-gradient(180deg, #1a3a6e 0%, #0d2850 100%);
    border: 2px solid rgba(79, 172, 254, 0.4);
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    margin-top: 0.5rem;
    min-width: 260px;
}

.nav-portail-cee .dropdown-item {
    color: #ffffff;
    padding: 0.75rem 1.2rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.nav-portail-cee .dropdown-item:hover {
    background: rgba(79, 172, 254, 0.25);
    color: #ffffff;
    transform: translateX(8px);
}

.nav-portail-cee .dropdown-header {
    color: #4facfe;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.6rem 1.2rem 0.4rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(79, 172, 254, 0.2);
    margin-bottom: 0.3rem;
}

.nav-portail-cee .dropdown-divider {
    border-color: rgba(79, 172, 254, 0.25);
    margin: 0.6rem 0;
}

/* Info utilisateur */
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user-info .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}

/* Responsive - Mobile */
@media (max-width: 991.98px) {
    .nav-portail-cee {
        padding: 0.5rem 1rem;
    }

    .nav-portail-cee .navbar-collapse {
        background: linear-gradient(180deg, #1a3a6e 0%, #0d2850 100%);
        border-radius: 14px;
        margin-top: 0.75rem;
        padding: 1rem;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(79, 172, 254, 0.3);
    }

    .nav-portail-cee .navbar-nav {
        gap: 0.4rem;
    }

    .nav-portail-cee .nav-link {
        padding: 0.9rem 1.2rem !important;
        justify-content: flex-start;
    }

    .nav-link-home {
        width: auto !important;
        border-radius: 10px !important;
    }

    .nav-badge {
        position: static;
        margin-left: auto;
    }

    .nav-portail-cee .dropdown-menu {
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(79, 172, 254, 0.2);
        box-shadow: none;
        padding-left: 1.5rem;
        margin-left: 1rem;
    }
}

/* Ajustement pour écrans moyens */
@media (min-width: 992px) and (max-width: 1200px) {
    .nav-portail-cee .nav-link {
        padding: 0.6rem 0.9rem !important;
        font-size: 0.88rem;
    }

    .nav-icon {
        font-size: 1.1rem;
    }
}

/* Animation d'apparition du dropdown */
.nav-portail-cee .dropdown-menu.show {
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bouton hamburger personnalisé */
.nav-portail-cee .navbar-toggler {
    border: 2px solid rgba(79, 172, 254, 0.5);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}

.nav-portail-cee .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.3);
}

.nav-portail-cee .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Force la couleur blanche pour les croix de fermeture des popups DevExtreme */
.dx-popup-title .dx-closebutton .dx-icon,
.dx-popup-title .dx-closebutton {
    color: white !important;
}

/* Au survol, on garde le blanc pour éviter que ça redevienne gris */
.dx-popup-title .dx-closebutton:hover .dx-icon,
.dx-popup-title .dx-closebutton:hover {
    color: #ffffff !important;
    opacity: 0.8;
}

/* Fix pour les dropdowns (SelectBox) dans les formulaires : éviter texte blanc sur fond blanc */
.dx-list-item-content {
    color: #333 !important; /* Texte noir par défaut */
}

/* Si le thème force un fond sombre pour les éléments sélectionnés, assurer que le texte reste lisible */
.dx-list-item.dx-state-focused .dx-list-item-content,
.dx-list-item.dx-state-active .dx-list-item-content,
.dx-list-item.dx-list-item-selected .dx-list-item-content {
    color: #333 !important; /* Ou blanc selon le fond, mais ici on assure la visibilité */
}

/* Assurer le contraste dans la popup d'édition */
#formDossier .dx-texteditor-input {
    color: #333 !important;
}